Exemplo n.º 1
0
 /**
  * editPage -- show edit form
  *
  * @access public
  *
  * @return String
  */
 public function editPage()
 {
     global $wgStylePath;
     wfProfileIn(__METHOD__);
     $text = '';
     $this->load(true);
     if ($this->canEdit() && !ArticleCommentInit::isFbConnectionNeeded()) {
         $vars = array('canEdit' => $this->canEdit(), 'comment' => ArticleCommentsAjax::getConvertedContent($this->mLastRevision->getText()), 'isReadOnly' => wfReadOnly(), 'isMiniEditorEnabled' => ArticleComment::isMiniEditorEnabled(), 'stylePath' => $wgStylePath, 'articleId' => $this->mTitle->getArticleId(), 'articleFullUrl' => $this->mTitle->getFullUrl());
         $text = F::app()->getView('ArticleComments', 'Edit', $vars)->render();
     }
     wfProfileOut(__METHOD__);
     return $text;
 }
 /**
  * axReply -- static hook/entry for ajax request post -- reply a comment
  *
  * @static
  * @access public
  *
  * @return String -- html -> textarea
  */
 public static function axReply()
 {
     global $wgRequest, $wgStylePath;
     $articleId = $wgRequest->getVal('article', false);
     $commentId = $wgRequest->getVal('id', false);
     $result = array('id' => $commentId);
     $title = Title::newFromID($articleId);
     if (!$title) {
         $result['error'] = 1;
         return $result;
     }
     $canComment = ArticleCommentInit::userCanComment($result, $title);
     if ($canComment == true) {
         $articleId = $wgRequest->getVal('article', false);
         $vars = array('commentId' => $commentId, 'isMiniEditorEnabled' => ArticleComment::isMiniEditorEnabled(), 'stylePath' => $wgStylePath);
         $result['html'] = F::app()->getView('ArticleComments', 'Reply', $vars)->render();
     }
     return $result;
 }
 public static function onBeforePageDisplay(OutputPage &$out, Skin &$skin)
 {
     if (class_exists('ArticleCommentInit') && ArticleCommentInit::ArticleCommentCheck()) {
         $app = F::app();
         // This is the actual entry point for Article Comment generation
         self::$content = $app->sendRequest('ArticleComments', 'index');
         // Load MiniEditor assets (oasis skin only)
         if (ArticleComment::isMiniEditorEnabled()) {
             $app->sendRequest('MiniEditor', 'loadAssets', array('loadStyles' => !ArticleComment::isLoadingOnDemand(), 'loadOnDemand' => true, 'loadOnDemandAssets' => array('/extensions/wikia/MiniEditor/js/Wall/Wall.Animations.js')));
         }
     }
     return true;
 }