Index: trunk/extensions/Maps/Maps.php |
— | — | @@ -36,7 +36,7 @@ |
37 | 37 | echo '<b>Warning:</b> You need to have <a href="http://www.mediawiki.org/wiki/Extension:Validator">Validator</a> installed in order to use <a href="http://www.mediawiki.org/wiki/Extension:Maps">Maps</a>.'; |
38 | 38 | } |
39 | 39 | else { |
40 | | - define( 'Maps_VERSION', '0.7 alpha-6' ); |
| 40 | + define( 'Maps_VERSION', '0.7 alpha-7' ); |
41 | 41 | |
42 | 42 | // The different coordinate notations. |
43 | 43 | define( 'Maps_COORDS_FLOAT', 'float' ); |
— | — | @@ -133,6 +133,7 @@ |
134 | 134 | $wgAutoloadClasses['MapsParamCoordSet'] = $manDir . 'Maps_ParamCoordSet.php'; |
135 | 135 | $wgAutoloadClasses['MapsParamDimension'] = $manDir . 'Maps_ParamDimension.php'; |
136 | 136 | $wgAutoloadClasses['MapsParamService'] = $manDir . 'Maps_ParamService.php'; |
| 137 | + $wgAutoloadClasses['MapsParamZoom'] = $manDir . 'Maps_ParamZoom.php'; |
137 | 138 | |
138 | 139 | // Autoload the "includes/parserHooks/" classes. |
139 | 140 | $phDir = $incDir . '/parserHooks/'; |
Index: trunk/extensions/Maps/includes/services/GoogleMaps3/Maps_ParamGMap3Type.php |
— | — | @@ -28,7 +28,7 @@ |
29 | 29 | * |
30 | 30 | * @since 0.7 |
31 | 31 | */ |
32 | | - public function doManipulation( &$value, array &$parameters ) { |
| 32 | + public function doManipulation( &$value, Parameter $parameter, array &$parameters ) { |
33 | 33 | $value = 'google.maps.MapTypeId.' . MapsGoogleMaps3::$mapTypes[$value]; |
34 | 34 | } |
35 | 35 | |
Index: trunk/extensions/Maps/includes/services/YahooMaps/Maps_ParamYMapType.php |
— | — | @@ -28,7 +28,7 @@ |
29 | 29 | * |
30 | 30 | * @since 0.7 |
31 | 31 | */ |
32 | | - public function doManipulation( &$value, array &$parameters ) { |
| 32 | + public function doManipulation( &$value, Parameter $parameter, array &$parameters ) { |
33 | 33 | $value = MapsYahooMaps::$mapTypes[$value]; |
34 | 34 | } |
35 | 35 | |
Index: trunk/extensions/Maps/includes/services/GoogleMaps/Maps_ParamGMapType.php |
— | — | @@ -28,7 +28,7 @@ |
29 | 29 | * |
30 | 30 | * @since 0.7 |
31 | 31 | */ |
32 | | - public function doManipulation( &$value, array &$parameters ) { |
| 32 | + public function doManipulation( &$value, Parameter $parameter, array &$parameters ) { |
33 | 33 | $value = MapsGoogleMaps::$mapTypes[$value]; |
34 | 34 | } |
35 | 35 | |
Index: trunk/extensions/Maps/includes/manipulations/Maps_ParamService.php |
— | — | @@ -38,7 +38,7 @@ |
39 | 39 | * |
40 | 40 | * @since 0.7 |
41 | 41 | */ |
42 | | - public function doManipulation( &$value, array &$parameters ) { |
| 42 | + public function doManipulation( &$value, Parameter $parameter, array &$parameters ) { |
43 | 43 | // Make sure the service is valid. |
44 | 44 | $value = MapsMappingServices::getValidServiceName( $value, $this->feature ); |
45 | 45 | |
Index: trunk/extensions/Maps/includes/manipulations/Maps_ParamCoordSet.php |
— | — | @@ -40,7 +40,7 @@ |
41 | 41 | * |
42 | 42 | * @since 0.7 |
43 | 43 | */ |
44 | | - public function doManipulation( &$value, array &$parameters ) { |
| 44 | + public function doManipulation( &$value, Parameter $parameter, array &$parameters ) { |
45 | 45 | if ( $this->metaDataSeparator !== false ) { |
46 | 46 | $parts = explode( $this->metaDataSeparator, $value ); |
47 | 47 | $value = array_shift( $parts ); |
Index: trunk/extensions/Maps/includes/manipulations/Maps_ParamZoom.php |
— | — | @@ -0,0 +1,37 @@ |
| 2 | +<?php |
| 3 | + |
| 4 | +/** |
| 5 | + * Parameter manipulation ensuring the value is a coordinate set. |
| 6 | + * |
| 7 | + * @since 0.7 |
| 8 | + * |
| 9 | + * @file Maps_ParamCoordSet.php |
| 10 | + * @ingroup Maps |
| 11 | + * @ingroup ParameterManipulations |
| 12 | + * |
| 13 | + * @author Jeroen De Dauw |
| 14 | + */ |
| 15 | +class MapsParamZoom extends ItemParameterManipulation { |
| 16 | + |
| 17 | + /** |
| 18 | + * Constructor. |
| 19 | + * |
| 20 | + * @since 0.7 |
| 21 | + */ |
| 22 | + public function __construct() { |
| 23 | + parent::__construct(); |
| 24 | + } |
| 25 | + |
| 26 | + /** |
| 27 | + * @see ItemParameterManipulation::doManipulation |
| 28 | + * |
| 29 | + * @since 0.7 |
| 30 | + */ |
| 31 | + public function doManipulation( &$value, Parameter $parameter, array &$parameters ) { |
| 32 | + if ( $parameter->wasSetToDefault() ) { |
| 33 | + //var_dump($parameters['coordinates']);exit; |
| 34 | + // TODO |
| 35 | + } |
| 36 | + } |
| 37 | + |
| 38 | +} |
\ No newline at end of file |
Property changes on: trunk/extensions/Maps/includes/manipulations/Maps_ParamZoom.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 39 | + native |
Index: trunk/extensions/Maps/includes/manipulations/Maps_ParamDimension.php |
— | — | @@ -38,7 +38,7 @@ |
39 | 39 | * |
40 | 40 | * @since 0.7 |
41 | 41 | */ |
42 | | - public function doManipulation( &$value, array &$parameters ) { |
| 42 | + public function doManipulation( &$value, Parameter $parameter, array &$parameters ) { |
43 | 43 | global $egMapsSizeRestrictions; |
44 | 44 | |
45 | 45 | // Set the default if the value is not valid. |
Index: trunk/extensions/Maps/includes/parserHooks/Maps_DisplayPoint.php |
— | — | @@ -60,6 +60,9 @@ |
61 | 61 | $params['mappingservice']->setDefault( $egMapsDefaultServices['display_point'] ); |
62 | 62 | $params['mappingservice']->addManipulations( new MapsParamService( 'display_point' ) ); |
63 | 63 | |
| 64 | + $params['zoom']->addDependencies( 'coordinates' ); |
| 65 | + $params['zoom']->addManipulations( new MapsParamZoom() ); |
| 66 | + |
64 | 67 | $params['coordinates'] = new ListParameter( 'coordinates', ';' ); |
65 | 68 | $params['coordinates']->addAliases( 'coords', 'location', 'address', 'addresses', 'locations' ); |
66 | 69 | $params['coordinates']->addCriteria( new CriterionIsLocation( '~' ) ); |