r79320 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r79319‎ | r79320 | r79321 >
Date:04:12, 31 December 2010
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Added parameter descriptions for distance and coordinates parser hooks
Modified paths:
  • /trunk/extensions/Maps/Maps.i18n.php (modified) (history)
  • /trunk/extensions/Maps/includes/parserHooks/Maps_Coordinates.php (modified) (history)
  • /trunk/extensions/Maps/includes/parserHooks/Maps_Distance.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Maps/Maps.i18n.php
@@ -45,6 +45,16 @@
4646 'maps-geocode-description' => 'Enables the geocoding of addresses, in other words, turning human readable locations into sets of coordinates. There is support for several geocoding services, which should not be confused with mapping services.',
4747 'maps-geodistance-description' => 'Calculate the geographical distance between two points, from and to any of the supported formats.',
4848
 49+ // Coordinates parser hook
 50+ 'maps-coordinates-par-location' => 'The coordinates you want to format.',
 51+ 'maps-coordinates-par-format' => 'The target format for the coordinates.',
 52+ 'maps-coordinates-par-directional' => 'Indicates if the coordinates should be outputted directional or not.',
 53+
 54+ // Distance parser hook
 55+ 'maps-distance-par-distance' => "The distance to convert to it's equivalent with a specified unit.",
 56+ 'maps-distance-par-decimals' => 'The maximum amount of fractional digits to use in the resulting value.',
 57+ 'maps-distance-par-unit' => 'The unit the output the distance in.',
 58+
4959 // Validation
5060 'validation-error-invalid-location' => 'Parameter $1 must be a valid location.',
5161 'validation-error-invalid-locations' => 'Parameter $1 must be one or more valid locations.',
Index: trunk/extensions/Maps/includes/parserHooks/Maps_Coordinates.php
@@ -69,6 +69,7 @@
7070 new CriterionIsLocation(),
7171 )
7272 );
 73+ $params['location']->setDescription( wfMsg( 'maps-coordinates-par-location' ) );
7374
7475 $params['format'] = new Parameter(
7576 'format',
@@ -80,12 +81,14 @@
8182 )
8283 );
8384 $params['format']->addManipulations( new ParamManipulationFunctions( 'strtolower' ) );
 85+ $params['format']->setDescription( wfMsg( 'maps-coordinates-par-format' ) );
8486
8587 $params['directional'] = new Parameter(
8688 'directional',
8789 Parameter::TYPE_BOOLEAN,
8890 $egMapsCoordinateDirectional
89 - );
 91+ );
 92+ $params['directional']->setDescription( wfMsg( 'maps-coordinates-par-directional' ) );
9093
9194 return $params;
9295 }
Index: trunk/extensions/Maps/includes/parserHooks/Maps_Distance.php
@@ -60,6 +60,7 @@
6161
6262 $params['distance'] = new Parameter( 'distance' );
6363 $params['distance']->addCriteria( new CriterionIsDistance() );
 64+ $params['distance']->setDescription( wfMsg( 'maps-distance-par-distance' ) );
6465
6566 $params['unit'] = new Parameter(
6667 'unit',
@@ -69,13 +70,15 @@
7071 array(
7172 new CriterionInArray( MapsDistanceParser::getUnits() ),
7273 )
73 - );
 74+ );
 75+ $params['unit']->setDescription( wfMsg( 'maps-distance-par-unit' ) );
7476
7577 $params['decimals'] = new Parameter(
7678 'decimals',
7779 Parameter::TYPE_INTEGER,
7880 $egMapsDistanceDecimals
79 - );
 81+ );
 82+ $params['decimals']->setDescription( wfMsg( 'maps-distance-par-decimals' ) );
8083
8184 return $params;
8285 }

Status & tagging log