예제 #1
0
파일: Wall.php 프로젝트: Sywooch/forums
 public function renderHtml()
 {
     XenForo_Application::set('view', $this);
     $bbCodeBase = XenForo_BbCode_Formatter_Base::create('Nobita_Teams_BbCode_Formatter_Base', array('view' => $this));
     $commentBbCode = XenForo_BbCode_Formatter_Base::create('Nobita_Teams_BbCode_Formatter_Comment', array('view', $this));
     $bbCodeParser = XenForo_BbCode_Parser::create($bbCodeBase);
     $commentBbCodeParser = XenForo_BbCode_Parser::create($commentBbCode);
     $bbCodeOptions = array('states' => array('viewAttachments' => $this->_params['canViewAttachments']), 'contentType' => 'team_post', 'contentIdKey' => 'post_id');
     $this->_params['team']['aboutHtml'] = new XenForo_BbCode_TextWrapper($this->_params['team']['about'], $bbCodeParser);
     XenForo_ViewPublic_Helper_Message::bbCodeWrapMessages($this->_params['posts'], $bbCodeParser, $bbCodeOptions);
     foreach ($this->_params['posts'] as &$post) {
         if (!$post['comments']) {
             continue;
         }
         XenForo_ViewPublic_Helper_Message::bbCodeWrapMessages($post['comments'], $commentBbCodeParser, array());
     }
     XenForo_ViewPublic_Helper_Message::bbCodeWrapMessages($this->_params['stickyPosts'], $bbCodeParser, $bbCodeOptions);
     foreach ($this->_params['stickyPosts'] as &$post) {
         if (!$post['comments']) {
             continue;
         }
         XenForo_ViewPublic_Helper_Message::bbCodeWrapMessages($post['comments'], $commentBbCodeParser, array());
     }
     unset($post);
     $this->_params['editorTemplate'] = XenForo_ViewPublic_Helper_Editor::getEditorTemplate($this, 'message', '', array('json' => array('buttonConfig' => $this->_params['customEditor']), 'height' => '60px'));
 }
예제 #2
0
파일: ViewAjax.php 프로젝트: Sywooch/forums
 public function renderHtml()
 {
     $bbCodeParser = XenForo_BbCode_Parser::create(XenForo_BbCode_Formatter_Base::create('Base', array('view' => $this)));
     $bbCodeOptions = array('states' => array('viewAttachments' => $this->_params['canViewImages']));
     $this->_params['showLimitedNotice'] = $this->_params['isLimited'];
     $this->_params['update']['messageHtml'] = XenForo_ViewPublic_Helper_Message::getBbCodeWrapper($this->_params['update'], $bbCodeParser, $bbCodeOptions);
 }
예제 #3
0
파일: Comment.php 프로젝트: Sywooch/forums
 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'] = new XenForo_BbCode_TextWrapper($this->_params['comment']['message'], $bbCodeParser);
     $this->_params['comment']['messageHtml'] = XenForo_ViewPublic_Helper_Message::getBbCodeWrapper($this->_params['comment'], $bbCodeParser, array());
     return array('comment' => $this->createTemplateObject('Team_post_comment', $this->_params));
 }
예제 #4
0
 public function renderHtml()
 {
     XenForo_Template_Helper_Core::setThreadPrefixes($this->_params['prefixes']);
     // don't pass a view to this, because the templates don't exist in the admin
     $bbCodeParser = XenForo_BbCode_Parser::create(XenForo_BbCode_Formatter_Base::create('Base'));
     $this->_params['entry']['messageHtml'] = new XenForo_BbCode_TextWrapper($this->_params['entry']['message'], $bbCodeParser);
 }
예제 #5
0
 public function renderHtml()
 {
     $bbCodeParser = XenForo_BbCode_Parser::create(XenForo_BbCode_Formatter_Base::create('Base', array('view' => $this)));
     $fields =& $this->_params['fields'];
     foreach ($fields as $fieldId => &$field) {
         if ($field['field_type'] == 'wysiwyg') {
             $field['editor'] = XenForo_ViewPublic_Helper_Editor::getEditorTemplate($this, 'fields[' . $field['field_id'] . '][editor]', $field['default_value'], array('editorId' => $fieldId . '_editor'));
         }
         if ($field['field_type'] == 'rating') {
             $field['fieldChoices'] = array();
             for ($i = 1; $i <= XenForo_Application::getOptions()->lpsfRatingMax; $i++) {
                 $field['fieldChoices'][] = $i;
             }
         }
         // render the pre text
         if ($field['pre_text'] != '') {
             $field['pre_text'] = new XenForo_BbCode_TextWrapper($field['pre_text'], $bbCodeParser);
         }
         // render the post text
         if ($field['post_text'] != '') {
             $field['post_text'] = new XenForo_BbCode_TextWrapper($field['post_text'], $bbCodeParser);
         }
         // datetime default_value editor
         if (array_key_exists('field_type', $field) && $field['field_type'] == 'datetime') {
             $temp = explode(' ', $field['default_value']);
             if (count($temp) == 2) {
                 $field['default_value'] = array('date' => $temp[0], 'time' => $temp[1]);
             } else {
                 $field['default_value'] = array('date' => '', 'time' => '');
             }
         }
     }
 }
예제 #6
0
파일: Comment.php 프로젝트: Sywooch/forums
 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);
 }
예제 #7
0
파일: Extra.php 프로젝트: Sywooch/forums
 public function renderHtml()
 {
     XenForo_Application::set('view', $this);
     $bbCodeParser = XenForo_BbCode_Parser::create(XenForo_BbCode_Formatter_Base::create('Base', array('view' => $this)));
     $this->_params['team']['aboutHtml'] = new XenForo_BbCode_TextWrapper($this->_params['team']['about'], $bbCodeParser);
     foreach ($this->_params['customFieldsGrouped'] as $id => &$fields) {
         if (empty($fields['fieldChoices'])) {
             // hard remove if custom fields did not have any values
             // @link https://nobita.me/threads/227/
             unset($this->_params['customFieldsGrouped'][$id]);
             continue;
         }
         foreach ($fields as &$field) {
             if ($field['field_type'] == 'bbcode') {
                 $field['fieldValueHtml'] = new XenForo_BbCode_TextWrapper($field['field_value'], $bbCodeParser);
             } else {
                 $field['fieldValueHtml'] = Nobita_Teams_ViewPublic_Helper_Team::getTeamFieldValueHtml($this->_params['team'], $field, $field['field_value']);
             }
         }
     }
     unset($fields, $field);
     foreach ($this->_params['parentTabsGrouped'] as &$fields) {
         foreach ($fields as &$field) {
             if ($field['field_type'] == 'bbcode') {
                 $field['fieldValueHtml'] = new XenForo_BbCode_TextWrapper($field['field_value'], $bbCodeParser);
             } else {
                 $field['fieldValueHtml'] = Nobita_Teams_ViewPublic_Helper_Team::getTeamFieldValueHtml($this->_params['team'], $field, $field['field_value']);
             }
         }
     }
 }
예제 #8
0
 public function renderHtml()
 {
     XenForo_Application::set('view', $this);
     $bbCodeParser = XenForo_BbCode_Parser::create(XenForo_BbCode_Formatter_Base::create('Base', array('view' => $this)));
     $bbCodeOptions = array('states' => array('viewAttachments' => $this->_params['canViewImages']), 'showSignature' => false);
     $this->_params['update']['messageHtml'] = XenForo_ViewPublic_Helper_Message::getBbCodeWrapper($this->_params['update'], $bbCodeParser, $bbCodeOptions);
 }
예제 #9
0
파일: Post.php 프로젝트: Sywooch/forums
 public function renderHtml()
 {
     $this->_params['editorTemplate'] = XenForo_ViewPublic_Helper_Editor::getQuickReplyEditor($this, 'message', $this->_params['post']['message'], array('json' => array('buttonConfig' => $this->_params['customEditor'])));
     $bbCodeParser = XenForo_BbCode_Parser::create(XenForo_BbCode_Formatter_Base::create('Nobita_Teams_BbCode_Formatter_Base', array('view' => $this)));
     $bbCodeOptions = array('states' => array('viewAttachments' => $this->_params['canViewAttachments']), 'contentType' => 'team_post', 'contentIdKey' => 'post_id');
     $this->_params['post']['messageHtml'] = XenForo_ViewPublic_Helper_Message::getBbCodeWrapper($this->_params['post'], $bbCodeParser, $bbCodeOptions);
 }
예제 #10
0
 public function renderJson()
 {
     $bbCodeParser = XenForo_BbCode_Parser::create(XenForo_BbCode_Formatter_Base::create('Base', array('view' => $this)));
     $bbCodeOptions = array('states' => array('viewAttachments' => $this->_params['canViewAttachments']), 'contentType' => 'post', 'contentIdKey' => 'post_id', 'showSignature' => XenForo_Visitor::getInstance()->get('content_show_signature'), 'states' => array());
     $this->_params['comment']['messageHtml'] = XenForo_ViewPublic_Helper_Message::getBbCodeWrapper($this->_params['comment'], $bbCodeParser, $bbCodeOptions);
     return array('comment' => $this->createTemplateObject('BRCR_post_comment', $this->_params));
 }
예제 #11
0
 /**
  * @return XenForo_BbCode_Parser
  */
 protected function _getXenParser()
 {
     static $parse = null;
     if (!$parse) {
         $parse = XenForo_BbCode_Parser::create(XenForo_BbCode_Formatter_Base::create('Base'));
     }
     return $parse;
 }
예제 #12
0
 public function renderHtml()
 {
     if (!empty($this->_params['verse'])) {
         $formatter = XenForo_BbCode_Formatter_Base::create('XenForo_BbCode_Formatter_Base');
         $parser = XenForo_BbCode_Parser::create($formatter);
         $this->_params['verseParsed'] = $parser->render($this->_params['verse']);
     }
 }
예제 #13
0
 public function renderHtml()
 {
     $formatter = XenForo_BbCode_Formatter_Base::create('XenForo_BbCode_Formatter_Base', array('view' => $this));
     $parser = XenForo_BbCode_Parser::create($formatter);
     foreach ($this->_params['posts'] as $postId => $post) {
         $this->_params['posts'][$postId]['messageParsed'] = $parser->render($post['message']);
     }
 }
예제 #14
0
 protected function _parseMessageForNotification(array $post)
 {
     $bbCodeParserText = XenForo_BbCode_Parser::create(XenForo_BbCode_Formatter_Base::create('Text'));
     $post['messageText'] = new XenForo_BbCode_TextWrapper($post['message'], $bbCodeParserText);
     $bbCodeParserHtml = XenForo_BbCode_Parser::create(XenForo_BbCode_Formatter_Base::create('HtmlEmail'));
     $post['messageHtml'] = new XenForo_BbCode_TextWrapper($post['message'], $bbCodeParserHtml);
     return $post;
 }
예제 #15
0
 public function renderHtml()
 {
     $previewLength = XenForo_Application::get('options')->discussionPreviewLength;
     if ($previewLength && !empty($this->_params['update'])) {
         $formatter = XenForo_BbCode_Formatter_Base::create('XenForo_BbCode_Formatter_Text');
         $parser = XenForo_BbCode_Parser::create($formatter);
         $this->_params['update']['messageParsed'] = $parser->render($this->_params['update']['message']);
     }
 }
예제 #16
0
 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']));
 }
예제 #17
0
 public function renderHtml()
 {
     $bbCodeParser = XenForo_BbCode_Parser::create(XenForo_BbCode_Formatter_Base::create('Base', array('view' => $this)));
     $this->_params['user']['aboutHtml'] = new XenForo_BbCode_TextWrapper($this->_params['user']['about'], $bbCodeParser);
     $this->_params['user']['signatureHtml'] = new XenForo_BbCode_TextWrapper($this->_params['user']['signature'], $bbCodeParser, array('lightBox' => false));
     foreach ($this->_params['customFieldsGrouped'] as &$fields) {
         $fields = XenForo_ViewPublic_Helper_User::addUserFieldsValueHtml($this, $fields);
     }
 }
예제 #18
0
 public function renderHtml()
 {
     if (!empty($this->_params['posts'])) {
         foreach ($this->_params['posts'] as &$post) {
             $formatter = XenForo_BbCode_Formatter_Base::create('XenForo_BbCode_Formatter_Text');
             $parser = XenForo_BbCode_Parser::create($formatter);
             $post['messageParsed'] = $parser->render($post['message']);
         }
     }
 }
예제 #19
0
 public function renderHtml()
 {
     $bbCodeParser = XenForo_BbCode_Parser::create(XenForo_BbCode_Formatter_Base::create('Base', array('view' => $this)));
     $bbCodeOptions = array('states' => array('viewAttachments' => $this->_params['canViewAttachments']));
     XenForo_ViewPublic_Helper_Message::bbCodeWrapMessages($this->_params['messages'], $bbCodeParser, $bbCodeOptions);
     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')));
     }
 }
 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 update
     $params = $this->_params;
     $params['comment'] = XenForo_Model::create('XenGallery_Model_Comment')->prepareComments($params['comment']);
     return XenForo_ViewRenderer_Json::jsonEncodeForOutput(array('templateHtml' => $this->createTemplateObject('xengallery_comment', $params), 'commentId' => $this->_params['comment']['comment_id'], 'date' => XenForo_Application::$time));
 }
예제 #21
0
 public function renderRaw()
 {
     if ($this->_params['media']['media_type'] == 'video_embed') {
         $bbCodeParser = XenForo_BbCode_Parser::create(XenForo_BbCode_Formatter_Base::create('Base', array('view' => $this)));
         $html = new XenForo_BbCode_TextWrapper($this->_params['media']['media_tag'], $bbCodeParser);
         $this->_params['videoHtml'] = $html;
     }
     $this->_params['jQuerySource'] = XenForo_Dependencies_Public::getJquerySource();
     $template = $this->createTemplateObject($this->_templateName, $this->_params);
     return $template;
 }
예제 #22
0
 public function renderHtml()
 {
     parent::renderHtml();
     foreach ($this->_params['posts'] as &$message) {
         if (!empty($message['BRCR_comments'])) {
             $bbCodeParser = XenForo_BbCode_Parser::create(XenForo_BbCode_Formatter_Base::create('Base', array('view' => $this)));
             $bbCodeOptions = array('states' => array('viewAttachments' => $this->_params['canViewAttachments']), 'contentType' => 'post', 'contentIdKey' => 'post_id');
             XenForo_ViewPublic_Helper_Message::bbCodeWrapMessages($message['BRCR_comments'], $bbCodeParser, $bbCodeOptions);
         }
     }
 }
예제 #23
0
 public function renderHtml()
 {
     parent::renderHtml();
     $userProfileModel = XenForo_Model::create('XenForo_Model_UserProfile');
     $this->_params['user']['about'] = $userProfileModel->getAndMergeAttachmentsIntoAbout($this->_params['user']['about'], $this->_params['user']['user_id']);
     if (!empty($this->_params['user']['about']['attachments'])) {
         $bbCodeParser = XenForo_BbCode_Parser::create(XenForo_BbCode_Formatter_Base::create('Base', array('view' => $this)));
         $bbCodeOptions = array('states' => array('viewAttachments' => true));
         $this->_params['user']['aboutHtml'] = XenForo_ViewPublic_Helper_Message::getBbCodeWrapper($this->_params['user']['about'], $bbCodeParser, $bbCodeOptions);
     }
 }
예제 #24
0
 public function renderHtml()
 {
     $buttonConfig = array('basic' => true);
     $categoryDescription = XenForo_Html_Renderer_BbCode::renderFromHtml($this->_params['category']['category_description']);
     /* @var $formatter ThemeHouse_ResCats_BbCode_Formatter_BbCode_Description */
     $formatter = XenForo_BbCode_Formatter_Base::create('ThemeHouse_ResCats_BbCode_Formatter_BbCode_Description');
     $formatter->configureForDescription();
     $parser = XenForo_BbCode_Parser::create($formatter);
     $categoryDescription = $parser->render($categoryDescription);
     $this->_params['descriptionEditor'] = XenForo_ViewPublic_Helper_Editor::getEditorTemplate($this, 'category_description', $categoryDescription, array('json' => array('buttonConfig' => $buttonConfig)));
 }
예제 #25
0
파일: Post.php 프로젝트: Sywooch/forums
 protected function _checkMessageValidity()
 {
     parent::_checkMessageValidity();
     if (!$this->getError('message')) {
         $formatter = XenForo_BbCode_Formatter_Base::create('XenForo_BbCode_Formatter_Base');
         $parser = XenForo_BbCode_Parser::create($formatter);
         $output = $parser->render($this->get('message'));
         if (!strlen(trim($output))) {
             $this->error(new XenForo_Phrase('please_enter_valid_message'), 'message');
         }
     }
 }
예제 #26
0
 public function renderHtml()
 {
     if (!empty($this->_params['media'])) {
         foreach ($this->_params['media'] as &$media) {
             if (isset($media['media_type']) && $media['media_type'] == 'video_embed') {
                 $bbCodeParser = XenForo_BbCode_Parser::create(XenForo_BbCode_Formatter_Base::create('Base', array('view' => $this)));
                 $html = new XenForo_BbCode_TextWrapper($media['media_tag'], $bbCodeParser);
                 $media['videoHtml'] = $html;
             }
         }
     }
 }
예제 #27
0
 public function renderJson()
 {
     $bbCodeParser = XenForo_BbCode_Parser::create(XenForo_BbCode_Formatter_Base::create('Base', array('view' => $this)));
     foreach ($this->_params['comments'] as &$comment) {
         $comment['messageHtml'] = new XenForo_BbCode_TextWrapper($comment['message'], $bbCodeParser);
         $comment['message'] = $comment['messageHtml'];
         // sanity check in case template not update
     }
     $output = $this->_renderer->getDefaultOutputArray(get_class($this), $this->_params, $this->_templateName);
     $output['date'] = $this->_params['date'];
     return XenForo_ViewRenderer_Json::jsonEncodeForOutput($output);
 }
예제 #28
0
파일: Comments.php 프로젝트: Sywooch/forums
 public function renderJson()
 {
     $bbCodeParser = XenForo_BbCode_Parser::create(XenForo_BbCode_Formatter_Base::create('Nobita_Teams_BbCode_Formatter_Comment', array('view' => $this)));
     XenForo_ViewPublic_Helper_Message::bbCodeWrapMessages($this->_params['comments'], $bbCodeParser, array());
     $comments = array();
     if ($this->_params['post']['first_comment_date'] < $this->_params['firstCommentShown']['comment_date']) {
         $comments[] = $this->createTemplateObject('Team_post_comments_before', $this->_params);
     }
     foreach ($this->_params['comments'] as $comment) {
         $comments[] = $this->createTemplateObject('Team_post_comment', array('comment' => $comment) + $this->_params);
     }
     return array('comments' => $comments);
 }
예제 #29
0
 public static function getHtml(&$message)
 {
     static $bbCodeParser = false;
     if ($bbCodeParser === false) {
         $formatter = XenForo_BbCode_Formatter_Base::create('Base');
         if (XenForo_Application::$versionId >= 1020000) {
             $bbCodeParser = XenForo_BbCode_Parser::create($formatter);
         } else {
             $bbCodeParser = new XenForo_BbCode_Parser($formatter);
         }
     }
     return XenForo_ViewPublic_Helper_Message::getBbCodeWrapper($message, $bbCodeParser);
 }
예제 #30
0
 public function renderHtml()
 {
     $bbCodeParser = XenForo_BbCode_Parser::create(XenForo_BbCode_Formatter_Base::create('Base', array('view' => $this)));
     $this->_params['parser'] = $bbCodeParser;
     $this->_params['videoHtml'] = new XenForo_BbCode_TextWrapper($this->_params['media']['media_tag'], $bbCodeParser);
     if (!empty($this->_params['canAddComment'])) {
         $this->_params['commentsEditor'] = XenForo_ViewPublic_Helper_Editor::getQuickReplyEditor($this, 'message', !empty($this->_params['draft']) ? $this->_params['draft']['message'] : '', array('autoSaveUrl' => XenForo_Link::buildPublicLink('xengallery/save-draft', $this->_params['media']), 'json' => array('placeholder' => new XenForo_Phrase('xengallery_write_a_comment') . '...')));
     }
     foreach ($this->_params['comments'] as &$comment) {
         $comment['messageHtml'] = new XenForo_BbCode_TextWrapper($comment['message'], $bbCodeParser);
         $comment['message'] = $comment['messageHtml'];
         // sanity check in case template not updated
     }
 }