* Get the content of the wanted revision, without section extraction.
*
* The result of this function can be used to compare user's input with
- * section replaced in its context (using WikiPage::replaceSection())
+ * section replaced in its context (using WikiPage::replaceSectionAtRev())
* to the original text of the edit.
*
* This differs from Article::getContent() that when a missing revision is
// is if an extension hook aborted from inside ArticleSave.
// Render the status object into $this->hookError
// FIXME this sucks, we should just use the Status object throughout
- $this->hookError = '<div class="error">' . $status->getWikitext() .
+ $this->hookError = '<div class="error">' . $status->getWikiText() .
'</div>';
return true;
}
} elseif ( $this->section != '' ) {
# Try to get a section anchor from the section source, redirect
# to edited section if header found.
- # XXX: Might be better to integrate this into Article::replaceSection
+ # XXX: Might be better to integrate this into Article::replaceSectionAtRev
# for duplicate heading checking and maybe parsing.
$hasmatch = preg_match( "/^ *([=]{1,6})(.*?)(\\1) *\\n/i", $this->textbox1, $matches );
# We can't deal with anchors, includes, html etc in the header for now,
'{{fullurl:Special:UserLogin/signup|returnto={{FULLPAGENAMEE}}}}' ]
);
} else {
- $wgOut->wrapWikiMsg( "<div id=\"mw-anon-preview-warning\">\n$1</div>",
+ $wgOut->wrapWikiMsg( "<div id=\"mw-anon-preview-warning\" class=\"warningbox\">\n$1</div>",
'anonpreviewwarning'
);
}
*/
function getPreviewText() {
global $wgOut, $wgUser, $wgRawHtml, $wgLang;
- global $wgAllowUserCss, $wgAllowUserJs;
+ global $wgAllowUserCss, $wgAllowUserJs, $wgAjaxEditStash;
$stats = $wgOut->getContext()->getStats();
# Try to stash the edit for the final submission step
# @todo: different date format preferences cause cache misses
- ApiStashEdit::stashEditFromPreview(
- $this->getArticle(), $content, $pstContent,
- $parserOutput, $parserOptions, $parserOptions, wfTimestampNow()
- );
+ if ( $wgAjaxEditStash ) {
+ ApiStashEdit::stashEditFromPreview(
+ $this->getArticle(), $content, $pstContent,
+ $parserOutput, $parserOptions, $parserOptions, wfTimestampNow()
+ );
+ }
$parserOutput->setEditSectionTokens( false ); // no section edit links
$previewHTML = $parserOutput->getText();
* Shows a bulletin board style toolbar for common editing functions.
* It can be disabled in the user preferences.
*
- * @param $title Title object for the page being edited (optional)
+ * @param Title $title Title object for the page being edited (optional)
* @return string
*/
static function getEditToolbar( $title = null ) {