Example #1
0
 public function renderHtml()
 {
     $response = parent::renderHtml();
     $bbCodeParser = new HQCoder_ParseHTML_BbCode_Parser(HQCoder_ParseHTML_BbCode_Formatter_Ritsu::create('HQCoder_ParseHTML_BbCode_Formatter_Ritsu', array('view' => $this)));
     $bbCodeOptions = array('states' => array('viewAttachments' => $this->_params['canViewAttachments']));
     $this->_params['message']['messageHtml'] = HQCoder_ParseHTML_ViewPublic_Helper_Message::getBbCodeWrapper($this->_params['message'], $bbCodeParser, $bbCodeOptions);
     return $response;
 }
Example #2
0
 public static function bbCodeWrapMessages(array &$messages, XenForo_BbCode_Parser $parser, array $options = array())
 {
     $options += array('showSignature' => XenForo_Visitor::getInstance()->get('content_show_signature'), 'states' => array());
     foreach ($messages as &$message) {
         $message['messageHtml'] = '';
         $message['messageHtml'] = HQCoder_ParseHTML_ViewPublic_Helper_Message::getBbCodeWrapper($message, $parser, $options);
     }
 }
Example #3
0
 public function renderJson()
 {
     $formatter = HQCoder_ParseHTML_BbCode_Formatter_Ritsu::create('HQCoder_ParseHTML_BbCode_Formatter_Ritsu', array('view' => $this));
     $bbCodeParser = new HQCoder_ParseHTML_BbCode_Parser($formatter);
     $bbCodeOptions = array('states' => array('viewAttachments' => isset($this->_params['canViewAttachments']) ? $this->_params['canViewAttachments'] : true));
     HQCoder_ParseHTML_ViewPublic_Helper_Message::bbCodeWrapMessages($this->_params['posts'], $bbCodeParser, $bbCodeOptions);
     $output = array('messagesTemplateHtml' => array());
     foreach ($this->_params['posts'] as $postId => $post) {
         $output['messagesTemplateHtml']["#post-{$postId}"] = $this->createTemplateObject('post', array_merge($this->_params, array('post' => $post)))->render();
     }
     $template = $this->createTemplateObject('', array());
     $output['css'] = $template->getRequiredExternals('css');
     $output['js'] = $template->getRequiredExternals('js');
     return XenForo_ViewRenderer_Json::jsonEncodeForOutput($output);
 }
Example #4
0
 public function renderHtml()
 {
     $bbCodeParser = new HQCoder_ParseHTML_BbCode_Parser(HQCoder_ParseHTML_BbCode_Formatter_Ritsu::create('HQCoder_ParseHTML_BbCode_Formatter_Ritsu', array('view' => $this)));
     $bbCodeOptions = array('states' => array('viewAttachments' => $this->_params['canViewAttachments']));
     HQCoder_ParseHTML_ViewPublic_Helper_Message::bbCodeWrapMessages($this->_params['messages'], $bbCodeParser, $bbCodeOptions);
     // pre v1.2
     if (XenForo_Application::get('options')->currentVersionId < 1020031) {
         if (!empty($this->_params['canReplyConversation'])) {
             $this->_params['qrEditor'] = XenForo_ViewPublic_Helper_Editor::getQuickReplyEditor($this, 'message');
         }
         // >= v1.2
     } else {
         if (!empty($this->_params['canReplyConversation'])) {
             $draft = isset($this->_params['conversation']['draft_message']) ? $this->_params['conversation']['draft_message'] : '';
             $this->_params['qrEditor'] = XenForo_ViewPublic_Helper_Editor::getQuickReplyEditor($this, 'message', $draft, array('extraClass' => 'NoAutoComplete', 'autoSaveUrl' => XenForo_Link::buildPublicLink('conversations/save-draft', $this->_params['conversation']), 'json' => array('placeholder' => 'reply_placeholder')));
         }
         // end version check
     }
 }
Example #5
0
 public function renderHtml()
 {
     $bbCodeParser = new HQCoder_ParseHTML_BbCode_Parser(HQCoder_ParseHTML_BbCode_Formatter_Ritsu::create('HQCoder_ParseHTML_BbCode_Formatter_Ritsu', array('view' => $this)));
     $bbCodeOptions = array('states' => array('viewAttachments' => $this->_params['canViewAttachments']));
     HQCoder_ParseHTML_ViewPublic_Helper_Message::bbCodeWrapMessages($this->_params['messages'], $bbCodeParser, $bbCodeOptions);
 }