本文整理汇总了PHP中Komento::trigger方法的典型用法代码示例。如果您正苦于以下问题:PHP Komento::trigger方法的具体用法?PHP Komento::trigger怎么用?PHP Komento::trigger使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Komento
的用法示例。
在下文中一共展示了Komento::trigger方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: defined
/**
* @package Komento
* @copyright Copyright (C) 2012 Stack Ideas Private Limited. All rights reserved.
* @license GNU/GPL, see LICENSE.php
*
* Komento is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/
defined('_JEXEC') or die('Restricted access');
?>
<?php
Komento::trigger('onBeforeKomentoBox', array('component' => $component, 'cid' => $cid, 'system' => &$system, 'comments' => &$comments));
?>
<script type='text/javascript'>
Komento.ready(function($) {
// declare master namespace variable for shared values
Komento.component = "<?php
echo $component;
?>
";
Komento.cid = "<?php
echo $cid;
?>
";
Komento.contentLink = "<?php
echo $contentLink;
示例2: defined
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/
defined( '_JEXEC' ) or die( 'Restricted access' ); ?>
<?php // KURO THEME
Komento::trigger( 'onBeforeProcessComment', array( 'component' => $row->component, 'cid' => $row->cid, 'comment' => &$row ) );
// Process data
Komento::import( 'helper', 'comment' );
$row = KomentoCommentHelper::process( $row );
Komento::trigger( 'onAfterProcessComment', array( 'component' => $row->component, 'cid' => $row->cid, 'comment' => &$row ) );
// Construct classes for this row
$classes = array();
$classes[] = 'kmt-item';
// Usergroup CSS classes
if( $row->author->guest )
{
$classes[] = $system->config->get( 'layout_css_public' );
}
else
{
$classes[] = $system->config->get( 'layout_css_registered' );
}
示例3: defined
<?php
/**
* @package Komento
* @copyright Copyright (C) 2012 Stack Ideas Private Limited. All rights reserved.
* @license GNU/GPL, see LICENSE.php
*
* Komento is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/
defined('_JEXEC') or die('Restricted access'); ?>
<?php Komento::trigger( 'onBeforeKomentoBar', array( 'component' => $component, 'cid' => $cid, 'commentCount', &$commentCount ) ); ?>
<?php $readmore = false;
if( $component == 'com_content' )
{
if( $system->config->get( 'layout_frontpage_readmore_use_joomla' ) == 0 && ( ( $system->config->get( 'layout_frontpage_readmore' ) == 2 ) || ( $system->config->get( 'layout_frontpage_readmore' ) == 1 && Komento::_('JParameter::get', $article->params, 'show_readmore') && $article->readmore ) ) )
{
$readmore = true;
}
}
else
{
if( $system->config->get( 'layout_frontpage_readmore' ) != 0 )
{
$readmore = true;
}
}
示例4: push
//.........这里部分代码省略.........
// process requested recipients first
foreach ($recipients as $recipient)
{
$recipient = 'get' . ucfirst( strtolower( trim($recipient) ) );
if( !method_exists($this, $recipient) )
{
continue;
}
if( $recipient == 'getMe' )
{
$skipMe = false;
}
$result = $this->$recipient( $type, $options );
// stacking up all the emails and details
$rows = $rows + $result;
}
// process usergroups notification based on notification type
$rows = $rows + $this->getUsergroups( $type );
if( $type == 'report' )
{
$admins = $this->getAdmins();
foreach( $admins as $admin )
{
if( isset($rows[$options['comment']->email]) && $options['comment']->email === $admin->email )
{
$skipMe = false;
}
}
}
if( empty($rows) )
{
return;
}
// Do not send to the commentor/actor
if( $skipMe && isset($rows[$options['comment']->email]) )
{
unset( $rows[$options['comment']->email] );
}
$lang = JFactory::getLanguage();
// Load English first as fallback
$konfig = Komento::getKonfig();
if( $konfig->get( 'enable_language_fallback' ) )
{
$lang->load( 'com_komento', JPATH_ROOT, 'en-GB', true );
}
// Load site's selected language
$lang->load( 'com_komento', JPATH_ROOT, $lang->getDefault(), true );
// Load user's preferred language file
$lang->load( 'com_komento', JPATH_ROOT, null, true );
$jconfig = JFactory::getConfig();
$data = $this->prepareData( $type, $options );
$template = $this->prepareTemplate( $type, $options );
$subject = $this->prepareTitle( $type, $options );
$mailfrom = Komento::_( 'JFactory::getConfig', 'mailfrom' );
$fromname = Komento::_( 'JFactory::getConfig', 'fromname' );
$config = Komento::getConfig();
$sendHTML = $config->get( 'notification_sendmailinhtml' ) ? 'html' : 'text';
// Storing notifications into mailq
foreach ($rows as $row)
{
if( Komento::trigger( 'onBeforeSendNotification', array( 'component' => $options['component'], 'cid' => $options['cid'], 'recipient' => &$row ) ) === false )
{
continue;
}
if( empty( $row->email ) )
{
continue;
}
$body = $this->getTemplateBuffer( $template, $data, array( 'recipient' => $row ) );
$mailQ = Komento::getTable( 'mailq' );
$mailQ->mailfrom = $mailfrom;
$mailQ->fromname = $fromname;
$mailQ->recipient = $row->email;
$mailQ->subject = $subject;
$mailQ->body = $body;
$mailQ->created = Komento::getDate()->toMySQL();
$mailQ->type = $sendHTML;
$mailQ->status = 0;
$result = $mailQ->store();
}
}
示例5: publish
public function publish( $type = '1' )
{
// set new = false
$new = false;
// Create the comment table object
$commentTable = Komento::getTable( 'Comments' );
$commentTable->bind($this->getProperties());
// get date
$now = Komento::getDate()->toMySQL();
// check original status == 2
if( $commentTable->published == 2 )
{
$new = true;
}
$commentTable->published = $type;
if( $type == '1' )
{
$commentTable->publish_up = $now;
}
else
{
$commentTable->publish_down = $now;
}
// Trigger onBeforePublishComment( $this->component, $this->cid, &$this )
// Trigger onBeforeUnpublishComment( $this->component, $this->cid, &$this )
$triggerResult = true;
if( $type == '1' )
{
$triggerResult = Komento::trigger( 'onBeforePublishComment', array( 'component' => $this->component, 'cid' => $this->cid, 'comment' => &$this ) );
}
else
{
$triggerResult = Komento::trigger( 'onBeforeUnpublishComment', array( 'component' => $this->component, 'cid' => $this->cid, 'comment' => &$this ) );
}
if( $triggerResult === false )
{
$this->setError( 'Trigger onBeforePublishComment/onBeforeUnpublishComment false' );
return false;
}
if( !$commentTable->store() )
{
$this->setError( 'Comment publish/unpublish failed' );
return false;
}
// bind with comment table data after successfully saving comment table.
$this->setProperties($commentTable->getProperties());
// Trigger onAfterPublishComment( $this->component, $this->cid, &$this )
// Trigger onAfterUnpublishComment( $this->component, $this->cid, &$this )
if( $type == '1' )
{
Komento::trigger( 'onAfterPublishComment', array( 'component' => $this->component, 'cid' => $this->cid, 'comment' => &$this ) );
}
else
{
Komento::trigger( 'onAfterUnpublishComment', array( 'component' => $this->component, 'cid' => $this->cid, 'comment' => &$this ) );
}
if( $new )
{
$config = Komento::getConfig( $commentTable->component );
$action = $commentTable->parent_id ? 'reply' : 'comment';
// send email
if( $config->get( 'notification_enable' ) )
{
if( ( $action == 'comment' && $config->get( 'notification_event_new_comment' ) ) || ( $action == 'reply' && $config->get( 'notification_event_new_reply' ) ) )
{
Komento::getHelper( 'Notification' )->push( $action, 'subscribers,author,usergroups', array( 'commentId' => $commentTable->id ) );
}
}
// process activities
$activity = Komento::getHelper( 'activity' )->process( $action, $commentTable->id );
// Manually get the attachment of this comment and process the "upload" activity
$attachments = $commentTable->getAttachments();
$totalAttachments = count( $attachments );
for( $i = 0; $i < $totalAttachments; $i++ )
{
Komento::getHelper( 'activity' )->process( 'upload', $commentTable->id );
}
}
return true;
}