Index: trunk/extensions/Maps/ParserFunctions/DisplayPoint/Maps_DisplayPoint.php |
— | — | @@ -68,7 +68,7 @@ |
69 | 69 | } |
70 | 70 | |
71 | 71 | private static function initializeParams() { |
72 | | - global $egMapsDefaultCentre, $egMapsAvailableGeoServices, $egMapsDefaultGeoService, $egMapsDefaultTitle, $egMapsDefaultLabel; |
| 72 | + global $egMapsDefaultCentre, $egMapsDefaultTitle, $egMapsDefaultLabel; |
73 | 73 | |
74 | 74 | self::$parameters = array_merge(MapsParserFunctions::$parameters, array( |
75 | 75 | 'centre' => array( |
Index: trunk/extensions/Maps/ParserFunctions/Maps_ParserFunctions.php |
— | — | @@ -56,7 +56,7 @@ |
57 | 57 | private static function initializeParams() { |
58 | 58 | global $egMapsAvailableGeoServices, $egMapsDefaultGeoService; |
59 | 59 | |
60 | | - self::$parameters = array( |
| 60 | + self::$parameters = array( |
61 | 61 | 'coordinates' => array( |
62 | 62 | 'aliases' => array('coords', 'location', 'locations'), |
63 | 63 | 'criteria' => array( |
— | — | @@ -66,10 +66,10 @@ |
67 | 67 | 'geoservice' => array( |
68 | 68 | 'aliases' => array(), |
69 | 69 | 'criteria' => array( |
70 | | - 'in_array' => $egMapsAvailableGeoServices |
| 70 | + 'in_array' => array_keys($egMapsAvailableGeoServices) |
71 | 71 | ), |
72 | | - 'default' => array($egMapsDefaultGeoService) |
73 | | - ), |
| 72 | + 'default' => $egMapsDefaultGeoService |
| 73 | + ), |
74 | 74 | ); |
75 | 75 | } |
76 | 76 | |
Index: trunk/extensions/Maps/Maps.php |
— | — | @@ -23,7 +23,7 @@ |
24 | 24 | die( 'Not an entry point.' ); |
25 | 25 | } |
26 | 26 | |
27 | | -define('Maps_VERSION', '0.5 a6'); |
| 27 | +define('Maps_VERSION', '0.5 a7'); |
28 | 28 | |
29 | 29 | // Constants indicating the strictness of the parameter validation. |
30 | 30 | define('Maps_ERRORS_NONE', 0); |
— | — | @@ -68,7 +68,7 @@ |
69 | 69 | $egMapsDefaultService = in_array($egMapsDefaultService, $egMapsAvailableServices) ? $egMapsDefaultService : $egMapsAvailableServices[0]; |
70 | 70 | if (!in_array($egMapsDefaultGeoService, $egMapsAvailableGeoServices)) { |
71 | 71 | reset($egMapsAvailableGeoServices); |
72 | | - $egMapsDefaultGeoService = current($egMapsAvailableGeoServices); |
| 72 | + $egMapsDefaultGeoService = key($egMapsAvailableGeoServices); |
73 | 73 | } |
74 | 74 | |
75 | 75 | wfLoadExtensionMessages( 'Maps' ); |
Index: trunk/extensions/Maps/Maps_ParamManager.php |
— | — | @@ -95,7 +95,7 @@ |
96 | 96 | }
|
97 | 97 | }
|
98 | 98 |
|
99 | | - return $errorList. implode($errors, '<br />') . '</i>';
|
| 99 | + return $errorList. implode($errors, '<br />') . '</i><br />';
|
100 | 100 | }
|
101 | 101 | else {
|
102 | 102 | return '';
|
Index: trunk/extensions/Maps/Geocoders/Maps_Geocoder.php |
— | — | @@ -39,6 +39,7 @@ |
40 | 40 | * @param string $service |
41 | 41 | * @param string $mappingService |
42 | 42 | * @param string $format |
| 43 | + * |
43 | 44 | * @return formatted coordinate string or false |
44 | 45 | */ |
45 | 46 | public static function geocodeToString($address, $service = '', $mappingService = '', $format = '%1$s, %2$s') { |
— | — | @@ -53,6 +54,7 @@ |
54 | 55 | * @param string $address |
55 | 56 | * @param string $service |
56 | 57 | * @param string $mappingService |
| 58 | + * |
57 | 59 | * @return array with coordinates or false |
58 | 60 | */ |
59 | 61 | public static function geocode($address, $service, $mappingService) { |
— | — | @@ -89,6 +91,7 @@ |
90 | 92 | * |
91 | 93 | * @param string $service |
92 | 94 | * @param string $mappingService |
| 95 | + * |
93 | 96 | * @return string |
94 | 97 | */ |
95 | 98 | private static function getValidGeoService($service, $mappingService) { |
— | — | @@ -99,7 +102,7 @@ |
100 | 103 | foreach ($egMapsAvailableGeoServices as $geoService => $serviceData) { |
101 | 104 | if (in_array($mappingService, $serviceData)) { |
102 | 105 | $service = $geoService; // Use the override |
103 | | - continue; |
| 106 | + break; |
104 | 107 | } |
105 | 108 | } |
106 | 109 | |
— | — | @@ -108,7 +111,7 @@ |
109 | 112 | } |
110 | 113 | else { |
111 | 114 | // If a service is provided, but is not supported, use the default. |
112 | | - if(!array_key_exists($service, $egMapsAvailableGeoServices)) $service = $egMapsDefaultGeoService; |
| 115 | + if(! array_key_exists($service, $egMapsAvailableGeoServices)) $service = $egMapsDefaultGeoService; |
113 | 116 | } |
114 | 117 | |
115 | 118 | return $service; |