MediaWiki master
SpecialMylog.php
Go to the documentation of this file.
1<?php
23
24use LogPage;
28
35 public function __construct() {
36 parent::__construct( 'Mylog' );
37 $this->mAllowedRedirectParams = [ 'type', 'subtype', 'page', 'pattern',
38 'tagfilter', 'tagInvert', 'offset', 'dir', 'offender',
39 'year', 'month', 'day' ];
40 }
41
46 public function getRedirect( $subpage ) {
47 if ( $subpage === null || $subpage === '' ) {
48 return SpecialPage::getSafeTitleFor( 'Log', $this->getUser()->getName() );
49 }
50 return SpecialPage::getSafeTitleFor( 'Log', $subpage . '/' . $this->getUser()->getName() );
51 }
52
58 public function personallyIdentifiableTarget() {
59 return true;
60 }
61
67 public function getSubpagesForPrefixSearch() {
68 $subpages = LogPage::validTypes();
69 $subpages[] = 'all';
70 sort( $subpages );
71 return $subpages;
72 }
73}
74
79class_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.
Special page pointing to current user's Special:Log.
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:78