Validate log type here, and moved showHeader to the special page where it belongs.
authorNiklas Laxström <nikerabbit@users.mediawiki.org>
Wed, 7 Sep 2011 16:09:24 +0000 (16:09 +0000)
committerNiklas Laxström <nikerabbit@users.mediawiki.org>
Wed, 7 Sep 2011 16:09:24 +0000 (16:09 +0000)
LogEventsList::showHeader still kept, because one extension calls it.

includes/specials/SpecialLog.php

index d8f6d8c..5d0771b 100644 (file)
@@ -64,6 +64,10 @@ class SpecialLog extends SpecialPage {
                        $opts->setValue( 'month', '' );
                }
 
+               if ( LogPage::isLogType( $opts->getValue( 'type' ) ) ) {
+                       $opts->setValue( 'type', '' );
+               }
+
                # Handle type-specific inputs
                $qc = array();
                if ( $opts->getValue( 'type' ) == 'suppress' ) {
@@ -103,8 +107,7 @@ class SpecialLog extends SpecialPage {
                        $opts->getValue( 'page' ), $opts->getValue( 'pattern' ), $extraConds, $opts->getValue( 'year' ),
                        $opts->getValue( 'month' ), $opts->getValue( 'tagfilter' ) );
 
-               # Set title and add header
-               $loglist->showHeader( $pager->getType() );
+               $this->addHeader( $opts->getValue( 'type' ) );
 
                # Set relevant user
                if ( $pager->getUser() ) {
@@ -129,4 +132,16 @@ class SpecialLog extends SpecialPage {
                        $wgOut->addWikiMsg( 'logempty' );
                }
        }
+
+       /**
+        * Set page title and show header for this log type
+        * @param $type string
+        * @since 1.19
+        */
+       protected function addHeader( $type ) {
+               $page = new LogPage( $type );
+               $this->getOutput()->setPageTitle( $page->getName()->text() );
+               $this->getOutput()->addHTML( $page->getDescription()->parseAsBlock() );
+       }
+
 }