本文整理汇总了PHP中CrowdfundingHelper::isAuthorized方法的典型用法代码示例。如果您正苦于以下问题:PHP CrowdfundingHelper::isAuthorized方法的具体用法?PHP CrowdfundingHelper::isAuthorized怎么用?PHP CrowdfundingHelper::isAuthorized使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CrowdfundingHelper
的用法示例。
在下文中一共展示了CrowdfundingHelper::isAuthorized方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: prepareExtras
protected function prepareExtras()
{
$model = JModelLegacy::getInstance('Extras', 'CrowdfundingModel', $config = array('ignore_request' => false));
/** @var $model CrowdfundingModelExtras */
// Get state
/** @var $state Joomla\Registry\Registry */
$this->state = $model->getState();
// Get item
$itemId = $this->state->get('extras.id');
$this->item = $model->getItem($itemId, $this->userId);
// Check if the item exists.
if (!CrowdfundingHelper::isAuthorized($this->userId, $this->item, 'extras')) {
$this->app->enqueueMessage(JText::_('COM_CROWDFUNDING_ERROR_SOMETHING_WRONG'), 'notice');
$this->app->redirect(JRoute::_(CrowdfundingHelperRoute::getDiscoverRoute()));
return;
}
$this->pathwayName = JText::_('COM_CROWDFUNDING_STEP_EXTRAS');
// Events
JPluginHelper::importPlugin('crowdfunding');
$dispatcher = JEventDispatcher::getInstance();
$results = $dispatcher->trigger('onExtrasDisplay', array('com_crowdfunding.project.extras', &$this->item, &$this->params));
$this->item->event = new stdClass();
$this->item->event->onExtrasDisplay = trim(implode("\n", $results));
}