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); }
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); }
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']); }
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']); }
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']); } }
public static function renderGalleryComment(XenForo_BbCode_Parser $parser, &$message) { if (XenForo_Application::getOptions()->sonnbXG_extraBbcode) { self::$_tags = array_merge(self::$_tags, array('img', 'media')); } $message = preg_replace(array('/(\\[url\\]\\[url\\])/i', '/(\\[\\/url\\]\\[\\/url\\])/i'), array('[url]', '[/url]'), $message); $message = XenForo_Helper_String::censorString($message); $message = self::linkTaggedPlainText($message); $tags = $parser->parse($message); if (!empty($tags)) { $tags = self::_processTags($tags); } $extraStates = array('stopLineBreakConversion' => 1); $message = new XenForo_BbCode_TextWrapper($tags, $parser, $extraStates); return $message; }
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); }
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']); } }
public function renderHtml() { $this->_params['itemRendered'] = sonnb_XenGallery_ViewPublic_Helper::renderContentByContentGrouped($this->_params['itemsGrouped'], $this); }