r79323 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r79322‎ | r79323 | r79324 >
Date:04:33, 31 December 2010
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Added parameter descriptions for geocode and geodistance parser hooks
Modified paths:
  • /trunk/extensions/Maps/Maps.i18n.php (modified) (history)
  • /trunk/extensions/Maps/includes/parserHooks/Maps_Geocode.php (modified) (history)
  • /trunk/extensions/Maps/includes/parserHooks/Maps_Geodistance.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Maps/Maps.i18n.php
@@ -67,6 +67,27 @@
6868 This will maps allow to override the default value of the service parameter by the one that's optimal for the mapping service.
6969 (Example: In case of Google Maps, the Google geocoder will be used.)",
7070
 71+ // Geocode parser hook
 72+ 'maps-geocode-par-location' => 'The address you want to geocode.',
 73+ 'maps-geocode-par-mappingservice' => 'The geocoding service you want to use. See the available geocoding services.',
 74+ 'maps-geocode-par-geoservice' => 'This parameter allows you to indicate you are using this geocoding request in combination with a specific mapping service.
 75+Each mapping service can have overrides over the default value for the geocoding service.
 76+This is for legal considerations, since you can not use the Google Geocoding service except together with Google Maps. Settings this parameter and not the service one will ensure you are not using an invalid combination.',
 77+ 'maps-geocode-par-allowcoordinates' => 'Allows disabling the support for coordinates in this function. Must be either yes or no.
 78+When no, every value will be geocoded, even valid coordinates. ',
 79+ 'maps-geocode-par-format' => 'The format for the resulting coordinates.',
 80+ 'maps-geocode-par-directional' => 'Indicates if the coordinates should be outputted directional or not.',
 81+
 82+ // Geodistance parser hook
 83+ 'maps-geodistance-par-location1' => 'The first point in the set to calculate the distance between.',
 84+ 'maps-geodistance-par-location2' => 'The second point in the set to calculate the distance between.',
 85+ 'maps-geodistance-par-unit' => 'The unit the output the distance in.',
 86+ 'maps-geodistance-par-decimals' => 'The maximum amount of fractional digits to use in the resulting value.',
 87+ 'maps-geodistance-par-mappingservice' => 'The geocoding service to use to geocode any addresses.',
 88+ 'maps-geodistance-par-geoservice' => 'The mapping service this is used together with.
 89+This can affect the default geocoding service value.',
 90+
 91+
7192 // Validation
7293 'validation-error-invalid-location' => 'Parameter $1 must be a valid location.',
7394 'validation-error-invalid-locations' => 'Parameter $1 must be one or more valid locations.',
Index: trunk/extensions/Maps/includes/parserHooks/Maps_Geocode.php
@@ -63,6 +63,7 @@
6464 $params['location'] = new Parameter( 'location' );
6565 $params['location']->addDependencies( 'mappingservice', 'geoservice' );
6666 $params['location']->addCriteria( new CriterionIsLocation() );
 67+ $params['location']->setDescription( wfMsg( 'maps-geocode-par-location' ) );
6768
6869 $params['mappingservice'] = new Parameter(
6970 'mappingservice',
@@ -74,6 +75,7 @@
7576 )
7677 );
7778 $params['mappingservice']->addManipulations( new ParamManipulationFunctions( 'strtolower' ) );
 79+ $params['mappingservice']->setDescription( wfMsg( 'maps-geocode-par-mappingservice' ) );
7880
7981 $params['geoservice'] = new Parameter(
8082 'geoservice',
@@ -85,12 +87,14 @@
8688 )
8789 );
8890 $params['geoservice']->addManipulations( new ParamManipulationFunctions( 'strtolower' ) );
 91+ $params['geoservice']->setDescription( wfMsg( 'maps-geocode-par-geoservice' ) );
8992
9093 $params['allowcoordinates'] = new Parameter(
9194 'allowcoordinates',
9295 Parameter::TYPE_BOOLEAN,
9396 $egMapsAllowCoordsGeocoding
9497 );
 98+ $params['allowcoordinates']->setDescription( wfMsg( 'maps-geocode-par-allowcoordinates' ) );
9599
96100 $params['format'] = new Parameter(
97101 'format',
@@ -102,12 +106,14 @@
103107 )
104108 );
105109 $params['format']->addManipulations( new ParamManipulationFunctions( 'strtolower' ) );
 110+ $params['format']->setDescription( wfMsg( 'maps-geocode-par-format' ) );
106111
107112 $params['directional'] = new Parameter(
108113 'directional',
109114 Parameter::TYPE_BOOLEAN,
110115 $egMapsCoordinateDirectional
111116 );
 117+ $params['directional']->setDescription( wfMsg( 'maps-geocode-par-directional' ) );
112118
113119 return $params;
114120 }
Index: trunk/extensions/Maps/includes/parserHooks/Maps_Geodistance.php
@@ -68,6 +68,7 @@
6969 )
7070 );
7171 $params['location1']->addDependencies( 'mappingservice', 'geoservice' );
 72+ $params['location1']->setDescription( wfMsg( 'maps-geodistance-par-location1' ) );
7273
7374 $params['location2'] = new Parameter(
7475 'location2',
@@ -79,6 +80,7 @@
8081 )
8182 );
8283 $params['location2']->addDependencies( 'mappingservice', 'geoservice' );
 84+ $params['location2']->setDescription( wfMsg( 'maps-geodistance-par-location2' ) );
8385
8486 $params['unit'] = new Parameter(
8587 'unit',
@@ -90,12 +92,14 @@
9193 )
9294 );
9395 $params['unit']->addManipulations( new ParamManipulationFunctions( 'strtolower' ) );
94 -
 96+ $params['unit']->setDescription( wfMsg( 'maps-geodistance-par-unit' ) );
 97+
9598 $params['decimals'] = new Parameter(
9699 'decimals',
97100 Parameter::TYPE_INTEGER,
98101 $egMapsDistanceDecimals
99102 );
 103+ $params['decimals']->setDescription( wfMsg( 'maps-geodistance-par-decimals' ) );
100104
101105 $params['mappingservice'] = new Parameter(
102106 'mappingservice',
@@ -107,6 +111,7 @@
108112 )
109113 );
110114 $params['mappingservice']->addManipulations( new ParamManipulationFunctions( 'strtolower' ) );
 115+ $params['mappingservice']->setDescription( wfMsg( 'maps-geodistance-par-mappingservice' ) );
111116
112117 $params['geoservice'] = new Parameter(
113118 'geoservice',
@@ -118,6 +123,7 @@
119124 )
120125 );
121126 $params['geoservice']->addManipulations( new ParamManipulationFunctions( 'strtolower' ) );
 127+ $params['geoservice']->setDescription( wfMsg( 'maps-geodistance-par-geoservice' ) );
122128
123129 return $params;
124130 }

Status & tagging log