diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2011-12-03 13:29:22 +0100 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2011-12-03 13:29:22 +0100 |
commit | ca32f08966f1b51fcb19460f0996bb0c4048e6fe (patch) | |
tree | ec04cc15b867bc21eedca904cea9af0254531a11 /includes/specials/SpecialDeadendpages.php | |
parent | a22fbfc60f36f5f7ee10d5ae6fe347340c2ee67c (diff) |
Update to MediaWiki 1.18.0
* also update ArchLinux skin to chagnes in MonoBook
* Use only css to hide our menu bar when printing
Diffstat (limited to 'includes/specials/SpecialDeadendpages.php')
-rw-r--r-- | includes/specials/SpecialDeadendpages.php | 58 |
1 files changed, 31 insertions, 27 deletions
diff --git a/includes/specials/SpecialDeadendpages.php b/includes/specials/SpecialDeadendpages.php index dfa053aa..f8ef4d44 100644 --- a/includes/specials/SpecialDeadendpages.php +++ b/includes/specials/SpecialDeadendpages.php @@ -28,8 +28,8 @@ */ class DeadendPagesPage extends PageQueryPage { - function getName( ) { - return "Deadendpages"; + function __construct( $name = 'Deadendpages' ) { + parent::__construct( $name ); } function getPageHeader() { @@ -41,11 +41,13 @@ class DeadendPagesPage extends PageQueryPage { * * @return true */ - function isExpensive( ) { - return 1; + function isExpensive() { + return true; } - function isSyndicated() { return false; } + function isSyndicated() { + return false; + } /** * @return false @@ -54,28 +56,30 @@ class DeadendPagesPage extends PageQueryPage { return false; } - /** - * @return string an sqlquery - */ - function getSQL() { - $dbr = wfGetDB( DB_SLAVE ); - list( $page, $pagelinks ) = $dbr->tableNamesN( 'page', 'pagelinks' ); - return "SELECT 'Deadendpages' as type, page_namespace AS namespace, page_title as title, page_title AS value " . - "FROM $page LEFT JOIN $pagelinks ON page_id = pl_from " . - "WHERE pl_from IS NULL " . - "AND page_namespace = 0 " . - "AND page_is_redirect = 0"; + function getQueryInfo() { + return array( + 'tables' => array( 'page', 'pagelinks' ), + 'fields' => array( 'page_namespace AS namespace', + 'page_title AS title', + 'page_title AS value' + ), + 'conds' => array( 'pl_from IS NULL', + 'page_namespace' => MWNamespace::getContentNamespaces(), + 'page_is_redirect' => 0 + ), + 'join_conds' => array( 'pagelinks' => array( 'LEFT JOIN', array( + 'page_id=pl_from' + ) ) ) + ); } -} -/** - * Constructor - */ -function wfSpecialDeadendpages() { - - list( $limit, $offset ) = wfCheckLimits(); - - $depp = new DeadendPagesPage(); - - return $depp->doQuery( $offset, $limit ); + function getOrderFields() { + // For some crazy reason ordering by a constant + // causes a filesort + if( count( MWNamespace::getContentNamespaces() ) > 1 ) { + return array( 'page_namespace', 'page_title' ); + } else { + return array( 'page_title' ); + } + } } |