本文整理汇总了PHP中Komento::onAfterEventTriggered方法的典型用法代码示例。如果您正苦于以下问题:PHP Komento::onAfterEventTriggered方法的具体用法?PHP Komento::onAfterEventTriggered怎么用?PHP Komento::onAfterEventTriggered使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Komento
的用法示例。
在下文中一共展示了Komento::onAfterEventTriggered方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: execute
private function execute( $eventTrigger, $context = '', &$article, &$params, $page = 0 )
{
static $bootstrap;
// @task: load bootstrap
if( !$bootstrap )
{
$file = JPATH_ROOT . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_komento' . DIRECTORY_SEPARATOR . 'bootstrap.php';
jimport('joomla.filesystem.file');
if( !JFile::exists( $file ) )
{
// missing bootstrap
return false;
}
require_once( $file );
$bootstrap = true;
}
if( !$this->extension )
{
$this->extension = JRequest::getCmd( 'option' );
}
// @task: trigger onAfterEventTriggered
if( !$result = Komento::onAfterEventTriggered( __CLASS__, $eventTrigger, $this->extension, $context, $article, $params ) )
{
return false;
}
// @task: trigger onBeforeCommentify
// if( !$result = Komento::loadApplication( $this->extension )->onBeforeCommentify( $eventTrigger, $context, $article, $params, $page ) )
// {
// return false;
// }
// Passing in the data
$options = array();
$options['trigger'] = $eventTrigger;
$options['context'] = $context;
$options['params'] = $params;
$options['page'] = $page;
// Ready to Commentify!
return Komento::commentify( $this->extension, $article, $options );
}
示例2: execute
private function execute($eventTrigger, $context = 'none', &$article, &$params, $page = 0)
{
static $bootstrap;
// @task: load bootstrap
if (!$bootstrap) {
$file = JPATH_ROOT . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_komento' . DIRECTORY_SEPARATOR . 'bootstrap.php';
jimport('joomla.filesystem.file');
if (!JFile::exists($file)) {
// missing bootstrap
return false;
}
require_once $file;
$bootstrap = true;
}
if (!$this->extension) {
$this->extension = JRequest::getCmd('option');
}
// Fix flexicontent's mess as they are trying to reset the option=com_flexicontent to com_content.
if (JRequest::getVar('isflexicontent')) {
$this->extension = 'com_flexicontent';
}
// @task: trigger onAfterEventTriggered
if (!($result = Komento::onAfterEventTriggered(__CLASS__, $eventTrigger, $this->extension, $context, $article, $params))) {
return false;
}
// Passing in the data
$options = array();
$options['trigger'] = $eventTrigger;
$options['context'] = $context;
$options['params'] = $params;
$options['page'] = $page;
// Ready to Commentify!
return Komento::commentify($this->extension, $article, $options);
}