Localisation updates from https://translatewiki.net.
[mediawiki.git] / includes / specials / SpecialCategories.php
blob246fb561b1b67c02e5a14449aff50f7cdddc2530
1 <?php
2 /**
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2 of the License, or
6 * (at your option) any later version.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License along
14 * with this program; if not, write to the Free Software Foundation, Inc.,
15 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 * http://www.gnu.org/copyleft/gpl.html
18 * @file
21 namespace MediaWiki\Specials;
23 use MediaWiki\Cache\LinkBatchFactory;
24 use MediaWiki\Html\Html;
25 use MediaWiki\Pager\CategoryPager;
26 use MediaWiki\SpecialPage\SpecialPage;
27 use Wikimedia\Rdbms\IConnectionProvider;
29 /**
30 * Implements Special:Categories
32 * @ingroup SpecialPage
34 class SpecialCategories extends SpecialPage {
36 private LinkBatchFactory $linkBatchFactory;
37 private IConnectionProvider $dbProvider;
39 /**
40 * @param LinkBatchFactory $linkBatchFactory
41 * @param IConnectionProvider $dbProvider
43 public function __construct(
44 LinkBatchFactory $linkBatchFactory,
45 IConnectionProvider $dbProvider
46 ) {
47 parent::__construct( 'Categories' );
48 $this->linkBatchFactory = $linkBatchFactory;
49 $this->dbProvider = $dbProvider;
52 public function execute( $par ) {
53 $this->setHeaders();
54 $this->outputHeader();
55 $this->addHelpLink( 'Help:Categories' );
56 $this->getOutput()->getMetadata()->setPreventClickjacking( false );
58 $from = $this->getRequest()->getText( 'from', $par ?? '' );
60 $cap = new CategoryPager(
61 $this->getContext(),
62 $this->linkBatchFactory,
63 $this->getLinkRenderer(),
64 $this->dbProvider,
65 $from
67 $cap->doQuery();
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' )
80 protected function getGroupName() {
81 return 'pages';
85 /** @deprecated class alias since 1.41 */
86 class_alias( SpecialCategories::class, 'SpecialCategories' );