MediaWiki REL1_33
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->getOutput()->allowClickjacking();
41
42 $from = $this->getRequest()->getText( 'from', $par );
43
44 $cap = new CategoryPager(
45 $this->getContext(),
46 $from,
47 $this->getLinkRenderer()
48 );
49 $cap->doQuery();
50
51 $this->getOutput()->addHTML(
52 Html::openElement( 'div', [ 'class' => 'mw-spcontent' ] ) .
53 $this->msg( 'categoriespagetext', $cap->getNumRows() )->parseAsBlock() .
54 $cap->getStartForm( $from ) .
55 $cap->getNavigationBar() .
56 '<ul>' . $cap->getBody() . '</ul>' .
57 $cap->getNavigationBar() .
58 Html::closeElement( 'div' )
59 );
60 }
61
62 protected function getGroupName() {
63 return 'pages';
64 }
65}
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)
Wrapper around wfMessage that sets the current context.
getRequest()
Get the WebRequest being used for this instance.