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/api/ApiQueryAllCategories.php | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) (limited to 'includes/api/ApiQueryAllCategories.php') diff --git a/includes/api/ApiQueryAllCategories.php b/includes/api/ApiQueryAllCategories.php index c1473252..c7f4b0aa 100644 --- a/includes/api/ApiQueryAllCategories.php +++ b/includes/api/ApiQueryAllCategories.php @@ -1,10 +1,10 @@ .@home.nl + * Copyright © 2007 Roan Kattouw .@gmail.com * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -53,6 +53,10 @@ class ApiQueryAllCategories extends ApiQueryGeneratorBase { $this->run( $resultPageSet ); } + /** + * @param $resultPageSet ApiPageSet + * @return void + */ private function run( $resultPageSet = null ) { $db = $this->getDB(); $params = $this->extractRequestParams(); @@ -65,6 +69,10 @@ class ApiQueryAllCategories extends ApiQueryGeneratorBase { $to = ( is_null( $params['to'] ) ? null : $this->titlePartToKey( $params['to'] ) ); $this->addWhereRange( 'cat_title', $dir, $from, $to ); + $min = $params['min']; + $max = $params['max']; + $this->addWhereRange( 'cat_pages', $dir, $min, $max ); + if ( isset( $params['prefix'] ) ) { $this->addWhere( 'cat_title' . $db->buildLike( $this->titlePartToKey( $params['prefix'] ), $db->anyString() ) ); } @@ -144,6 +152,14 @@ class ApiQueryAllCategories extends ApiQueryGeneratorBase { 'descending' ), ), + 'min' => array( + ApiBase::PARAM_DFLT => null, + ApiBase::PARAM_TYPE => 'integer' + ), + 'max' => array( + ApiBase::PARAM_DFLT => null, + ApiBase::PARAM_TYPE => 'integer' + ), 'limit' => array( ApiBase::PARAM_DFLT => 10, ApiBase::PARAM_TYPE => 'limit', @@ -165,6 +181,8 @@ class ApiQueryAllCategories extends ApiQueryGeneratorBase { 'to' => 'The category to stop enumerating at', 'prefix' => 'Search for all category titles that begin with this value', 'dir' => 'Direction to sort in', + 'min' => 'Minimum number of category members', + 'max' => 'Maximum number of category members', 'limit' => 'How many categories to return', 'prop' => array( 'Which properties to get', @@ -185,7 +203,11 @@ class ApiQueryAllCategories extends ApiQueryGeneratorBase { ); } + public function getHelpUrls() { + return 'https://www.mediawiki.org/wiki/API:Allcategories'; + } + public function getVersion() { - return __CLASS__ . ': $Id: ApiQueryAllCategories.php 70647 2010-08-07 19:59:42Z ialex $'; + return __CLASS__ . ': $Id: ApiQueryAllCategories.php 104449 2011-11-28 15:52:04Z reedy $'; } } -- cgit v1.2.2