MediaWiki master
SpecialMylog.php
Go to the documentation of this file.
1<?php
22
23use LogPage;
27
34 public function __construct() {
35 parent::__construct( 'Mylog' );
36 $this->mAllowedRedirectParams = [ 'type', 'subtype', 'page', 'pattern',
37 'tagfilter', 'tagInvert', 'offset', 'dir', 'offender',
38 'year', 'month', 'day' ];
39 }
40
45 public function getRedirect( $subpage ) {
46 if ( $subpage === null || $subpage === '' ) {
47 return SpecialPage::getSafeTitleFor( 'Log', $this->getUser()->getName() );
48 }
49 return SpecialPage::getSafeTitleFor( 'Log', $subpage . '/' . $this->getUser()->getName() );
50 }
51
57 public function personallyIdentifiableTarget() {
58 return true;
59 }
60
66 public function getSubpagesForPrefixSearch() {
67 $subpages = LogPage::validTypes();
68 $subpages[] = 'all';
69 sort( $subpages );
70 return $subpages;
71 }
72}
73
78class_alias( SpecialMylog::class, 'SpecialMylog' );
Class to simplify the use of log pages.
Definition LogPage.php:44
Shortcut to construct a special page alias.
Parent class for all special pages.
getUser()
Shortcut to get the User executing this instance.
static getSafeTitleFor( $name, $subpage=false)
Get a localised Title object for a page name with a possibly unvalidated subpage.
getName()
Get the canonical, unlocalized name of this special page without namespace.
Redirect to Special:Log for the current user's name or IP.
getSubpagesForPrefixSearch()
Return an array of subpages that this special page will accept.
personallyIdentifiableTarget()
Target identifies a specific User.
Represents a title within MediaWiki.
Definition Title.php:79