本文整理汇总了PHP中XenForo_ViewRenderer_Json类的典型用法代码示例。如果您正苦于以下问题:PHP XenForo_ViewRenderer_Json类的具体用法?PHP XenForo_ViewRenderer_Json怎么用?PHP XenForo_ViewRenderer_Json使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了XenForo_ViewRenderer_Json类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: renderJson
public function renderJson()
{
$output = $this->_renderer->getDefaultOutputArray(get_class($this), $this->_params, $this->_templateName);
$output['lastDate'] = $this->_params['lastMessage']['message_date'];
$output['count'] = count($this->_params['messages']);
return XenForo_ViewRenderer_Json::jsonEncodeForOutput($output);
}
示例2: renderJson
public function renderJson()
{
$output = array();
$bbCodeParser = new XenForo_BbCode_Parser(XenForo_BbCode_Formatter_Base::create('Base', array('view' => $this)));
$bbCodeOptions = array('states' => array('viewAttachments' => $this->_params['canViewAttachments']));
XenForo_ViewPublic_Helper_Message::bbCodeWrapMessages($this->_params['posts'], $bbCodeParser, $bbCodeOptions);
$viewParams = $this->_params;
unset($viewParams['posts']);
foreach ($this->_params['posts'] as &$post) {
$viewParams['post'] = $post;
$template = $this->createTemplateObject('post', $viewParams);
$output['posts'][] = $template->render();
}
if (XenForo_Application::getOptions()->sonnb_LiveThread_reserveOrder) {
$lastPost = reset($this->_params['posts']);
} else {
$lastPost = end($this->_params['posts']);
}
$template = $this->createTemplateObject('', $viewParams);
$viewOutput = $template->render();
$output['css'] = $template->getRequiredExternals('css');
$output['js'] = $template->getRequiredExternals('js');
$output['lastDate'] = $lastPost['post_date'];
$output['reserveOrder'] = isset($viewParams['reserveOrder']) ? $viewParams['reserveOrder'] : false;
return XenForo_ViewRenderer_Json::jsonEncodeForOutput($output);
}
示例3: renderJson
public function renderJson()
{
$this->_params['urls'] = ThemeHouse_SocialGroups_Template_Helper_SocialForum::getAvatarUrls($this->_params['socialForum']);
$this->_params['user_id'] = "sg-" . $this->_params['social_forum_id'];
$output = XenForo_Application::arrayFilterKeys($this->_params, array('sizeCode', 'maxWidth', 'maxDimension', 'width', 'height', 'cropX', 'cropY', 'urls', 'user_id', 'logo_date', 'cropCss', 'message'));
return XenForo_ViewRenderer_Json::jsonEncodeForOutput($output);
}
示例4: renderJson
public function renderJson()
{
foreach ($this->_params['followUsers'] as $userId => &$user) {
$user = $this->createTemplateObject('member_list_item_follower', array('user' => $user));
}
return XenForo_ViewRenderer_Json::jsonEncodeForOutput(array('followUsers' => $this->_params['followUsers'], 'following' => $this->_params['following']));
}
示例5: renderJson
public function renderJson()
{
$options = XenForo_Application::get('options');
$maxid = Dark_TaigaChat_Helper_Global::processMessagesForView($this->_params, $this);
$template = $this->createTemplateObject($this->_templateName, $this->_params);
$template->setParams($this->_params);
if (!empty($this->_params['taigachat']['publichtml'])) {
$template->setLanguageId(XenForo_Phrase::getLanguageId());
$template->setStyleId($options->defaultStyleId);
}
$rendered = $template->render();
$rendered = preg_replace('/\\s+<\\/(.*?)>\\s+</si', ' </$1> <', $rendered);
$rendered = preg_replace('/\\s+<(.*?)([ >])/si', ' <$1$2', $rendered);
$params = array("templateHtml" => $rendered, "reverse" => $options->dark_taigachat_direction, "lastrefresh" => $maxid, "motd" => $this->_params['taigachat']['motd'], "numInChat" => $this->_params['taigachat']['numInChat']);
if (!empty($this->_params['taigachat']['publichtml'])) {
$params += array("_visitor_conversationsUnread" => "IGNORE", "_visitor_alertsUnread" => "IGNORE");
}
//$rendered = str_replace(array("\r", "\n", "\t"), "", $rendered);
$derp = XenForo_ViewRenderer_Json::jsonEncodeForOutput($params, empty($this->_params['taigachat']['publichtml']));
if (empty($this->_params['taigachat']['publichtml'])) {
$extraHeaders = XenForo_Application::gzipContentIfSupported($derp);
foreach ($extraHeaders as $extraHeader) {
header("{$extraHeader['0']}: {$extraHeader['1']}", $extraHeader[2]);
}
}
return $derp;
}
示例6: renderJson
public function renderJson()
{
$bbCodeParser = XenForo_BbCode_Parser::create(XenForo_BbCode_Formatter_Base::create('Nobita_Teams_BbCode_Formatter_Comment', array('view' => $this)));
$this->_params['comment']['messageHtml'] = XenForo_ViewPublic_Helper_Message::getBbCodeWrapper($this->_params['comment'], $bbCodeParser, array());
$output = $this->_renderer->getDefaultOutputArray(get_class($this), $this->_params, $this->_templateName);
return XenForo_ViewRenderer_Json::jsonEncodeForOutput($output);
}
示例7: renderJson
public function renderJson()
{
foreach ($this->_params['linkedUsers'] as $userId => &$user) {
$user = $this->createTemplateObject('th_member_list_item_linked_parentalcontrol', array('user' => $user));
}
return XenForo_ViewRenderer_Json::jsonEncodeForOutput(array('users' => $this->_params['linkedUsers'], 'userIds' => array_keys($this->_params['linkedUsers'])));
}
示例8: renderJson
public function renderJson()
{
$output = array('templateHtml' => '', 'js' => '', 'css' => '');
$output['watched'] = $this->_params['watched'];
$output += sonnb_XenGallery_ViewPublic_Helper::getWatchViewParams($this->_params['watched']);
return XenForo_ViewRenderer_Json::jsonEncodeForOutput($output);
}
示例9: renderJson
public function renderJson()
{
$photo = $this->_preparePhotoForJson($this->_params['content'], $this->_params['album']);
if (!empty($this->_params['message'])) {
$photo['message'] = $this->_params['message'];
}
return XenForo_ViewRenderer_Json::jsonEncodeForOutput($photo);
}
示例10: renderJson
public function renderJson()
{
$output = $this->_renderer->getDefaultOutputArray(get_class($this), $this->_params, $this->_templateName);
if ($this->_params['isStatus']) {
$output['statusHtml'] = XenForo_Template_Helper_Core::callHelper('bodytext', array($this->_params['profilePost']['message'])) . ' ' . XenForo_Template_Helper_Core::callHelper('datetimehtml', array($this->_params['profilePost']['post_date']));
}
return XenForo_ViewRenderer_Json::jsonEncodeForOutput($output);
}
示例11: renderJson
public function renderJson()
{
if (!empty($this->_params['startNewsFeedId'])) {
// this is for loading more entries
$this->renderHtml();
return XenForo_ViewRenderer_Json::jsonEncodeForOutput(array('templateHtml' => $this->createTemplateObject('news_feed', $this->_params), 'oldestItemId' => $this->_params['oldestItemId'], 'feedEnds' => $this->_params['feedEnds']));
}
}
示例12: renderJson
public function renderJson()
{
$output = $this->_renderer->getDefaultOutputArray(get_class($this), $this->_params, $this->_templateName);
$output['newPostCount'] = $this->_params['newPostCount'];
$output['draftSaved'] = $this->_params['draftSaved'];
$output['draftDeleted'] = $this->_params['draftDeleted'];
return XenForo_ViewRenderer_Json::jsonEncodeForOutput($output);
}
示例13: renderJson
public function renderJson()
{
$attach = $this->_prepareAttachmentForJson($this->_params['attachment']);
if (!empty($this->_params['message'])) {
$attach['message'] = $this->_params['message'];
}
return XenForo_ViewRenderer_Json::jsonEncodeForOutput($attach);
}
示例14: renderJson
public function renderJson()
{
$bbCodeParser = XenForo_BbCode_Parser::create(XenForo_BbCode_Formatter_Base::create('Base', array('view' => $this)));
$this->_params['comment']['messageHtml'] = new XenForo_BbCode_TextWrapper($this->_params['comment']['message'], $bbCodeParser);
$this->_params['comment']['message'] = $this->_params['comment']['messageHtml'];
// sanity check in case template not updated
$this->_params['comment']['comment_state'] = 'visible';
return XenForo_ViewRenderer_Json::jsonEncodeForOutput(array('templateHtml' => $this->createTemplateObject('xengallery_comment', $this->_params), 'commentId' => $this->_params['comment']['comment_id']));
}
示例15: renderRedirect
/**
* Simple handler for XML redirects - do not redirect, just send status:ok and redirect:$redirectTarget
*
* @param integer Type of redirect. See {@link XenForo_ControllerResponse_Redirect}
* @param string Target to redirect to
* @param mixed Redirect message
*
* @return string XML response (response tag)
*/
public function renderRedirect($redirectType, $redirectTarget, $redirectMessage = null, array $redirectParams = array())
{
$document = new DOMDocument('1.0', 'utf-8');
$document->formatOutput = true;
$rootNode = $document->createElement('response');
XenForo_Helper_DevelopmentXml::createDomElements($rootNode, array('_redirectStatus' => 'ok', '_redirectTarget' => $redirectTarget, '_redirectMessage' => is_null($redirectMessage) ? new XenForo_Phrase('redirect_changes_saved_successfully') : $redirectMessage, 'jsonParams' => XenForo_ViewRenderer_Json::jsonEncodeForOutput($redirectParams)));
$document->appendChild($rootNode);
return $document->saveXML();
}