r64704 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r64703‎ | r64704 | r64705 >
Date:14:32, 7 April 2010
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Follow up to r64673
Modified paths:
  • /trunk/extensions/Maps/Geocoders/Maps_Geocoder.php (modified) (history)
  • /trunk/extensions/Maps/Maps_CoordinateParser.php (modified) (history)
  • /trunk/extensions/Maps/OpenStreetMap/Maps_OSM.php (modified) (history)
  • /trunk/extensions/Maps/ParserFunctions/DisplayMap/Maps_DisplayMap.php (modified) (history)
  • /trunk/extensions/Maps/ParserFunctions/DisplayPoint/Maps_DisplayPoint.php (modified) (history)
  • /trunk/extensions/Maps/ParserFunctions/Geocode/Maps_GeocodeFunctions.php (modified) (history)
  • /trunk/extensions/Maps/ParserFunctions/Maps_ParserFunctions.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Maps/ParserFunctions/Maps_ParserFunctions.php
@@ -53,14 +53,13 @@
5454 'criteria' => array(
5555 'in_array' => $egMapsAvailableServices
5656 ),
57 - 'default' => $egMapsDefaultServices['pf']
5857 ),
5958 'coordinates' => array(
6059 'aliases' => array( 'coords', 'location', 'locations' ),
6160 ),
6261 'geoservice' => array(
6362 'criteria' => array(
64 - 'in_array' => array_keys( $egMapsAvailableGeoServices )
 63+ 'in_array' => $egMapsAvailableGeoServices
6564 ),
6665 'default' => $egMapsDefaultGeoService
6766 ),
Index: trunk/extensions/Maps/ParserFunctions/DisplayPoint/Maps_DisplayPoint.php
@@ -68,25 +68,31 @@
6969 }
7070
7171 private static function initializeParams() {
72 - global $egMapsDefaultCentre, $egMapsDefaultTitle, $egMapsDefaultLabel;
 72+ global $egMapsDefaultCentre, $egMapsDefaultTitle, $egMapsDefaultLabel, $egMapsDefaultServices;
7373
74 - self::$parameters = array_merge( MapsParserFunctions::$parameters, array(
75 - 'centre' => array(
76 - 'aliases' => array( 'center' ),
77 - 'default' => $egMapsDefaultCentre
 74+ self::$parameters = array_merge(
 75+ MapsParserFunctions::$parameters,
 76+ array(
 77+ 'service' => array(
 78+ 'default' => $egMapsDefaultServices['display_map']
 79+ ),
 80+ 'centre' => array(
 81+ 'aliases' => array( 'center' ),
 82+ 'default' => $egMapsDefaultCentre
7883 ),
79 - 'title' => array(
80 - 'default' => $egMapsDefaultTitle
 84+ 'title' => array(
 85+ 'default' => $egMapsDefaultTitle
8186 ),
82 - 'label' => array(
83 - 'default' => $egMapsDefaultLabel
 87+ 'label' => array(
 88+ 'default' => $egMapsDefaultLabel
8489 ),
85 - 'icon' => array(
86 - 'criteria' => array(
87 - 'not_empty' => array()
 90+ 'icon' => array(
 91+ 'criteria' => array(
 92+ 'not_empty' => array()
8893 )
8994 ),
90 - ) );
 95+ )
 96+ );
9197 }
9298
9399 }
\ No newline at end of file
Index: trunk/extensions/Maps/ParserFunctions/DisplayMap/Maps_DisplayMap.php
@@ -65,12 +65,18 @@
6666 $args = func_get_args();
6767 return MapsParserFunctions::getMapHtml( $parser, $args, 'display_map' );
6868 }
69 -
 69+
7070 private static function initializeParams() {
71 - global $egMapsAvailableGeoServices, $egMapsDefaultGeoService;
72 -
73 - self::$parameters = array_merge( MapsParserFunctions::$parameters, array(
74 - ) );
 71+ global $egMapsAvailableGeoServices, $egMapsDefaultGeoService, $egMapsDefaultServices;
 72+
 73+ self::$parameters = array_merge(
 74+ MapsParserFunctions::$parameters,
 75+ array(
 76+ 'service' => array(
 77+ 'default' => $egMapsDefaultServices['display_map']
 78+ ),
 79+ )
 80+ );
7581 }
7682
7783 }
\ No newline at end of file
Index: trunk/extensions/Maps/ParserFunctions/Geocode/Maps_GeocodeFunctions.php
@@ -103,12 +103,12 @@
104104 'mappingservice' => array(
105105 'criteria' => array(
106106 'in_array' => $egMapsAvailableServices
107 - ),
108 - 'default' => $egMapsDefaultServices['pf']
 107+ ),
 108+ 'default' => false
109109 ),
110110 'service' => array(
111111 'criteria' => array(
112 - 'in_array' => array_keys( $egMapsAvailableGeoServices )
 112+ 'in_array' => $egMapsAvailableGeoServices
113113 ),
114114 'default' => $egMapsDefaultGeoService
115115 ),
Index: trunk/extensions/Maps/OpenStreetMap/Maps_OSM.php
@@ -14,6 +14,8 @@
1515 * @ingroup MapsOpenStreetMap
1616 *
1717 * @author Jeroen De Dauw
 18+ *
 19+ * FIXME: this file has not been changed to work with 0.6
1820 */
1921
2022 if ( !defined( 'MEDIAWIKI' ) ) {
Index: trunk/extensions/Maps/Maps_CoordinateParser.php
@@ -27,6 +27,8 @@
2828 */
2929 class MapsCoordinateParser {
3030
 31+ protected static $mSeperators = array( ',', ';' );
 32+
3133 protected static $mI18nDirections = false; // Cache for localised direction labels
3234 protected static $mDirections; // Cache for English direction labels
3335
Index: trunk/extensions/Maps/Geocoders/Maps_Geocoder.php
@@ -60,7 +60,7 @@
6161 *
6262 * @return formatted coordinate string or false
6363 */
64 - public static function attemptToGeocodeToString( $coordsOrAddress, $service = '', $mappingService = '', $checkForCoords = true, $targetFormat = Maps_COORDS_FLOAT, $directional = false ) {
 64+ public static function attemptToGeocodeToString( $coordsOrAddress, $service = '', $mappingService = false, $checkForCoords = true, $targetFormat = Maps_COORDS_FLOAT, $directional = false ) {
6565 $geoValues = self::attemptToGeocode( $coordsOrAddress, $service, $mappingService, $checkForCoords );
6666 return $geoValues ? MapsCoordinateParser::formatCoordinates( $geoValues, $targetFormat, $directional ) : false;
6767 }
@@ -109,7 +109,7 @@
110110 global $egMapsAvailableGeoServices, $egMapsDefaultGeoService, $egMapsGeoOverrides, $egMapsUserGeoOverrides;
111111
112112 if ( $service == '' ) {
113 - if ( $egMapsUserGeoOverrides ) {
 113+ if ( $egMapsUserGeoOverrides && $mappingService ) {
114114 // If no service has been provided, check if there are overrides for the default.
115115 foreach ( $egMapsAvailableGeoServices as $geoService ) {
116116 if ( array_key_exists( $geoService, $egMapsGeoOverrides ) && in_array( $mappingService, $egMapsGeoOverrides[$geoService] ) ) {

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r64673Changes for 0.6 - bugfixjeroendedauw22:15, 6 April 2010

Status & tagging log