r79321 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r79320‎ | r79321 | r79322 >
Date:04:23, 31 December 2010
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Added parameter descriptions for finddestination parser hook
Modified paths:
  • /trunk/extensions/Maps/Maps.i18n.php (modified) (history)
  • /trunk/extensions/Maps/includes/parserHooks/Maps_Finddestination.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Maps/Maps.i18n.php
@@ -55,6 +55,18 @@
5656 'maps-distance-par-decimals' => 'The maximum amount of fractional digits to use in the resulting value.',
5757 'maps-distance-par-unit' => 'The unit the output the distance in.',
5858
 59+ // Finddestination paser hook
 60+ 'maps-finddestination-par-location' => 'The initial location.',
 61+ 'maps-finddestination-par-bearing' => 'The initial bearing.',
 62+ 'maps-finddestination-par-distance' => 'The distance to travel.',
 63+ 'maps-finddestination-par-format' => 'The format in which to output the destination.',
 64+ 'maps-finddestination-par-directional' => 'Indicates if the format of the destination should be directional or not.',
 65+ 'maps-finddestination-par-allowcoordinates' => 'Indicates if coordinates should be allowed. If set to no, only addresses will be accepted.',
 66+ 'maps-finddestination-par-geoservice' => "The geocoding service to use to geocode the value in case it's an address.",
 67+ 'maps-finddestination-par-mappingservice' => "Parameter you can use to indicate the mapping service you are using this function with.
 68+This will maps allow to override the default value of the service parameter by the one that's optimal for the mapping service.
 69+(Example: In case of Google Maps, the Google geocoder will be used.)",
 70+
5971 // Validation
6072 'validation-error-invalid-location' => 'Parameter $1 must be a valid location.',
6173 'validation-error-invalid-locations' => 'Parameter $1 must be one or more valid locations.',
Index: trunk/extensions/Maps/includes/parserHooks/Maps_Finddestination.php
@@ -62,14 +62,17 @@
6363 $params['location'] = new Parameter( 'location' );
6464 $params['location']->addCriteria( new CriterionIsLocation() );
6565 $params['location']->addDependencies( 'mappingservice', 'geoservice' );
 66+ $params['location']->setDescription( wfMsg( 'maps-finddestination-par-location' ) );
6667
6768 $params['bearing'] = new Parameter(
6869 'bearing',
6970 Parameter::TYPE_FLOAT
7071 );
 72+ $params['bearing']->setDescription( wfMsg( 'maps-finddestination-par-bearing' ) );
7173
7274 $params['distance'] = new Parameter( 'distance' );
7375 $params['distance']->addCriteria( new CriterionIsDistance() );
 76+ $params['distance']->setDescription( wfMsg( 'maps-finddestination-par-distance' ) );
7477 // TODO: manipulate to distance object
7578
7679 $params['mappingservice'] = new Parameter(
@@ -82,6 +85,7 @@
8386 )
8487 );
8588 $params['mappingservice']->addManipulations( new ParamManipulationFunctions( 'strtolower' ) );
 89+ $params['mappingservice']->setDescription( wfMsg( 'maps-finddestination-par-mappingservice' ) );
8690
8791 $params['geoservice'] = new Parameter(
8892 'geoservice',
@@ -93,12 +97,14 @@
9498 )
9599 );
96100 $params['geoservice']->addManipulations( new ParamManipulationFunctions( 'strtolower' ) );
97 -
 101+ $params['geoservice']->setDescription( wfMsg( 'maps-finddestination-par-geoservice' ) );
 102+
98103 $params['allowcoordinates'] = new Parameter(
99104 'allowcoordinates',
100105 Parameter::TYPE_BOOLEAN,
101106 $egMapsAllowCoordsGeocoding
102107 );
 108+ $params['allowcoordinates']->setDescription( wfMsg( 'maps-finddestination-par-allowcoordinates' ) );
103109
104110 $params['format'] = new Parameter(
105111 'format',
@@ -110,12 +116,14 @@
111117 )
112118 );
113119 $params['format']->addManipulations( new ParamManipulationFunctions( 'strtolower' ) );
 120+ $params['format']->setDescription( wfMsg( 'maps-finddestination-par-format' ) );
114121
115122 $params['directional'] = new Parameter(
116123 'directional',
117124 Parameter::TYPE_BOOLEAN,
118125 $egMapsCoordinateDirectional
119126 );
 127+ $params['directional']->setDescription( wfMsg( 'maps-finddestination-par-directional' ) );
120128
121129 return $params;
122130 }

Status & tagging log