Implement extension registration from an extension.json file
[mediawiki.git] / includes / specials / SpecialMyRedirectPages.php
blob9b8d52bb32cb68af67e0a07e51f8224e724144db
1 <?php
2 /**
3 * Special pages that are used to get user independent links pointing to
4 * current user's pages (user page, talk page, contributions, etc.).
5 * This can let us cache a single copy of some generated content for all
6 * users or be linked in wikitext help pages.
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License along
19 * with this program; if not, write to the Free Software Foundation, Inc.,
20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 * http://www.gnu.org/copyleft/gpl.html
23 * @file
24 * @ingroup SpecialPage
27 /**
28 * Special page pointing to current user's user page.
30 * @ingroup SpecialPage
32 class SpecialMypage extends RedirectSpecialArticle {
33 function __construct() {
34 parent::__construct( 'Mypage' );
37 function getRedirect( $subpage ) {
38 if ( strval( $subpage ) !== '' ) {
39 return Title::makeTitle( NS_USER, $this->getUser()->getName() . '/' . $subpage );
40 } else {
41 return Title::makeTitle( NS_USER, $this->getUser()->getName() );
46 /**
47 * Special page pointing to current user's talk page.
49 * @ingroup SpecialPage
51 class SpecialMytalk extends RedirectSpecialArticle {
52 function __construct() {
53 parent::__construct( 'Mytalk' );
56 function getRedirect( $subpage ) {
57 if ( strval( $subpage ) !== '' ) {
58 return Title::makeTitle( NS_USER_TALK, $this->getUser()->getName() . '/' . $subpage );
59 } else {
60 return Title::makeTitle( NS_USER_TALK, $this->getUser()->getName() );
65 /**
66 * Special page pointing to current user's contributions.
68 * @ingroup SpecialPage
70 class SpecialMycontributions extends RedirectSpecialPage {
71 function __construct() {
72 parent::__construct( 'Mycontributions' );
73 $this->mAllowedRedirectParams = array( 'limit', 'namespace', 'tagfilter',
74 'offset', 'dir', 'year', 'month', 'feed' );
77 function getRedirect( $subpage ) {
78 return SpecialPage::getTitleFor( 'Contributions', $this->getUser()->getName() );
82 /**
83 * Special page pointing to current user's uploaded files.
85 * @ingroup SpecialPage
87 class SpecialMyuploads extends RedirectSpecialPage {
88 function __construct() {
89 parent::__construct( 'Myuploads' );
90 $this->mAllowedRedirectParams = array( 'limit', 'ilshowall', 'ilsearch' );
93 function getRedirect( $subpage ) {
94 return SpecialPage::getTitleFor( 'Listfiles', $this->getUser()->getName() );
98 /**
99 * Special page pointing to current user's uploaded files (including old versions).
101 * @ingroup SpecialPage
103 class SpecialAllMyUploads extends RedirectSpecialPage {
104 function __construct() {
105 parent::__construct( 'AllMyUploads' );
106 $this->mAllowedRedirectParams = array( 'limit', 'ilsearch' );
109 function getRedirect( $subpage ) {
110 $this->mAddedRedirectParams['ilshowall'] = 1;
112 return SpecialPage::getTitleFor( 'Listfiles', $this->getUser()->getName() );