- md5
- 0174208f88c73410764fd8ac3f43466f
- sha1
- f9b5429bf5edce6b8e12bda410b629cb4433f630
- sha256
- faea3c85ee0554d420a8da565e753f5ea5d1d9b0f440338bbad1d734bda8f215
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
<?php
/**
* @package Joomla.Administrator
* @subpackage com_content
*
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* Content component helper.
*
* @package Joomla.Administrator
* @subpackage com_content
* @since 1.6
*/
class ContentHelper
{
public static $extension = 'com_content';
/**
* Configure the Linkbar.
*
* @param string $vName The name of the active view.
*
* @return void
* @since 1.6
*/
public static function addSubmenu($vName)
{
JHtmlSidebar::addEntry(
JText::_('JGLOBAL_ARTICLES'),
'index.php?option=com_content&view=articles',
$vName == 'articles'
);
JHtmlSidebar::addEntry(
JText::_('COM_CONTENT_SUBMENU_CATEGORIES'),
'index.php?option=com_categories&extension=com_content',
$vName == 'categories');
JHtmlSidebar::addEntry(
JText::_('COM_CONTENT_SUBMENU_FEATURED'),
'index.php?option=com_content&view=featured',
$vName == 'featured'
);
}
/**
* Gets a list of the actions that can be performed.
*
* @param integer The category ID.
* @param integer The article ID.
*
* @return JObject
* @since 1.6
*/
public static function getActions($categoryId = 0, $articleId = 0)
{
// Reverted a change for version 2.5.6
$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 = array(
'core.admin', 'core.manage', 'core.create', 'core.edit', 'core.edit.own', 'core.edit.state', 'core.delete'
);
foreach ($actions as $action)
{
$result->set($action, $user->authorise($action, $assetName));
}
return $result;
}
/**
* Applies the content tag filters to arbitrary text as per settings for current user group
*
* @param text $text The string to filter
*
* @return string The filtered string
*
* @deprecated 4.0 Use JComponentHelper::filterText() instead.
*/
public static function filterText($text)
{
JLog::add('ContentHelper::filterText() is deprecated. Use JComponentHelper::filterText() instead.', JLog::WARNING, 'deprecated');
return JComponentHelper::filterText($text);
}
}
The same content is in 5 releases, Joomla 3.1.0 to 3.1.6. See them all, or every version of this file.