r79325 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r79324‎ | r79325 | r79326 >
Date:04:44, 31 December 2010
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Added parameter descriptions for display_map and display_points parser hooks
Modified paths:
  • /trunk/extensions/Maps/Maps.i18n.php (modified) (history)
  • /trunk/extensions/Maps/includes/parserHooks/Maps_DisplayMap.php (modified) (history)
  • /trunk/extensions/Maps/includes/parserHooks/Maps_DisplayPoint.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Maps/Maps.i18n.php
@@ -87,7 +87,23 @@
8888 'maps-geodistance-par-geoservice' => 'The mapping service this is used together with.
8989 This can affect the default geocoding service value.',
9090
 91+ // display_map parser hook
 92+ 'maps-displaymap-par-mappingservice' => 'Allows to set the mapping service that will be used to generate the map.',
 93+ 'maps-displaymap-par-coordinates' => 'The location the map will initially be centred on.',
9194
 95+ // display_points parser hook
 96+ 'maps-displaypoints-par-zoom' => 'Allows to set the zoom level of the map.
 97+When not provided and multiple markers are present on the map, the best fitting zoom will be taken, not the configurable default.',
 98+ 'maps-displaypoints-par-mappingservice' => 'Allows to set the mapping service that will be used to generate the map.',
 99+ 'maps-displaypoints-par-coordinates' => 'One or more locations to display on the map. They will be indicated with a marker.',
 100+ 'maps-displaypoints-par-centre' => "Allows to set the coordinates of the map's centre for display_point(s).
 101+Accepts both addresses and coordinates.
 102+When this property is not provided, the map will centre itself on the provided marker, or between the provided markers.",
 103+ 'maps-displaypoints-par-title' => 'Allows to set text that will be displayed in the pop-ups of all markers that do not have a specific title.
 104+When used together with label, the title will be bold and have a line under it.',
 105+ 'maps-displaypoints-par-label' => 'Allows to set text that will be displayed in the pop-ups of all markers that do not have a specific label.',
 106+ 'maps-displaypoints-par-icon' => 'Allows you to set the icon used for all markers.',
 107+
92108 // Validation
93109 'validation-error-invalid-location' => 'Parameter $1 must be a valid location.',
94110 'validation-error-invalid-locations' => 'Parameter $1 must be one or more valid locations.',
Index: trunk/extensions/Maps/includes/parserHooks/Maps_DisplayPoint.php
@@ -59,15 +59,18 @@
6060
6161 $params['mappingservice']->setDefault( $egMapsDefaultServices['display_point'] );
6262 $params['mappingservice']->addManipulations( new MapsParamService( 'display_point' ) );
 63+ $params['mappingservice']->setDescription( wfMsg( 'maps-displaypoints-par-mappingservice' ) );
6364
6465 $params['zoom']->addDependencies( 'coordinates', 'mappingservice' );
6566 $params['zoom']->addManipulations( new MapsParamZoom() );
 67+ $params['zoom']->setDescription( wfMsg( 'maps-displaypoints-par-zoom' ) );
6668
6769 $params['coordinates'] = new ListParameter( 'coordinates', $type === ParserHook::TYPE_FUNCTION ? ';' : "\n" );
6870 $params['coordinates']->addAliases( 'coords', 'location', 'address', 'addresses', 'locations' );
6971 $params['coordinates']->addCriteria( new CriterionIsLocation( $type === ParserHook::TYPE_FUNCTION ? '~' : '|' ) );
7072 $params['coordinates']->addManipulations( new MapsParamCoordSet( $type === ParserHook::TYPE_FUNCTION ? '~' : '|' ) );
7173 $params['coordinates']->addDependencies( 'mappingservice', 'geoservice' );
 74+ $params['coordinates']->setDescription( wfMsg( 'maps-displaypoints-par-coordinates' ) );
7275
7376 $params['centre'] = new Parameter(
7477 'centre',
@@ -78,12 +81,14 @@
7982 new CriterionIsLocation(),
8083 )
8184 );
 85+ $params['centre']->setDescription( wfMsg( 'maps-displaypoints-par-centre' ) );
8286
8387 $params['title'] = new Parameter(
8488 'title',
8589 Parameter::TYPE_STRING,
8690 $egMapsDefaultTitle
8791 );
 92+ $params['title']->setDescription( wfMsg( 'maps-displaypoints-par-title' ) );
8893
8994 $params['label'] = new Parameter(
9095 'label',
@@ -91,6 +96,7 @@
9297 $egMapsDefaultLabel,
9398 array( 'text' )
9499 );
 100+ $params['label']->setDescription( wfMsg( 'maps-displaypoints-par-label' ) );
95101
96102 $params['icon'] = new Parameter(
97103 'icon',
@@ -101,6 +107,7 @@
102108 New CriterionNotEmpty()
103109 )
104110 );
 111+ $params['icon']->setDescription( wfMsg( 'maps-displaypoints-par-icon' ) );
105112
106113 return $params;
107114 }
Index: trunk/extensions/Maps/includes/parserHooks/Maps_DisplayMap.php
@@ -63,12 +63,14 @@
6464
6565 $params['mappingservice']->setDefault( $egMapsDefaultServices['display_map'] );
6666 $params['mappingservice']->addManipulations( new MapsParamService( 'display_map' ) );
 67+ $params['mappingservice']->setDescription( wfMsg( 'maps-displaymap-par-mappingservice' ) );
6768
6869 $params['coordinates'] = new Parameter( 'coordinates' );
6970 $params['coordinates']->addAliases( 'coords', 'location', 'address' );
7071 $params['coordinates']->addCriteria( new CriterionIsLocation() );
7172 $params['coordinates']->addManipulations( new MapsParamCoordSet() );
7273 $params['coordinates']->addDependencies( 'mappingservice', 'geoservice' );
 74+ $params['coordinates']->setDescription( wfMsg( 'maps-displaymap-par-coordinates' ) );
7375
7476 return $params;
7577 }

Status & tagging log