/** * axEdit -- static hook/entry for ajax request post -- edit comment * * @static * @access public * * @return String -- html -> textarea */ public static function axEdit() { global $wgRequest; $articleId = $wgRequest->getVal('article', false); $commentId = $wgRequest->getVal('id', false); $result = array('error' => 1, 'id' => $commentId, 'show' => false, 'text' => ''); /** * check owner of article */ $title = Title::newFromID($articleId); if (!$title) { return $result; } /** * edit comment */ $comment = ArticleComment::newFromId($commentId); if ($comment) { $comment->load(true); if ($comment->canEdit()) { $result['error'] = 0; $result['show'] = true; $result['text'] = $comment->editPage(); if (ArticleComment::isMiniEditorEnabled()) { $result['edgeCases'] = MiniEditorHelper::getEdgeCases(); } $result['emptyMsg'] = wfMsg('article-comments-empty-comment', $comment->getTitle()->getLocalUrl('redirect=no&action=delete')); } } return $result; }