r65693 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r65692‎ | r65693 | r65694 >
Date:15:16, 30 April 2010
Author:siebrand
Status:deferred
Tags:
Comment:
Whitespace updates and comment breaks added.
Modified paths:
  • /trunk/extensions/Maps/Maps_Mapper.php (modified) (history)
  • /trunk/extensions/Maps/Maps_Settings.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Maps/Maps_Settings.php
@@ -1,18 +1,17 @@
22 <?php
3 -
43 /**
54 * File defining the settings for the Maps extension.
65 * More info can be found at http://www.mediawiki.org/wiki/Extension:Maps#Settings
76 *
87 * NOTICE:
9 - * Changing one of these settings can be done by copieng or cutting it,
 8+ * Changing one of these settings can be done by copieng or cutting it,
109 * and placing it in LocalSettings.php, AFTER the inclusion of Maps.
1110 *
1211 * @file Maps_Settings.php
1312 * @ingroup Maps
1413 *
1514 * @author Jeroen De Dauw
16 - *
 15+ *
1716 * TODO: clean up, update docs
1817 */
1918
@@ -20,21 +19,16 @@
2120 die( 'Not an entry point.' );
2221 }
2322
24 -
25 -
26 -
27 -
2823 # Map features configuration
2924 # (named) Array of String. This array contains the available features for Maps.
3025 # The array element name contains an abbriviation, used for code references,
31 -# and in the service data arrays, the value is the human readible version for displaying purpouses.
 26+# and in the service data arrays, the value is the human readible version for
 27+# displaying purposes.
3228
3329 include_once $egMapsDir . 'Features/Maps_ParserFunctions.php'; // Parser functions
34 -include_once $egMapsDir . 'Features/DisplayMap/Maps_DisplayMap.php'; // #display_map
 30+include_once $egMapsDir . 'Features/DisplayMap/Maps_DisplayMap.php'; // #display_map
3531 include_once $egMapsDir . 'Features/DisplayPoint/Maps_DisplayPoint.php'; // #display_point(s)
3632
37 -
38 -
3933 # Include the parser functions that should be loaded into Maps.
4034 # Commenting or removing a parser functions will cause Maps to completely ignore it, and so improve performance.
4135 include_once $egMapsDir . 'Geocoders/Maps_Geocoders.php'; // Geocoders
@@ -42,20 +36,16 @@
4337 include_once $egMapsDir . 'ParserFunctions/Coordinates/Maps_Coordinates.php'; // #coordinates
4438 include_once $egMapsDir . 'ParserFunctions/GeoFunctions/Maps_GeoFunctions.php'; // #geodistance
4539
46 -
47 -
48 -
49 -
5040 # Mapping services configuration
5141 # Note: You can not use aliases in the settings. Use the main service names.
5242
53 -# Include the mapping services that should be loaded into Maps.
 43+# Include the mapping services that should be loaded into Maps.
5444 # Commenting or removing a mapping service will cause Maps to completely ignore it, and so improve performance.
55 -include_once $egMapsDir . 'Services/GoogleMaps/Maps_GoogleMaps.php'; // Google Maps
56 -include_once $egMapsDir . 'Services/GoogleMaps3/Maps_GoogleMaps3.php'; // Google Maps v3
57 -include_once $egMapsDir . 'Services/OpenLayers/Maps_OpenLayers.php'; // OpenLayers
58 -include_once $egMapsDir . 'Services/YahooMaps/Maps_YahooMaps.php'; // Yahoo! Maps
59 -// include_once $egMapsDir . 'Services/OpenStreetMap/Maps_OSM.php'; // OpenLayers optimized for OSM
 45+include_once $egMapsDir . 'Services/GoogleMaps/Maps_GoogleMaps.php'; // Google Maps
 46+include_once $egMapsDir . 'Services/GoogleMaps3/Maps_GoogleMaps3.php'; // Google Maps v3
 47+include_once $egMapsDir . 'Services/OpenLayers/Maps_OpenLayers.php'; // OpenLayers
 48+include_once $egMapsDir . 'Services/YahooMaps/Maps_YahooMaps.php'; // Yahoo! Maps
 49+// include_once $egMapsDir . 'Services/OpenStreetMap/Maps_OSM.php'; // OpenLayers optimized for OSM
6050
6151 # Array of String. Array containing all the mapping services that will be made available to the user.
6252 # Currently Maps provides the following services: googlemaps, yahoomaps, openlayers
@@ -66,49 +56,45 @@
6757 'openlayers'
6858 );
6959
70 -# String. The default mapping service, which will be used when no default service is present in the
71 -# $egMapsDefaultServices array for a certain feature. A service that supports all features is recommended.
72 -# This service needs to be enabled, if not, the first one from the available services will be taken.
 60+# String. The default mapping service, which will be used when no default
 61+# service is present in the $egMapsDefaultServices array for a certain feature.
 62+# A service that supports all features is recommended. This service needs to be
 63+# enabled, if not, the first one from the available services will be taken.
7364 $egMapsDefaultService = 'googlemaps2';
7465
75 -# Array of String. The default mapping service for each feature, which will be used when no valid service is provided by the user.
76 -# Each service needs to be enabled, if not, the first one from the available services will be taken.
77 -# Note: The default service needs to be available for the feature you set it for, since it's used as a fallback mechanism.
 66+# Array of String. The default mapping service for each feature, which will be
 67+# used when no valid service is provided by the user. Each service needs to be
 68+# enabled, if not, the first one from the available services will be taken.
 69+# Note: The default service needs to be available for the feature you set it
 70+# for, since it's used as a fallback mechanism.
7871 $egMapsDefaultServices = array(
7972 'display_point' => 'googlemaps2',
8073 'display_map' => 'googlemaps2'
8174 );
8275
83 -
84 -
85 -
8676 # Geocoding services configuration
8777
88 -# Array of String. Array containing all the geocoding services that will be made available to the user.
89 -# Currently Maps provides the following services: geonames, google, yahoo
 78+# Array of String. Array containing all the geocoding services that will be
 79+# made available to the user. Currently Maps provides the following services:
 80+# geonames, google, yahoo
9081 $egMapsAvailableGeoServices = array(
9182 'geonames',
9283 'google',
9384 'yahoo'
9485 );
9586
96 -# String. The default geocoding service, which will be used when no service is provided by the user.
97 -# This service needs to be enabled, if not, the first one from the available services will be taken.
 87+# String. The default geocoding service, which will be used when no service is
 88+# is provided by the user. This service needs to be enabled, if not, the first
 89+# one from the available services will be taken.
9890 $egMapsDefaultGeoService = 'geonames';
9991
10092 $egMapsUserGeoOverrides = true;
10193
102 -
103 -
10494 # General configuration
10595
10696 # Boolean. Indicates if minified js files should be used where available.
10797 $egMapsUseMinJs = false;
10898
109 -
110 -
111 -
112 -
11399 # Coordinate configuration
114100
115101 $egMapsAvailableCoordNotations = array(
@@ -119,60 +105,62 @@
120106 );
121107
122108 # Enum. The default output format of coordinates.
123 -# Possible values: Maps_COORDS_FLOAT, Maps_COORDS_DMS, Maps_COORDS_DM, Maps_COORDS_DD
 109+# Possible values: Maps_COORDS_FLOAT, Maps_COORDS_DMS, Maps_COORDS_DM,
 110+# Maps_COORDS_DD
124111 $egMapsCoordinateNotation = Maps_COORDS_FLOAT;
125112
126 -# Boolean. Indicates if coordinates should be outputted in directional notation by default.
 113+# Boolean. Indicates if coordinates should be outputted in directional notation
 114+# by default.
127115 $egMapsCoordinateDirectional = false;
128116
129117 $egMapsAllowCoordsGeocoding = true;
130118
131119 $egMapsEnableGeoCache = true;
132120
133 -
134 -
135 -
136121 # General map configuration
137122
138 -# Integer or string. The default width and height of a map. These values will only be used when the user does not provide them.
 123+# Integer or string. The default width and height of a map. These values will
 124+# only be used when the user does not provide them.
139125 $egMapsMapWidth = '100%';
140126 $egMapsMapHeight = 350;
141127
142 -# Array. The minimum and maximum width and height for all maps.
143 -# First min and max for absolute values, then min and max for percentage values.
144 -# When the height or width exceed their limits, they will be changed to the closest allowed value.
 128+# Array. The minimum and maximum width and height for all maps. First min and
 129+# max for absolute values, then min and max for percentage values. When the
 130+# height or width exceed their limits, they will be changed to the closest
 131+# allowed value.
145132 $egMapsSizeRestrictions = array(
146133 'width' => array( 50, 1020, 1, 100 ),
147134 'height' => array( 50, 1000, 1, 100 ),
148135 );
149136
150 -# Strings. The default coordinates for the map. Must be in floating point notation.
151 -# This value will only be used when the user does not provide one.
 137+# Strings. The default coordinates for the map. Must be in floating point
 138+# notation. This value will only be used when the user does not provide one.
152139 $egMapsMapLat = '1';
153140 $egMapsMapLon = '1';
154141
155 -# Strings. The default content for all pop-ups. This value will only be used when the user does not provide one.
 142+# Strings. The default content for all pop-ups. This value will only be used
 143+# when the user does not provide one.
156144 $egMapsDefaultTitle = '';
157145 $egMapsDefaultLabel = '';
158146
159 -
160 -
161 -
162 -
163147 # Specific map properties configuration
164148
165149 # Google Maps
166150
167 -# Your Google Maps API key. Required for displaying Google Maps, and using the Google Geocoder services.
 151+# Your Google Maps API key. Required for displaying Google Maps, and using the
 152+# Google Geocoder services.
168153 $egGoogleMapsKey = ''; # http://code.google.com/apis/maps/signup.html
169154
170 -# String. The Google Maps map name prefix. It can not be identical to the one of another mapping service.
 155+# String. The Google Maps map name prefix. It can not be identical to the one
 156+# of another mapping service.
171157 $egMapsGoogleMapsPrefix = 'map_google';
172158
173 -# Integer. The default zoom of a map. This value will only be used when the user does not provide one.
 159+# Integer. The default zoom of a map. This value will only be used when the
 160+# user does not provide one.
174161 $egMapsGoogleMapsZoom = 14;
175162
176 -# Array of String. The Google Maps v2 default map types. This value will only be used when the user does not provide one.
 163+# Array of String. The Google Maps v2 default map types. This value will only
 164+# be used when the user does not provide one.
177165 $egMapsGoogleMapsTypes = array(
178166 'normal',
179167 'satellite',
@@ -180,15 +168,18 @@
181169 'physical'
182170 );
183171
184 -# String. The default map type. This value will only be used when the user does not provide one.
 172+# String. The default map type. This value will only be used when the user does
 173+# not provide one.
185174 $egMapsGoogleMapsType = 'normal';
186175
187176 # Boolean. The default value for enabling or disabling the autozoom of a map.
188177 # This value will only be used when the user does not provide one.
189178 $egMapsGoogleAutozoom = true;
190179
191 -# Array of String. The default controls for Google Maps v2. This value will only be used when the user does not provide one.
192 -# Available values: auto, large, small, large-original, small-original, zoom, type, type-menu, overview-map, scale, nav-label, overlays
 180+# Array of String. The default controls for Google Maps v2. This value will
 181+# only be used when the user does not provide one.
 182+# Available values: auto, large, small, large-original, small-original, zoom,
 183+# type, type-menu, overview-map, scale, nav-label, overlays
193184 $egMapsGMapControls = array(
194185 'auto',
195186 'scale',
@@ -196,8 +187,9 @@
197188 'overlays'
198189 );
199190
200 -# Array. The default overlays for the Google Maps v2 overlays control, and whether they should be shown at pageload.
201 -# This value will only be used when the user does not provide one.
 191+# Array. The default overlays for the Google Maps v2 overlays control, and
 192+# whether they should be shown at pageload. This value will only be used when
 193+# the user does not provide one.
202194 # Available values: photos, videos, wikipedia, webcams
203195 $egMapsGMapOverlays = array(
204196 'photos',
@@ -206,17 +198,18 @@
207199 'webcams'
208200 );
209201
210 -
211 -
212202 # Google Maps v3
213203
214 -# String. The Google Maps v3 map name prefix. It can not be identical to the one of another mapping service.
 204+# String. The Google Maps v3 map name prefix. It can not be identical to the
 205+# one of another mapping service.
215206 $egMapsGMaps3Prefix = 'map_google3';
216207
217 -# Integer. The default zoom of a map. This value will only be used when the user does not provide one.
 208+# Integer. The default zoom of a map. This value will only be used when the
 209+# user does not provide one.
218210 $egMapsGMaps3Zoom = 14;
219211
220 -# Array of String. The Google Maps v3 default map types. This value will only be used when the user does not provide one.
 212+# Array of String. The Google Maps v3 default map types. This value will only
 213+# be used when the user does not provide one.
221214 $egMapsGMaps3Types = array(
222215 'roadmap',
223216 'satellite',
@@ -224,38 +217,42 @@
225218 'terrain'
226219 );
227220
228 -# String. The default map type. This value will only be used when the user does not provide one.
 221+# String. The default map type. This value will only be used when the user
 222+# does not provide one.
229223 $egMapsGMaps3Type = 'roadmap';
230224
231 -
232 -
233225 # Yahoo! Maps
234226
235227 # Your Yahoo! Maps API key. Required for displaying Yahoo! Maps.
236228 # Haven't got an API key yet? Get it here: https://developer.yahoo.com/wsregapp/
237229 $egYahooMapsKey = '';
238230
239 -# String. The Yahoo! maps map name prefix. It can not be identical to the one of another mapping service.
 231+# String. The Yahoo! maps map name prefix. It can not be identical to the one
 232+# of another mapping service.
240233 $egMapsYahooMapsPrefix = 'map_yahoo';
241234
242 -# Array of String. The Google Maps default map types. This value will only be used when the user does not provide one.
 235+# Array of String. The Google Maps default map types. This value will only be
 236+# used when the user does not provide one.
243237 $egMapsYahooMapsTypes = array(
244238 'normal',
245239 'satellite',
246240 'hybrid'
247241 );
248242
249 -# String. The default map type. This value will only be used when the user does not provide one.
 243+# String. The default map type. This value will only be used when the user does
 244+# not provide one.
250245 $egMapsYahooMapsType = 'normal';
251246
252 -# Integer. The default zoom of a map. This value will only be used when the user does not provide one.
 247+# Integer. The default zoom of a map. This value will only be used when the
 248+# user does not provide one.
253249 $egMapsYahooMapsZoom = 4;
254250
255251 # Boolean. The default value for enabling or disabling the autozoom of a map.
256252 # This value will only be used when the user does not provide one.
257253 $egMapsYahooAutozoom = true;
258254
259 -# Array of String. The default controls for Yahoo! Maps. This value will only be used when the user does not provide one.
 255+# Array of String. The default controls for Yahoo! Maps. This value will only
 256+# be used when the user does not provide one.
260257 # Available values: type, pan, zoom, zoom-short, auto-zoom
261258 $egMapsYMapControls = array(
262259 'type',
@@ -263,18 +260,20 @@
264261 'auto-zoom'
265262 );
266263
267 -
268 -
269264 # OpenLayers
270265
271 -# String. The OpenLayers map name prefix. It can not be identical to the one of another mapping service.
 266+# String. The OpenLayers map name prefix. It can not be identical to the one of
 267+# another mapping service.
272268 $egMapsOpenLayersPrefix = 'open_layer';
273269
274 -# Integer. The default zoom of a map. This value will only be used when the user does not provide one.
 270+# Integer. The default zoom of a map. This value will only be used when the
 271+# user does not provide one.
275272 $egMapsOpenLayersZoom = 13;
276273
277 -# Array of String. The default controls for Open Layers. This value will only be used when the user does not provide one.
278 -# Available values: layerswitcher, mouseposition, autopanzoom, panzoom, panzoombar, scaleline, navigation, keyboarddefaults, overviewmap, permalink
 274+# Array of String. The default controls for Open Layers. This value will only
 275+# be used when the user does not provide one.
 276+# Available values: layerswitcher, mouseposition, autopanzoom, panzoom,
 277+# panzoombar, scaleline, navigation, keyboarddefaults, overviewmap, permalink
279278 $egMapsOLControls = array(
280279 'layerswitcher',
281280 'mouseposition',
@@ -283,7 +282,8 @@
284283 'navigation'
285284 );
286285
287 -# Array of String. The default layers for Open Layers. This value will only be used when the user does not provide one.
 286+# Array of String. The default layers for Open Layers. This value will only be
 287+# used when the user does not provide one.
288288 # Available values: google, bing, yahoo, openlayers, nasa
289289 $egMapsOLLayers = array(
290290 'openlayers-wms'
@@ -306,11 +306,12 @@
307307 'openlayers-wms' => array( 'OpenLayers.Layer.WMS( "OpenLayers WMS", "http://labs.metacarta.com/wms/vmap0",
308308 {layers: "basic", "sphericalMercator":true} )', 'ol-wms' ),
309309
310 - 'nasa' => 'OpenLayers.Layer.WMS("NASA Global Mosaic", "http://t1.hypercube.telascience.org/cgi-bin/landsat7",
 310+ 'nasa' => 'OpenLayers.Layer.WMS("NASA Global Mosaic", "http://t1.hypercube.telascience.org/cgi-bin/landsat7",
311311 {layers: "landsat7", "sphericalMercator":true} )',
312312 );
313313
314 -# Layer group definitions. Group names must be different from layer names, and must only contain layers that are present in $egMapsOLAvailableLayers.
 314+# Layer group definitions. Group names must be different from layer names, and
 315+# must only contain layers that are present in $egMapsOLAvailableLayers.
315316 $egMapsOLLayerGroups = array(
316317 'yahoo' => array( 'yahoo-normal', 'yahoo-satellite', 'yahoo-hybrid' ),
317318 'bing' => array( 'bing-normal', 'bing-satellite', 'bing-hybrid' ),
@@ -329,14 +330,18 @@
330331
331332 # OpenStreetMap (OpenLayers optimized for OSM)
332333
333 -# String. The OSM map name prefix. It can not be identical to the one of another mapping service.
 334+# String. The OSM map name prefix. It can not be identical to the one of
 335+# another mapping service.
334336 $egMapsOSMPrefix = 'map_osm';
335337
336 -# Integer. The default zoom of a map. This value will only be used when the user does not provide one.
 338+# Integer. The default zoom of a map. This value will only be used when the
 339+# user does not provide one.
337340 $egMapsOSMZoom = 13;
338341
339 -# Array of String. The default controls for OSM maps. This value will only be used when the user does not provide one.
340 -# Available values: layerswitcher, mouseposition, autopanzoom, panzoom, panzoombar, scaleline, navigation, keyboarddefaults, overviewmap, permalink
 342+# Array of String. The default controls for OSM maps. This value will only be
 343+# used when the user does not provide one.
 344+# Available values: layerswitcher, mouseposition, autopanzoom, panzoom,
 345+# panzoombar, scaleline, navigation, keyboarddefaults, overviewmap, permalink
341346 $egMapsOSMControls = array(
342347 'layerswitcher',
343348 'mouseposition',
@@ -350,5 +355,5 @@
351356 $egMapsOSMStaticAsDefault = false;
352357
353358 # Boolean. Indicates whether the user should be able to activate a static map.
354 -# This value will only be used when the user does not provide one.
355 -$egMapsOSMStaticActivatable = true;
\ No newline at end of file
 359+# This value will only be used when the user does not provide one.
 360+$egMapsOSMStaticActivatable = true;
Index: trunk/extensions/Maps/Maps_Mapper.php
@@ -1,5 +1,4 @@
22 <?php
3 -
43 /**
54 * A class that holds static helper functions for common functionality that is not map-spesific.
65 *
@@ -14,7 +13,6 @@
1514 }
1615
1716 final class MapsMapper {
18 -
1917 public static function initialize() {
2018 global $egMapsSizeRestrictions, $egMapsMapWidth, $egMapsMapHeight;
2119
@@ -265,5 +263,4 @@
266264 ),
267265 );
268266 }
269 -
270267 }

Status & tagging log