- md5
- a2097b8b8bbb4c44e9f852207dd1bc66
- sha1
- 6e69cd323bf4074bb3e88d44e302328d32e7b124
- sha256
- 99244a663d6f58b0315e564adf50e2adcafd4dec9b12c57cd493c18eb0a2bda3
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
<?php
/**
* @package Joomla.Administrator
* @subpackage com_users
*
* @copyright Copyright (C) 2005 - 2016 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('JPATH_BASE') or die;
/**
* Form Field class for the Joomla Framework.
*
* @since 1.6
*/
class JFormFieldGroupParent extends JFormAbstractlist
{
/**
* The form field type.
*
* @var string
* @since 1.6
*/
protected $type = 'GroupParent';
/**
* Method to get the field options.
*
* @return array The field option objects
*
* @since 1.6
*/
protected function getOptions()
{
$options = JHelperUsergroups::getInstance()->getAll();
// Prevent parenting to children of this item.
if ($id = $this->form->getValue('id'))
{
unset($options[$id]);
}
$options = array_values($options);
$isSuperAdmin = JFactory::getUser()->authorise('core.admin');
// Pad the option text with spaces using depth level as a multiplier.
for ($i = 0, $n = count($options); $i < $n; $i++)
{
// Show groups only if user is super admin or group is not super admin
if ($isSuperAdmin || !JAccess::checkGroup($options[$i]->id, 'core.admin'))
{
$options[$i]->value = $options[$i]->id;
$options[$i]->text = str_repeat('- ', $options[$i]->level) . $options[$i]->title;
}
else
{
unset($options[$i]);
}
}
// Merge any additional options in the XML definition.
return array_merge(parent::getOptions(), $options);
}
}
No other release has this exact content. See every version of this file.