r65929 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r65928‎ | r65929 | r65930 >
Date:01:47, 5 May 2010
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Follow up to r65928
Modified paths:
  • /trunk/extensions/Maps/Features/Maps_ParserFunctions.php (modified) (history)
  • /trunk/extensions/Maps/ParserFunctions/Coordinates/Maps_Coordinates.php (modified) (history)
  • /trunk/extensions/Maps/ParserFunctions/GeoFunctions/Maps_GeoFunctions.php (modified) (history)
  • /trunk/extensions/Maps/ParserFunctions/Geocode/Maps_GeocodeFunctions.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Maps/ParserFunctions/GeoFunctions/Maps_GeoFunctions.php
@@ -61,7 +61,7 @@
6262
6363 $manager = new ValidatorManager();
6464
65 - $parameters = $manager->manageParameters(
 65+ $doCalculation = $manager->manageParameters(
6666 $args,
6767 array(
6868 'location1' => array(
@@ -74,9 +74,9 @@
7575 array( 'location1', 'location2' )
7676 );
7777
78 - $doCalculation = $parameters !== false;
79 -
8078 if ( $doCalculation ) {
 79+ $parameters = $manager->getParameters( false );
 80+
8181 $canGeocode = MapsMapper::geocoderIsAvailable();
8282
8383 if ( $canGeocode ) {
@@ -144,7 +144,7 @@
145145
146146 $manager = new ValidatorManager();
147147
148 - $parameters = $manager->manageParameters(
 148+ $doCalculation = $manager->manageParameters(
149149 $args,
150150 array(
151151 'location' => array(
@@ -190,9 +190,10 @@
191191 ),
192192 array( 'location', 'bearing', 'distance' )
193193 );
194 - $doCalculation = $parameters !== false;
195194
196195 if ( $doCalculation ) {
 196+ $parameters = $manager->getParameters( false );
 197+
197198 $canGeocode = MapsMapper::geocoderIsAvailable();
198199
199200 if ( $canGeocode ) {
Index: trunk/extensions/Maps/ParserFunctions/Geocode/Maps_GeocodeFunctions.php
@@ -72,7 +72,7 @@
7373
7474 $manager = new ValidatorManager();
7575
76 - $parameters = $manager->manageParameters(
 76+ $doGeocoding = $manager->manageParameters(
7777 $args,
7878 array(
7979 'location' => array(
@@ -111,9 +111,9 @@
112112 array( 'location', 'service', 'mappingservice' )
113113 );
114114
115 - $doGeocoding = $parameters !== false;
116 -
117115 if ( $doGeocoding ) {
 116+ $parameters = $manager->getParameters( false );
 117+
118118 if ( self::geocoderIsAvailable() ) {
119119 $geovalues = MapsGeocoder::attemptToGeocodeToString(
120120 $parameters['location'],
Index: trunk/extensions/Maps/ParserFunctions/Coordinates/Maps_Coordinates.php
@@ -51,7 +51,7 @@
5252
5353 $manager = new ValidatorManager();
5454
55 - $parameters = $manager->manageParameters(
 55+ $doFormatting = $manager->manageParameters(
5656 $args,
5757 array(
5858 'location' => array(
@@ -74,9 +74,9 @@
7575 array( 'location', 'format', 'directional' )
7676 );
7777
78 - $doFormatting = $parameters !== false;
79 -
8078 if ( $doFormatting ) {
 79+ $parameters = $manager->getParameters( false );
 80+
8181 $parsedCoords = MapsCoordinateParser::parseCoordinates( $parameters['location'] );
8282
8383 if ( $parsedCoords ) {
Index: trunk/extensions/Maps/Features/Maps_ParserFunctions.php
@@ -88,17 +88,15 @@
8989 $parameterInfo = array_merge_recursive( $parameterInfo, $egMapsServices[$service]['parameters'] );
9090 $parameterInfo = array_merge_recursive( $parameterInfo, $mapClass->getSpecificParameterInfo() );
9191
92 - $parameters = $manager->manageParameters(
 92+ $displayMap = $manager->manageParameters(
9393 $parameters,
9494 $parameterInfo,
9595 array( 'coordinates' )
9696 );
97 -
98 - $displayMap = $parameters !== false;
9997
10098 if ( $displayMap ) {
10199 // Call the function according to the map service to get the HTML output.
102 - $output = $mapClass->getMapHtml( $parser, $parameters ) . $manager->getErrorList();
 100+ $output = $mapClass->getMapHtml( $parser, $manager->getParameters( false ) ) . $manager->getErrorList();
103101 } else {
104102 // TODO: Get failiures
105103 if ( $egValidatorFatalLevel == Validator_ERRORS_WARN ) {

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r65928Changes for 0.3 - improved validation manager classjeroendedauw01:47, 5 May 2010

Status & tagging log