(bug 35565) Special:Log/patrol doesn't indicate whether patrolling was automatic
[mediawiki.git] / includes / specials / SpecialLonelypages.php
blob0c86163709b28b9167a463cd6047961184a48343
1 <?php
2 /**
3 * Implements Special:Lonelypaages
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 * http://www.gnu.org/copyleft/gpl.html
20 * @file
21 * @ingroup SpecialPage
24 /**
25 * A special page looking for articles with no article linking to them,
26 * thus being lonely.
28 * @ingroup SpecialPage
30 class LonelyPagesPage extends PageQueryPage {
32 function __construct( $name = 'Lonelypages' ) {
33 parent::__construct( $name );
36 function getPageHeader() {
37 return $this->msg( 'lonelypagestext' )->parseAsBlock();
40 function sortDescending() {
41 return false;
44 function isExpensive() {
45 return true;
47 function isSyndicated() { return false; }
49 function getQueryInfo() {
50 return array (
51 'tables' => array ( 'page', 'pagelinks',
52 'templatelinks' ),
53 'fields' => array ( 'page_namespace AS namespace',
54 'page_title AS title',
55 'page_title AS value' ),
56 'conds' => array ( 'pl_namespace IS NULL',
57 'page_namespace' => MWNamespace::getContentNamespaces(),
58 'page_is_redirect' => 0,
59 'tl_namespace IS NULL' ),
60 'join_conds' => array (
61 'pagelinks' => array (
62 'LEFT JOIN', array (
63 'pl_namespace = page_namespace',
64 'pl_title = page_title' ) ),
65 'templatelinks' => array (
66 'LEFT JOIN', array (
67 'tl_namespace = page_namespace',
68 'tl_title = page_title' ) ) )
72 function getOrderFields() {
73 // For some crazy reason ordering by a constant
74 // causes a filesort in MySQL 5
75 if( count( MWNamespace::getContentNamespaces() ) > 1 ) {
76 return array( 'page_namespace', 'page_title' );
77 } else {
78 return array( 'page_title' );