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
23 * @ingroup SpecialPage
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() {
39 'tables' => array( 'categorylinks', 'page' ),
40 'fields' => array( 'namespace' => NS_CATEGORY
,
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
) ) )
53 * @param object $result Result row
56 function formatResult( $skin, $result ) {
59 $nt = Title
::makeTitle( $result->namespace, $result->title
);
60 $text = htmlspecialchars( $wgContLang->convert( $nt->getText() ) );
62 $plink = $this->isCached() ?
63 Linker
::link( $nt, $text ) :
72 $nlinks = $this->msg( 'nmembers' )->numParams( $result->value
)->escaped();
73 return $this->getLanguage()->specialList( $plink, $nlinks );
76 protected function getGroupName() {