r64842 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r64841‎ | r64842 | r64843 >
Date:00:05, 10 April 2010
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Small fixes to #coodrinates parser function
Modified paths:
  • /trunk/extensions/Maps/ParserFunctions/Coordinates/Maps_Coordinates.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Maps/ParserFunctions/Coordinates/Maps_Coordinates.php
@@ -1,10 +1,9 @@
22 <?php
33
44 /**
5 - * This file contains registration
 5+ * This file contains registration for the #coordinates parser function,
 6+ * which can transform the notation of a set of coordinates.
67 *
7 - *
8 - *
98 * @file Maps_Coordinates.php
109 * @ingroup Maps
1110 *
@@ -37,6 +36,7 @@
3837 return true;
3938 }
4039
 40+// TODO: add coordinate validation
4141 function efMapsRenderCoordinates() {
4242 global $egMapsAvailableServices, $egMapsAvailableGeoServices, $egMapsAvailableCoordNotations;
4343 global $egMapsDefaultServices, $egMapsDefaultGeoService, $egMapsCoordinateNotation;
@@ -74,6 +74,9 @@
7575 'criteria' => array(
7676 'in_array' => $egMapsAvailableCoordNotations
7777 ),
 78+ 'aliases' => array(
 79+ 'format'
 80+ ),
7881 'default' => $egMapsCoordinateNotation
7982 ),
8083 'directional' => array(
@@ -92,13 +95,15 @@
9396 $parsedCoords = MapsCoordinateParser::parseCoordinates( $parameters['location'] );
9497
9598 if ( $parsedCoords ) {
96 - return MapsCoordinateParser::formatCoordinates( $parsedCoords, $parameters['notation'], $parameters['directional'] ) .
97 - $manager->getErrorList();
 99+ $output = MapsCoordinateParser::formatCoordinates( $parsedCoords, $parameters['notation'], $parameters['directional'] ) .
 100+ '<br />' . $manager->getErrorList();
98101 } else {
99 - return htmlspecialchars( wfMsgExt( 'maps-invalid-coordinates', 'parsemag', $parameters['location'] ) ) .
100 - $manager->getErrorList();
 102+ $output = htmlspecialchars( wfMsgExt( 'maps-invalid-coordinates', 'parsemag', $parameters['location'] ) ) .
 103+ '<br />' . $manager->getErrorList();
101104 }
102105 } else {
103 - return $manager->getErrorList();
104 - }
 106+ $output = $manager->getErrorList();
 107+ }
 108+
 109+ return array( $output, 'noparse' => true, 'isHTML' => true );
105110 }
\ No newline at end of file

Status & tagging log