Source for file usergrouplist.php
Documentation is available at usergrouplist.php
* @package Joomla.Libraries
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
* Field to load a list of available users statuses
* @package Joomla.Libraries
protected $type =
'UserGroupList';
* Cached array of the category items.
protected static $options =
array();
* Method to get the options to populate list
* @return array The field option objects.
if (!isset
(static::$options[$hash]))
static::$options[$hash] =
parent::getOptions();
$db =
JFactory::getDbo();
$query =
$db->getQuery(true)
->select('a.id AS value')
->select('a.title AS text')
->select('COUNT(DISTINCT b.id) AS level')
->from('#__usergroups as a')
->join('LEFT', '#__usergroups AS b ON a.lft > b.lft AND a.rgt < b.rgt')
->group('a.id, a.title, a.lft, a.rgt')
if ($options =
$db->loadObjectList())
foreach ($options as &$option)
$option->text =
str_repeat('- ', $option->level) .
$option->text;
static::$options[$hash] =
array_merge(static::$options[$hash], $options);
return static::$options[$hash];
Documentation generated on Tue, 19 Nov 2013 15:16:35 +0100 by phpDocumentor 1.4.3