MediaWiki REL1_34
SpecialCategories.php
Go to the documentation of this file.
1<?php
28
29 public function __construct() {
30 parent::__construct( 'Categories' );
31
32 // Since we don't control the constructor parameters, we can't inject services that way.
33 // Instead, we initialize services in the execute() method, and allow them to be overridden
34 // using the initServices() method.
35 }
36
37 public function execute( $par ) {
38 $this->setHeaders();
39 $this->outputHeader();
40 $this->addHelpLink( 'Help:Categories' );
41 $this->getOutput()->allowClickjacking();
42
43 $from = $this->getRequest()->getText( 'from', $par );
44
45 $cap = new CategoryPager(
46 $this->getContext(),
47 $from,
48 $this->getLinkRenderer()
49 );
50 $cap->doQuery();
51
52 $this->getOutput()->addHTML(
53 Html::openElement( 'div', [ 'class' => 'mw-spcontent' ] ) .
54 $this->msg( 'categoriespagetext', $cap->getNumRows() )->parseAsBlock() .
55 $cap->getStartForm( $from ) .
56 $cap->getNavigationBar() .
57 '<ul>' . $cap->getBody() . '</ul>' .
58 $cap->getNavigationBar() .
59 Html::closeElement( 'div' )
60 );
61 }
62
63 protected function getGroupName() {
64 return 'pages';
65 }
66}
getGroupName()
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-gro...
execute( $par)
Default execute method Checks user permissions.
Parent class for all special pages.
outputHeader( $summaryMessageKey='')
Outputs a summary message on top of special pages Per default the message key is the canonical name o...
setHeaders()
Sets headers - this should be called from the execute() method of all derived classes!
getOutput()
Get the OutputPage being used for this instance.
getContext()
Gets the context this SpecialPage is executed in.
msg( $key,... $params)
Wrapper around wfMessage that sets the current context.
getRequest()
Get the WebRequest being used for this instance.
addHelpLink( $to, $overrideBaseUrl=false)
Adds help link with an icon via page indicators.