Add SpecialPage::getGroupName and use it
authorumherirrender <umherirrender_de.wp@web.de>
Thu, 7 Mar 2013 20:15:54 +0000 (21:15 +0100)
committerumherirrender <umherirrender_de.wp@web.de>
Thu, 7 Mar 2013 20:15:54 +0000 (21:15 +0100)
Having all group mapping for Special:SpecialPages in the global
$wgSpecialPageGroups is not a good OO style.
Created a method SpecialPage::getGroupName, which than can be overridden
by each subclasses to the featured group name.

Added also SpecialPage::getFinalGroupName to get the groupname on
Special:SpecialPages to handle the customization and
to keep $wgSpecialPageGroups for b/c

Change-Id: I1de3a186f0a59ec5ecb8996c5f805cf164e9637f

85 files changed:
includes/DefaultSettings.php
includes/SpecialPage.php
includes/SpecialPageFactory.php
includes/specials/SpecialActiveusers.php
includes/specials/SpecialAllmessages.php
includes/specials/SpecialAllpages.php
includes/specials/SpecialAncientpages.php
includes/specials/SpecialBlock.php
includes/specials/SpecialBlockList.php
includes/specials/SpecialBlockme.php
includes/specials/SpecialBooksources.php
includes/specials/SpecialBrokenRedirects.php
includes/specials/SpecialCategories.php
includes/specials/SpecialChangeEmail.php
includes/specials/SpecialChangePassword.php
includes/specials/SpecialComparePages.php
includes/specials/SpecialContributions.php
includes/specials/SpecialDeadendpages.php
includes/specials/SpecialDeletedContributions.php
includes/specials/SpecialDisambiguations.php
includes/specials/SpecialDoubleRedirects.php
includes/specials/SpecialEmailuser.php
includes/specials/SpecialExport.php
includes/specials/SpecialFewestrevisions.php
includes/specials/SpecialFileDuplicateSearch.php
includes/specials/SpecialFilepath.php
includes/specials/SpecialImport.php
includes/specials/SpecialJavaScriptTest.php
includes/specials/SpecialLinkSearch.php
includes/specials/SpecialListfiles.php
includes/specials/SpecialListgrouprights.php
includes/specials/SpecialListredirects.php
includes/specials/SpecialListusers.php
includes/specials/SpecialLockdb.php
includes/specials/SpecialLog.php
includes/specials/SpecialLonelypages.php
includes/specials/SpecialLongpages.php
includes/specials/SpecialMIMEsearch.php
includes/specials/SpecialMergeHistory.php
includes/specials/SpecialMostcategories.php
includes/specials/SpecialMostimages.php
includes/specials/SpecialMostinterwikis.php
includes/specials/SpecialMostlinked.php
includes/specials/SpecialMostlinkedcategories.php
includes/specials/SpecialMostlinkedtemplates.php
includes/specials/SpecialMostrevisions.php
includes/specials/SpecialMovepage.php
includes/specials/SpecialNewimages.php
includes/specials/SpecialNewpages.php
includes/specials/SpecialPagesWithProp.php
includes/specials/SpecialPasswordReset.php
includes/specials/SpecialPopularpages.php
includes/specials/SpecialPreferences.php
includes/specials/SpecialPrefixindex.php
includes/specials/SpecialProtectedpages.php
includes/specials/SpecialProtectedtitles.php
includes/specials/SpecialRandompage.php
includes/specials/SpecialRecentchanges.php
includes/specials/SpecialRevisiondelete.php
includes/specials/SpecialSearch.php
includes/specials/SpecialShortpages.php
includes/specials/SpecialSpecialpages.php
includes/specials/SpecialStatistics.php
includes/specials/SpecialTags.php
includes/specials/SpecialUnblock.php
includes/specials/SpecialUncategorizedimages.php
includes/specials/SpecialUncategorizedpages.php
includes/specials/SpecialUndelete.php
includes/specials/SpecialUnlockdb.php
includes/specials/SpecialUnusedcategories.php
includes/specials/SpecialUnusedimages.php
includes/specials/SpecialUnusedtemplates.php
includes/specials/SpecialUnwatchedpages.php
includes/specials/SpecialUpload.php
includes/specials/SpecialUserlogin.php
includes/specials/SpecialUserlogout.php
includes/specials/SpecialUserrights.php
includes/specials/SpecialVersion.php
includes/specials/SpecialWantedcategories.php
includes/specials/SpecialWantedfiles.php
includes/specials/SpecialWantedpages.php
includes/specials/SpecialWantedtemplates.php
includes/specials/SpecialWatchlist.php
includes/specials/SpecialWhatlinkshere.php
includes/specials/SpecialWithoutinterwiki.php

index eb87e7b..ee70276 100644 (file)
@@ -5813,111 +5813,10 @@ $wgDisableQueryPageUpdate = false;
 /**
  * List of special pages, followed by what subtitle they should go under
  * at Special:SpecialPages
+ *
+ * @deprecated 1.21 Override SpecialPage::getGroupName instead
  */
-$wgSpecialPageGroups = array(
-       'DoubleRedirects' => 'maintenance',
-       'BrokenRedirects' => 'maintenance',
-       'Lonelypages' => 'maintenance',
-       'Uncategorizedpages' => 'maintenance',
-       'Uncategorizedcategories' => 'maintenance',
-       'Uncategorizedimages' => 'maintenance',
-       'Uncategorizedtemplates' => 'maintenance',
-       'Unusedcategories' => 'maintenance',
-       'Unusedimages' => 'maintenance',
-       'Protectedpages' => 'maintenance',
-       'Protectedtitles' => 'maintenance',
-       'Unusedtemplates' => 'maintenance',
-       'Withoutinterwiki' => 'maintenance',
-       'Longpages' => 'maintenance',
-       'Shortpages' => 'maintenance',
-       'Ancientpages' => 'maintenance',
-       'Deadendpages' => 'maintenance',
-       'Wantedpages' => 'maintenance',
-       'Wantedcategories' => 'maintenance',
-       'Wantedfiles' => 'maintenance',
-       'Wantedtemplates' => 'maintenance',
-       'Unwatchedpages' => 'maintenance',
-       'Fewestrevisions' => 'maintenance',
-
-       'Userlogin' => 'login',
-       'Userlogout' => 'login',
-       'CreateAccount' => 'login',
-
-       'Recentchanges' => 'changes',
-       'Recentchangeslinked' => 'changes',
-       'Watchlist' => 'changes',
-       'Newimages' => 'changes',
-       'Newpages' => 'changes',
-       'Log' => 'changes',
-       'Tags' => 'changes',
-
-       'Upload' => 'media',
-       'Listfiles' => 'media',
-       'MIMEsearch' => 'media',
-       'FileDuplicateSearch' => 'media',
-       'Filepath' => 'media',
-
-       'Listusers' => 'users',
-       'Activeusers' => 'users',
-       'Listgrouprights' => 'users',
-       'BlockList' => 'users',
-       'Contributions' => 'users',
-       'Emailuser' => 'users',
-       'Listadmins' => 'users',
-       'Listbots' => 'users',
-       'Userrights' => 'users',
-       'Block' => 'users',
-       'Unblock' => 'users',
-       'Preferences' => 'users',
-       'ChangeEmail' => 'users',
-       'ChangePassword' => 'users',
-       'DeletedContributions' => 'users',
-       'PasswordReset' => 'users',
-
-       'Mostlinked' => 'highuse',
-       'Mostlinkedcategories' => 'highuse',
-       'Mostlinkedtemplates' => 'highuse',
-       'Mostcategories' => 'highuse',
-       'Mostimages' => 'highuse',
-       'Mostinterwikis' => 'highuse',
-       'Mostrevisions' => 'highuse',
-
-       'Allpages' => 'pages',
-       'Prefixindex' => 'pages',
-       'Listredirects' => 'pages',
-       'Categories' => 'pages',
-       'Disambiguations' => 'pages',
-       'PagesWithProp' => 'pages',
-
-       'Randompage' => 'redirects',
-       'Randomredirect' => 'redirects',
-       'Mypage' => 'redirects',
-       'Mytalk' => 'redirects',
-       'Mycontributions' => 'redirects',
-       'Search' => 'redirects',
-       'LinkSearch' => 'redirects',
-
-       'ComparePages' => 'pagetools',
-       'Movepage' => 'pagetools',
-       'MergeHistory' => 'pagetools',
-       'Revisiondelete' => 'pagetools',
-       'Undelete' => 'pagetools',
-       'Export' => 'pagetools',
-       'Import' => 'pagetools',
-       'Whatlinkshere' => 'pagetools',
-
-       'Statistics' => 'wiki',
-       'Version' => 'wiki',
-       'Lockdb' => 'wiki',
-       'Unlockdb' => 'wiki',
-       'Allmessages' => 'wiki',
-       'Popularpages' => 'wiki',
-
-       'Specialpages' => 'other',
-       'Blockme' => 'other',
-       'Booksources' => 'other',
-       'JavaScriptTest' => 'other',
-);
+$wgSpecialPageGroups = array();
 
 /** Whether or not to sort special pages in Special:Specialpages */
 
index 5801e2a..0eadac5 100644 (file)
@@ -850,6 +850,56 @@ class SpecialPage {
                        $this->getOutput()->addFeedLink( $format, $url );
                }
        }
+
+       /**
+        * Get the group that the special page belongs in on Special:SpecialPage
+        * Use this method, instead of getGroupName to allow customization
+        * of the group name from the wiki side
+        *
+        * @return string Group of this special page
+        * @since 1.21
+        */
+       public function getFinalGroupName() {
+               $name = $this->getName();
+               $group = '-';
+
+               // Allow overridding the group from the wiki side
+               $msg = $this->msg( 'specialpages-specialpagegroup-' . strtolower( $name ) )->inContentLanguage();
+               if ( !$msg->isBlank() ) {
+                       $group = $msg->text();
+               } else {
+                       // Than use the group from this object
+                       $group = $this->getGroupName();
+
+                       // Group '-' is used as default to have the chance to determine,
+                       // if the special pages overriddes this method,
+                       // if not overridden, $wgSpecialPageGroups is checked for b/c
+                       if ( $group === '-' && isset( $wgSpecialPageGroups[$name] ) ) {
+                               $group = $wgSpecialPageGroups[$name];
+                       }
+               }
+
+               // never give '-' back, change to 'other'
+               if ( $group === '-' ) {
+                       $group = 'other';
+               }
+
+               return $group;
+       }
+
+       /**
+        * Under which header this special page is listed in Special:SpecialPages
+        * See messages 'specialpages-group-*' for valid names
+        * This method defaults to group 'other'
+        *
+        * @return string
+        * @since 1.21
+        */
+       protected function getGroupName() {
+               // '-' used here to determine, if this group is overridden or has a hardcoded 'other'
+               // Needed for b/c in getFinalGroupName
+               return '-';
+       }
 }
 
 /**
index c94c358..09479bd 100644 (file)
@@ -286,8 +286,11 @@ class SpecialPageFactory {
         *
         * @param $page Mixed: SpecialPage or string
         * @param $group String
+        * @deprecated 1.21 Override SpecialPage::getGroupName
         */
        public static function setGroup( $page, $group ) {
+               wfDeprecated( __METHOD__, '1.21' );
+
                global $wgSpecialPageGroups;
                $name = is_object( $page ) ? $page->getName() : $page;
                $wgSpecialPageGroups[$name] = $group;
@@ -298,28 +301,12 @@ class SpecialPageFactory {
         *
         * @param $page SpecialPage
         * @return String
+        * @deprecated 1.21 Use SpecialPage::getFinalGroupName
         */
        public static function getGroup( &$page ) {
-               $name = $page->getName();
+               wfDeprecated( __METHOD__, '1.21' );
 
-               global $wgSpecialPageGroups;
-               static $specialPageGroupsCache = array();
-               if ( isset( $specialPageGroupsCache[$name] ) ) {
-                       return $specialPageGroupsCache[$name];
-               }
-               $msg = wfMessage( 'specialpages-specialpagegroup-' . strtolower( $name ) );
-               if ( !$msg->isBlank() ) {
-                       $group = $msg->text();
-               } else {
-                       $group = isset( $wgSpecialPageGroups[$name] )
-                               ? $wgSpecialPageGroups[$name]
-                               : '-';
-               }
-               if ( $group == '-' ) {
-                       $group = 'other';
-               }
-               $specialPageGroupsCache[$name] = $group;
-               return $group;
+               return $page->getFinalGroupName();
        }
 
        /**
index 994365e..72cfcc2 100644 (file)
@@ -244,4 +244,7 @@ class SpecialActiveUsers extends SpecialPage {
                }
        }
 
+       protected function getGroupName() {
+               return 'users';
+       }
 }
index e3424ec..a60c8ef 100644 (file)
@@ -77,6 +77,9 @@ class SpecialAllmessages extends SpecialPage {
 
        }
 
+       protected function getGroupName() {
+               return 'wiki';
+       }
 }
 
 /**
index d401d34..a5bf8df 100644 (file)
@@ -538,4 +538,8 @@ class SpecialAllpages extends IncludableSpecialPage {
                        return null;
                }
        }
+
+       protected function getGroupName() {
+               return 'pages';
+       }
 }
index fc5df4f..b0f333c 100644 (file)
@@ -71,4 +71,8 @@ class AncientPagesPage extends QueryPage {
                );
                return $this->getLanguage()->specialList( $link, htmlspecialchars( $d ) );
        }
+
+       protected function getGroupName() {
+               return 'maintenance';
+       }
 }
index ac05f67..efa718f 100644 (file)
@@ -946,6 +946,10 @@ class SpecialBlock extends FormSpecialPage {
                $out->setPageTitle( $this->msg( 'blockipsuccesssub' ) );
                $out->addWikiMsg( 'blockipsuccesstext', wfEscapeWikiText( $this->target ) );
        }
+
+       protected function getGroupName() {
+               return 'users';
+       }
 }
 
 # BC @since 1.18
index 56b9b00..0771512 100644 (file)
@@ -205,6 +205,10 @@ class SpecialBlockList extends SpecialPage {
                        $out->addHTML( Html::rawElement( 'ul', array( 'class' => 'mw-ipblocklist-otherblocks' ), $list ) . "\n" );
                }
        }
+
+       protected function getGroupName() {
+               return 'users';
+       }
 }
 
 class BlockListPager extends TablePager {
index 13e2351..85a3019 100644 (file)
@@ -59,4 +59,8 @@ class SpecialBlockme extends UnlistedSpecialPage {
 
                $this->getOutput()->addWikiMsg( 'proxyblocksuccess' );
        }
+
+       protected function getGroupName() {
+               return 'other';
+       }
 }
index 527dbb7..7849c0c 100644 (file)
@@ -179,4 +179,8 @@ class SpecialBookSources extends SpecialPage {
                $url = str_replace( '$1', $this->isbn, $url );
                return '<li><a href="' . htmlspecialchars( $url ) . '" class="external">' . htmlspecialchars( $label ) . '</a></li>';
        }
+
+       protected function getGroupName() {
+               return 'other';
+       }
 }
index 77b69e8..fac4123 100644 (file)
@@ -151,4 +151,8 @@ class BrokenRedirectsPage extends QueryPage {
                $out .= " {$arr} {$to}";
                return $out;
        }
+
+       protected function getGroupName() {
+               return 'maintenance';
+       }
 }
index 44388c4..9040c64 100644 (file)
@@ -50,6 +50,10 @@ class SpecialCategories extends SpecialPage {
                        Html::closeElement( 'div' )
                );
        }
+
+       protected function getGroupName() {
+               return 'pages';
+       }
 }
 
 /**
index 53faba7..59a0257 100644 (file)
@@ -254,4 +254,8 @@ class SpecialChangeEmail extends UnlistedSpecialPage {
 
                return $status->value;
        }
+
+       protected function getGroupName() {
+               return 'users';
+       }
 }
index 2b505b3..73eb97f 100644 (file)
@@ -270,4 +270,8 @@ class SpecialChangePassword extends UnlistedSpecialPage {
 
                $user->saveSettings();
        }
+
+       protected function getGroupName() {
+               return 'users';
+       }
 }
index 8be1cf0..c3bd3fe 100644 (file)
@@ -163,4 +163,8 @@ class SpecialComparePages extends SpecialPage {
                }
                return true;
        }
+
+       protected function getGroupName() {
+               return 'pagetools';
+       }
 }
index 569fde5..fa5394b 100644 (file)
@@ -540,6 +540,10 @@ class SpecialContributions extends SpecialPage {
                        Xml::closeElement( 'form' );
                return $form;
        }
+
+       protected function getGroupName() {
+               return 'users';
+       }
 }
 
 /**
index f4904a5..6978d6b 100644 (file)
@@ -82,4 +82,8 @@ class DeadendPagesPage extends PageQueryPage {
                        return array( 'page_title' );
                }
        }
+
+       protected function getGroupName() {
+               return 'maintenance';
+       }
 }
index 0c934a4..e291a55 100644 (file)
@@ -522,4 +522,8 @@ class DeletedContributionsPage extends SpecialPage {
                        Xml::closeElement( 'form' );
                return $f;
        }
+
+       protected function getGroupName() {
+               return 'users';
+       }
 }
index a9c554a..2126ca5 100644 (file)
@@ -158,4 +158,8 @@ class DisambiguationsPage extends QueryPage {
 
                return "$from $edit $arr $to";
        }
+
+       protected function getGroupName() {
+               return 'pages';
+       }
 }
index 512fd85..5a5d749 100644 (file)
@@ -162,4 +162,8 @@ class DoubleRedirectsPage extends QueryPage {
 
                return( "{$linkA} {$edit} {$arr} {$linkB} {$arr} {$linkC}" );
        }
+
+       protected function getGroupName() {
+               return 'maintenance';
+       }
 }
index 9a42c09..6842386 100644 (file)
@@ -337,4 +337,8 @@ class SpecialEmailUser extends UnlistedSpecialPage {
                        return $status;
                }
        }
+
+       protected function getGroupName() {
+               return 'users';
+       }
 }
index 9d1ec10..2abd116 100644 (file)
@@ -561,4 +561,7 @@ class SpecialExport extends SpecialPage {
                return $pageSet;
        }
 
+       protected function getGroupName() {
+               return 'pagetools';
+       }
 }
index 5366e3b..5b7f353 100644 (file)
@@ -93,4 +93,8 @@ class FewestrevisionsPage extends QueryPage {
 
                return $this->getLanguage()->specialList( $plink, $nlink );
        }
+
+       protected function getGroupName() {
+               return 'maintenance';
+       }
 }
index 366aa81..bdf3263 100644 (file)
@@ -215,4 +215,8 @@ class FileDuplicateSearchPage extends QueryPage {
 
                return "$plink . . $user . . $time";
        }
+
+       protected function getGroupName() {
+               return 'media';
+       }
 }
index d0ae101..bbcced2 100644 (file)
@@ -86,4 +86,8 @@ class SpecialFilepath extends SpecialPage {
                        Html::closeElement( 'form' )
                );
        }
+
+       protected function getGroupName() {
+               return 'media';
+       }
 }
index 16772ec..aa56041 100644 (file)
@@ -341,6 +341,10 @@ class SpecialImport extends SpecialPage {
                        );
                }
        }
+
+       protected function getGroupName() {
+               return 'pagetools';
+       }
 }
 
 /**
index 84e3cb7..f7e2267 100644 (file)
@@ -157,4 +157,8 @@ HTML;
                // $wgJavaScriptTestConfig in DefaultSettings.php
                $out->addJsConfigVars( 'QUnitTestSwarmInjectJSPath', $wgJavaScriptTestConfig['qunit']['testswarm-injectjs'] );
        }
+
+       protected function getGroupName() {
+               return 'other';
+       }
 }
index 018ad79..53625cf 100644 (file)
@@ -221,4 +221,8 @@ class LinkSearchPage extends QueryPage {
        function getOrderFields() {
                return array();
        }
+
+       protected function getGroupName() {
+               return 'redirects';
+       }
 }
index 661db7b..c864ae2 100644 (file)
@@ -51,6 +51,10 @@ class SpecialListFiles extends IncludableSpecialPage {
                }
                $this->getOutput()->addHTML( $html );
        }
+
+       protected function getGroupName() {
+               return 'media';
+       }
 }
 
 /**
index c82522a..c625044 100644 (file)
@@ -212,4 +212,8 @@ class SpecialListGroupRights extends SpecialPage {
                        return '<ul><li>' . implode( "</li>\n<li>", $r ) . '</li></ul>';
                }
        }
+
+       protected function getGroupName() {
+               return 'users';
+       }
 }
index cdad688..0283767 100644 (file)
@@ -126,4 +126,8 @@ class ListredirectsPage extends QueryPage {
                        return "<del>$rd_link</del>";
                }
        }
+
+       protected function getGroupName() {
+               return 'pages';
+       }
 }
index 3265d1a..10e9e68 100644 (file)
@@ -347,4 +347,8 @@ class SpecialListUsers extends IncludableSpecialPage {
 
                $this->getOutput()->addHTML( $s );
        }
+
+       protected function getGroupName() {
+               return 'users';
+       }
 }
index d71ac6e..95ef951 100644 (file)
@@ -102,4 +102,8 @@ class SpecialLockdb extends FormSpecialPage {
                $out->addSubtitle( $this->msg( 'lockdbsuccesssub' ) );
                $out->addWikiMsg( 'lockdbsuccesstext' );
        }
+
+       protected function getGroupName() {
+               return 'wiki';
+       }
 }
index 0b9cf43..4fc0f6e 100644 (file)
@@ -193,4 +193,7 @@ class SpecialLog extends SpecialPage {
                $this->getOutput()->addHTML( $page->getDescription()->parseAsBlock() );
        }
 
+       protected function getGroupName() {
+               return 'changes';
+       }
 }
index 2889f7e..8c6a88a 100644 (file)
@@ -81,4 +81,8 @@ class LonelyPagesPage extends PageQueryPage {
                        return array( 'page_title' );
                }
        }
+
+       protected function getGroupName() {
+               return 'maintenance';
+       }
 }
index dd60e37..c045f9e 100644 (file)
@@ -34,4 +34,8 @@ class LongPagesPage extends ShortPagesPage {
        function sortDescending() {
                return true;
        }
+
+       protected function getGroupName() {
+               return 'maintenance';
+       }
 }
index 7350cc7..c5a109d 100644 (file)
@@ -133,4 +133,8 @@ class MIMEsearchPage extends QueryPage {
                );
                return in_array( $type, $types );
        }
+
+       protected function getGroupName() {
+               return 'media';
+       }
 }
index 85e1d65..c68f2df 100644 (file)
@@ -423,6 +423,10 @@ class SpecialMergeHistory extends SpecialPage {
 
                return true;
        }
+
+       protected function getGroupName() {
+               return 'pagetools';
+       }
 }
 
 class MergeHistoryPager extends ReverseChronologicalPager {
index 085a09f..11f26bd 100644 (file)
@@ -99,4 +99,8 @@ class MostcategoriesPage extends QueryPage {
 
                return $this->getLanguage()->specialList( $link, $count );
        }
+
+       protected function getGroupName() {
+               return 'highuse';
+       }
 }
index 01a5caf..78b2d91 100644 (file)
@@ -58,4 +58,7 @@ class MostimagesPage extends ImageQueryPage {
                return $this->msg( 'nimagelinks' )->numParams( $row->value )->escaped() . '<br />';
        }
 
+       protected function getGroupName() {
+               return 'highuse';
+       }
 }
index e08cdf3..574a9af 100644 (file)
@@ -114,4 +114,8 @@ class MostinterwikisPage extends QueryPage {
 
                return $this->getLanguage()->specialList( $link, $count );
        }
+
+       protected function getGroupName() {
+               return 'highuse';
+       }
 }
index 66814cb..3c30bfb 100644 (file)
@@ -107,4 +107,8 @@ class MostlinkedPage extends QueryPage {
                        $this->msg( 'nlinks' )->numParams( $result->value )->escaped() );
                return $this->getLanguage()->specialList( $link, $wlh );
        }
+
+       protected function getGroupName() {
+               return 'highuse';
+       }
 }
index df2975c..a1bce45 100644 (file)
@@ -94,4 +94,8 @@ class MostlinkedCategoriesPage extends QueryPage {
                $nlinks = $this->msg( 'nmembers' )->numParams( $result->value )->escaped();
                return $this->getLanguage()->specialList( $plink, $nlinks );
        }
+
+       protected function getGroupName() {
+               return 'highuse';
+       }
 }
index a2d51db..506e6b2 100644 (file)
@@ -124,4 +124,8 @@ class MostlinkedTemplatesPage extends QueryPage {
                $label = $this->msg( 'ntransclusions' )->numParams( $result->value )->escaped();
                return Linker::link( $wlh, $label );
        }
+
+       protected function getGroupName() {
+               return 'highuse';
+       }
 }
index b025331..ad6b788 100644 (file)
@@ -31,4 +31,8 @@ class MostrevisionsPage extends FewestrevisionsPage {
        function sortDescending() {
                return true;
        }
+
+       protected function getGroupName() {
+               return 'highuse';
+       }
 }
index b76e877..70ea6b9 100644 (file)
@@ -675,4 +675,8 @@ class MovePageForm extends UnlistedSpecialPage {
                }
                $out->addHTML( "</ul>\n" );
        }
+
+       protected function getGroupName() {
+               return 'pagetools';
+       }
 }
index 7954795..52cbc3a 100644 (file)
@@ -42,6 +42,10 @@ class SpecialNewFiles extends IncludableSpecialPage {
                        $this->getOutput()->addHTML( $pager->getNavigationBar() );
                }
        }
+
+       protected function getGroupName() {
+               return 'changes';
+       }
 }
 
 /**
index 6e8e634..ebb3021 100644 (file)
@@ -476,6 +476,10 @@ class SpecialNewpages extends IncludableSpecialPage {
                }
                return '';
        }
+
+       protected function getGroupName() {
+               return 'changes';
+       }
 }
 
 /**
index 189798d..8f8c981 100644 (file)
@@ -131,4 +131,8 @@ class SpecialPagesWithProp extends QueryPage {
                }
                return $ret;
        }
+
+       protected function getGroupName() {
+               return 'pages';
+       }
 }
index f42a7a1..90b0ac8 100644 (file)
@@ -326,4 +326,8 @@ class SpecialPasswordReset extends FormSpecialPage {
 
                return false;
        }
+
+       protected function getGroupName() {
+               return 'users';
+       }
 }
index 99b586e..7ce8c13 100644 (file)
@@ -72,4 +72,8 @@ class PopularPagesPage extends QueryPage {
                $nv = $this->msg( 'nviews' )->numParams( $result->value )->escaped();
                return $this->getLanguage()->specialList( $link, $nv );
        }
+
+       protected function getGroupName() {
+               return 'wiki';
+       }
 }
index 340172c..a50e7c1 100644 (file)
@@ -87,4 +87,8 @@ class SpecialPreferences extends SpecialPage {
 
                return true;
        }
+
+       protected function getGroupName() {
+               return 'users';
+       }
 }
index 7586dbb..0d68737 100644 (file)
@@ -263,4 +263,8 @@ class SpecialPrefixindex extends SpecialAllpages {
 
                $this->getOutput()->addHTML( $out2 . $out . $footer );
        }
+
+       protected function getGroupName() {
+               return 'pages';
+       }
 }
index bc0cab7..5f04ab5 100644 (file)
@@ -290,6 +290,10 @@ class SpecialProtectedpages extends SpecialPage {
                                array( 'id' => $this->IdLevel, 'name' => $this->IdLevel ),
                                implode( "\n", $options ) ) . "</span>";
        }
+
+       protected function getGroupName() {
+               return 'maintenance';
+       }
 }
 
 /**
index bac8b7b..6a94deb 100644 (file)
@@ -182,6 +182,10 @@ class SpecialProtectedtitles extends SpecialPage {
                                array( 'id' => $this->IdLevel, 'name' => $this->IdLevel ),
                                implode( "\n", $options ) );
        }
+
+       protected function getGroupName() {
+               return 'maintenance';
+       }
 }
 
 /**
index 74fe66c..b59f834 100644 (file)
@@ -159,4 +159,8 @@ class RandomPage extends SpecialPage {
 
                return $dbr->fetchObject( $res );
        }
+
+       protected function getGroupName() {
+               return 'redirects';
+       }
 }
index 69c291d..59d3138 100644 (file)
@@ -907,4 +907,8 @@ class SpecialRecentChanges extends IncludableSpecialPage {
                        'mediawiki.special.recentchanges',
                ) );
        }
+
+       protected function getGroupName() {
+               return 'changes';
+       }
 }
index 85ca2bd..148bc48 100644 (file)
@@ -623,4 +623,8 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
                        array( 'value' => $bitfield, 'comment' => $reason )
                );
        }
+
+       protected function getGroupName() {
+               return 'pagetools';
+       }
 }
index ae2b009..0d54e76 100644 (file)
@@ -1161,4 +1161,7 @@ class SpecialSearch extends SpecialPage {
                $this->extraParams[$key] = $value;
        }
 
+       protected function getGroupName() {
+               return 'redirects';
+       }
 }
index 5a4e8f0..1be7fbe 100644 (file)
@@ -110,4 +110,8 @@ class ShortPagesPage extends QueryPage {
                                ? "${hlinkInParentheses} {$dm}{$plink} {$dm}[{$size}]"
                                : "<del>${hlinkInParentheses} {$dm}{$plink} {$dm}[{$size}]</del>";
        }
+
+       protected function getGroupName() {
+               return 'maintenance';
+       }
 }
index d80218f..57fffb8 100644 (file)
@@ -62,7 +62,7 @@ class SpecialSpecialpages extends UnlistedSpecialPage {
                $groups = array();
                foreach ( $pages as $page ) {
                        if ( $page->isListed() ) {
-                               $group = SpecialPageFactory::getGroup( $page );
+                               $group = $page->getFinalGroupName();
                                if( !isset( $groups[$group] ) ) {
                                        $groups[$group] = array();
                                }
index 7d6d90e..bc1b600 100644 (file)
@@ -329,4 +329,8 @@ class SpecialStatistics extends SpecialPage {
                        Xml::tags( 'th', array( 'colspan' => '2' ), $this->msg( $header )->parse() ) .
                        Xml::closeElement( 'tr' );
        }
+
+       protected function getGroupName() {
+               return 'wiki';
+       }
 }
index 4036ebb..6d16103 100644 (file)
@@ -92,4 +92,8 @@ class SpecialTags extends SpecialPage {
 
                return Xml::tags( 'tr', null, $newRow ) . "\n";
        }
+
+       protected function getGroupName() {
+               return 'changes';
+       }
 }
index 076469c..c4a53cf 100644 (file)
@@ -213,4 +213,8 @@ class SpecialUnblock extends SpecialPage {
 
                return true;
        }
+
+       protected function getGroupName() {
+               return 'users';
+       }
 }
index 5865bf6..53aa3f3 100644 (file)
@@ -60,4 +60,7 @@ class UncategorizedImagesPage extends ImageQueryPage {
                );
        }
 
+       protected function getGroupName() {
+               return 'maintenance';
+       }
 }
index abbe997..b518e6f 100644 (file)
@@ -69,4 +69,8 @@ class UncategorizedPagesPage extends PageQueryPage {
                        return array( 'page_namespace', 'page_title' );
                return array( 'page_title' );
        }
+
+       protected function getGroupName() {
+               return 'maintenance';
+       }
 }
index b97a171..1607369 100644 (file)
@@ -1525,4 +1525,8 @@ class SpecialUndelete extends SpecialPage {
                        $out->addWikiText( '<div class="error">' . $status->getWikiText( 'undelete-error-short', 'undelete-error-long' ) . '</div>' );
                }
        }
+
+       protected function getGroupName() {
+               return 'pagetools';
+       }
 }
index 2e77254..35141d8 100644 (file)
@@ -84,4 +84,8 @@ class SpecialUnlockdb extends FormSpecialPage {
                $out->addSubtitle( $this->msg( 'unlockdbsuccesssub' ) );
                $out->addWikiMsg( 'unlockdbsuccesstext' );
        }
+
+       protected function getGroupName() {
+               return 'wiki';
+       }
 }
index 69c42d5..6b91dd3 100644 (file)
@@ -64,4 +64,8 @@ class UnusedCategoriesPage extends QueryPage {
                $title = Title::makeTitle( NS_CATEGORY, $result->title );
                return Linker::link( $title, htmlspecialchars( $title->getText() ) );
        }
+
+       protected function getGroupName() {
+               return 'maintenance';
+       }
 }
index cdab557..6955328 100644 (file)
@@ -80,4 +80,7 @@ class UnusedimagesPage extends ImageQueryPage {
                return $this->msg( 'unusedimagestext' )->parseAsBlock();
        }
 
+       protected function getGroupName() {
+               return 'maintenance';
+       }
 }
index fe79731..493e936 100644 (file)
@@ -85,4 +85,8 @@ class UnusedtemplatesPage extends QueryPage {
        function getPageHeader() {
                return $this->msg( 'unusedtemplatestext' )->parseAsBlock();
        }
+
+       protected function getGroupName() {
+               return 'maintenance';
+       }
 }
index d397149..05ec6b0 100644 (file)
@@ -94,4 +94,8 @@ class UnwatchedpagesPage extends QueryPage {
 
                return $this->getLanguage()->specialList( $plink, $wlink );
        }
+
+       protected function getGroupName() {
+               return 'maintenance';
+       }
 }
index 1a35b04..babbde1 100644 (file)
@@ -717,6 +717,9 @@ class SpecialUpload extends SpecialPage {
                        $gallery->toHtml() . "</li>\n";
        }
 
+       protected function getGroupName() {
+               return 'media';
+       }
 }
 
 /**
index ddd57c3..f88a3c7 100644 (file)
@@ -1362,4 +1362,8 @@ class LoginForm extends SpecialPage {
                        $query
                );
        }
+
+       protected function getGroupName() {
+               return 'login';
+       }
 }
index 4be36c6..d957e87 100644 (file)
@@ -62,4 +62,8 @@ class SpecialUserlogout extends UnlistedSpecialPage {
 
                $out->returnToMain();
        }
+
+       protected function getGroupName() {
+               return 'login';
+       }
 }
index 22fdc1a..5224183 100644 (file)
@@ -639,4 +639,8 @@ class UserrightsPage extends SpecialPage {
                $output->addHTML( Xml::element( 'h2', null, $rightsLogPage->getName()->text() ) );
                LogEventsList::showLogExtract( $output, 'rights', $user->getUserPage() );
        }
+
+       protected function getGroupName() {
+               return 'users';
+       }
 }
index 6447bbe..ea9b247 100644 (file)
@@ -827,6 +827,10 @@ class SpecialVersion extends SpecialPage {
                return $out;
        }
 
+       protected function getGroupName() {
+               return 'wiki';
+       }
+
        function showEasterEgg() {
                $rx = $rp = $xe = '';
                $alpha = array( "", "kbQW", "\$\n()" );
index 0b1fb25..0035bfa 100644 (file)
@@ -72,4 +72,8 @@ class WantedCategoriesPage extends WantedQueryPage {
                $nlinks = $this->msg( 'nmembers' )->numParams( $result->value )->escaped();
                return $this->getLanguage()->specialList( $plink, $nlinks );
        }
+
+       protected function getGroupName() {
+               return 'maintenance';
+       }
 }
index ddeb4a1..9a2d30a 100644 (file)
@@ -87,4 +87,8 @@ class WantedFilesPage extends WantedQueryPage {
                        )
                );
        }
+
+       protected function getGroupName() {
+               return 'maintenance';
+       }
 }
index 05df400..acec4ea 100644 (file)
@@ -91,4 +91,8 @@ class WantedPagesPage extends WantedQueryPage {
                wfRunHooks( 'WantedPages::getQueryInfo', array( &$this, &$query ) );
                return $query;
        }
+
+       protected function getGroupName() {
+               return 'maintenance';
+       }
 }
index f3e3369..f5539c1 100644 (file)
@@ -52,4 +52,8 @@ class WantedTemplatesPage extends WantedQueryPage {
                                                'page_title = tl_title' ) ) )
                );
        }
+
+       protected function getGroupName() {
+               return 'maintenance';
+       }
 }
index c498bde..89c2e76 100644 (file)
@@ -503,4 +503,8 @@ class SpecialWatchlist extends SpecialPage {
 
                return floor( $count / 2 );
        }
+
+       protected function getGroupName() {
+               return 'changes';
+       }
 }
index 0b835a2..bc20e3d 100644 (file)
@@ -464,4 +464,8 @@ class SpecialWhatLinksHere extends SpecialPage {
                }
                return Xml::fieldset( $this->msg( 'whatlinkshere-filters' )->text(), $this->getLanguage()->pipeList( $links ) );
        }
+
+       protected function getGroupName() {
+               return 'pagetools';
+       }
 }
index 2988b04..3723740 100644 (file)
@@ -95,4 +95,8 @@ class WithoutInterwikiPage extends PageQueryPage {
                }
                return $query;
        }
+
+       protected function getGroupName() {
+               return 'maintenance';
+       }
 }