Index: trunk/extensions/Maps/ParserFunctions/Maps_Coordinates.php |
— | — | @@ -54,7 +54,8 @@ |
55 | 55 | $args, |
56 | 56 | array( |
57 | 57 | 'location' => array( |
58 | | - 'required' => true |
| 58 | + 'required' => true, |
| 59 | + 'tolower' => false |
59 | 60 | ), |
60 | 61 | 'format' => array( |
61 | 62 | 'criteria' => array( |
— | — | @@ -85,13 +86,13 @@ |
86 | 87 | } |
87 | 88 | |
88 | 89 | $errorList = $manager->getErrorList(); |
89 | | - |
| 90 | + |
90 | 91 | if ( $errorList != '' ) { |
91 | | - $output .= $errorList; |
| 92 | + $output .= '<br />' . $errorList; |
92 | 93 | } |
93 | 94 | } else { |
94 | 95 | $output = $manager->getErrorList(); |
95 | 96 | } |
96 | 97 | |
97 | | - return array( $output, 'noparse' => true, 'isHTML' => true ); |
| 98 | + return array( $output ); |
98 | 99 | } |
\ No newline at end of file |
Index: trunk/extensions/Maps/ParserFunctions/Maps_GeocodeFunctions.php |
— | — | @@ -72,47 +72,48 @@ |
73 | 73 | |
74 | 74 | $manager = new ValidatorManager(); |
75 | 75 | |
76 | | -$doGeocoding = $manager->manageParameters( |
77 | | - $args, |
78 | | - array( |
79 | | - 'location' => array( |
80 | | - 'required' => true |
81 | | - ), |
82 | | - 'mappingservice' => array( |
83 | | - 'criteria' => array( |
84 | | - 'in_array' => $egMapsAvailableServices |
| 76 | + $doGeocoding = $manager->manageParameters( |
| 77 | + $args, |
| 78 | + array( |
| 79 | + 'location' => array( |
| 80 | + 'required' => true, |
| 81 | + 'tolower' => false |
| 82 | + ), |
| 83 | + 'mappingservice' => array( |
| 84 | + 'criteria' => array( |
| 85 | + 'in_array' => $egMapsAvailableServices |
| 86 | + ), |
| 87 | + 'default' => false |
| 88 | + ), |
| 89 | + 'service' => array( |
| 90 | + 'criteria' => array( |
| 91 | + 'in_array' => $egMapsAvailableGeoServices |
| 92 | + ), |
| 93 | + 'default' => $egMapsDefaultGeoService |
| 94 | + ), |
| 95 | + 'format' => array( |
| 96 | + 'criteria' => array( |
| 97 | + 'in_array' => $egMapsAvailableCoordNotations |
| 98 | + ), |
| 99 | + 'aliases' => array( |
| 100 | + 'notation' |
| 101 | + ), |
| 102 | + 'default' => $egMapsCoordinateNotation |
| 103 | + ), |
| 104 | + 'allowcoordinates' => array( |
| 105 | + 'type' => 'boolean', |
| 106 | + 'default' => $egMapsAllowCoordsGeocoding |
| 107 | + ), |
| 108 | + 'directional' => array( |
| 109 | + 'type' => 'boolean', |
| 110 | + 'default' => $egMapsCoordinateDirectional |
| 111 | + ), |
85 | 112 | ), |
86 | | - 'default' => false |
87 | | - ), |
88 | | - 'service' => array( |
89 | | - 'criteria' => array( |
90 | | - 'in_array' => $egMapsAvailableGeoServices |
91 | | - ), |
92 | | - 'default' => $egMapsDefaultGeoService |
93 | | - ), |
94 | | - 'format' => array( |
95 | | - 'criteria' => array( |
96 | | - 'in_array' => $egMapsAvailableCoordNotations |
97 | | - ), |
98 | | - 'aliases' => array( |
99 | | - 'notation' |
100 | | - ), |
101 | | - 'default' => $egMapsCoordinateNotation |
102 | | - ), |
103 | | - 'allowcoordinates' => array( |
104 | | - 'type' => 'boolean', |
105 | | - 'default' => $egMapsAllowCoordsGeocoding |
106 | | - ), |
107 | | - 'directional' => array( |
108 | | - 'type' => 'boolean', |
109 | | - 'default' => $egMapsCoordinateDirectional |
110 | | - ), |
111 | | - ), |
112 | | - array( 'location', 'service', 'mappingservice' ) |
113 | | -); |
114 | | - |
115 | | -if ( $doGeocoding ) { |
116 | | - $parameters = $manager->getParameters( false ); |
| 113 | + array( 'location', 'service', 'mappingservice' ) |
| 114 | + ); |
| 115 | + |
| 116 | + if ( $doGeocoding ) { |
| 117 | + $parameters = $manager->getParameters( false ); |
117 | 118 | |
118 | 119 | if ( self::geocoderIsAvailable() ) { |
119 | 120 | $geovalues = MapsGeocoder::attemptToGeocodeToString( |
Index: trunk/extensions/Maps/ParserFunctions/Maps_GeoFunctions.php |
— | — | @@ -69,10 +69,12 @@ |
70 | 70 | $args, |
71 | 71 | array( |
72 | 72 | 'location1' => array( |
73 | | - 'required' => true |
| 73 | + 'required' => true, |
| 74 | + 'tolower' => false |
74 | 75 | ), |
75 | 76 | 'location2' => array( |
76 | | - 'required' => true |
| 77 | + 'required' => true, |
| 78 | + 'tolower' => false |
77 | 79 | ), |
78 | 80 | 'unit' => array( |
79 | 81 | 'criteria' => array( |
— | — | @@ -164,7 +166,8 @@ |
165 | 167 | $args, |
166 | 168 | array( |
167 | 169 | 'location' => array( |
168 | | - 'required' => true |
| 170 | + 'required' => true, |
| 171 | + 'tolower' => false |
169 | 172 | ), |
170 | 173 | 'bearing' => array( |
171 | 174 | 'type' => 'float', |
Index: trunk/extensions/Maps/Includes/Maps_CoordinateParser.php |
— | — | @@ -1,19 +1,6 @@ |
2 | 2 | <?php |
3 | 3 | |
4 | 4 | /** |
5 | | - * File holding class MapsCoordinateParser. |
6 | | - * |
7 | | - * @file Maps_CoordinateParser.php |
8 | | - * @ingroup Maps |
9 | | - * |
10 | | - * @author Jeroen De Dauw |
11 | | - */ |
12 | | - |
13 | | -if ( !defined( 'MEDIAWIKI' ) ) { |
14 | | - die( 'Not an entry point.' ); |
15 | | -} |
16 | | - |
17 | | -/** |
18 | 5 | * Static class for coordinate validation and parsing. |
19 | 6 | * Supports floats, DMS, decimal degrees, and decimal minutes notations, both directional and non-directional. |
20 | 7 | * Internal representatations are arrays with lat and lon key with float values. |
— | — | @@ -26,6 +13,7 @@ |
27 | 14 | * regex to also accept dm and dd, which can give unexpected results in certain |
28 | 15 | * usecases. The different seperator support could also be made nice. |
29 | 16 | * |
| 17 | + * @file Maps_CoordinateParser.php |
30 | 18 | * @ingroup Maps |
31 | 19 | * @since 0.6 |
32 | 20 | * |
— | — | @@ -382,13 +370,26 @@ |
383 | 371 | * @since 0.6 |
384 | 372 | */ |
385 | 373 | protected static function initializeDirectionLabels() { |
| 374 | + global $egMapsInternatDirectionLabels; |
| 375 | + |
386 | 376 | if ( !self::$i18nDirections ) { |
387 | | - self::$i18nDirections = array( |
388 | | - 'N' => wfMsgForContent( 'maps-abb-north' ), |
389 | | - 'E' => wfMsgForContent( 'maps-abb-east' ), |
390 | | - 'S' => wfMsgForContent( 'maps-abb-south' ), |
391 | | - 'W' => wfMsgForContent( 'maps-abb-west' ), |
392 | | - ); |
| 377 | + if ( $egMapsInternatDirectionLabels ) { |
| 378 | + self::$i18nDirections = array( |
| 379 | + 'N' => wfMsgForContent( 'maps-abb-north' ), |
| 380 | + 'E' => wfMsgForContent( 'maps-abb-east' ), |
| 381 | + 'S' => wfMsgForContent( 'maps-abb-south' ), |
| 382 | + 'W' => wfMsgForContent( 'maps-abb-west' ), |
| 383 | + ); |
| 384 | + } |
| 385 | + else { |
| 386 | + self::$i18nDirections = array( |
| 387 | + 'N' => 'N', |
| 388 | + 'E' => 'E', |
| 389 | + 'S' => 'S', |
| 390 | + 'W' => 'W', |
| 391 | + ); |
| 392 | + } |
| 393 | + |
393 | 394 | self::$directions = array_keys( self::$i18nDirections ); |
394 | 395 | } |
395 | 396 | } |
Index: trunk/extensions/Maps/Includes/Maps_Mapper.php |
— | — | @@ -1,22 +1,13 @@ |
2 | 2 | <?php |
3 | | -/** |
4 | | - * A class that holds static helper functions for common functionality that is not map-specific. |
5 | | - * |
6 | | - * @file Maps_Mapper.php |
7 | | - * @ingroup Maps |
8 | | - * |
9 | | - * @author Jeroen De Dauw |
10 | | - */ |
11 | 3 | |
12 | | -if ( !defined( 'MEDIAWIKI' ) ) { |
13 | | - die( 'Not an entry point.' ); |
14 | | -} |
15 | | - |
16 | 4 | /** |
17 | | - * Class with generic mapping methods. |
| 5 | + * A class that holds static helper functions for generic mapping-related functions. |
18 | 6 | * |
19 | 7 | * @since 0.1 |
20 | 8 | * |
| 9 | + * @file Maps_Mapper.php |
| 10 | + * @ingroup Maps |
| 11 | + * |
21 | 12 | * @author Jeroen De Dauw |
22 | 13 | */ |
23 | 14 | final class MapsMapper { |
— | — | @@ -252,4 +243,5 @@ |
253 | 244 | ), |
254 | 245 | ); |
255 | 246 | } |
| 247 | + |
256 | 248 | } |
\ No newline at end of file |
Index: trunk/extensions/Maps/Maps.php |
— | — | @@ -33,7 +33,7 @@ |
34 | 34 | echo '<b>Warning:</b> You need to have <a href="http://www.mediawiki.org/wiki/Extension:Validator">Validator</a> installed in order to use <a href="http://www.mediawiki.org/wiki/Extension:Maps">Maps</a>.'; |
35 | 35 | } |
36 | 36 | else { |
37 | | - define( 'Maps_VERSION', '0.6.6 rc1' ); |
| 37 | + define( 'Maps_VERSION', '0.6.6 rc2' ); |
38 | 38 | |
39 | 39 | // The different coordinate notations. |
40 | 40 | define( 'Maps_COORDS_FLOAT', 'float' ); |
Index: trunk/extensions/Maps/Maps_Settings.php |
— | — | @@ -148,6 +148,9 @@ |
149 | 149 | |
150 | 150 | # Boolean. Sets if geocoded addresses should be stored in a cache. |
151 | 151 | $egMapsEnableGeoCache = true; |
| 152 | + |
| 153 | + # Boolean. Sets if direction labels should be translated to their equivalent in the wiki language or not. |
| 154 | + $egMapsInternatDirectionLabels = true; |
152 | 155 | |
153 | 156 | |
154 | 157 | |
Index: trunk/extensions/Maps/Features/DisplayPoint/Maps_DisplayPoint.php |
— | — | @@ -96,4 +96,4 @@ |
97 | 97 | $location = $segments; |
98 | 98 | } |
99 | 99 | |
100 | | -} |
| 100 | +} |
\ No newline at end of file |
Index: trunk/extensions/Maps/Features/DisplayPoint/Maps_BasePointMap.php |
— | — | @@ -94,6 +94,7 @@ |
95 | 95 | ), |
96 | 96 | 'centre' => array( |
97 | 97 | 'aliases' => array( 'center' ), |
| 98 | + 'tolower' => false, |
98 | 99 | ), |
99 | 100 | 'title' => array( |
100 | 101 | 'default' => $egMapsDefaultTitle |
— | — | @@ -108,6 +109,7 @@ |
109 | 110 | ), |
110 | 111 | 'coordinates' => array( |
111 | 112 | 'required' => true, |
| 113 | + 'tolower' => false, |
112 | 114 | 'type' => array( 'string', 'list', ';' ), |
113 | 115 | 'aliases' => array( 'coords', 'location', 'locations', 'address', 'addresses' ), |
114 | 116 | 'criteria' => array( |
— | — | @@ -256,4 +258,5 @@ |
257 | 259 | $this->centreLat = $egMapsMapLat; |
258 | 260 | $this->centreLon = $egMapsMapLon; |
259 | 261 | } |
| 262 | + |
260 | 263 | } |
\ No newline at end of file |
Index: trunk/extensions/Maps/Features/DisplayMap/Maps_BaseMap.php |
— | — | @@ -96,6 +96,7 @@ |
97 | 97 | ), |
98 | 98 | 'coordinates' => array( |
99 | 99 | 'required' => true, |
| 100 | + 'tolower' => false, |
100 | 101 | 'aliases' => array( 'coords', 'location', 'address' ), |
101 | 102 | 'criteria' => array( |
102 | 103 | 'is_location' => array() |