Merge "Add ss_active_users in SiteStats::isSane"
[mediawiki.git] / includes / specials / SpecialWantedcategories.php
blobd2ffdb94028fa93d1844a6ef09a5936f3c42f839
1 <?php
2 /**
3 * Implements Special:Wantedcategories
5 * Copyright © 2005 Ævar Arnfjörð Bjarmason
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 * http://www.gnu.org/copyleft/gpl.html
22 * @file
23 * @ingroup SpecialPage
26 /**
27 * A querypage to list the most wanted categories - implements Special:Wantedcategories
29 * @ingroup SpecialPage
31 class WantedCategoriesPage extends WantedQueryPage {
33 function __construct( $name = 'Wantedcategories' ) {
34 parent::__construct( $name );
37 function getQueryInfo() {
38 return array(
39 'tables' => array( 'categorylinks', 'page' ),
40 'fields' => array( 'namespace' => NS_CATEGORY,
41 'title' => 'cl_to',
42 'value' => 'COUNT(*)' ),
43 'conds' => array( 'page_title IS NULL' ),
44 'options' => array( 'GROUP BY' => 'cl_to' ),
45 'join_conds' => array( 'page' => array( 'LEFT JOIN',
46 array( 'page_title = cl_to',
47 'page_namespace' => NS_CATEGORY ) ) )
51 /**
52 * @param Skin $skin
53 * @param object $result Result row
54 * @return string
56 function formatResult( $skin, $result ) {
57 global $wgContLang;
59 $nt = Title::makeTitle( $result->namespace, $result->title );
60 $text = htmlspecialchars( $wgContLang->convert( $nt->getText() ) );
62 $plink = $this->isCached() ?
63 Linker::link( $nt, $text ) :
64 Linker::link(
65 $nt,
66 $text,
67 array(),
68 array(),
69 array( 'broken' )
72 $nlinks = $this->msg( 'nmembers' )->numParams( $result->value )->escaped();
73 return $this->getLanguage()->specialList( $plink, $nlinks );
76 protected function getGroupName() {
77 return 'maintenance';