本文整理匯總了PHP中K2HelperPermissions::setPermissions方法的典型用法代碼示例。如果您正苦於以下問題:PHP K2HelperPermissions::setPermissions方法的具體用法?PHP K2HelperPermissions::setPermissions怎麽用?PHP K2HelperPermissions::setPermissions使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類K2HelperPermissions
的用法示例。
在下文中一共展示了K2HelperPermissions::setPermissions方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getProfile
public static function getProfile(&$params)
{
$user = JFactory::getUser();
$db = JFactory::getDBO();
$query = "SELECT * FROM #__k2_users WHERE userID=".(int)$user->id;
$db->setQuery($query, 0, 1);
$profile = $db->loadObject();
if ($profile)
{
if ($profile->image != '')
$profile->avatar = JURI::root().'media/k2/users/'.$profile->image;
require_once (JPATH_SITE.DS.'components'.DS.'com_k2'.DS.'helpers'.DS.'permissions'.'.php');
if (JRequest::getCmd('option') != 'com_k2')
K2HelperPermissions::setPermissions();
if (K2HelperPermissions::canAddItem())
$profile->addLink = JRoute::_('index.php?option=com_k2&view=item&task=add&tmpl=component');
return $profile;
}
}
示例2: canEdit
public function canEdit()
{
JLoader::register('K2HelperPermissions', JPATH_SITE . '/components/com_k2/helpers/permissions.php');
if ($this->params->option != 'com_k2') {
K2HelperPermissions::setPermissions();
}
return K2HelperPermissions::canEditItem($this->article->created_by, $this->article->catid);
}
示例3: defined
<?php
/**
* @version $Id: k2.php 307 2010-01-11 20:58:54Z joomlaworks $
* @package K2
* @author JoomlaWorks http://www.joomlaworks.gr
* @copyright Copyright (c) 2006 - 2010 JoomlaWorks Ltd. All rights reserved.
* @license GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
*/
// no direct access
defined('_JEXEC') or die('Restricted access');
require_once JPATH_COMPONENT . DS . 'helpers' . DS . 'route' . '.php';
require_once JPATH_COMPONENT . DS . 'helpers' . DS . 'permissions' . '.php';
require_once JPATH_COMPONENT . DS . 'helpers' . DS . 'utilities' . '.php';
K2HelperPermissions::setPermissions();
K2HelperPermissions::checkPermissions();
$controller = JRequest::getWord('view', 'itemlist');
jimport('joomla.filesystem.file');
if (JFile::exists(JPATH_COMPONENT . DS . 'controllers' . DS . $controller . '.php')) {
require_once JPATH_COMPONENT . DS . 'controllers' . DS . $controller . '.php';
$classname = 'K2Controller' . $controller;
$controller = new $classname();
$controller->execute(JRequest::getWord('task'));
$controller->redirect();
}
echo "\n<!-- JoomlaWorks \"K2\" (v2.2) | Learn more about K2 at http://getk2.org -->\n\n";