';
return implode("\n", $html);
}
/**
* Get the id of the parent asset
*
* @param integer $assetId The asset for which the parentid will be returned
*
* @return integer The id of the parent asset
*
* @since 11.1
*/
protected static function _getParentAssetId($assetId)
{
// Get a database object.
$db = JFactory::getDBO();
// Get the user groups from the database.
$db->setQuery(
'SELECT parent_id' .
' FROM #__assets' .
' WHERE id = '.(int) $assetId
);
return (int) $db->loadResult();
}
/**
* Get the user groups
*
* @return array Array of user groups
*
* @since 11.1
*/
protected static function _getUserGroups()
{
// Get a database object.
$db = JFactory::getDBO();
// Get the user groups from the database.
$db->setQuery(
'SELECT a.id AS value, a.title AS text, COUNT(DISTINCT b.id) AS level' .
' , GROUP_CONCAT(b.id SEPARATOR \',\') AS parents' .
' FROM #__usergroups AS a' .
' LEFT JOIN #__usergroups AS b ON a.lft > b.lft AND a.rgt < b.rgt' .
' GROUP BY a.id' .
' ORDER BY a.lft ASC'
);
$options = $db->loadObjectList();
// Pre-compute additional values.
foreach ($options as &$option)
{
// Pad the option text with spaces using depth level as a multiplier.
$option->identities = ($option->parents) ? explode(',', $option->parents.','.$option->value) : array($option->value);
}
return $options;
}
/**
* Get the array of images associate with specific permissions
*
* @return array An associative array of permissions and images
*
* @since 11.1
*/
protected static function _getImagesArray()
{
$base = JURI::root(true);
$images['allow-l'] = '';
$images['deny-l'] = '';
$images['allow'] = '';
$images['deny'] = '';
$images['allow-i'] = '';
$images['deny-i'] = '';
return $images;
}
}