* Further work on rev_deleted; changed to a bitfield with several data-hiding
[lhc/web/wiklou.git] / includes / SpecialPage.php
index cb3cbfb..eb64341 100644 (file)
@@ -70,17 +70,17 @@ $wgSpecialPages = array(
        'Allmessages'   => new SpecialPage( 'Allmessages' ),
        'Log'           => new SpecialPage( 'Log' ),
        'Blockip'               => new SpecialPage( 'Blockip', 'block' ),
-       'Undelete'              => new SpecialPage( 'Undelete' ),
+       'Undelete'              => new SpecialPage( 'Undelete', 'deletedhistory' ),
        "Import"                => new SpecialPage( "Import", 'import' ),
        'Lockdb'                => new SpecialPage( 'Lockdb', 'siteadmin' ),
        'Unlockdb'              => new SpecialPage( 'Unlockdb', 'siteadmin' ),
        'Userrights'    => new SpecialPage( 'Userrights', 'userrights' ),
        'MIMEsearch'    => new SpecialPage( 'MIMEsearch' ),
+       'Unwatchedpages' => new SpecialPage( 'Unwatchedpages', 'unwatchedpages' ),
+       'Listredirects' => new SpecialPage( 'Listredirects' ),
+       'Revisiondelete' => new SpecialPage( 'Revisiondelete', 'deleterevision' ),
 );
 
-if ( $wgUseValidation )
-       $wgSpecialPages['Validate'] = new SpecialPage( 'Validate' );
-
 if( !$wgDisableCounters ) {
        $wgSpecialPages['Popularpages'] = new SpecialPage( 'Popularpages' );
 }
@@ -93,9 +93,6 @@ if( $wgEmailAuthentication ) {
        $wgSpecialPages['Confirmemail'] = new UnlistedSpecialPage( 'Confirmemail' );
 }
 
-if ( $wgEnableUnwatchedpages )
-        $wgSpecialPages['Unwatchedpages'] = new SpecialPage( 'Unwatchedpages' );
-
 /**
  * Parent special page class, also static functions for handling the special
  * page list
@@ -229,7 +226,7 @@ class SpecialPage
         * @param $including      output is being captured for use in {{special:whatever}}
         */
        function executePath( &$title, $including = false ) {
-               global $wgSpecialPages, $wgOut, $wgTitle;
+               global $wgOut, $wgTitle;
                $fname = 'SpecialPage::executePath';
                wfProfileIn( $fname );
 
@@ -349,7 +346,7 @@ class SpecialPage
        function getFile() { return $this->mFile; }
        function isListed() { return $this->mListed; }
        /**#@-*/
-       
+
        /**#@+
          * Accessor and mutator
          */
@@ -361,7 +358,7 @@ class SpecialPage
        function includable( $x = NULL ) { return wfSetVar( $this->mIncludable, $x ); }
        function including( $x = NULL ) { return wfSetVar( $this->mIncluding, $x ); }
        /**#@-*/
-       
+
        /**
         * Checks if the given user (identified by an object) can execute this
         * special page (as defined by $mRestriction)
@@ -401,7 +398,7 @@ class SpecialPage
         * Checks user permissions, calls the function given in mFunction
         */
        function execute( $par ) {
-               global $wgUser, $wgOut, $wgTitle;
+               global $wgUser;
 
                $this->setHeaders();
 
@@ -411,12 +408,28 @@ class SpecialPage
                        if(!function_exists($func) and $this->mFile) {
                                require_once( $this->mFile );
                        }
+                       if ( wfRunHooks( 'SpecialPageExecuteBeforeHeader', array( &$this, &$par, &$func ) ) )
+                               $this->outputHeader();
+                       if ( ! wfRunHooks( 'SpecialPageExecuteBeforePage', array( &$this, &$par, &$func ) ) )
+                               return;
                        $func( $par, $this );
+                       if ( ! wfRunHooks( 'SpecialPageExecuteAfterPage', array( &$this, &$par, &$func ) ) )
+                               return;
                } else {
                        $this->displayRestrictionError();
                }
        }
 
+       function outputHeader() {
+               global $wgOut, $wgContLang;
+
+               $msg = $wgContLang->lc( $this->name() ) . '-summary';
+               $out = wfMsg( $msg );
+               if ( ! wfEmptyMsg( $msg, $out ) and  $out !== '' and ! $this->including() )
+                       $wgOut->addWikiText( $out );
+
+       }
+
        # Returns the name that goes in the <h1> in the special page itself, and also the name that
        # will be listed in Special:Specialpages
        #