Beispiel #1
0
 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']);
     }
 }
Beispiel #2
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);
 }
Beispiel #3
0
 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']);
     }
 }