- md5
- 9f48bdc0aa32d55b783f35d459de251f
- sha1
- c159bd9197310903b55243e6eabd7eaac87165e8
- sha256
- bcd66d4ac45c8e028181fcb9851e1604987cb2c0e6121520aa4a425056c59655
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
<?php
/**
* @version $Id: contact.php 22355 2011-11-07 05:11:58Z github_bot $
* @copyright Copyright (C) 2005 - 2011 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;
/**
* Contact component helper.
*
* @package Joomla.Administrator
* @subpackage com_contact
* @since 1.6
*/
class ContactHelper
{
/**
* Configure the Linkbar.
*
* @param string $vName The name of the active view.
*
* @return void
* @since 1.6
*/
public static function addSubmenu($vName)
{
JSubMenuHelper::addEntry(
JText::_('COM_CONTACT_SUBMENU_CONTACTS'),
'index.php?option=com_contact&view=contacts',
$vName == 'contacts'
);
JSubMenuHelper::addEntry(
JText::_('COM_CONTACT_SUBMENU_CATEGORIES'),
'index.php?option=com_categories&extension=com_contact',
$vName == 'categories'
);
if ($vName=='categories') {
JToolBarHelper::title(
JText::sprintf('COM_CATEGORIES_CATEGORIES_TITLE',JText::_('com_contact')),
'contact-categories');
}
}
/**
* Gets a list of the actions that can be performed.
*
* @param int The category ID.
* @param int The contact ID.
*
* @return JObject
* @since 1.6
*/
public static function getActions($categoryId = 0, $contactId = 0)
{
$user = JFactory::getUser();
$result = new JObject;
if (empty($contactId) && empty($categoryId)) {
$assetName = 'com_contact';
}
elseif (empty($contactId)) {
$assetName = 'com_contact.category.'.(int) $categoryId;
}
else {
$assetName = 'com_contact.contact.'.(int) $contactId;
}
$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;
}
}
The same content is in 3 releases, Joomla 1.7.3 to 1.7.5. See them all, or every version of this file.