CoreFiles by mySites.guru
usergrouplist.php32 lines, 690 bytes, from Joomla_3.8.13-Stable-Full_Package.zip
Raw History Compare with 3.8.12
md5
5a0908e8ae0600a74782cb360a3c1c07
sha1
068698e01c7e9c3c37bac311c943a8343c66229a
sha256
96c4e7e49196f3ac48f43d65976756d3810d32f00e25f903e69c9e886b23a6b0
<?php
/**
 * @package     Joomla.Plugin
 * @subpackage  Fields.Usergrouplist
 *
 * @copyright   Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */
defined('_JEXEC') or die;

$value = $field->value;

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

JLoader::register('UsersHelper', JPATH_ADMINISTRATOR . '/components/com_users/helpers/users.php');

$value  = (array) $value;
$texts  = array();
$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 30 releases, Joomla 3.8.4-rc to 4.0.0-alpha3. See them all, or every version of this file.