* 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' );
} 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 != '' ) {
'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