r64475 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r64474‎ | r64475 | r64476 >
Date:09:42, 1 April 2010
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Added setting and functions for coordinate parser function
Modified paths:
  • /trunk/extensions/Maps/Maps.php (modified) (history)
  • /trunk/extensions/Maps/Maps_Settings.php (modified) (history)
  • /trunk/extensions/Maps/ParserFunctions/Coordinates (added) (history)
  • /trunk/extensions/Maps/ParserFunctions/Coordinates/Maps_Coordinates.php (added) (history)

Diff [purge]

Index: trunk/extensions/Maps/ParserFunctions/Coordinates/Maps_Coordinates.php
@@ -0,0 +1,42 @@
 2+<?php
 3+
 4+/**
 5+ * This file contains registration
 6+ *
 7+ *
 8+ *
 9+ * @file Maps_Coordinates.php
 10+ * @ingroup Maps
 11+ *
 12+ * @author Jeroen De Dauw
 13+ */
 14+
 15+if ( !defined( 'MEDIAWIKI' ) ) {
 16+ die( 'Not an entry point.' );
 17+}
 18+
 19+$wgHooks['LanguageGetMagic'][] = 'efMapsCoordinatesMagic';
 20+$wgHooks['ParserFirstCallInit'][] = 'efMapsCoordinatesFunction';
 21+
 22+/**
 23+ * Adds the magic words for the parser functions.
 24+ */
 25+function efMapsCoordinatesMagic( &$magicWords, $langCode ) {
 26+ $magicWords['coordinates'] = array( 0, 'coordinates' );
 27+
 28+ return true; // Unless we return true, other parser functions won't get loaded.
 29+}
 30+
 31+/**
 32+ * Adds the parser function hooks.
 33+ */
 34+function efMapsCoordinatesFunction( &$wgParser ) {
 35+ // Hooks to enable the geocoding parser functions.
 36+ $wgParser->setFunctionHook( 'coordinates', 'efMapsRenderCoordinates' );
 37+
 38+ return true;
 39+}
 40+
 41+function efMapsRenderCoordinates() {
 42+
 43+}
\ No newline at end of file
Property changes on: trunk/extensions/Maps/ParserFunctions/Coordinates/Maps_Coordinates.php
___________________________________________________________________
Name: svn:eol-style
144 + native
Index: trunk/extensions/Maps/Maps.php
@@ -33,7 +33,7 @@
3434 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>.';
3535 }
3636 else {
37 - define( 'Maps_VERSION', '0.6 a8' );
 37+ define( 'Maps_VERSION', '0.6 a9' );
3838
3939 // The different coordinate notations.
4040 define( 'Maps_COORDS_FLOAT', 'float' );
Index: trunk/extensions/Maps/Maps_Settings.php
@@ -37,7 +37,11 @@
3838
3939 # Array of String. Array containing all the geocoding services that will be made available to the user.
4040 # Currently Maps provides the following services: geonames, google, yahoo
41 -$egMapsAvailableGeoServices = array('geonames', 'google', 'yahoo');
 41+$egMapsAvailableGeoServices = array(
 42+ 'geonames',
 43+ 'google',
 44+ 'yahoo'
 45+);
4246
4347 # String. The default geocoding service, which will be used when no service is provided by the user.
4448 # This service needs to be enabled, if not, the first one from the available services will be taken.
@@ -47,9 +51,10 @@
4852
4953 # Include the parser functions that should be loaded into Maps.
5054 # Commenting or removing a parser functions will cause Maps to completely ignore it, and so improve performance.
51 -include_once $egMapsDir . 'ParserFunctions/DisplayMap/Maps_DisplayMap.php'; // display_map
52 -include_once $egMapsDir . 'ParserFunctions/DisplayPoint/Maps_DisplayPoint.php'; // display_point(s)
53 -include_once $egMapsDir . 'ParserFunctions/Geocode/Maps_GeocodeFunctions.php'; // geocode, geocodelon, geocodelat
 55+include_once $egMapsDir . 'ParserFunctions/DisplayMap/Maps_DisplayMap.php'; // #display_map
 56+include_once $egMapsDir . 'ParserFunctions/DisplayPoint/Maps_DisplayPoint.php'; // #display_point(s)
 57+include_once $egMapsDir . 'ParserFunctions/Geocode/Maps_GeocodeFunctions.php'; // #geocode, #geocodelat, #geocodelon
 58+include_once $egMapsDir . 'ParserFunctions/Coordinates/Maps_Coordinates.php'; // #coordinates
5459
5560
5661
@@ -57,9 +62,6 @@
5863 # Mapping services configuration
5964 # Note: You can not use aliases in the settings. Use the main service names.
6065
61 -# Initialization of the mapping services array.
62 -$egMapsServices = array();
63 -
6466 # Include the mapping services that should be loaded into Maps.
6567 # Commenting or removing a mapping service will cause Maps to completely ignore it, and so improve performance.
6668 include_once $egMapsDir . 'GoogleMaps/Maps_GoogleMaps.php'; // Google Maps
@@ -70,7 +72,12 @@
7173
7274 # Array of String. Array containing all the mapping services that will be made available to the user.
7375 # Currently Maps provides the following services: googlemaps, yahoomaps, openlayers
74 -$egMapsAvailableServices = array( 'googlemaps2', 'googlemaps3', 'yahoomaps', 'openlayers' );
 76+$egMapsAvailableServices = array(
 77+ 'googlemaps2',
 78+ 'googlemaps3',
 79+ 'yahoomaps',
 80+ 'openlayers'
 81+);
7582
7683 # String. The default mapping service, which will be used when no default service is present in the
7784 # $egMapsDefaultServices array for a certain feature. A service that supports all features is recommended.
@@ -91,10 +98,6 @@
9299
93100
94101
95 -
96 -
97 -
98 -
99102 # General configuration
100103
101104 # Boolean. Indicates if minified js files should be used where available.
@@ -106,6 +109,13 @@
107110
108111 # Coordinate configuration
109112
 113+$egMapsAvailableCoordNotations = array(
 114+ Maps_COORDS_FLOAT,
 115+ Maps_COORDS_DMS,
 116+ Maps_COORDS_DM,
 117+ Maps_COORDS_DD
 118+);
 119+
110120 # Enum. The default output format of coordinates.
111121 # Possible values: Maps_COORDS_FLOAT, Maps_COORDS_DMS, Maps_COORDS_DM, Maps_COORDS_DD
112122 $egMapsCoordinateNotation = Maps_COORDS_FLOAT;
@@ -117,6 +127,8 @@
118128
119129
120130
 131+
 132+
121133 # General map configuration
122134
123135 # Integer or string. The default width and height of a map. These values will only be used when the user does not provide them.
@@ -163,7 +175,12 @@
164176 $egMapsGoogleMapsZoom = 14;
165177
166178 # Array of String. The Google Maps v2 default map types. This value will only be used when the user does not provide one.
167 -$egMapsGoogleMapsTypes = array( 'normal', 'satellite', 'hybrid', 'physical' );
 179+$egMapsGoogleMapsTypes = array(
 180+ 'normal',
 181+ 'satellite',
 182+ 'hybrid',
 183+ 'physical'
 184+);
168185
169186 # String. The default map type. This value will only be used when the user does not provide one.
170187 $egMapsGoogleMapsType = 'normal';
@@ -174,12 +191,22 @@
175192
176193 # Array of String. The default controls for Google Maps v2. This value will only be used when the user does not provide one.
177194 # Available values: auto, large, small, large-original, small-original, zoom, type, type-menu, overview-map, scale, nav-label, overlays
178 -$egMapsGMapControls = array( 'auto', 'scale', 'type', 'overlays' );
 195+$egMapsGMapControls = array(
 196+ 'auto',
 197+ 'scale',
 198+ 'type',
 199+ 'overlays'
 200+);
179201
180202 # Array. The default overlays for the Google Maps v2 overlays control, and whether they should be shown at pageload.
181203 # This value will only be used when the user does not provide one.
182204 # Available values: photos, videos, wikipedia, webcams
183 -$egMapsGMapOverlays = array( 'photos', 'videos', 'wikipedia', 'webcams' );
 205+$egMapsGMapOverlays = array(
 206+ 'photos',
 207+ 'videos',
 208+ 'wikipedia',
 209+ 'webcams'
 210+);
184211
185212
186213
@@ -192,7 +219,12 @@
193220 $egMapsGMaps3Zoom = 14;
194221
195222 # Array of String. The Google Maps v3 default map types. This value will only be used when the user does not provide one.
196 -$egMapsGMaps3Types = array( 'roadmap', 'satellite', 'hybrid', 'terrain' );
 223+$egMapsGMaps3Types = array(
 224+ 'roadmap',
 225+ 'satellite',
 226+ 'hybrid',
 227+ 'terrain'
 228+);
197229
198230 # String. The default map type. This value will only be used when the user does not provide one.
199231 $egMapsGMaps3Type = 'roadmap';
@@ -209,7 +241,11 @@
210242 $egMapsYahooMapsPrefix = 'map_yahoo';
211243
212244 # Array of String. The Google Maps default map types. This value will only be used when the user does not provide one.
213 -$egMapsYahooMapsTypes = array( 'normal', 'satellite', 'hybrid' );
 245+$egMapsYahooMapsTypes = array(
 246+ 'normal',
 247+ 'satellite',
 248+ 'hybrid'
 249+);
214250
215251 # String. The default map type. This value will only be used when the user does not provide one.
216252 $egMapsYahooMapsType = 'normal';
@@ -223,7 +259,11 @@
224260
225261 # Array of String. The default controls for Yahoo! Maps. This value will only be used when the user does not provide one.
226262 # Available values: type, pan, zoom, zoom-short, auto-zoom
227 -$egMapsYMapControls = array( 'type', 'pan', 'auto-zoom' );
 263+$egMapsYMapControls = array(
 264+ 'type',
 265+ 'pan',
 266+ 'auto-zoom'
 267+);
228268
229269
230270
@@ -237,11 +277,19 @@
238278
239279 # Array of String. The default controls for Open Layers. This value will only be used when the user does not provide one.
240280 # Available values: layerswitcher, mouseposition, autopanzoom, panzoom, panzoombar, scaleline, navigation, keyboarddefaults, overviewmap, permalink
241 -$egMapsOLControls = array( 'layerswitcher', 'mouseposition', 'autopanzoom', 'scaleline', 'navigation' );
 281+$egMapsOLControls = array(
 282+ 'layerswitcher',
 283+ 'mouseposition',
 284+ 'autopanzoom',
 285+ 'scaleline',
 286+ 'navigation'
 287+);
242288
243289 # Array of String. The default layers for Open Layers. This value will only be used when the user does not provide one.
244290 # Available values: google, bing, yahoo, openlayers, nasa
245 -$egMapsOLLayers = array( 'openlayers-wms' );
 291+$egMapsOLLayers = array(
 292+ 'openlayers-wms'
 293+);
246294
247295 # The difinitions for the layers that should be available for the user.
248296 $egMapsOLAvailableLayers = array(
@@ -291,7 +339,13 @@
292340
293341 # Array of String. The default controls for OSM maps. This value will only be used when the user does not provide one.
294342 # Available values: layerswitcher, mouseposition, autopanzoom, panzoom, panzoombar, scaleline, navigation, keyboarddefaults, overviewmap, permalink
295 -$egMapsOSMControls = array( 'layerswitcher', 'mouseposition', 'autopanzoom', 'scaleline', 'navigation' );
 343+$egMapsOSMControls = array(
 344+ 'layerswitcher',
 345+ 'mouseposition',
 346+ 'autopanzoom',
 347+ 'scaleline',
 348+ 'navigation'
 349+);
296350
297351 # Boolean. Indicates whether you want to get a static map (image) or not.
298352 # This value will only be used when the user does not provide one.

Status & tagging log