예제 #1
0
 public function renderJson()
 {
     $bbCodeFormatter = XenForo_BbCode_Formatter_Base::create('Base', array('view' => $this));
     $parser = new XenForo_BbCode_Parser($bbCodeFormatter);
     $output = array();
     $this->_params['comment']['message'] = sonnb_XenGallery_ViewPublic_Helper::renderGalleryComment($parser, $this->_params['comment']['message']);
     $output['messagesTemplateHtml'] = $this->createTemplateObject('sonnb_xengallery_comment', $this->_params);
     $output['_message'] = nl2br($this->_params['comment']['message']);
     $output['css'] = $output['messagesTemplateHtml']->getRequiredExternals('css');
     $output['js'] = $output['messagesTemplateHtml']->getRequiredExternals('js');
     return XenForo_ViewRenderer_Json::jsonEncodeForOutput($output);
 }
예제 #2
0
파일: Comment.php 프로젝트: Sywooch/forums
 public function renderJson()
 {
     $bbCodeFormatter = XenForo_BbCode_Formatter_Base::create('Base', array('view' => $this));
     $parser = new XenForo_BbCode_Parser($bbCodeFormatter);
     $output = array();
     $comments = $this->_params['comments'];
     $lastComment = end($comments);
     foreach ($comments as $commentId => &$comment) {
         $comment['message'] = sonnb_XenGallery_ViewPublic_Helper::renderGalleryComment($parser, $comment['message']);
         $output[] = $this->createTemplateObject('sonnb_xengallery_comment', array('comment' => $comment) + $this->_params);
     }
     return array('comments' => $output, 'lastShownCommentDate' => $lastComment['comment_date']);
 }
예제 #3
0
파일: Comments.php 프로젝트: Sywooch/forums
 public function renderJson()
 {
     $bbCodeFormatter = XenForo_BbCode_Formatter_Base::create('Base', array('view' => $this));
     $parser = new XenForo_BbCode_Parser($bbCodeFormatter);
     $comments = array();
     if ($this->_params['remainCommentCount']) {
         $comments[] = $this->createTemplateObject('sonnb_xengallery_album_comments_before', $this->_params + array('firstShownCommentDate' => $this->_params['firstCommentShown']['comment_date']));
     }
     foreach ($this->_params['comments'] as &$comment) {
         $comment['message'] = sonnb_XenGallery_ViewPublic_Helper::renderGalleryComment($parser, $comment['message']);
         $comments[] = $this->createTemplateObject('sonnb_xengallery_comment', array('comment' => $comment) + $this->_params);
     }
     return array('comments' => $comments, 'firstShownCommentDate' => $this->_params['firstCommentShown']['comment_date'], 'commentShownCount' => $this->_params['commentShownCount']);
 }
예제 #4
0
파일: View.php 프로젝트: Sywooch/forums
 public function renderHtml()
 {
     $bbCodeFormatter = XenForo_BbCode_Formatter_Base::create('Base', array('view' => $this));
     $parser = new XenForo_BbCode_Parser($bbCodeFormatter);
     $this->_params['album']['descriptionHtml'] = sonnb_XenGallery_ViewPublic_Helper::renderGalleryComment($parser, $this->_params['album']['description']);
     if (!empty($this->_params['album']['comments'])) {
         foreach ($this->_params['album']['comments'] as &$comment) {
             $comment['message'] = sonnb_XenGallery_ViewPublic_Helper::renderGalleryComment($parser, $comment['message']);
         }
     }
     if (!empty($this->_params['fields'])) {
         $this->_params['fields'] = sonnb_XenGallery_ViewPublic_Helper::addFieldsValueHtml($this, $this->_params['fields']);
     }
 }
예제 #5
0
 public function renderJson()
 {
     $bbCodeFormatter = XenForo_BbCode_Formatter_Base::create('Base', array('view' => $this));
     $parser = new XenForo_BbCode_Parser($bbCodeFormatter);
     $output = array();
     $output['message'] = new XenForo_Phrase('changes_saved');
     $output['contentId'] = $this->_params['content']['content_id'];
     $output['description'] = sonnb_XenGallery_ViewPublic_Helper::renderGalleryComment($parser, $this->_params['content']['description']);
     $output['fields'] = '';
     if (!empty($this->_params['fields'])) {
         $fields = sonnb_XenGallery_ViewPublic_Helper::addFieldsValueHtml($this, $this->_params['fields']);
         foreach ($fields as $field) {
             $output['fields'] .= $this->createTemplateObject('sonnb_xengallery_custom_field_view', array('field' => $field));
         }
     }
     return XenForo_ViewRenderer_Json::jsonEncodeForOutput($output);
 }
예제 #6
0
파일: View.php 프로젝트: Sywooch/forums
 public function renderHtml()
 {
     $bbCodeFormatter = XenForo_BbCode_Formatter_Base::create('Base', array('view' => $this));
     $parser = new XenForo_BbCode_Parser($bbCodeFormatter);
     $this->_params['content']['descriptionHtml'] = sonnb_XenGallery_ViewPublic_Helper::renderGalleryComment($parser, $this->_params['content']['description']);
     if (isset($this->_params['content']['video_type'])) {
         $this->_params['content']['embed'] = $parser->render('[MEDIA=' . $this->_params['content']['video_type'] . ']' . $this->_params['content']['video_key'] . '[/MEDIA]');
     }
     if (!empty($this->_params['content']['comments'])) {
         foreach ($this->_params['content']['comments'] as &$comment) {
             $comment['message'] = sonnb_XenGallery_ViewPublic_Helper::renderGalleryComment($parser, $comment['message']);
         }
     }
     if (!empty($this->_params['fields'])) {
         $this->_params['fields'] = sonnb_XenGallery_ViewPublic_Helper::addFieldsValueHtml($this, $this->_params['fields']);
     }
 }