本文整理汇总了PHP中Komento::getAjax方法的典型用法代码示例。如果您正苦于以下问题:PHP Komento::getAjax方法的具体用法?PHP Komento::getAjax怎么用?PHP Komento::getAjax使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Komento
的用法示例。
在下文中一共展示了Komento::getAjax方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: preview
function preview()
{
$id = JRequest::getInt('id');
$table = Komento::getTable('mailq');
$table->load($id);
$ajax = Komento::getAjax();
$ajax->success($table->body, $table->type);
$ajax->send();
}
示例2: 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();
}
示例3: migrateSettings
function migrateSettings()
{
$ajax = Komento::getAjax();
$fromTable = Komento::getTable('configs');
$toTable = Komento::getTable('configs');
$component = JRequest::getVar('component');
$currentComponent = JRequest::getVar('currentComponent');
$fromTable->load($component);
$toTable->load($currentComponent);
$toTable->params = $fromTable->params;
$toTable->store();
$ajax->success();
$ajax->send();
}
示例4: loadReplies
function loadReplies()
{
$ajax = Komento::getAjax();
$model = Komento::getModel('comments');
$options['parent_id'] = JRequest::getInt('parentId');
$startCount = JRequest::getInt('startCount');
$commentsModel = Komento::getModel('comments');
$comments = $commentsModel->getData($options);
$count = count($comments);
$this->assign('comments', $comments);
$this->assign('search', '');
$this->assign('startCount', $startCount);
$this->assign('columns', Komento::getConfig('com_komento_comments_columns', false));
$html = $this->loadTemplate('list_' . $this->getTheme());
$ajax->success($html);
$ajax->send();
}
示例5: 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();
}
示例6: normalizeStructure
public function normalizeStructure()
{
$sql = Komento::getSql();
$ajax = Komento::getAjax();
$component = JRequest::getString('component');
$cid = JRequest::getString('cid');
// Normalize all invalid parent id first
$query = "UPDATE `#__komento_comments` as `a`";
$query .= " LEFT JOIN `#__komento_comments` as `b`";
$query .= " ON `a`.`parent_id` = `b`.`id`";
$query .= " AND `a`.`component` = `b`.`component`";
$query .= " AND `a`.`cid` = `b`.`cid`";
$query .= " SET `a`.`parent_id` = 0, `a`.`depth` = 0";
$query .= " WHERE `b`.`id` is null";
$query .= " AND `a`.`component` = '{$component}'";
$query .= " AND `a`.`cid` = '{$cid}'";
$query .= " AND `a`.`parent_id` <> 0";
$sql->raw($query);
$sql->query();
$sql->clear();
// Now we normalize the structure of lft rgt values
$sql->select('#__komento_comments')->where('component', $component)->where('cid', $cid)->order('created');
$result = $sql->loadObjectList();
$boundary = 1;
foreach ($result as $row) {
$table = Komento::getTable('comments');
$table->bind($row);
$table->lft = $boundary++;
$table->rgt = $boundary++;
$table->store();
}
$ajax->resolve();
return $ajax->send();
}
示例7: __construct
function __construct()
{
$this->ajax = Komento::getAjax();
$this->model = Komento::getModel('migrators', true)->getMigrator(JRequest::getString('type'));
$this->kmtmodel = Komento::getModel('comments');
}
示例8: unsubscribeUser
public function unsubscribeUser()
{
$id = JRequest::getInt( 'user', null );
$component = JRequest::getCmd( 'component' );
$cid = JRequest::getCmd( 'cid' );
$model = Komento::getModel( 'subscription' );
$state = $model->unsubscribe( $component, $cid, $id );
$ajax = Komento::getAjax();
if( $state )
{
$ajax->success();
}
else
{
$ajax->fail();
}
$ajax->send();
}
示例9: getStickedComments
function getStickedComments()
{
$loadMore = JRequest::getInt( 'loadMore', 0 );
$ajax = Komento::getAjax();
$model = Komento::getModel( 'comments' );
$uid = JRequest::getInt( 'uid' );
$start = JRequest::getInt( 'start', 0 );
$limit = JRequest::getInt( 'limit', 10 );
$options = array(
'limitstart' => $start,
'limit' => $limit,
'userid' => $uid,
'sticked' => 1,
'threaded' => 0,
'sort' => 'latest'
);
$comments = $model->getComments( 'all', 'all', $options );
$total = '';
if( !$loadMore )
{
$total = $model->getCount( 'all', 'all', $options );
}
$count = count( $comments );
$theme = Komento::getTheme();
$theme->set( 'items', $comments );
$theme->set( 'total', $total );
$html = '';
if( $loadMore )
{
$html = $theme->fetch( 'profile/sticked/list.php' );
}
else
{
$html = $theme->fetch( 'profile/sticked.php' );
}
$ajax->success( $html, $count, $total);
$ajax->send();
}