3 * SpecialPage: handling special pages and lists thereof.
5 * To add a special page in an extension, add to $wgSpecialPages either
6 * an object instance or an array containing the name and constructor
7 * parameters. The latter is preferred for performance reasons.
9 * The object instantiated must be either an instance of SpecialPage or a
10 * sub-class thereof. It must have an execute() method, which sends the HTML
11 * for the special page to $wgOut. The parent class has an execute() method
12 * which distributes the call to the historical global functions. Additionally,
13 * execute() also checks if the user has the necessary access privileges
14 * and bails out if not.
16 * To add a core special page, use the similar static list in
17 * SpecialPage::$mList. To remove a core static special page at runtime, use
18 * a SpecialPage_initList hook.
20 * @addtogroup SpecialPage
28 * Parent special page class, also static functions for handling the special
30 * @addtogroup SpecialPage
38 * The canonical name of this special page
39 * Also used for the default <h1> heading, @see getDescription()
43 * The local name of this special page
47 * Minimum user level required to access this page, or "" for anyone.
48 * Also used to categorise the pages in Special:Specialpages
52 * Listed in Special:Specialpages?
56 * Function name called by the default execute()
60 * File which needs to be included before the function above can be called
64 * Whether or not this special page is being included from an article
68 * Whether the special page can be included in an article
72 * Query parameters that can be passed through redirects
74 var $mAllowedRedirectParams = array();
76 static public $mList = array(
77 'DoubleRedirects' => array( 'SpecialPage', 'DoubleRedirects' ),
78 'BrokenRedirects' => array( 'SpecialPage', 'BrokenRedirects' ),
79 'Disambiguations' => array( 'SpecialPage', 'Disambiguations' ),
81 'Userlogin' => array( 'SpecialPage', 'Userlogin' ),
82 'Userlogout' => array( 'UnlistedSpecialPage', 'Userlogout' ),
83 'Preferences' => array( 'SpecialPage', 'Preferences' ),
84 'Watchlist' => array( 'SpecialPage', 'Watchlist' ),
86 'Recentchanges' => array( 'IncludableSpecialPage', 'Recentchanges' ),
87 'Upload' => array( 'SpecialPage', 'Upload' ),
88 'Imagelist' => array( 'SpecialPage', 'Imagelist' ),
89 'Newimages' => array( 'IncludableSpecialPage', 'Newimages' ),
90 'Listusers' => array( 'SpecialPage', 'Listusers' ),
91 'Statistics' => array( 'SpecialPage', 'Statistics' ),
92 'Randompage' => array( 'SpecialPage', 'Randompage' ),
93 'Lonelypages' => array( 'SpecialPage', 'Lonelypages' ),
94 'Uncategorizedpages' => array( 'SpecialPage', 'Uncategorizedpages' ),
95 'Uncategorizedcategories' => array( 'SpecialPage', 'Uncategorizedcategories' ),
96 'Uncategorizedimages' => array( 'SpecialPage', 'Uncategorizedimages' ),
97 'Uncategorizedtemplates' => array( 'SpecialPage', 'Uncategorizedtemplates' ),
98 'Unusedcategories' => array( 'SpecialPage', 'Unusedcategories' ),
99 'Unusedimages' => array( 'SpecialPage', 'Unusedimages' ),
100 'Wantedpages' => array( 'IncludableSpecialPage', 'Wantedpages' ),
101 'Wantedcategories' => array( 'SpecialPage', 'Wantedcategories' ),
102 'Mostlinked' => array( 'SpecialPage', 'Mostlinked' ),
103 'Mostlinkedcategories' => array( 'SpecialPage', 'Mostlinkedcategories' ),
104 'Mostlinkedtemplates' => array( 'SpecialPage', 'Mostlinkedtemplates' ),
105 'Mostcategories' => array( 'SpecialPage', 'Mostcategories' ),
106 'Mostimages' => array( 'SpecialPage', 'Mostimages' ),
107 'Mostrevisions' => array( 'SpecialPage', 'Mostrevisions' ),
108 'Fewestrevisions' => array( 'SpecialPage', 'Fewestrevisions' ),
109 'Shortpages' => array( 'SpecialPage', 'Shortpages' ),
110 'Longpages' => array( 'SpecialPage', 'Longpages' ),
111 'Newpages' => array( 'IncludableSpecialPage', 'Newpages' ),
112 'Ancientpages' => array( 'SpecialPage', 'Ancientpages' ),
113 'Deadendpages' => array( 'SpecialPage', 'Deadendpages' ),
114 'Protectedpages' => array( 'SpecialPage', 'Protectedpages' ),
115 'Allpages' => array( 'IncludableSpecialPage', 'Allpages' ),
116 'Prefixindex' => array( 'IncludableSpecialPage', 'Prefixindex' ) ,
117 'Ipblocklist' => array( 'SpecialPage', 'Ipblocklist' ),
118 'Specialpages' => array( 'UnlistedSpecialPage', 'Specialpages' ),
119 'Contributions' => array( 'SpecialPage', 'Contributions' ),
120 'Emailuser' => array( 'UnlistedSpecialPage', 'Emailuser' ),
121 'Whatlinkshere' => array( 'SpecialPage', 'Whatlinkshere' ),
122 'Recentchangeslinked' => array( 'UnlistedSpecialPage', 'Recentchangeslinked' ),
123 'Movepage' => array( 'UnlistedSpecialPage', 'Movepage' ),
124 'Blockme' => array( 'UnlistedSpecialPage', 'Blockme' ),
125 'Resetpass' => array( 'UnlistedSpecialPage', 'Resetpass' ),
126 'Booksources' => 'SpecialBookSources',
127 'Categories' => array( 'SpecialPage', 'Categories' ),
128 'Export' => array( 'SpecialPage', 'Export' ),
129 'Version' => array( 'SpecialPage', 'Version' ),
130 'Allmessages' => array( 'SpecialPage', 'Allmessages' ),
131 'Log' => array( 'SpecialPage', 'Log' ),
132 'Blockip' => array( 'SpecialPage', 'Blockip', 'block' ),
133 'Undelete' => array( 'SpecialPage', 'Undelete', 'deletedhistory' ),
134 'Import' => array( 'SpecialPage', 'Import', 'import' ),
135 'Lockdb' => array( 'SpecialPage', 'Lockdb', 'siteadmin' ),
136 'Unlockdb' => array( 'SpecialPage', 'Unlockdb', 'siteadmin' ),
137 'Userrights' => array( 'SpecialPage', 'Userrights', 'userrights' ),
138 'MIMEsearch' => array( 'SpecialPage', 'MIMEsearch' ),
139 'Unwatchedpages' => array( 'SpecialPage', 'Unwatchedpages', 'unwatchedpages' ),
140 'Listredirects' => array( 'SpecialPage', 'Listredirects' ),
141 'Revisiondelete' => array( 'UnlistedSpecialPage', 'Revisiondelete', 'deleterevision' ),
142 'Unusedtemplates' => array( 'SpecialPage', 'Unusedtemplates' ),
143 'Randomredirect' => array( 'SpecialPage', 'Randomredirect' ),
144 'Withoutinterwiki' => array( 'SpecialPage', 'Withoutinterwiki' ),
146 'Mypage' => array( 'SpecialMypage' ),
147 'Mytalk' => array( 'SpecialMytalk' ),
148 'Mycontributions' => array( 'SpecialMycontributions' ),
149 'Listadmins' => array( 'SpecialRedirectToSpecial', 'Listadmins', 'Listusers', 'sysop' ),
150 'MergeHistory' => array( 'SpecialPage', 'MergeHistory', 'mergehistory' ),
151 'Listbots' => array( 'SpecialRedirectToSpecial', 'Listbots', 'Listusers', 'bot' ),
154 static public $mAliases;
155 static public $mListInitialised = false;
160 * Initialise the special page list
161 * This must be called before accessing SpecialPage::$mList
163 static function initList() {
164 global $wgSpecialPages;
165 global $wgDisableCounters, $wgDisableInternalSearch, $wgEmailAuthentication;
167 if ( self
::$mListInitialised ) {
170 wfProfileIn( __METHOD__
);
172 # Better to set this now, to avoid infinite recursion in carelessly written hooks
173 self
::$mListInitialised = true;
175 if( !$wgDisableCounters ) {
176 self
::$mList['Popularpages'] = array( 'SpecialPage', 'Popularpages' );
179 if( !$wgDisableInternalSearch ) {
180 self
::$mList['Search'] = array( 'SpecialPage', 'Search' );
183 if( $wgEmailAuthentication ) {
184 self
::$mList['Confirmemail'] = 'EmailConfirmation';
187 # Add extension special pages
188 self
::$mList = array_merge( self
::$mList, $wgSpecialPages );
191 # This hook can be used to remove undesired built-in special pages
192 wfRunHooks( 'SpecialPage_initList', array( &self
::$mList ) );
193 wfProfileOut( __METHOD__
);
196 static function initAliasList() {
197 if ( !is_null( self
::$mAliases ) ) {
202 $aliases = $wgContLang->getSpecialPageAliases();
203 $missingPages = self
::$mList;
204 self
::$mAliases = array();
205 foreach ( $aliases as $realName => $aliasList ) {
206 foreach ( $aliasList as $alias ) {
207 self
::$mAliases[$wgContLang->caseFold( $alias )] = $realName;
209 unset( $missingPages[$realName] );
211 foreach ( $missingPages as $name => $stuff ) {
212 self
::$mAliases[$wgContLang->caseFold( $name )] = $name;
217 * Given a special page alias, return the special page name.
218 * Returns false if there is no such alias.
220 static function resolveAlias( $alias ) {
223 if ( !self
::$mListInitialised ) self
::initList();
224 if ( is_null( self
::$mAliases ) ) self
::initAliasList();
225 $caseFoldedAlias = $wgContLang->caseFold( $alias );
226 if ( isset( self
::$mAliases[$caseFoldedAlias] ) ) {
227 return self
::$mAliases[$caseFoldedAlias];
234 * Given a special page name with a possible subpage, return an array
235 * where the first element is the special page name and the second is the
238 static function resolveAliasWithSubpage( $alias ) {
239 $bits = explode( '/', $alias, 2 );
240 $name = self
::resolveAlias( $bits[0] );
241 if( !isset( $bits[1] ) ) { // bug 2087
246 return array( $name, $par );
250 * Add a page to the list of valid special pages. This used to be the preferred
251 * method for adding special pages in extensions. It's now suggested that you add
252 * an associative record to $wgSpecialPages. This avoids autoloading SpecialPage.
254 * @param mixed $page Must either be an array specifying a class name and
255 * constructor parameters, or an object. The object,
256 * when constructed, must have an execute() method which
257 * sends HTML to $wgOut.
260 static function addPage( &$page ) {
261 if ( !self
::$mListInitialised ) {
264 self
::$mList[$page->mName
] = $page;
268 * Remove a special page from the list
269 * Formerly used to disable expensive or dangerous special pages. The
270 * preferred method is now to add a SpecialPage_initList hook.
274 static function removePage( $name ) {
275 if ( !self
::$mListInitialised ) {
278 unset( self
::$mList[$name] );
282 * Check if a given name exist as a special page or as a special page alias
283 * @param $name string: name of a special page
284 * @return boolean: true if a special page exists with this name
286 static function exists( $name ) {
288 if ( !self
::$mListInitialised ) {
291 if( !self
::$mAliases ) {
292 self
::initAliasList();
295 # Remove special pages inline parameters:
296 $bits = explode( '/', $name );
297 $name = $wgContLang->caseFold($bits[0]);
300 array_key_exists( $name, self
::$mList )
301 or array_key_exists( $name, self
::$mAliases )
306 * Find the object with a given name and return it (or NULL)
308 * @param string $name
310 static function getPage( $name ) {
311 if ( !self
::$mListInitialised ) {
314 if ( array_key_exists( $name, self
::$mList ) ) {
315 $rec = self
::$mList[$name];
316 if ( is_string( $rec ) ) {
318 self
::$mList[$name] = new $className;
319 } elseif ( is_array( $rec ) ) {
320 $className = array_shift( $rec );
321 self
::$mList[$name] = wfCreateObject( $className, $rec );
323 return self
::$mList[$name];
330 * Get a special page with a given localised name, or NULL if there
331 * is no such special page.
333 static function getPageByAlias( $alias ) {
334 $realName = self
::resolveAlias( $alias );
336 return self
::getPage( $realName );
343 * Return categorised listable special pages for all users
346 static function getRegularPages() {
347 if ( !self
::$mListInitialised ) {
352 foreach ( self
::$mList as $name => $rec ) {
353 $page = self
::getPage( $name );
354 if ( $page->isListed() && $page->getRestriction() == '' ) {
355 $pages[$name] = $page;
362 * Return categorised listable special pages which are available
363 * for the current user, but not for everyone
366 static function getRestrictedPages() {
368 if ( !self
::$mListInitialised ) {
373 foreach ( self
::$mList as $name => $rec ) {
374 $page = self
::getPage( $name );
375 if ( $page->isListed() ) {
376 $restriction = $page->getRestriction();
377 if ( $restriction != '' && $wgUser->isAllowed( $restriction ) ) {
378 $pages[$name] = $page;
386 * Execute a special page path.
387 * The path may contain parameters, e.g. Special:Name/Params
388 * Extracts the special page name and call the execute method, passing the parameters
390 * Returns a title object if the page is redirected, false if there was no such special
391 * page, and true if it was successful.
393 * @param $title a title object
394 * @param $including output is being captured for use in {{special:whatever}}
396 static function executePath( &$title, $including = false ) {
397 global $wgOut, $wgTitle, $wgRequest;
398 wfProfileIn( __METHOD__
);
400 # FIXME: redirects broken due to this call
401 $bits = explode( '/', $title->getDBkey(), 2 );
403 if( !isset( $bits[1] ) ) { // bug 2087
408 $page = SpecialPage
::getPageByAlias( $name );
413 $wgOut->setArticleRelated( false );
414 $wgOut->setRobotpolicy( 'noindex,nofollow' );
415 $wgOut->setStatusCode( 404 );
416 $wgOut->showErrorPage( 'nosuchspecialpage', 'nospecialpagetext' );
418 wfProfileOut( __METHOD__
);
424 $redirect = $page->getRedirect( $par );
426 $query = $page->getRedirectQuery();
427 $url = $redirect->getFullUrl( $query );
428 $wgOut->redirect( $url );
429 wfProfileOut( __METHOD__
);
434 # Redirect to canonical alias for GET commands
435 # Not for POST, we'd lose the post data, so it's best to just distribute
436 # the request. Such POST requests are possible for old extensions that
437 # generate self-links without being aware that their default name has
439 if ( !$including && $name != $page->getLocalName() && !$wgRequest->wasPosted() ) {
441 unset( $query['title'] );
442 $query = wfArrayToCGI( $query );
443 $title = $page->getTitle( $par );
444 $url = $title->getFullUrl( $query );
445 $wgOut->redirect( $url );
446 wfProfileOut( __METHOD__
);
450 if ( $including && !$page->includable() ) {
451 wfProfileOut( __METHOD__
);
453 } elseif ( !$including ) {
454 $wgTitle = $page->getTitle();
456 $page->including( $including );
458 // Execute special page
459 $profName = 'Special:' . $page->getName();
460 wfProfileIn( $profName );
461 $page->execute( $par );
462 wfProfileOut( $profName );
463 wfProfileOut( __METHOD__
);
468 * Just like executePath() except it returns the HTML instead of outputting it
469 * Returns false if there was no such special page, or a title object if it was
473 static function capturePath( &$title ) {
474 global $wgOut, $wgTitle;
476 $oldTitle = $wgTitle;
478 $wgOut = new OutputPage
;
480 $ret = SpecialPage
::executePath( $title, true );
481 if ( $ret === true ) {
482 $ret = $wgOut->getHTML();
484 $wgTitle = $oldTitle;
490 * Get the local name for a specified canonical name
493 * @param mixed $subpage Boolean false, or string
497 static function getLocalNameFor( $name, $subpage = false ) {
499 $aliases = $wgContLang->getSpecialPageAliases();
500 if ( isset( $aliases[$name][0] ) ) {
501 $name = $aliases[$name][0];
503 if ( $subpage !== false && !is_null( $subpage ) ) {
504 $name = "$name/$subpage";
510 * Get a localised Title object for a specified special page name
512 static function getTitleFor( $name, $subpage = false ) {
513 $name = self
::getLocalNameFor( $name, $subpage );
515 return Title
::makeTitle( NS_SPECIAL
, $name );
517 throw new MWException( "Invalid special page name \"$name\"" );
522 * Get a localised Title object for a page name with a possibly unvalidated subpage
524 static function getSafeTitleFor( $name, $subpage = false ) {
525 $name = self
::getLocalNameFor( $name, $subpage );
527 return Title
::makeTitleSafe( NS_SPECIAL
, $name );
534 * Get a title for a given alias
535 * @return Title or null if there is no such alias
537 static function getTitleForAlias( $alias ) {
538 $name = self
::resolveAlias( $alias );
540 return self
::getTitleFor( $name );
547 * Default constructor for special pages
548 * Derivative classes should call this from their constructor
549 * Note that if the user does not have the required level, an error message will
550 * be displayed by the default execute() method, without the global function ever
553 * If you override execute(), you can recover the default behaviour with userCanExecute()
554 * and displayRestrictionError()
556 * @param string $name Name of the special page, as seen in links and URLs
557 * @param string $restriction User right required, e.g. "block" or "delete"
558 * @param boolean $listed Whether the page is listed in Special:Specialpages
559 * @param string $function Function called by execute(). By default it is constructed from $name
560 * @param string $file File which is included by execute(). It is also constructed from $name by default
562 function SpecialPage( $name = '', $restriction = '', $listed = true, $function = false, $file = 'default', $includable = false ) {
563 $this->mName
= $name;
564 $this->mRestriction
= $restriction;
565 $this->mListed
= $listed;
566 $this->mIncludable
= $includable;
567 if ( $function == false ) {
568 $this->mFunction
= 'wfSpecial'.$name;
570 $this->mFunction
= $function;
572 if ( $file === 'default' ) {
573 $this->mFile
= dirname(__FILE__
) . "/Special{$name}.php";
575 $this->mFile
= $file;
584 function getName() { return $this->mName
; }
585 function getRestriction() { return $this->mRestriction
; }
586 function getFile() { return $this->mFile
; }
587 function isListed() { return $this->mListed
; }
591 * Accessor and mutator
593 function name( $x = NULL ) { return wfSetVar( $this->mName
, $x ); }
594 function restrictions( $x = NULL) { return wfSetVar( $this->mRestrictions
, $x ); }
595 function listed( $x = NULL) { return wfSetVar( $this->mListed
, $x ); }
596 function func( $x = NULL) { return wfSetVar( $this->mFunction
, $x ); }
597 function file( $x = NULL) { return wfSetVar( $this->mFile
, $x ); }
598 function includable( $x = NULL ) { return wfSetVar( $this->mIncludable
, $x ); }
599 function including( $x = NULL ) { return wfSetVar( $this->mIncluding
, $x ); }
603 * Get the localised name of the special page
605 function getLocalName() {
606 if ( !isset( $this->mLocalName
) ) {
607 $this->mLocalName
= self
::getLocalNameFor( $this->mName
);
609 return $this->mLocalName
;
613 * Checks if the given user (identified by an object) can execute this
614 * special page (as defined by $mRestriction)
616 function userCanExecute( &$user ) {
617 return $user->isAllowed( $this->mRestriction
);
621 * Output an error message telling the user what access level they have to have
623 function displayRestrictionError() {
625 $wgOut->permissionRequired( $this->mRestriction
);
629 * Sets headers - this should be called from the execute() method of all derived classes!
631 function setHeaders() {
633 $wgOut->setArticleRelated( false );
634 $wgOut->setRobotPolicy( "noindex,nofollow" );
635 $wgOut->setPageTitle( $this->getDescription() );
639 * Default execute method
640 * Checks user permissions, calls the function given in mFunction
642 * This may be overridden by subclasses.
644 function execute( $par ) {
649 if ( $this->userCanExecute( $wgUser ) ) {
650 $func = $this->mFunction
;
651 // only load file if the function does not exist
652 if(!is_callable($func) and $this->mFile
) {
653 require_once( $this->mFile
);
655 # FIXME: these hooks are broken for extensions and anything else that subclasses SpecialPage.
656 if ( wfRunHooks( 'SpecialPageExecuteBeforeHeader', array( &$this, &$par, &$func ) ) )
657 $this->outputHeader();
658 if ( ! wfRunHooks( 'SpecialPageExecuteBeforePage', array( &$this, &$par, &$func ) ) )
660 call_user_func( $func, $par, $this );
661 if ( ! wfRunHooks( 'SpecialPageExecuteAfterPage', array( &$this, &$par, &$func ) ) )
664 $this->displayRestrictionError();
668 function outputHeader() {
669 global $wgOut, $wgContLang;
671 $msg = $wgContLang->lc( $this->name() ) . '-summary';
672 $out = wfMsg( $msg );
673 if ( ! wfEmptyMsg( $msg, $out ) and $out !== '' and ! $this->including() )
674 $wgOut->addWikiText( $out );
678 # Returns the name that goes in the <h1> in the special page itself, and also the name that
679 # will be listed in Special:Specialpages
681 # Derived classes can override this, but usually it is easier to keep the default behaviour.
682 # Messages can be added at run-time, see MessageCache.php
683 function getDescription() {
684 return wfMsg( strtolower( $this->mName
) );
688 * Get a self-referential title object
690 function getTitle( $subpage = false) {
691 return self
::getTitleFor( $this->mName
, $subpage );
695 * Set whether this page is listed in Special:Specialpages, at run-time
697 function setListed( $listed ) {
698 return wfSetVar( $this->mListed
, $listed );
702 * If the special page is a redirect, then get the Title object it redirects to.
705 function getRedirect( $subpage ) {
710 * Return part of the request string for a special redirect page
711 * This allows passing, e.g. action=history to Special:Mypage, etc.
715 function getRedirectQuery() {
718 foreach( $this->mAllowedRedirectParams
as $arg ) {
719 if( $val = $wgRequest->getVal( $arg, false ) )
720 $params[] = $arg . '=' . $val;
723 return count( $params ) ?
implode( '&', $params ) : false;
728 * Shortcut to construct a special page which is unlisted by default
729 * @addtogroup SpecialPage
731 class UnlistedSpecialPage
extends SpecialPage
733 function UnlistedSpecialPage( $name, $restriction = '', $function = false, $file = 'default' ) {
734 SpecialPage
::SpecialPage( $name, $restriction, false, $function, $file );
739 * Shortcut to construct an includable special page
740 * @addtogroup SpecialPage
742 class IncludableSpecialPage
extends SpecialPage
744 function IncludableSpecialPage( $name, $restriction = '', $listed = true, $function = false, $file = 'default' ) {
745 SpecialPage
::SpecialPage( $name, $restriction, $listed, $function, $file, true );
750 * Shortcut to construct a special page alias.
751 * @addtogroup SpecialPage
753 class SpecialRedirectToSpecial
extends UnlistedSpecialPage
{
754 var $redirName, $redirSubpage;
756 function __construct( $name, $redirName, $redirSubpage = false, $redirectParams = array() ) {
757 parent
::__construct( $name );
758 $this->redirName
= $redirName;
759 $this->redirSubpage
= $redirSubpage;
760 $this->mAllowedRedirectParams
= $redirectParams;
763 function getRedirect( $subpage ) {
764 if ( $this->redirSubpage
=== false ) {
765 return SpecialPage
::getTitleFor( $this->redirName
, $subpage );
767 return SpecialPage
::getTitleFor( $this->redirName
, $this->redirSubpage
);
772 /** SpecialMypage, SpecialMytalk and SpecialMycontributions special pages
773 * are used to get user independant links pointing to the user page, talk
774 * page and list of contributions.
775 * This can let us cache a single copy of any generated content for all
780 * Shortcut to construct a special page pointing to current user user's page.
781 * @addtogroup SpecialPage
783 class SpecialMypage
extends UnlistedSpecialPage
{
784 function __construct() {
785 parent
::__construct( 'Mypage' );
786 $this->mAllowedRedirectParams
= array( 'action' , 'preload' , 'editintro' );
789 function getRedirect( $subpage ) {
791 if ( strval( $subpage ) !== '' ) {
792 return Title
::makeTitle( NS_USER
, $wgUser->getName() . '/' . $subpage );
794 return Title
::makeTitle( NS_USER
, $wgUser->getName() );
800 * Shortcut to construct a special page pointing to current user talk page.
801 * @addtogroup SpecialPage
803 class SpecialMytalk
extends UnlistedSpecialPage
{
804 function __construct() {
805 parent
::__construct( 'Mytalk' );
806 $this->mAllowedRedirectParams
= array( 'action' , 'preload' , 'editintro' );
809 function getRedirect( $subpage ) {
811 if ( strval( $subpage ) !== '' ) {
812 return Title
::makeTitle( NS_USER_TALK
, $wgUser->getName() . '/' . $subpage );
814 return Title
::makeTitle( NS_USER_TALK
, $wgUser->getName() );
820 * Shortcut to construct a special page pointing to current user contributions.
821 * @addtogroup SpecialPage
823 class SpecialMycontributions
extends UnlistedSpecialPage
{
824 function __construct() {
825 parent
::__construct( 'Mycontributions' );
828 function getRedirect( $subpage ) {
830 return SpecialPage
::getTitleFor( 'Contributions', $wgUser->getName() );