r34070 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r34069‎ | r34070 | r34071 >
Date:13:03, 1 May 2008
Author:aaron
Status:old
Tags:
Comment:
Move group list to $wgSpecialPageGroups to make it easy for extensions to set
Modified paths:
  • /trunk/phase3/includes/DefaultSettings.php (modified) (history)
  • /trunk/phase3/includes/SpecialPage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/DefaultSettings.php
@@ -2544,6 +2544,98 @@
25452545 );
25462546
25472547 /**
 2548+ * List of special pages, followed by what subtitle they should go under
 2549+ * at Special:SpecialPages
 2550+ */
 2551+$wgSpecialPageGroups = array(
 2552+ 'DoubleRedirects' => 'maintenance',
 2553+ 'BrokenRedirects' => 'maintenance',
 2554+ 'Lonelypages' => 'maintenance',
 2555+ 'Uncategorizedpages' => 'maintenance',
 2556+ 'Uncategorizedcategories' => 'maintenance',
 2557+ 'Uncategorizedimages' => 'maintenance',
 2558+ 'Uncategorizedtemplates' => 'maintenance',
 2559+ 'Unusedcategories' => 'maintenance',
 2560+ 'Unusedimages' => 'maintenance',
 2561+ 'Protectedpages' => 'maintenance',
 2562+ 'Protectedtitles' => 'maintenance',
 2563+ 'Unusedtemplates' => 'maintenance',
 2564+ 'Withoutinterwiki' => 'maintenance',
 2565+ 'Longpages' => 'maintenance',
 2566+
 2567+ 'Userlogin' => 'login',
 2568+ 'Userlogout' => 'login',
 2569+ 'CreateAccount' => 'login',
 2570+
 2571+ 'Recentchanges' => 'changes',
 2572+ 'Recentchangeslinked' => 'changes',
 2573+ 'Watchlist' => 'changes',
 2574+ 'Newimages' => 'changes',
 2575+ 'Newpages' => 'changes',
 2576+ 'Log' => 'changes',
 2577+
 2578+ 'Upload' => 'media',
 2579+ 'Imagelist' => 'media',
 2580+ 'MIMEsearch' => 'media',
 2581+ 'FileDuplicateSearch' => 'media',
 2582+ 'Filepath' => 'media',
 2583+
 2584+ 'Listusers' => 'users',
 2585+ 'Listgrouprights' => 'users',
 2586+ 'Ipblocklist' => 'users',
 2587+ 'Contributions' => 'users',
 2588+ 'Emailuser' => 'users',
 2589+ 'Listadmins' => 'users',
 2590+ 'Listbots' => 'users',
 2591+
 2592+ 'Wantedpages' => 'needy',
 2593+ 'Wantedcategories' => 'needy',
 2594+ 'Shortpages' => 'needy',
 2595+ 'Ancientpages' => 'needy',
 2596+ 'Deadendpages' => 'needy',
 2597+
 2598+ 'Mostlinked' => 'highuse',
 2599+ 'Mostlinkedcategories' => 'highuse',
 2600+ 'Mostlinkedtemplates' => 'highuse',
 2601+ 'Mostcategories' => 'highuse',
 2602+ 'Mostimages' => 'highuse',
 2603+ 'Mostrevisions' => 'highuse',
 2604+
 2605+ 'Userrights' => 'permissions',
 2606+ 'Blockip' => 'permissions',
 2607+
 2608+ 'Statistics' => 'other',
 2609+ 'Fewestrevisions' => 'other',
 2610+ 'Randompage' => 'other',
 2611+ 'Disambiguations' => 'other',
 2612+ 'Specialpages' => 'other',
 2613+ 'Blockme' => 'other',
 2614+ 'Movepage' => 'other',
 2615+ 'MergeHistory' => 'other',
 2616+ 'Lockdb' => 'other',
 2617+ 'Unlockdb' => 'other',
 2618+ 'Version' => 'other',
 2619+ 'Whatlinkshere' => 'other',
 2620+ 'Booksources' => 'other',
 2621+ 'Revisiondelete' => 'other',
 2622+ 'Export' => 'other',
 2623+ 'Categories' => 'other',
 2624+ 'Undelete' => 'other',
 2625+ 'Import' => 'other',
 2626+ 'Unwatchedpages' => 'other',
 2627+ 'Randomredirect' => 'other',
 2628+ 'Allpages' => 'other',
 2629+ 'Allmessages' => 'other',
 2630+ 'Prefixindex' => 'other',
 2631+ 'Listredirects' => 'other',
 2632+ 'Preferences' => 'other',
 2633+ 'Resetpass' => 'other',
 2634+ 'Mypage' => 'other',
 2635+ 'Mytalk' => 'other',
 2636+ 'Mycontributions' => 'other',
 2637+);
 2638+
 2639+/**
25482640 * Experimental preview feature to fetch rendered text
25492641 * over an XMLHttpRequest from JavaScript instead of
25502642 * forcing a submit and reload of the whole page.
Index: trunk/phase3/includes/SpecialPage.php
@@ -162,98 +162,7 @@
163163
164164 static public $mAliases;
165165 static public $mListInitialised = false;
166 - /**
167 - * List of special pages, followed by what subtitle they should go under
168 - * at Special:SpecialPages
169 - */
170 - static public $mGroupsList = array(
171 - 'DoubleRedirects' => 'maintenance',
172 - 'BrokenRedirects' => 'maintenance',
173 - 'Lonelypages' => 'maintenance',
174 - 'Uncategorizedpages' => 'maintenance',
175 - 'Uncategorizedcategories' => 'maintenance',
176 - 'Uncategorizedimages' => 'maintenance',
177 - 'Uncategorizedtemplates' => 'maintenance',
178 - 'Unusedcategories' => 'maintenance',
179 - 'Unusedimages' => 'maintenance',
180 - 'Protectedpages' => 'maintenance',
181 - 'Protectedtitles' => 'maintenance',
182 - 'Unusedtemplates' => 'maintenance',
183 - 'Withoutinterwiki' => 'maintenance',
184 - 'Longpages' => 'maintenance',
185166
186 - 'Userlogin' => 'login',
187 - 'Userlogout' => 'login',
188 - 'CreateAccount' => 'login',
189 -
190 - 'Recentchanges' => 'changes',
191 - 'Recentchangeslinked' => 'changes',
192 - 'Watchlist' => 'changes',
193 - 'Newimages' => 'changes',
194 - 'Newpages' => 'changes',
195 - 'Log' => 'changes',
196 -
197 - 'Upload' => 'media',
198 - 'Imagelist' => 'media',
199 - 'MIMEsearch' => 'media',
200 - 'FileDuplicateSearch' => 'media',
201 - 'Filepath' => 'media',
202 -
203 - 'Listusers' => 'users',
204 - 'Listgrouprights' => 'users',
205 - 'Ipblocklist' => 'users',
206 - 'Contributions' => 'users',
207 - 'Emailuser' => 'users',
208 - 'Listadmins' => 'users',
209 - 'Listbots' => 'users',
210 -
211 - 'Wantedpages' => 'needy',
212 - 'Wantedcategories' => 'needy',
213 - 'Shortpages' => 'needy',
214 - 'Ancientpages' => 'needy',
215 - 'Deadendpages' => 'needy',
216 -
217 - 'Mostlinked' => 'highuse',
218 - 'Mostlinkedcategories' => 'highuse',
219 - 'Mostlinkedtemplates' => 'highuse',
220 - 'Mostcategories' => 'highuse',
221 - 'Mostimages' => 'highuse',
222 - 'Mostrevisions' => 'highuse',
223 -
224 - 'Userrights' => 'permissions',
225 - 'Blockip' => 'permissions',
226 -
227 - 'Statistics' => 'other',
228 - 'Fewestrevisions' => 'other',
229 - 'Randompage' => 'other',
230 - 'Disambiguations' => 'other',
231 - 'Specialpages' => 'other',
232 - 'Blockme' => 'other',
233 - 'Movepage' => 'other',
234 - 'MergeHistory' => 'other',
235 - 'Lockdb' => 'other',
236 - 'Unlockdb' => 'other',
237 - 'Version' => 'other',
238 - 'Whatlinkshere' => 'other',
239 - 'Booksources' => 'other',
240 - 'Revisiondelete' => 'other',
241 - 'Export' => 'other',
242 - 'Categories' => 'other',
243 - 'Undelete' => 'other',
244 - 'Import' => 'other',
245 - 'Unwatchedpages' => 'other',
246 - 'Randomredirect' => 'other',
247 - 'Allpages' => 'other',
248 - 'Allmessages' => 'other',
249 - 'Prefixindex' => 'other',
250 - 'Listredirects' => 'other',
251 - 'Preferences' => 'other',
252 - 'Resetpass' => 'other',
253 - 'Mypage' => 'other',
254 - 'Mytalk' => 'other',
255 - 'Mycontributions' => 'other',
256 - );
257 -
258167 /**#@-*/
259168
260169 /**
@@ -370,11 +279,9 @@
371280 * @static
372281 */
373282 static function setGroup( $page, $group ) {
374 - if ( !self::$mListInitialised ) {
375 - self::initList();
376 - }
 283+ global $wgSpecialPageGroups;
377284 $name = is_object($page) ? $page->mName : $page;
378 - self::$mGroupsList[$name] = $group;
 285+ $wgSpecialPageGroups[$name] = $group;
379286 }
380287
381288 /**
@@ -384,11 +291,9 @@
385292 * @static
386293 */
387294 static function getGroup( &$page ) {
388 - if ( !self::$mListInitialised ) {
389 - self::initList();
390 - }
391 - $group = isset(self::$mGroupsList[$page->mName]) ?
392 - self::$mGroupsList[$page->mName] : 'other';
 295+ global $wgSpecialPageGroups;
 296+ $group = isset($wgSpecialPageGroups[$page->mName]) ?
 297+ $wgSpecialPageGroups[$page->mName] : 'other';
393298 return $group;
394299 }
395300

Status & tagging log