* Query parameteres added by redirects
*/
var $mAddedRedirectParams = array();
+ /**
+ * Current request
+ * @var WebRequest
+ */
+ protected $mRequest;
+ /**
+ * Current output page
+ * @var OutputPage
+ */
+ protected $mOutput;
+ /**
+ * Full title including $par
+ * @var Title
+ */
+ protected $mFullTitle;
+
/**
* List of special pages, followed by parameters.
* If the only parameter is a string, that is the page name.
'CreateAccount' => array( 'SpecialRedirectToSpecial', 'CreateAccount', 'Userlogin', 'signup', array( 'uselang' ) ),
# Users and rights
- 'Blockip' => 'IPBlockForm',
- 'Ipblocklist' => 'IPUnblockForm',
- 'Unblock' => array( 'SpecialRedirectToSpecial', 'Unblock', 'Ipblocklist', false, array( 'uselang', 'ip', 'id' ), array( 'action' => 'unblock' ) ),
+ 'Block' => 'SpecialBlock',
+ 'Unblock' => 'SpecialUnblock',
+ 'BlockList' => 'SpecialBlockList',
'Resetpass' => 'SpecialResetpass',
'DeletedContributions' => 'DeletedContributionsPage',
'Preferences' => 'SpecialPreferences',
'Contributions' => 'SpecialContributions',
'Listgrouprights' => 'SpecialListGroupRights',
- 'Listusers' => array( 'SpecialPage', 'Listusers' ),
+ 'Listusers' => 'SpecialListusers',
'Listadmins' => array( 'SpecialRedirectToSpecial', 'Listadmins', 'Listusers', 'sysop' ),
'Listbots' => array( 'SpecialRedirectToSpecial', 'Listbots', 'Listusers', 'bot' ),
'Activeusers' => 'SpecialActiveUsers',
'Userrights' => 'UserrightsPage',
'DisableAccount' => 'SpecialDisableAccount',
+ 'EditWatchlist' => 'SpecialEditWatchlist',
# Recent changes and logs
- 'Newimages' => array( 'IncludableSpecialPage', 'Newimages' ),
+ 'Newimages' => 'SpecialNewFiles',
'Log' => 'SpecialLog',
- 'Watchlist' => array( 'SpecialPage', 'Watchlist' ),
+ 'Watchlist' => 'SpecialWatchlist',
'Newpages' => 'SpecialNewpages',
'Recentchanges' => 'SpecialRecentchanges',
'Recentchangeslinked' => 'SpecialRecentchangeslinked',
'Tags' => 'SpecialTags',
# Media reports and uploads
- 'Listfiles' => array( 'SpecialPage', 'Listfiles' ),
+ 'Listfiles' => 'SpecialListFiles',
'Filepath' => 'SpecialFilepath',
'MIMEsearch' => 'MIMEsearchPage',
'FileDuplicateSearch' => 'FileDuplicateSearchPage',
wfProfileOut( __METHOD__ );
return false;
}
+
+ # Page exists, set the context
+ $page->setContext( $wgRequest, $wgOut );
# Check for redirect
if ( !$including ) {
$found = false;
foreach ( $aliases as $n => $values ) {
if ( strcasecmp( $name, $n ) === 0 ) {
- wfWarn( "Found alias defined for $n when searching for" .
+ wfWarn( "Found alias defined for $n when searching for " .
"special page aliases for $name. Case mismatch?" );
$name = $values[0];
$found = true;
}
}
if ( !$found ) {
- wfWarn( "Did not find alias for special page '$name'. " .
+ wfWarn( "Did not find alias for special page '$name'. " .
"Perhaps no aliases are defined for it?" );
}
}
return $this->mLocalName;
}
+ /**
+ * Is this page expensive (for some definition of expensive)?
+ * Expensive pages are disabled or cached in miser mode. Originally used
+ * (and still overridden) by QueryPage and subclasses, moved here so that
+ * Special:SpecialPages can safely call it for all special pages.
+ *
+ * @return Boolean
+ */
+ public function isExpensive() {
+ return false;
+ }
+
/**
* Can be overridden by subclasses with more complicated permissions
* schemes.
? $params
: false;
}
+
+ /**
+ * Sets the context this SpecialPage is executed in
+ *
+ * @param $request WebRequest
+ * @param $output OutputPage
+ */
+ protected function setContext( $request, $output ) {
+ $this->mRequest = $request;
+ $this->mOutput = $output;
+ $this->mFullTitle = $output->getTitle();
+ }
+ /**
+ * Wrapper around wfMessage that sets the current context. Currently this
+ * is only the title.
+ *
+ * @see wfMessage
+ */
+ public function msg( /* $args */ ) {
+ return call_user_func_array( 'wfMessage', func_get_args() )->title( $this->mFullTitle );
+ }
}
/**