本文整理汇总了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";