MediaWiki  1.34.0
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 }
SpecialPage\msg
msg( $key,... $params)
Wrapper around wfMessage that sets the current context.
Definition: SpecialPage.php:792
SpecialPage\getOutput
getOutput()
Get the OutputPage being used for this instance.
Definition: SpecialPage.php:719
SpecialCategories\execute
execute( $par)
Default execute method Checks user permissions.
Definition: SpecialCategories.php:37
SpecialCategories
Definition: SpecialCategories.php:27
SpecialPage\addHelpLink
addHelpLink( $to, $overrideBaseUrl=false)
Adds help link with an icon via page indicators.
Definition: SpecialPage.php:828
SpecialCategories\getGroupName
getGroupName()
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-gro...
Definition: SpecialCategories.php:63
SpecialCategories\__construct
__construct()
Definition: SpecialCategories.php:29
SpecialPage\setHeaders
setHeaders()
Sets headers - this should be called from the execute() method of all derived classes!
Definition: SpecialPage.php:537
SpecialPage\getContext
getContext()
Gets the context this SpecialPage is executed in.
Definition: SpecialPage.php:692
CategoryPager
Definition: CategoryPager.php:26
SpecialPage
Parent class for all special pages.
Definition: SpecialPage.php:37
SpecialPage\getRequest
getRequest()
Get the WebRequest being used for this instance.
Definition: SpecialPage.php:709
SpecialPage\getLinkRenderer
getLinkRenderer()
Definition: SpecialPage.php:904
SpecialPage\outputHeader
outputHeader( $summaryMessageKey='')
Outputs a summary message on top of special pages Per default the message key is the canonical name o...
Definition: SpecialPage.php:639