From ca32f08966f1b51fcb19460f0996bb0c4048e6fe Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sat, 3 Dec 2011 13:29:22 +0100 Subject: Update to MediaWiki 1.18.0 * also update ArchLinux skin to chagnes in MonoBook * Use only css to hide our menu bar when printing --- includes/specials/SpecialMostlinkedtemplates.php | 50 +++++++----------------- 1 file changed, 14 insertions(+), 36 deletions(-) (limited to 'includes/specials/SpecialMostlinkedtemplates.php') diff --git a/includes/specials/SpecialMostlinkedtemplates.php b/includes/specials/SpecialMostlinkedtemplates.php index 822d6bc9..69771925 100644 --- a/includes/specials/SpecialMostlinkedtemplates.php +++ b/includes/specials/SpecialMostlinkedtemplates.php @@ -21,22 +21,17 @@ * @ingroup SpecialPage * @author Rob Church */ - + /** * Special page lists templates with a large number of * transclusion links, i.e. "most used" templates * * @ingroup SpecialPage */ -class SpecialMostlinkedtemplates extends QueryPage { +class MostlinkedTemplatesPage extends QueryPage { - /** - * Name of the report - * - * @return String - */ - public function getName() { - return 'Mostlinkedtemplates'; + function __construct( $name = 'Mostlinkedtemplates' ) { + parent::__construct( $name ); } /** @@ -66,22 +61,15 @@ class SpecialMostlinkedtemplates extends QueryPage { return true; } - /** - * Generate SQL for the report - * - * @return String - */ - public function getSql() { - $dbr = wfGetDB( DB_SLAVE ); - $templatelinks = $dbr->tableName( 'templatelinks' ); - $name = $dbr->addQuotes( $this->getName() ); - return "SELECT {$name} AS type, - " . NS_TEMPLATE . " AS namespace, - tl_title AS title, - COUNT(*) AS value - FROM {$templatelinks} - WHERE tl_namespace = " . NS_TEMPLATE . " - GROUP BY tl_title"; + public function getQueryInfo() { + return array ( + 'tables' => array ( 'templatelinks' ), + 'fields' => array ( 'tl_namespace AS namespace', + 'tl_title AS title', + 'COUNT(*) AS value' ), + 'conds' => array ( 'tl_namespace' => NS_TEMPLATE ), + 'options' => array( 'GROUP BY' => 'tl_namespace, tl_title' ) + ); } /** @@ -108,7 +96,7 @@ class SpecialMostlinkedtemplates extends QueryPage { * @return String */ public function formatResult( $skin, $result ) { - $title = Title::makeTitleSafe( $result->namespace, $result->title ); + $title = Title::makeTitle( $result->namespace, $result->title ); return wfSpecialList( $skin->link( $title ), @@ -133,13 +121,3 @@ class SpecialMostlinkedtemplates extends QueryPage { } } -/** - * Execution function - * - * @param $par Mixed: parameters passed to the page - */ -function wfSpecialMostlinkedtemplates( $par = false ) { - list( $limit, $offset ) = wfCheckLimits(); - $mlt = new SpecialMostlinkedtemplates(); - $mlt->doQuery( $offset, $limit ); -} -- cgit v1.2.3-54-g00ecf