'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',
* @return String: HTML fragment
*/
static function capturePath( &$title ) {
- global $wgOut, $wgTitle;
+ global $wgOut, $wgTitle, $wgUser;
$oldTitle = $wgTitle;
$oldOut = $wgOut;
$wgOut = new OutputPage;
$wgOut->setTitle( $title );
+ $wgOut->setUser( $wgUser ); # for now, there may be a better idea in the future
$ret = SpecialPage::executePath( $title, true );
if ( $ret === 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.
$this->mOutput = $output;
$this->mFullTitle = $output->getTitle();
}
+
+ /**
+ * Get the WebRequest being used for this instance
+ *
+ * @return WebRequest
+ */
+ public function getRequest() {
+ if ( !isset($this->mRequest) ) {
+ wfDebug( __METHOD__ . " called and \$mRequest is null. Return \$wgRequest for sanity\n" );
+ global $wgRequest;
+ return $wgRequest;
+ }
+ return $this->mRequest;
+ }
+
+ /**
+ * Get the OutputPage being used for this instance
+ *
+ * @return OutputPage
+ */
+ public function getOutput() {
+ if ( !isset($this->mOutput) ) {
+ wfDebug( __METHOD__ . " called and \$mOutput is null. Return \$wgOut for sanity\n" );
+ global $wgOut;
+ return $wgOut;
+ }
+ return $this->mOutput;
+ }
+
+ /**
+ * Shortcut to get the skin being used for this instance
+ *
+ * @return User
+ */
+ public function getUser() {
+ return $this->getOutput()->getUser();
+ }
+
+ /**
+ * Shortcut to get the skin being used for this instance
+ *
+ * @return Skin
+ */
+ public function getSkin() {
+ return $this->getOutput()->getSkin();
+ }
+
/**
* Wrapper around wfMessage that sets the current context. Currently this
* is only the title.