MediaWiki  master
SpecialCategories.php
Go to the documentation of this file.
1 <?php
26 
31 
34 
36  private $loadBalancer;
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 }
SpecialCategories\__construct
__construct(LinkBatchFactory $linkBatchFactory, ILoadBalancer $loadBalancer)
Definition: SpecialCategories.php:42
SpecialPage\msg
msg( $key,... $params)
Wrapper around wfMessage that sets the current context.
Definition: SpecialPage.php:827
SpecialPage\getOutput
getOutput()
Get the OutputPage being used for this instance.
Definition: SpecialPage.php:743
SpecialCategories\execute
execute( $par)
Default execute method Checks user permissions.
Definition: SpecialCategories.php:51
SpecialCategories
Definition: SpecialCategories.php:30
Html\closeElement
static closeElement( $element)
Returns "</$element>".
Definition: Html.php:315
SpecialPage\addHelpLink
addHelpLink( $to, $overrideBaseUrl=false)
Adds help link with an icon via page indicators.
Definition: SpecialPage.php:863
SpecialCategories\getGroupName
getGroupName()
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-gro...
Definition: SpecialCategories.php:79
MediaWiki\Cache\LinkBatchFactory
Definition: LinkBatchFactory.php:38
SpecialPage\setHeaders
setHeaders()
Sets headers - this should be called from the execute() method of all derived classes!...
Definition: SpecialPage.php:571
SpecialCategories\$linkBatchFactory
LinkBatchFactory $linkBatchFactory
Definition: SpecialCategories.php:33
SpecialPage\getContext
getContext()
Gets the context this SpecialPage is executed in.
Definition: SpecialPage.php:717
CategoryPager
Definition: CategoryPager.php:29
SpecialCategories\$loadBalancer
ILoadBalancer $loadBalancer
Definition: SpecialCategories.php:36
SpecialPage
Parent class for all special pages.
Definition: SpecialPage.php:41
SpecialPage\getRequest
getRequest()
Get the WebRequest being used for this instance.
Definition: SpecialPage.php:733
SpecialPage\getLinkRenderer
getLinkRenderer()
Definition: SpecialPage.php:944
Html\openElement
static openElement( $element, $attribs=[])
Identical to rawElement(), but has no third parameter and omits the end tag (and the self-closing '/'...
Definition: Html.php:251
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:662
Wikimedia\Rdbms\ILoadBalancer
Database cluster connection, tracking, load balancing, and transaction manager interface.
Definition: ILoadBalancer.php:81