*Automatically pre-fill the edit-summary field when undoing an edit.*Add a message...
authorAndrew Garrett <werdna@users.mediawiki.org>
Wed, 29 Nov 2006 06:56:18 +0000 (06:56 +0000)
committerAndrew Garrett <werdna@users.mediawiki.org>
Wed, 29 Nov 2006 06:56:18 +0000 (06:56 +0000)
includes/EditPage.php
languages/messages/MessagesEn.php

index f655c5b..8cad492 100644 (file)
@@ -119,6 +119,10 @@ class EditPage {
                                                #Give a warning
                                                $this->editFormPageTop .= "<h2>" . wfMsg('undofailed') . "</h2>\n" .
                                                                        '<p><strong class="error">'.wfMsg('explainundofailed').'</strong></p>';
+                                       } else {
+                                               $this->editFormPageTop .= '<h2>'.wfMsg('undosucceeded')."</h2>\n" .
+                                                                               '<p>'.wfMsg('explainundosucceeded').'</p>';
+                                               $this->summary = wfMsgForContent('undo-summary', $undo, $undorev->getUserText());
                                        }
                                }
                        }
@@ -844,8 +848,8 @@ class EditPage {
         */
        function initialiseForm() {
                $this->edittime = $this->mArticle->getTimestamp();
-               $this->textbox1 = $this->getContent();
                $this->summary = '';
+               $this->textbox1 = $this->getContent();
                if ( !$this->mArticle->exists() && $this->mArticle->mTitle->getNamespace() == NS_MEDIAWIKI )
                        $this->textbox1 = wfMsgWeirdKey( $this->mArticle->mTitle->getText() ) ;
                wfProxyCheck();
index 6514ff5..2ff707c 100644 (file)
@@ -999,6 +999,9 @@ the text into a text file and save it for later.</strong>',
 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-summary' => 'Undo revision $1 by [[Special:Contributions/$2]] ([[User talk:$2]])',
 
 # Account creation failure
 'cantcreateaccounttitle' => 'Can\'t create account',