* Fix revert bug caused by bug 1175 fix
authorBrion Vibber <brion@users.mediawiki.org>
Fri, 24 Dec 2004 09:51:36 +0000 (09:51 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Fri, 24 Dec 2004 09:51:36 +0000 (09:51 +0000)
includes/EditPage.php

index 07d01c1..3a8e3b7 100644 (file)
@@ -74,11 +74,10 @@ class EditPage {
                } else if ( $this->preview ) {
                        $this->editForm( 'preview' );
                } else { # First time through
-                       $this->initForm();
                        if( $wgUser->getOption('previewonfirst') ) {
-                               $this->editForm( 'preview' );
+                               $this->editForm( 'preview', true );
                        } else {
-                               $this->editForm( 'initial' );
+                               $this->editForm( 'initial', true );
                        }
                }
        }
@@ -131,8 +130,9 @@ class EditPage {
         * the newly-edited page.
         *
         * @param string $formtype Type of form either : save, initial or preview
+        * @param bool $firsttime True to load form data from db
         */
-       function editForm( $formtype ) {
+       function editForm( $formtype, $firsttime = false ) {
                global $wgOut, $wgUser;
                global $wgLang, $wgContLang, $wgParser, $wgTitle;
                global $wgAllowAnonymousMinor;
@@ -276,8 +276,11 @@ class EditPage {
                # First time through: get contents, set time for conflict
                # checking, etc.
 
-               if ( 'initial' == $formtype ) {
-                       $this->initForm();
+               if ( 'initial' == $formtype || $firsttime ) {
+                       $this->edittime = $this->mArticle->getTimestamp();
+                       $this->textbox1 = $this->mArticle->getContent( true );
+                       $this->summary = '';
+                       $this->proxyCheck();
                }
                $wgOut->setRobotpolicy( 'noindex,nofollow' );
 
@@ -515,16 +518,6 @@ END
                        $wgOut->addHTML('<div id="wikiPreview">' . $previewOutput . '</div>');
                }
        }
-       
-       /**
-        * @todo document
-        */
-       function initForm() {
-               $this->edittime = $this->mArticle->getTimestamp();
-               $this->textbox1 = $this->mArticle->getContent( true );
-               $this->summary = '';
-               $this->proxyCheck();
-       }
 
        function getPreviewText( $isConflict, $isCssJsSubpage ) {
                global $wgOut, $wgUser, $wgTitle, $wgParser;