CoreFiles by mySites.guru
usergrouplist.php31 lines, 650 bytes, from Joomla_5.3.2-Stable-Full_Package.zip
Raw History Compare with 5.3.1
md5
b7d0dbb6c168355e453ea16b02d49893
sha1
b2c0d82d9bccf1bc29dc58b94dcc978781a9f6e5
sha256
a7376d70a569ccafdcb83314a5a9f055d633865ae14401b3b1fd7c318c5d3129
<?php

/**
 * @package     Joomla.Plugin
 * @subpackage  Fields.Usergrouplist
 *
 * @copyright   (C) 2017 Open Source Matters, Inc. <https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

use Joomla\Component\Users\Administrator\Helper\UsersHelper;

$value = $field->value;

if ($value == '') {
    return;
}

$value  = (array) $value;
$texts  = [];
$groups = UsersHelper::getGroups();

foreach ($groups as $group) {
    if (in_array($group->value, $value)) {
        $texts[] = htmlentities(trim($group->text, '- '));
    }
}

echo htmlentities(implode(', ', $texts));

The same content is in 217 releases, Joomla 4.2.7-rc1 to 6.3.0-alpha1. See them all, or every version of this file.