From: Brion Vibber Date: Fri, 24 Dec 2004 05:19:04 +0000 (+0000) Subject: * (bug 1175) Fix "preview on first edit" mode X-Git-Tag: 1.5.0alpha1~1034 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/membres/fiche.php?a=commitdiff_plain;h=7b439de3a955dc21e7caa6d8a18e708caa835da3;p=lhc%2Fweb%2Fwiklou.git * (bug 1175) Fix "preview on first edit" mode merge fix from REL1_4 --- diff --git a/includes/EditPage.php b/includes/EditPage.php index 33e17c9401..07d01c1a13 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -71,10 +71,15 @@ class EditPage { } if ( $this->save ) { $this->editForm( 'save' ); - } else if ( $this->preview or $wgUser->getOption('previewonfirst')) { + } else if ( $this->preview ) { $this->editForm( 'preview' ); } else { # First time through - $this->editForm( 'initial' ); + $this->initForm(); + if( $wgUser->getOption('previewonfirst') ) { + $this->editForm( 'preview' ); + } else { + $this->editForm( 'initial' ); + } } } @@ -272,10 +277,7 @@ class EditPage { # checking, etc. if ( 'initial' == $formtype ) { - $this->edittime = $this->mArticle->getTimestamp(); - $this->textbox1 = $this->mArticle->getContent( true ); - $this->summary = ''; - $this->proxyCheck(); + $this->initForm(); } $wgOut->setRobotpolicy( 'noindex,nofollow' ); @@ -513,6 +515,16 @@ END $wgOut->addHTML('
' . $previewOutput . '
'); } } + + /** + * @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;