本文整理汇总了PHP中Komento::getHelper方法的典型用法代码示例。如果您正苦于以下问题:PHP Komento::getHelper方法的具体用法?PHP Komento::getHelper怎么用?PHP Komento::getHelper使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Komento
的用法示例。
在下文中一共展示了Komento::getHelper方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display
public function display($tpl = null)
{
// //Load pane behavior
// jimport('joomla.html.pane');
// $slider = JPane::getInstance( 'sliders' );
//initialise variables
$model = Komento::getModel('comments');
$comments = '';
$options = array('threaded' => 0, 'sort' => 'latest', 'limit' => 10);
$comments = $model->getComments('all', 'all', $options);
// Set Options
$optionsPending['published'] = 2;
$optionsPending['no_tree'] = 1;
$optionsPending['no_child'] = 1;
$pendings = $model->getData($optionsPending);
foreach ($pendings as $pending) {
$pending = Komento::getHelper('comment')->process($pending, 1);
}
foreach ($comments as $comment) {
$comment = Komento::getHelper('comment')->process($comment, 1);
}
$document = JFactory::getDocument();
$user = JFactory::getUser();
$this->assignRef('slider', $slider);
$this->assignRef('user', $user);
$this->assignRef('document', $document);
$this->assignRef('comments', $comments);
$this->assignRef('pendings', $pendings);
parent::display($tpl);
}
示例2: init
public function init()
{
$obj = new stdClass();
$obj->config = Komento::getConfig();
$obj->konfig = Komento::getKonfig();
$obj->my = Komento::getProfile();
$obj->acl = Komento::getHelper('acl');
$obj->session = JFactory::getSession();
$this->_system = $obj;
}
示例3: getAvatar
public function getAvatar()
{
// Settings that requires EasySocial scripts
// easysocial_profile_popbox
if (Komento::getConfig()->get('easysocial_profile_popbox')) {
Komento::getHelper('easysocial')->init();
}
$user = Foundry::user($this->profile->id);
$avatar = $user->getAvatar();
return $avatar;
}
示例4: getSupportedComponents
function getSupportedComponents()
{
static $supportedComponents = array();
if (empty($supportedComponents)) {
$components = array_values(Komento::getHelper('components')->getAvailableComponents());
foreach ($components as $component) {
$supportedComponents[] = $this->_db->quote($component);
}
}
return $supportedComponents;
}
示例5: getVersion
public function getVersion()
{
$ajax = Komento::getAjax();
$local = Komento::komentoVersion();
$remote = Komento::getHelper('Version')->getVersion();
$html = '<span class="version_outdated">' . JText::sprintf('COM_KOMENTO_VERSION_OUTDATED', $local) . '</span>';
if ((string) $local >= (string) $remote) {
$html = '<span class="version_latest">' . JText::sprintf('COM_KOMENTO_VERSION_LATEST', $local) . '</span>';
}
$ajax->success($html);
$ajax->send();
}
示例6: upload
public function upload()
{
$component = JRequest::getString( 'component' );
Komento::setCurrentComponent( $component );
$profile = Komento::getProfile();
$config = Komento::getConfig();
// acl stuffs here
if( !$config->get( 'upload_enable' ) || !$profile->allow( 'upload_attachment' ) )
{
echo json_encode( array( 'status' => 'notallowed' ) ); exit;
}
$file = JRequest::getVar( 'file', '', 'FILES', 'array' );
// check for file size if runtime HTML4 is used
if( $file['size'] > ( $config->get( 'upload_max_size' ) * 1024 * 1024 ) )
{
echo json_encode( array( 'status' => 'exceedfilesize' ) ); exit;
}
// $file['name'] = filename
// $file['type'] = mime
// $file['tmp_name'] = temporary source
// $file['size'] = size
$id = Komento::getHelper( 'file' )->upload( $file );
$result = array(
'status' => 1,
'id' => 0
);
if( $id === false )
{
$result['status'] = 0;
}
else
{
$result['id'] = $id;
}
// do not return
// echo json string instead and exit
echo json_encode( $result ); exit;
}
示例7: getVersion
public function getVersion()
{
$ajax = Komento::getAjax();
$local = Komento::komentoVersion();
$remote = Komento::getHelper('Version')->getVersion();
// Test build only since build will always be incremented regardless of version
$localVersion = explode('.', $local);
$localBuild = $localVersion[2];
$remoteVersion = explode('.', $remote);
$build = $remoteVersion[2];
$html = '<span class="version_outdated">' . JText::sprintf('COM_KOMENTO_VERSION_OUTDATED', $local) . '</span>';
if ($localBuild >= $build) {
$html = '<span class="version_latest">' . JText::sprintf('COM_KOMENTO_VERSION_LATEST', $local) . '</span>';
}
$ajax->success($html);
$ajax->send();
}
示例8: __construct
public function __construct()
{
$konfig = Komento::getKonfig();
$config = Komento::getConfig();
// @legacy: If environment is set to production, change to static.
$environment = $konfig->get('komento_environment');
if ($environment=='production') {
$environment='static';
}
$this->fullName = 'Komento';
$this->shortName = 'kmt';
$this->environment = $environment;
$this->mode = $konfig->get('komento_mode');
$this->version = (string) Komento::getHelper( 'Version' )->getLocalVersion();
$this->baseUrl = Komento::getHelper( 'Document' )->getBaseUrl();
$this->token = Komento::_( 'getToken' );
$newConfig = clone $config->toObject();
$newKonfig = clone $konfig->toObject();
unset( $newConfig->antispam_recaptcha_private_key );
unset( $newConfig->antispam_recaptcha_public_key );
unset( $newConfig->antispam_akismet_key );
unset( $newConfig->layout_phpbb_path );
unset( $newConfig->layout_phpbb_url );
unset( $newKonfig->layout_phpbb_path );
unset( $newKonfig->layout_phpbb_url );
$this->options = array(
"responsive" => (bool) $config->get('enable_responsive'),
"jversion" => Komento::joomlaVersion(),
"spinner" => JURI::root() . 'media/com_komento/images/loader.gif',
"view" => JRequest::getString( 'view', '' ),
"guest" => Komento::getProfile()->guest ? 1 : 0,
"config" => $newConfig,
"konfig" => $newKonfig,
"acl" => Komento::getACL(),
"element" => new stdClass()
);
parent::__construct();
}
示例9: loadComments
public static function loadComments( $id, $component, $options = array() )
{
$commentsModel = Komento::getModel( 'comments' );
$comments = $commentsModel->getComments( $component, $id, $options );
$commentsModel = Komento::getModel( 'comments' );
$commentCount = $commentsModel->getCount( $component, $id );
if( array_key_exists('raw', $options) )
{
return $comments;
}
// @task: load necessary css and javascript files.
Komento::getHelper( 'Document' )->loadHeaders();
$application = Komento::loadApplication( $component );
if( $application->load( $id ) === false )
{
$application = Komento::getErrorApplication( $component, $id );
}
$theme = Komento::getTheme();
$theme->set( 'component', $component );
$theme->set( 'cid', $id );
$theme->set( 'comments', $comments );
$theme->set( 'options', $options );
$theme->set( 'componentHelper', $application );
$theme->set( 'application', $application );
$theme->set( 'commentCount', $commentCount );
$contentLink = $application->getContentPermalink();
$theme->set( 'contentLink', $contentLink );
$html = $theme->fetch('comment/box.php');
/* [KOMENTO_POWERED_BY_LINK] */
// free version powered by link append (for reference only)
// $html .= '<div style="text-align: center; padding: 20px 0;"><a href="http://stackideas.com">' . JText::_( 'COM_KOMENTO_POWERED_BY_KOMENTO' ) . '</a></div>';
return $html;
}
示例10: display
function display($tpl = null)
{
//initialise variables
$document = JFactory::getDocument();
$user = JFactory::getUser();
$mainframe = JFactory::getApplication();
$components = array();
$result = Komento::getHelper('components')->getAvailableComponents();
if (Komento::joomlaVersion() >= '1.6') {
if (!$user->authorise('komento.manage.comments', 'com_komento')) {
$mainframe->redirect('index.php', JText::_('JERROR_ALERTNOAUTHOR'), 'error');
$mainframe->close();
}
}
//Load pane behavior
jimport('joomla.html.pane');
$commentId = JRequest::getVar('commentid', '');
$comment = Komento::getTable('Comments');
$comment->load($commentId);
$this->comment = $comment;
// Set default values for new entries.
if (empty($comment->created)) {
Komento::import('helper', 'date');
$date = KomentoDateHelper::getDate();
$now = KomentoDateHelper::toFormat($date);
$comment->created = $now;
$comment->published = true;
}
// Set all non published comments to unpublished
if ($comment->published != 1) {
$comment->published = 0;
}
// @task: Translate each component with human readable name.
foreach ($result as $item) {
$components[] = JHTML::_('select.option', $item, Komento::loadApplication($item)->getComponentName());
}
$this->assignRef('comment', $comment);
$this->assignRef('components', $components);
parent::display($tpl);
}
示例11: mark
function mark()
{
$type = JRequest::getVar('type');
$id = JRequest::getInt('id');
$userId = JFactory::getUser()->id;
$ajax = Komento::getHelper('Ajax');
$commentObj = Komento::getComment( $id );
$commentObj->load( $id );
$commentObj->flag = $type;
$commentObj->flag_by = $userId;
if( !$commentObj->save() )
{
$ajax->fail();
$ajax->send();
}
$ajax->success();
$ajax->send();
}
示例12: stick
function stick($comments = array(), $stick = 1)
{
if (!is_array($comments)) {
$comments = array($comments);
}
if (count($comments) > 0) {
$allComments = implode(',', $comments);
$query = 'UPDATE ' . $this->db->namequote('#__komento_comments');
$query .= ' SET ' . $this->db->namequote('sticked') . ' = ' . $this->db->quote($stick);
$query .= ' WHERE ' . $this->db->namequote('id') . ' IN (' . $allComments . ')';
$this->db->setQuery($query);
if (!$this->db->query()) {
$this->setError($this->db->getErrorMsg());
return false;
}
foreach ($comments as $comment) {
// process all activities
if ($stick) {
$activity = Komento::getHelper('activity')->process('stick', $comment);
} else {
$activity = Komento::getHelper('activity')->process('unstick', $comment);
}
}
return true;
}
return false;
}
示例13: 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');
?>
<div class="row-fluid">
<div class="span12">
<div class="span6">
<fieldset class="adminform">
<legend><?php
echo JText::_('COM_KOMENTO_SETTINGS_ACTIVITIES_DISCUSS');
?>
</legend>
<?php
if (Komento::getHelper('components')->isInstalled('com_easydiscuss')) {
?>
<p><?php
echo JText::_('COM_KOMENTO_SETTINGS_ACTIVITIES_DISCUSS_INSTRUCTIONS');
?>
</p>
<table class="admintable" cellspacing="1">
<tbody>
<!-- Enable Discuss Points -->
<?php
echo $this->renderSetting('COM_KOMENTO_SETTINGS_ACTIVITIES_ENABLE_DISCUSS_POINTS', 'enable_discuss_points');
?>
<!-- Enable Discuss Log -->
<?php
echo $this->renderSetting('COM_KOMENTO_SETTINGS_ACTIVITIES_ENABLE_DISCUSS_LOG', 'enable_discuss_log');
示例14: escape
public static function escape($s)
{
$code = $s[3];
$code = str_replace("[", "[", $code);
$code = str_replace("]", "]", $code);
$brush = isset($s[2]) && !empty($s[2]) ? $s[2] : 'xml';
$code = html_entity_decode($code);
$code = Komento::getHelper('String')->escape($code);
if ($brush != '') {
$result = '<pre><code class="language-' . htmlspecialchars($brush) . '">' . $code . '</code></pre>';
} else {
$result = '<pre><code>' . $code . '</code></pre>';
}
return $result;
}
示例15: 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');
$componentHelper = Komento::getHelper('components');
if ($componentHelper->isInstalled('com_zoo')) {
$zooObj = Komento::loadApplication('com_zoo');
$categories = $zooObj->getCategories();
$selection = $this->renderMultilist('category', '', $categories);
?>
<table id="migrator-zoo" migrator-type="zoo" migration-type="article" class="noshow migratorTable">
<tr>
<td width="50%" valign="top">
<fieldset class="adminform">
<legend><?php
echo JText::_('COM_KOMENTO_MIGRATORS_LAYOUT_MAIN');
?>
</legend>
<table class="migrator-options admintable">
<tr>
<td class="key"><span><?php