当前位置: 首页>>代码示例>>PHP>>正文


PHP XenForo_ViewRenderer_Json类代码示例

本文整理汇总了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);
 }
开发者ID:hahuunguyen,项目名称:DTUI_201105,代码行数:7,代码来源:ViewNewMessages.php

示例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);
 }
开发者ID:Sywooch,项目名称:forums,代码行数:26,代码来源:ReplyLive.php

示例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);
 }
开发者ID:AndroidOS,项目名称:SocialGroups,代码行数:7,代码来源:AvatarUpload.php

示例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']));
 }
开发者ID:hahuunguyen,项目名称:DTUI_201105,代码行数:7,代码来源:Follow.php

示例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;
 }
开发者ID:VoDongMy,项目名称:xenforo-laravel5.1,代码行数:27,代码来源:List.php

示例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);
 }
开发者ID:Sywooch,项目名称:forums,代码行数:7,代码来源:Comment.php

示例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'])));
 }
开发者ID:ThemeHouse-XF,项目名称:ParentalContro,代码行数:7,代码来源:Link.php

示例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);
 }
开发者ID:Sywooch,项目名称:forums,代码行数:7,代码来源:WatchConfirmed.php

示例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);
 }
开发者ID:Sywooch,项目名称:forums,代码行数:8,代码来源:DoUpload.php

示例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);
 }
开发者ID:VoDongMy,项目名称:xenforo-laravel5.1,代码行数:8,代码来源:Post.php

示例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']));
     }
 }
开发者ID:Sywooch,项目名称:forums,代码行数:8,代码来源:RecentActivity.php

示例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);
 }
开发者ID:namgiangle90,项目名称:tokyobaito,代码行数:8,代码来源:SaveDraft.php

示例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);
 }
开发者ID:hahuunguyen,项目名称:DTUI_201105,代码行数:8,代码来源:DoUpload.php

示例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']));
 }
开发者ID:VoDongMy,项目名称:xenforo-laravel5.1,代码行数:9,代码来源:ShowComment.php

示例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();
 }
开发者ID:namgiangle90,项目名称:tokyobaito,代码行数:18,代码来源:Xml.php


注:本文中的XenForo_ViewRenderer_Json类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。