r108139 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r108138‎ | r108139 | r108140 >
Date:13:33, 5 January 2012
Author:maxsem
Status:ok
Tags:
Comment:
Filter by namespace
Modified paths:
  • /trunk/extensions/GeoData/ApiQueryGeoSearch.php (modified) (history)

Diff [purge]

Index: trunk/extensions/GeoData/ApiQueryGeoSearch.php
@@ -73,6 +73,7 @@
7474 $this->addWhereRange( 'gt_lat', 'newer', $rect["minLat"], $rect["maxLat"], false );
7575 $this->addWhereRange( 'gt_lon', 'newer', $rect["minLon"], $rect["maxLon"], false );
7676 //$this->addWhere( 'dist < ' . intval( $radius ) ); hasta be in HAVING, not WHERE
 77+ $this->addWhereFld( 'page_namespace', $params['namespace'] );
7778 $this->addWhere( 'gt_page_id = page_id' );
7879 if ( $exclude ) {
7980 $this->addWhere( "gt_page_id <> {$exclude}" );
@@ -140,6 +141,11 @@
141142 ApiBase::PARAM_TYPE => 'string',
142143 ApiBase::PARAM_DFLT => $wgDefaultGlobe,
143144 ),
 145+ 'namespace' => array(
 146+ ApiBase::PARAM_TYPE => 'namespace',
 147+ ApiBase::PARAM_DFLT => NS_MAIN,
 148+ ApiBase::PARAM_ISMULTI => true,
 149+ )
144150 );
145151 }
146152
@@ -149,9 +155,10 @@
150156 'coord' => 'Coordinate around which to search: two floating-point values separated by pipe (|)',
151157 'page' => 'Page around which to search',
152158 'radius' => 'Search radius in meters',
153 - 'maxdim' => 'Restrict search to onjects no larger than this, in meters',
 159+ 'maxdim' => 'Restrict search to objects no larger than this, in meters',
154160 'limit' => 'Maximum number of pages to return',
155161 'globe' => "Globe to search on (by default `{$wgDefaultGlobe}')",
 162+ 'namespace' => 'Namespace(s) to search',
156163 );
157164 }
158165

Status & tagging log