diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2009-06-10 13:00:47 +0200 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2009-06-10 13:00:47 +0200 |
commit | 72e90545454c0e014318fa3c81658e035aac58c1 (patch) | |
tree | 9212e3f46868989c4d57ae9a5c8a1a80e4dc0702 /includes/SpecialPage.php | |
parent | 565a0ccc371ec1a2a0e9b39487cbac18e6f60e25 (diff) |
applying patch to version 1.15.0
Diffstat (limited to 'includes/SpecialPage.php')
-rw-r--r-- | includes/SpecialPage.php | 176 |
1 files changed, 105 insertions, 71 deletions
diff --git a/includes/SpecialPage.php b/includes/SpecialPage.php index 00eacd1e..31b43839 100644 --- a/includes/SpecialPage.php +++ b/includes/SpecialPage.php @@ -80,92 +80,112 @@ class SpecialPage ** array( 'SpecialRedirectToSpecial', name, page to redirect to, special page param, ... ) */ static public $mList = array( - 'DoubleRedirects' => array( 'SpecialPage', 'DoubleRedirects' ), + # Maintenance Reports 'BrokenRedirects' => array( 'SpecialPage', 'BrokenRedirects' ), + 'Deadendpages' => array( 'SpecialPage', 'Deadendpages' ), + 'DoubleRedirects' => array( 'SpecialPage', 'DoubleRedirects' ), + 'Longpages' => array( 'SpecialPage', 'Longpages' ), + 'Ancientpages' => array( 'SpecialPage', 'Ancientpages' ), + 'Lonelypages' => array( 'SpecialPage', 'Lonelypages' ), + 'Fewestrevisions' => array( 'SpecialPage', 'Fewestrevisions' ), + 'Withoutinterwiki' => array( 'SpecialPage', 'Withoutinterwiki' ), + 'Protectedpages' => array( 'SpecialPage', 'Protectedpages' ), + 'Protectedtitles' => array( 'SpecialPage', 'Protectedtitles' ), + 'Shortpages' => array( 'SpecialPage', 'Shortpages' ), + 'Uncategorizedcategories' => array( 'SpecialPage', 'Uncategorizedcategories' ), + 'Uncategorizedimages' => array( 'SpecialPage', 'Uncategorizedimages' ), + 'Uncategorizedpages' => array( 'SpecialPage', 'Uncategorizedpages' ), + 'Uncategorizedtemplates' => array( 'SpecialPage', 'Uncategorizedtemplates' ), + 'Unusedcategories' => array( 'SpecialPage', 'Unusedcategories' ), + 'Unusedimages' => array( 'SpecialPage', 'Unusedimages' ), + 'Unusedtemplates' => array( 'SpecialPage', 'Unusedtemplates' ), + 'Unwatchedpages' => array( 'SpecialPage', 'Unwatchedpages', 'unwatchedpages' ), + 'Wantedcategories' => array( 'SpecialPage', 'Wantedcategories' ), + 'Wantedfiles' => array( 'SpecialPage', 'Wantedfiles' ), + 'Wantedpages' => array( 'IncludableSpecialPage', 'Wantedpages' ), + 'Wantedtemplates' => array( 'SpecialPage', 'Wantedtemplates' ), + + # List of pages + 'Allpages' => 'SpecialAllpages', + 'Prefixindex' => 'SpecialPrefixindex', + 'Categories' => array( 'SpecialPage', 'Categories' ), 'Disambiguations' => array( 'SpecialPage', 'Disambiguations' ), + 'Listredirects' => array( 'SpecialPage', 'Listredirects' ), - 'Userlogin' => array( 'SpecialPage', 'Userlogin' ), - 'Userlogout' => array( 'UnlistedSpecialPage', 'Userlogout' ), + # Login/create account + 'Userlogin' => array( 'SpecialPage', 'Userlogin' ), 'CreateAccount' => array( 'SpecialRedirectToSpecial', 'CreateAccount', 'Userlogin', 'signup', array( 'uselang' ) ), - 'Preferences' => array( 'SpecialPage', 'Preferences' ), - 'Watchlist' => array( 'SpecialPage', 'Watchlist' ), - 'Resetpass' => 'SpecialResetpass', + # Users and rights + 'Blockip' => array( 'SpecialPage', 'Blockip', 'block' ), + 'Ipblocklist' => array( 'SpecialPage', 'Ipblocklist' ), + 'Resetpass' => 'SpecialResetpass', + 'DeletedContributions' => 'DeletedContributionsPage', + 'Preferences' => array( 'SpecialPage', 'Preferences' ), + 'Contributions' => 'SpecialContributions', + 'Listgrouprights' => 'SpecialListGroupRights', + 'Listusers' => array( 'SpecialPage', 'Listusers' ), + 'Userrights' => 'UserrightsPage', + # Recent changes and logs + 'Newimages' => array( 'IncludableSpecialPage', 'Newimages' ), + 'Log' => array( 'SpecialPage', 'Log' ), + 'Watchlist' => array( 'SpecialPage', 'Watchlist' ), + 'Newpages' => 'SpecialNewpages', 'Recentchanges' => 'SpecialRecentchanges', - 'Upload' => array( 'SpecialPage', 'Upload' ), + 'Recentchangeslinked' => 'SpecialRecentchangeslinked', + 'Tags' => 'SpecialTags', + + # Media reports and uploads 'Listfiles' => array( 'SpecialPage', 'Listfiles' ), - 'Newimages' => array( 'IncludableSpecialPage', 'Newimages' ), - 'Listusers' => array( 'SpecialPage', 'Listusers' ), - 'Listgrouprights' => 'SpecialListGroupRights', - 'DeletedContributions' => 'DeletedContributionsPage', + 'Filepath' => array( 'SpecialPage', 'Filepath' ), + 'MIMEsearch' => array( 'SpecialPage', 'MIMEsearch' ), + 'FileDuplicateSearch' => array( 'SpecialPage', 'FileDuplicateSearch' ), + 'Upload' => array( 'SpecialPage', 'Upload' ), + + # Wiki data and tools 'Statistics' => 'SpecialStatistics', + 'Allmessages' => array( 'SpecialPage', 'Allmessages' ), + 'Version' => 'SpecialVersion', + 'Lockdb' => array( 'SpecialPage', 'Lockdb', 'siteadmin' ), + 'Unlockdb' => array( 'SpecialPage', 'Unlockdb', 'siteadmin' ), + + # Redirecting special pages + 'LinkSearch' => array( 'SpecialPage', 'LinkSearch' ), 'Randompage' => 'Randompage', - 'Lonelypages' => array( 'SpecialPage', 'Lonelypages' ), - 'Uncategorizedpages' => array( 'SpecialPage', 'Uncategorizedpages' ), - 'Uncategorizedcategories' => array( 'SpecialPage', 'Uncategorizedcategories' ), - 'Uncategorizedimages' => array( 'SpecialPage', 'Uncategorizedimages' ), - 'Uncategorizedtemplates' => array( 'SpecialPage', 'Uncategorizedtemplates' ), - 'Unusedcategories' => array( 'SpecialPage', 'Unusedcategories' ), - 'Unusedimages' => array( 'SpecialPage', 'Unusedimages' ), - 'Wantedpages' => array( 'IncludableSpecialPage', 'Wantedpages' ), - 'Wantedcategories' => array( 'SpecialPage', 'Wantedcategories' ), - 'Wantedfiles' => array( 'SpecialPage', 'Wantedfiles' ), - 'Wantedtemplates' => array( 'SpecialPage', 'Wantedtemplates' ), - 'Mostlinked' => array( 'SpecialPage', 'Mostlinked' ), + 'Randomredirect' => 'SpecialRandomredirect', + + # High use pages 'Mostlinkedcategories' => array( 'SpecialPage', 'Mostlinkedcategories' ), + 'Mostimages' => array( 'SpecialPage', 'Mostimages' ), + 'Mostlinked' => array( 'SpecialPage', 'Mostlinked' ), 'Mostlinkedtemplates' => array( 'SpecialPage', 'Mostlinkedtemplates' ), 'Mostcategories' => array( 'SpecialPage', 'Mostcategories' ), - 'Mostimages' => array( 'SpecialPage', 'Mostimages' ), 'Mostrevisions' => array( 'SpecialPage', 'Mostrevisions' ), - 'Fewestrevisions' => array( 'SpecialPage', 'Fewestrevisions' ), - 'Shortpages' => array( 'SpecialPage', 'Shortpages' ), - 'Longpages' => array( 'SpecialPage', 'Longpages' ), - 'Newpages' => 'SpecialNewpages', - 'Ancientpages' => array( 'SpecialPage', 'Ancientpages' ), - 'Deadendpages' => array( 'SpecialPage', 'Deadendpages' ), - 'Protectedpages' => array( 'SpecialPage', 'Protectedpages' ), - 'Protectedtitles' => array( 'SpecialPage', 'Protectedtitles' ), - 'Allpages' => 'SpecialAllpages', - 'Prefixindex' => 'SpecialPrefixindex', - 'Ipblocklist' => array( 'SpecialPage', 'Ipblocklist' ), - 'Specialpages' => array( 'UnlistedSpecialPage', 'Specialpages' ), - 'Contributions' => 'SpecialContributions', - 'Emailuser' => array( 'UnlistedSpecialPage', 'Emailuser' ), + + # Page tools + 'Export' => 'SpecialExport', + 'Import' => 'SpecialImport', + 'Undelete' => array( 'SpecialPage', 'Undelete', 'deletedhistory' ), 'Whatlinkshere' => array( 'SpecialPage', 'Whatlinkshere' ), - 'LinkSearch' => array( 'SpecialPage', 'LinkSearch' ), - 'Recentchangeslinked' => 'SpecialRecentchangeslinked', - 'Movepage' => array( 'UnlistedSpecialPage', 'Movepage' ), - 'Blockme' => array( 'UnlistedSpecialPage', 'Blockme' ), + 'MergeHistory' => array( 'SpecialPage', 'MergeHistory', 'mergehistory' ), + + # Other 'Booksources' => 'SpecialBookSources', - 'Categories' => array( 'SpecialPage', 'Categories' ), - 'Export' => array( 'SpecialPage', 'Export' ), - 'Version' => 'SpecialVersion', + + # Unlisted / redirects 'Blankpage' => array( 'UnlistedSpecialPage', 'Blankpage' ), - 'Allmessages' => array( 'SpecialPage', 'Allmessages' ), - 'Log' => array( 'SpecialPage', 'Log' ), - 'Blockip' => array( 'SpecialPage', 'Blockip', 'block' ), - 'Undelete' => array( 'SpecialPage', 'Undelete', 'deletedhistory' ), - 'Import' => 'SpecialImport', - 'Lockdb' => array( 'SpecialPage', 'Lockdb', 'siteadmin' ), - 'Unlockdb' => array( 'SpecialPage', 'Unlockdb', 'siteadmin' ), - 'Userrights' => 'UserrightsPage', - 'MIMEsearch' => array( 'SpecialPage', 'MIMEsearch' ), - 'FileDuplicateSearch' => array( 'SpecialPage', 'FileDuplicateSearch' ), - 'Unwatchedpages' => array( 'SpecialPage', 'Unwatchedpages', 'unwatchedpages' ), - 'Listredirects' => array( 'SpecialPage', 'Listredirects' ), - 'Revisiondelete' => array( 'UnlistedSpecialPage', 'Revisiondelete', 'deleterevision' ), - 'Unusedtemplates' => array( 'SpecialPage', 'Unusedtemplates' ), - 'Randomredirect' => 'SpecialRandomredirect', - 'Withoutinterwiki' => array( 'SpecialPage', 'Withoutinterwiki' ), - 'Filepath' => array( 'SpecialPage', 'Filepath' ), - - 'Mypage' => array( 'SpecialMypage' ), - 'Mytalk' => array( 'SpecialMytalk' ), - 'Mycontributions' => array( 'SpecialMycontributions' ), + 'Blockme' => array( 'UnlistedSpecialPage', 'Blockme' ), + 'Emailuser' => array( 'UnlistedSpecialPage', 'Emailuser' ), 'Listadmins' => array( 'SpecialRedirectToSpecial', 'Listadmins', 'Listusers', 'sysop' ), - 'MergeHistory' => array( 'SpecialPage', 'MergeHistory', 'mergehistory' ), 'Listbots' => array( 'SpecialRedirectToSpecial', 'Listbots', 'Listusers', 'bot' ), + 'Movepage' => array( 'UnlistedSpecialPage', 'Movepage' ), + 'Mycontributions' => array( 'SpecialMycontributions' ), + 'Mypage' => array( 'SpecialMypage' ), + 'Mytalk' => array( 'SpecialMytalk' ), + 'Revisiondelete' => 'SpecialRevisionDelete', + 'Specialpages' => array( 'UnlistedSpecialPage', 'Specialpages' ), + 'Userlogout' => array( 'UnlistedSpecialPage', 'Userlogout' ), ); static public $mAliases; @@ -695,7 +715,9 @@ class SpecialPage * pages? */ public function isRestricted() { - return $this->mRestriction != ''; + global $wgGroupPermissions; + // DWIM: If all anons can do something, then it is not restricted + return $this->mRestriction != '' && empty($wgGroupPermissions['*'][$this->mRestriction]); } /** @@ -752,13 +774,25 @@ class SpecialPage } } - function outputHeader() { + /** + * Outputs a summary message on top of special pages + * Per default the message key is the canonical name of the special page + * May be overriden, i.e. by extensions to stick with the naming conventions + * for message keys: 'extensionname-xxx' + * + * @param string message key of the summary + */ + function outputHeader( $summaryMessageKey = '' ) { global $wgOut, $wgContLang; - $msg = $wgContLang->lc( $this->name() ) . '-summary'; + if( $summaryMessageKey == '' ) { + $msg = $wgContLang->lc( $this->name() ) . '-summary'; + } else { + $msg = $summaryMessageKey; + } $out = wfMsgNoTrans( $msg ); if ( ! wfEmptyMsg( $msg, $out ) and $out !== '' and ! $this->including() ) { - $wgOut->addWikiMsg( $msg ); + $wgOut->wrapWikiMsg( "<div class='mw-specialpage-summary'>\n$1</div>", $msg ); } } |