MediaWiki  1.30.0
SpecialMyRedirectPages.php
Go to the documentation of this file.
1 <?php
33  public function __construct() {
34  parent::__construct( 'Mypage' );
35  }
36 
41  public function getRedirect( $subpage ) {
42  if ( $subpage === null || $subpage === '' ) {
43  return Title::makeTitle( NS_USER, $this->getUser()->getName() );
44  }
45 
46  return Title::makeTitle( NS_USER, $this->getUser()->getName() . '/' . $subpage );
47  }
48 
55  public function personallyIdentifiableTarget() {
56  return true;
57  }
58 }
59 
66  public function __construct() {
67  parent::__construct( 'Mytalk' );
68  }
69 
74  public function getRedirect( $subpage ) {
75  if ( $subpage === null || $subpage === '' ) {
76  return Title::makeTitle( NS_USER_TALK, $this->getUser()->getName() );
77  }
78 
79  return Title::makeTitle( NS_USER_TALK, $this->getUser()->getName() . '/' . $subpage );
80  }
81 
88  public function personallyIdentifiableTarget() {
89  return true;
90  }
91 }
92 
99  public function __construct() {
100  parent::__construct( 'Mycontributions' );
101  $this->mAllowedRedirectParams = [ 'limit', 'namespace', 'tagfilter',
102  'offset', 'dir', 'year', 'month', 'feed', 'deletedOnly',
103  'nsInvert', 'associated', 'newOnly', 'topOnly' ];
104  }
105 
110  public function getRedirect( $subpage ) {
111  return SpecialPage::getTitleFor( 'Contributions', $this->getUser()->getName() );
112  }
113 
120  public function personallyIdentifiableTarget() {
121  return true;
122  }
123 }
124 
131  public function __construct() {
132  parent::__construct( 'Myuploads' );
133  $this->mAllowedRedirectParams = [ 'limit', 'ilshowall', 'ilsearch' ];
134  }
135 
140  public function getRedirect( $subpage ) {
141  return SpecialPage::getTitleFor( 'Listfiles', $this->getUser()->getName() );
142  }
143 
150  public function personallyIdentifiableTarget() {
151  return true;
152  }
153 }
154 
161  public function __construct() {
162  parent::__construct( 'AllMyUploads' );
163  $this->mAllowedRedirectParams = [ 'limit', 'ilsearch' ];
164  }
165 
170  public function getRedirect( $subpage ) {
171  $this->mAddedRedirectParams['ilshowall'] = 1;
172 
173  return SpecialPage::getTitleFor( 'Listfiles', $this->getUser()->getName() );
174  }
175 
182  public function personallyIdentifiableTarget() {
183  return true;
184  }
185 }
SpecialMycontributions\__construct
__construct()
Definition: SpecialMyRedirectPages.php:99
SpecialMytalk\personallyIdentifiableTarget
personallyIdentifiableTarget()
Target identifies a specific User.
Definition: SpecialMyRedirectPages.php:88
SpecialAllMyUploads\__construct
__construct()
Definition: SpecialMyRedirectPages.php:161
SpecialAllMyUploads
Special page pointing to current user's uploaded files (including old versions).
Definition: SpecialMyRedirectPages.php:160
SpecialMypage
Special page pointing to current user's user page.
Definition: SpecialMyRedirectPages.php:32
SpecialMypage\getRedirect
getRedirect( $subpage)
Definition: SpecialMyRedirectPages.php:41
SpecialMycontributions
Special page pointing to current user's contributions.
Definition: SpecialMyRedirectPages.php:98
SpecialMyuploads\personallyIdentifiableTarget
personallyIdentifiableTarget()
Target identifies a specific User.
Definition: SpecialMyRedirectPages.php:150
SpecialPage\getTitleFor
static getTitleFor( $name, $subpage=false, $fragment='')
Get a localised Title object for a specified special page name If you don't need a full Title object,...
Definition: SpecialPage.php:82
SpecialAllMyUploads\personallyIdentifiableTarget
personallyIdentifiableTarget()
Target identifies a specific User.
Definition: SpecialMyRedirectPages.php:182
SpecialPage\getName
getName()
Get the name of this Special Page.
Definition: SpecialPage.php:150
RedirectSpecialPage
Shortcut to construct a special page alias.
Definition: RedirectSpecialPage.php:29
php
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
Definition: injection.txt:35
SpecialMyuploads\getRedirect
getRedirect( $subpage)
Definition: SpecialMyRedirectPages.php:140
SpecialMytalk\__construct
__construct()
Definition: SpecialMyRedirectPages.php:66
SpecialMycontributions\personallyIdentifiableTarget
personallyIdentifiableTarget()
Target identifies a specific User.
Definition: SpecialMyRedirectPages.php:120
SpecialMycontributions\getRedirect
getRedirect( $subpage)
Definition: SpecialMyRedirectPages.php:110
SpecialPage\getUser
getUser()
Shortcut to get the User executing this instance.
Definition: SpecialPage.php:685
Title\makeTitle
static makeTitle( $ns, $title, $fragment='', $interwiki='')
Create a new Title from a namespace index and a DB key.
Definition: Title.php:529
SpecialMypage\personallyIdentifiableTarget
personallyIdentifiableTarget()
Target identifies a specific User.
Definition: SpecialMyRedirectPages.php:55
RedirectSpecialArticle
Superclass for any RedirectSpecialPage which redirects the user to a particular article (as opposed t...
Definition: RedirectSpecialPage.php:213
NS_USER_TALK
const NS_USER_TALK
Definition: Defines.php:68
SpecialAllMyUploads\getRedirect
getRedirect( $subpage)
Definition: SpecialMyRedirectPages.php:170
SpecialMypage\__construct
__construct()
Definition: SpecialMyRedirectPages.php:33
SpecialMytalk\getRedirect
getRedirect( $subpage)
Definition: SpecialMyRedirectPages.php:74
SpecialMytalk
Special page pointing to current user's talk page.
Definition: SpecialMyRedirectPages.php:65
NS_USER
const NS_USER
Definition: Defines.php:67
SpecialMyuploads
Special page pointing to current user's uploaded files.
Definition: SpecialMyRedirectPages.php:130
SpecialMyuploads\__construct
__construct()
Definition: SpecialMyRedirectPages.php:131