MediaWiki REL1_37
SpecialCategories.php
Go to the documentation of this file.
1<?php
26
31
34
37
42 public function __construct(
45 ) {
46 parent::__construct( 'Categories' );
47 $this->linkBatchFactory = $linkBatchFactory;
48 $this->loadBalancer = $loadBalancer;
49 }
50
51 public function execute( $par ) {
52 $this->setHeaders();
53 $this->outputHeader();
54 $this->addHelpLink( 'Help:Categories' );
55 $this->getOutput()->allowClickjacking();
56
57 $from = $this->getRequest()->getText( 'from', $par ?? '' );
58
59 $cap = new CategoryPager(
60 $this->getContext(),
61 $from,
62 $this->getLinkRenderer(),
63 $this->linkBatchFactory,
64 $this->loadBalancer
65 );
66 $cap->doQuery();
67
68 $this->getOutput()->addHTML(
69 Html::openElement( 'div', [ 'class' => 'mw-spcontent' ] ) .
70 $this->msg( 'categoriespagetext', $cap->getNumRows() )->parseAsBlock() .
71 $cap->getStartForm( $from ) .
72 $cap->getNavigationBar() .
73 '<ul>' . $cap->getBody() . '</ul>' .
74 $cap->getNavigationBar() .
75 Html::closeElement( 'div' )
76 );
77 }
78
79 protected function getGroupName() {
80 return 'pages';
81 }
82}
LinkBatchFactory $linkBatchFactory
__construct(LinkBatchFactory $linkBatchFactory, ILoadBalancer $loadBalancer)
ILoadBalancer $loadBalancer
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.
Database cluster connection, tracking, load balancing, and transaction manager interface.