- md5
- 9056f650ef79b024e95a92f1a2536ce0
- sha1
- 4463dca5f92889782d1aa6c79bf80439aad0598d
- sha256
- 42a73d3fe999ec43895ea4d1b9b2594be28c0aff2321506a234fe65a1acc06e8
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
<?php
/**
* @copyright Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// No direct access
defined('_JEXEC') or die;
/**
* Weblinks helper.
*
* @package Joomla.Administrator
* @subpackage com_weblinks
* @since 1.6
*/
class WeblinksHelper
{
/**
* Configure the Linkbar.
*
* @param string The name of the active view.
* @since 1.6
*/
public static function addSubmenu($vName = 'weblinks')
{
JSubMenuHelper::addEntry(
JText::_('COM_WEBLINKS_SUBMENU_WEBLINKS'),
'index.php?option=com_weblinks&view=weblinks',
$vName == 'weblinks'
);
JSubMenuHelper::addEntry(
JText::_('COM_WEBLINKS_SUBMENU_CATEGORIES'),
'index.php?option=com_categories&extension=com_weblinks',
$vName == 'categories'
);
if ($vName=='categories') {
JToolBarHelper::title(
JText::sprintf('COM_CATEGORIES_CATEGORIES_TITLE', JText::_('com_weblinks')),
'weblinks-categories');
}
}
/**
* Gets a list of the actions that can be performed.
*
* @param int The category ID.
* @return JObject
* @since 1.6
*/
public static function getActions($categoryId = 0)
{
$user = JFactory::getUser();
$result = new JObject;
if (empty($categoryId)) {
$assetName = 'com_weblinks';
$level = 'component';
} else {
$assetName = 'com_weblinks.category.'.(int) $categoryId;
$level = 'category';
}
$actions = JAccess::getActions('com_weblinks', $level);
foreach ($actions as $action) {
$result->set($action->name, $user->authorise($action->name, $assetName));
}
return $result;
}
}
The same content is in 11 releases, Joomla 2.5.18 to 2.5.28. See them all, or every version of this file.