Fix #1242: category list missing on edit page
authorAntoine Musso <hashar@users.mediawiki.org>
Mon, 27 Jun 2005 00:06:30 +0000 (00:06 +0000)
committerAntoine Musso <hashar@users.mediawiki.org>
Mon, 27 Jun 2005 00:06:30 +0000 (00:06 +0000)
includes/EditPage.php

index 4718f57..1291a4c 100644 (file)
@@ -181,7 +181,8 @@ class EditPage {
                } else if ( $this->diff ) {
                        $this->editForm( 'diff' );
                } else { # First time through
-                       if( $wgUser->getOption('previewonfirst') ) {
+                       if( $wgUser->getOption('previewonfirst') 
+                               or $this->mTitle->getNamespace() == NS_CATEGORY ) {
                                $this->editForm( 'preview', true );
                        } else {
                                $this->extractMetaDataFromArticle () ;
@@ -584,6 +585,9 @@ class EditPage {
                        $previewOutput = $this->getPreviewText( $isConflict, $isCssJsSubpage );
                        if ( $wgUser->getOption('previewontop' ) ) {
                                $wgOut->addHTML( $previewOutput );
+                               if($this->mTitle->getNamespace() == NS_CATEGORY) {
+                                       $this->mArticle->closeShowCategory();
+                               }                               
                                $wgOut->addHTML( "<br style=\"clear:both;\" />\n" );
                        }
                }
@@ -759,7 +763,7 @@ END
                                        $wgTitle, $parserOptions );             
                        
                        $previewHTML = $parserOutput->mText;
-
+                       
                        $wgOut->addCategoryLinks($parserOutput->getCategoryLinks());
                        $wgOut->addLanguageLinks($parserOutput->getLanguageLinks());
                        return $previewhead . $previewHTML;