本文整理匯總了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));
}