administrator/components/com_content/helpers/content.php
/** | |
* Gets a list of the actions that can be performed. | |
* | |
* @param int The category ID. | |
* @param int The article ID. | |
* | |
* @return JObject | |
* @since 1.6 | |
*/ | |
public static function getActions($categoryId = 0, $articleId = 0) | |
{ | |
$user = JFactory::getUser(); | |
$result = new JObject; | |
if (empty($articleId) && empty($categoryId)) { | |
$assetName = 'com_content'; | |
} | |
elseif (empty($articleId)) { | |
$assetName = 'com_content.category.'.(int) $categoryId; | |
} | |
else { | |
$assetName = 'com_content.article.'.(int) $articleId; | |
} | |
$actions = JAccess::getActionsFromFile(JPATH_ADMINISTRATOR . '/components/com_content/access.xml'); | |
foreach ($actions as $action) { | |
$result->set($action->name, $user->authorise($action->name, $assetName)); | |
} | |
return $result; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment