r74302 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r74301‎ | r74302 | r74303 >
Date:14:18, 5 October 2010
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Changes for 0.7 - implemented correct defaulting of the zoom parameter for display_points
Modified paths:
  • /trunk/extensions/Maps/includes/Maps_Mapper.php (modified) (history)
  • /trunk/extensions/Maps/includes/manipulations/Maps_ParamZoom.php (modified) (history)
  • /trunk/extensions/Maps/includes/parserHooks/Maps_DisplayPoint.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Maps/includes/manipulations/Maps_ParamZoom.php
@@ -29,8 +29,9 @@
3030 */
3131 public function doManipulation( &$value, Parameter $parameter, array &$parameters ) {
3232 if ( $parameter->wasSetToDefault() ) {
33 - //var_dump($parameters['coordinates']);exit;
34 - // TODO
 33+ if ( count( $parameters['coordinates']->getValue() ) > 1 ) {
 34+ $value = 'null';
 35+ }
3536 }
3637 }
3738
Index: trunk/extensions/Maps/includes/Maps_Mapper.php
@@ -175,9 +175,7 @@
176176
177177 $params['zoom'] = new Parameter(
178178 'zoom',
179 - Parameter::TYPE_INTEGER,
180 - 10,
181 - array( 'service' )
 179+ Parameter::TYPE_INTEGER
182180 );
183181
184182 $params['width'] = new Parameter(
Index: trunk/extensions/Maps/includes/parserHooks/Maps_DisplayPoint.php
@@ -60,7 +60,7 @@
6161 $params['mappingservice']->setDefault( $egMapsDefaultServices['display_point'] );
6262 $params['mappingservice']->addManipulations( new MapsParamService( 'display_point' ) );
6363
64 - $params['zoom']->addDependencies( 'coordinates' );
 64+ $params['zoom']->addDependencies( 'coordinates', 'mappingservice' );
6565 $params['zoom']->addManipulations( new MapsParamZoom() );
6666
6767 $params['coordinates'] = new ListParameter( 'coordinates', ';' );

Status & tagging log