} 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 );
}
}
}
* 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;
# 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' );
$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;