'Listredirects' => array( 'SpecialPage', 'Listredirects' ),
# Login/create account
- 'Userlogin' => array( 'SpecialPage', 'Userlogin' ),
+ 'Userlogin' => 'LoginForm',
'CreateAccount' => array( 'SpecialRedirectToSpecial', 'CreateAccount', 'Userlogin', 'signup', array( 'uselang' ) ),
# Users and rights
'Listbots' => array( 'SpecialRedirectToSpecial', 'Listbots', 'Listusers', 'bot' ),
'Activeusers' => 'SpecialActiveUsers',
'Userrights' => 'UserrightsPage',
+ 'DisableAccount' => 'SpecialDisableAccount',
# Recent changes and logs
'Newimages' => array( 'IncludableSpecialPage', 'Newimages' ),
'MIMEsearch' => array( 'SpecialPage', 'MIMEsearch' ),
'FileDuplicateSearch' => array( 'SpecialPage', 'FileDuplicateSearch' ),
'Upload' => 'SpecialUpload',
+ 'UploadStash' => 'SpecialUploadStash',
# Wiki data and tools
'Statistics' => 'SpecialStatistics',
'Mycontributions' => 'SpecialMycontributions',
'Mypage' => 'SpecialMypage',
'Mytalk' => 'SpecialMytalk',
+ 'Myuploads' => 'SpecialMyuploads',
'Revisiondelete' => 'SpecialRevisionDelete',
'RevisionMove' => 'SpecialRevisionMove',
'Specialpages' => 'SpecialSpecialpages',
static function initList() {
global $wgSpecialPages;
global $wgDisableCounters, $wgDisableInternalSearch, $wgEmailAuthentication;
- global $wgEnableSelenium;
if ( self::$mListInitialised ) {
return;
}
if( !$wgDisableInternalSearch ) {
- self::$mList['Search'] = array( 'SpecialPage', 'Search' );
+ self::$mList['Search'] = 'SpecialSearch';
}
if( $wgEmailAuthentication ) {
self::$mList['Invalidateemail'] = 'EmailInvalidation';
}
- if ( $wgEnableSelenium ) {
- self::$mList['Selenium'] = 'SpecialSelenium';
- }
-
# Add extension special pages
self::$mList = array_merge( self::$mList, $wgSpecialPages );
if ( !self::$mListInitialised ) self::initList();
if ( is_null( self::$mAliases ) ) self::initAliasList();
$caseFoldedAlias = $wgContLang->caseFold( $alias );
+ $caseFoldedAlias = str_replace( ' ', '_', $caseFoldedAlias );
if ( isset( self::$mAliases[$caseFoldedAlias] ) ) {
return self::$mAliases[$caseFoldedAlias];
} else {
$page->including( $including );
// Execute special page
- $profName = 'Special:' . $page->getName();
+ $profName = 'Special:' . $page->name();
wfProfileIn( $profName );
$page->execute( $par );
wfProfileOut( $profName );
}
}
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?" );
}
}
* @param $file String: file which is included by execute(). It is also constructed from $name by default
* @param $includable Boolean: whether the page can be included in normal pages
*/
- function SpecialPage( $name = '', $restriction = '', $listed = true, $function = false, $file = 'default', $includable = false ) {
+ public function __construct( $name = '', $restriction = '', $listed = true, $function = false, $file = 'default', $includable = false ) {
+ $this->init( $name, $restriction, $listed, $function, $file, $includable );
+ }
+
+ /**
+ * Do the real work for the constructor, mainly so __call() can intercept
+ * calls to SpecialPage()
+ * @see __construct() for param docs
+ */
+ private function init( $name, $restriction, $listed, $function, $file, $includable ) {
$this->mName = $name;
$this->mRestriction = $restriction;
$this->mListed = $listed;
}
}
+ /**
+ * Use PHP's magic __call handler to get calls to the old PHP4 constructor
+ * because PHP E_STRICT yells at you for having __construct() and SpecialPage()
+ *
+ * @param $fName String Name of called method
+ * @param $a Array Arguments to the method
+ * @deprecated Call isn't deprecated, but SpecialPage::SpecialPage() is
+ */
+ public function __call( $fName, $a ) {
+ // Sometimes $fName is SpecialPage, sometimes it's specialpage. <3 PHP
+ if( strtolower( $fName ) == 'specialpage' ) {
+ // Debug messages now, warnings in 1.19 or 1.20?
+ wfDebug( "Deprecated SpecialPage::SpecialPage() called, use __construct();\n" );
+ $name = isset( $a[0] ) ? $a[0] : '';
+ $restriction = isset( $a[1] ) ? $a[1] : '';
+ $listed = isset( $a[2] ) ? $a[2] : true;
+ $function = isset( $a[3] ) ? $a[3] : false;
+ $file = isset( $a[4] ) ? $a[4] : 'default';
+ $includable = isset( $a[5] ) ? $a[5] : false;
+ $this->init( $name, $restriction, $listed, $function, $file, $includable );
+ }
+ }
+
/**#@+
* Accessor
*
*/
class UnlistedSpecialPage extends SpecialPage
{
- function UnlistedSpecialPage( $name, $restriction = '', $function = false, $file = 'default' ) {
- parent::SpecialPage( $name, $restriction, false, $function, $file );
+ function __construct( $name, $restriction = '', $function = false, $file = 'default' ) {
+ parent::__construct( $name, $restriction, false, $function, $file );
}
}
*/
class IncludableSpecialPage extends SpecialPage
{
- function IncludableSpecialPage( $name, $restriction = '', $listed = true, $function = false, $file = 'default' ) {
- parent::SpecialPage( $name, $restriction, $listed, $function, $file, true );
+ function __construct( $name, $restriction = '', $listed = true, $function = false, $file = 'default' ) {
+ parent::__construct( $name, $restriction, $listed, $function, $file, true );
}
}
class SpecialMypage extends UnlistedSpecialPage {
function __construct() {
parent::__construct( 'Mypage' );
- $this->mAllowedRedirectParams = array( 'action' , 'preload' , 'editintro', 'section' );
+ $this->mAllowedRedirectParams = array( 'action' , 'preload' , 'editintro',
+ 'section', 'oldid', 'diff', 'dir' );
}
function getRedirect( $subpage ) {
class SpecialMytalk extends UnlistedSpecialPage {
function __construct() {
parent::__construct( 'Mytalk' );
- $this->mAllowedRedirectParams = array( 'action' , 'preload' , 'editintro', 'section' );
+ $this->mAllowedRedirectParams = array( 'action' , 'preload' , 'editintro',
+ 'section', 'oldid', 'diff', 'dir' );
}
function getRedirect( $subpage ) {
return SpecialPage::getTitleFor( 'Contributions', $wgUser->getName() );
}
}
+
+/**
+ * Redirect to Special:Listfiles?user=$wgUser
+ */
+class SpecialMyuploads extends UnlistedSpecialPage {
+ function __construct() {
+ parent::__construct( 'Myuploads' );
+ $this->mAllowedRedirectParams = array( 'limit' );
+ }
+
+ function getRedirect( $subpage ) {
+ global $wgUser;
+ return SpecialPage::getTitleFor( 'Listfiles', $wgUser->getName() );
+ }
+}