* Make the default messages for "undo" less intrusive, remove headings
* Rename messages for "undo" to "undo-success" and "undo-failure" * Treat "undo-success" and "undo-failure" as wikitext ** Please remember that output needs to be escaped before it's sent to the browser, and be careful with message handling. **
This commit is contained in:
parent
c243323c63
commit
51f06b796d
2 changed files with 13 additions and 16 deletions
|
|
@ -70,7 +70,7 @@ class EditPage {
|
|||
* Fetch initial editing page content.
|
||||
*/
|
||||
private function getContent() {
|
||||
global $wgRequest, $wgParser;
|
||||
global $wgOut, $wgRequest, $wgParser;
|
||||
|
||||
# Get variables from query string :P
|
||||
$section = $wgRequest->getVal( 'section' );
|
||||
|
|
@ -116,19 +116,16 @@ class EditPage {
|
|||
} else {
|
||||
$result = true;
|
||||
}
|
||||
|
||||
if (!$result) {
|
||||
#Undoing failed. Bailing out with regular revision text.
|
||||
$text = $currev_text;
|
||||
|
||||
#Give a warning
|
||||
$this->editFormPageTop .= "<h2>" . wfMsg('undofailed') . "</h2>\n" .
|
||||
'<p><strong class="error">'.wfMsg('explainundofailed').'</strong></p>';
|
||||
|
||||
if( $result ) {
|
||||
# Inform the user of our success and set an automatic edit summary
|
||||
$this->editFormPageTop .= $wgOut->parse( wfMsgNoTrans( 'undo-success' ) );
|
||||
$this->summary = wfMsgForContent( 'undo-summary', $undo, $undorev->getUserText() );
|
||||
} else {
|
||||
$this->editFormPageTop .= '<h2>'.wfMsg('undosucceeded')."</h2>\n" .
|
||||
'<p>'.wfMsg('explainundosucceeded').'</p>';
|
||||
$this->summary = wfMsgForContent('undo-summary', $undo, $undorev->getUserText());
|
||||
# Warn the user that something went wrong
|
||||
$this->editFormPageTop .= $wgOut->parse( wfMsgNoTrans( 'undo-failure' ) );
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
else if( $section != '' ) {
|
||||
|
|
|
|||
|
|
@ -1012,10 +1012,10 @@ the text into a text file and save it for later.</strong>',
|
|||
'nocreatetitle' => 'Page creation limited',
|
||||
'nocreatetext' => 'This site has restricted the ability to create new pages.
|
||||
You can go back and edit an existing page, or [[Special:Userlogin|log in or create an account]].',
|
||||
'undofailed' => 'Undo Failed',
|
||||
'explainundofailed' => 'The edit could not be undone because of conflicting intermediate edits. Please manually undo the edits.',
|
||||
'undosucceeded' => 'Undo Succeeded',
|
||||
'explainundosucceeded' => 'The edit was successfully undone. Please click save to apply this change.',
|
||||
|
||||
# "Undo" feature
|
||||
'undo-success' => 'The edit has been undone. Please confirm, and then save the changes below.',
|
||||
'undo-failure' => 'The edit could not be undone due to conflicting intermediate edits.',
|
||||
'undo-summary' => 'Undo revision $1 by [[Special:Contributions/$2]] ([[User talk:$2]])',
|
||||
|
||||
# Account creation failure
|
||||
|
|
|
|||
Loading…
Reference in a new issue