MediaWiki REL1_40
SpecialCategories.php
Go to the documentation of this file.
1<?php
27
32
34 private $linkBatchFactory;
35
37 private $loadBalancer;
38
43 public function __construct(
44 LinkBatchFactory $linkBatchFactory,
45 ILoadBalancer $loadBalancer
46 ) {
47 parent::__construct( 'Categories' );
48 $this->linkBatchFactory = $linkBatchFactory;
49 $this->loadBalancer = $loadBalancer;
50 }
51
52 public function execute( $par ) {
53 $this->setHeaders();
54 $this->outputHeader();
55 $this->addHelpLink( 'Help:Categories' );
56 $this->getOutput()->setPreventClickjacking( false );
57
58 $from = $this->getRequest()->getText( 'from', $par ?? '' );
59
60 $cap = new CategoryPager(
61 $this->getContext(),
62 $this->linkBatchFactory,
63 $this->getLinkRenderer(),
64 $this->loadBalancer,
65 $from
66 );
67 $cap->doQuery();
68
69 $this->getOutput()->addHTML(
70 Html::openElement( 'div', [ 'class' => 'mw-spcontent' ] ) .
71 $this->msg( 'categoriespagetext', $cap->getNumRows() )->parseAsBlock() .
72 $cap->getStartForm( $from ) .
73 $cap->getNavigationBar() .
74 '<ul>' . $cap->getBody() . '</ul>' .
75 $cap->getNavigationBar() .
76 Html::closeElement( 'div' )
77 );
78 }
79
80 protected function getGroupName() {
81 return 'pages';
82 }
83}
This class is a collection of static functions that serve two purposes:
Definition Html.php:55
__construct(LinkBatchFactory $linkBatchFactory, 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.
This class is a delegate to ILBFactory for a given database cluster.