r60385 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r60384‎ | r60385 | r60386 >
Date:12:02, 25 December 2009
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Modified paths:
  • /trunk/extensions/Maps/GoogleMaps/Maps_GoogleMaps.php (modified) (history)
  • /trunk/extensions/Maps/GoogleMaps/Maps_GoogleMapsDispMap.php (modified) (history)
  • /trunk/extensions/Maps/GoogleMaps/Maps_GoogleMapsDispPoint.php (modified) (history)
  • /trunk/extensions/Maps/Maps.php (modified) (history)
  • /trunk/extensions/Maps/Maps_Mapper.php (modified) (history)
  • /trunk/extensions/Maps/Maps_Settings.php (modified) (history)
  • /trunk/extensions/Maps/OpenLayers/Maps_OpenLayers.php (modified) (history)
  • /trunk/extensions/Maps/OpenLayers/Maps_OpenLayersDispPoint.php (modified) (history)
  • /trunk/extensions/Maps/OpenStreetMap/Maps_OSM.php (modified) (history)
  • /trunk/extensions/Maps/OpenStreetMap/Maps_OSMDispPoint.php (modified) (history)
  • /trunk/extensions/Maps/YahooMaps/Maps_YahooMaps.php (modified) (history)
  • /trunk/extensions/Maps/YahooMaps/Maps_YahooMapsDispPoint.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Maps/OpenLayers/Maps_OpenLayersDispPoint.php
@@ -33,13 +33,7 @@
3434 $this->elementNamePrefix = $egMapsOpenLayersPrefix;
3535 $this->defaultZoom = $egMapsOpenLayersZoom;
3636
37 - $this->markerStringFormat = 'getOLMarkerData(lon, lat, "title", "label", "icon")';
38 -
39 - $this->spesificParameters = array(
40 - 'zoom' => array(
41 - 'default' => '',
42 - )
43 - );
 37+ $this->markerStringFormat = 'getOLMarkerData(lon, lat, "title", "label", "icon")';
4438 }
4539
4640 /**
Index: trunk/extensions/Maps/OpenLayers/Maps_OpenLayers.php
@@ -53,10 +53,9 @@
5454 private static function initializeParams() {
5555 global $egMapsServices, $egMapsOLLayers, $egMapsOLControls, $egMapsOpenLayersZoom;
5656
 57+ $egMapsServices[self::SERVICE_NAME]['parameters']['default'] = $egMapsOpenLayersZoom;
 58+
5759 $egMapsServices[self::SERVICE_NAME]['parameters'] = array(
58 - 'zoom' => array(
59 - 'default' => $egMapsOpenLayersZoom,
60 - ),
6160 'controls' => array(
6261 'type' => array('string', 'list'),
6362 'criteria' => array(
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.5.1 a7');
 37+ define('Maps_VERSION', '0.5.1 a8');
3838
3939 $egMapsScriptPath = $wgScriptPath . '/extensions/Maps';
4040 $egMapsIP = $IP . '/extensions/Maps';
@@ -103,26 +103,19 @@
104104 $wgAutoloadClasses[$values['class']] = $values['local'] ? $egMapsIP . '/' . $values['file'] : $IP . '/extensions/' . $values['file'];
105105 if (method_exists($values['class'], 'initialize')) call_user_func(array($values['class'], 'initialize'));
106106 }
107 -
108 - // Check for wich services there are handlers for the current fature, and load them
109 - foreach ($egMapsServices as $serviceData) {
110 - if (array_key_exists($key, $serviceData)) {
111 - if (array_key_exists('class', $serviceData[$key]) && array_key_exists('file', $serviceData[$key]) && array_key_exists('local', $serviceData[$key])) {
112 - $file = $serviceData[$key]['local'] ? $egMapsIP . '/' . $serviceData[$key]['file'] : $IP . '/extensions/' . $serviceData[$key]['file'];
113 - $wgAutoloadClasses[$serviceData[$key]['class']] = $file;
114 - }
115 - }
116 -
117 - if (array_key_exists('classes', $serviceData)) {
118 - foreach($serviceData['classes'] as $class) {
119 - $file = $class['local'] ? $egMapsIP . '/' . $class['file'] : $IP . '/extensions/' . $class['file'];
120 - $wgAutoloadClasses[$class['class']] = $file;
121 - if (method_exists($class['class'], 'initialize')) call_user_func(array($class['class'], 'initialize'));
122 - }
123 - }
124 - }
125107 }
126108
 109+ // Check for wich services there are handlers for the current fature, and load them
 110+ foreach ($egMapsServices as $serviceData) {
 111+ if (array_key_exists('classes', $serviceData)) {
 112+ foreach($serviceData['classes'] as $class) {
 113+ $file = $class['local'] ? $egMapsIP . '/' . $class['file'] : $IP . '/extensions/' . $class['file'];
 114+ $wgAutoloadClasses[$class['class']] = $file;
 115+ if (method_exists($class['class'], 'initialize')) call_user_func(array($class['class'], 'initialize'));
 116+ }
 117+ }
 118+ }
 119+
127120 return true;
128121 }
129122
Index: trunk/extensions/Maps/OpenStreetMap/Maps_OSM.php
@@ -51,10 +51,9 @@
5252 global $wgLang;
5353 global $egMapsServices, $egMapsOSMZoom, $egMapsOSMControls;
5454
 55+ $egMapsServices[self::SERVICE_NAME]['parameters']['default'] = $egMapsOSMZoom;
 56+
5557 $egMapsServices[self::SERVICE_NAME]['parameters'] = array(
56 - 'zoom' => array(
57 - 'default' => $egMapsOSMZoom,
58 - ),
5958 'controls' => array(
6059 'type' => array('string', 'list'),
6160 'criteria' => array(
Index: trunk/extensions/Maps/OpenStreetMap/Maps_OSMDispPoint.php
@@ -32,13 +32,7 @@
3333 $this->elementNamePrefix = $egMapsOSMPrefix;
3434 $this->defaultZoom = $egMapsOSMZoom;
3535
36 - $this->markerStringFormat = 'getOSMMarkerData(lat, lon, "title", "label", "icon")';
37 -
38 - $this->spesificParameters = array(
39 - 'zoom' => array(
40 - 'default' => '',
41 - )
42 - );
 36+ $this->markerStringFormat = 'getOSMMarkerData(lat, lon, "title", "label", "icon")';
4337 }
4438
4539 /**
Index: trunk/extensions/Maps/Maps_Mapper.php
@@ -62,18 +62,6 @@
6363 }
6464
6565 /**
66 - * TODO: remove
67 - *
68 - * Returns the JS version (true/false as string) of the provided boolean parameter.
69 - *
70 - * @param boolean $bool
71 - * @return string
72 - */
73 - public static function getJSBoolValue($bool) {
74 - return $bool ? 'true' : 'false';
75 - }
76 -
77 - /**
7866 * Returns a valid service. When an invalid service is provided, the default one will be returned.
7967 * Aliases are also chancged into the main service names @see MapsMapper::getMainServiceName().
8068 *
Index: trunk/extensions/Maps/GoogleMaps/Maps_GoogleMapsDispMap.php
@@ -22,7 +22,7 @@
2323 *
2424 */
2525 protected function setMapSettings() {
26 - global $egMapsGoogleMapsZoom, $egMapsGoogleMapsPrefix;
 26+ global $egMapsGoogleMapsZoom, $egMapsGoogleMapsPrefix, $egMapsGMapOverlays;
2727
2828 $this->elementNamePrefix = $egMapsGoogleMapsPrefix;
2929 $this->defaultZoom = $egMapsGoogleMapsZoom;
@@ -32,8 +32,8 @@
3333 'type' => array('string', 'list'),
3434 'criteria' => array(
3535 'is_google_overlay' => array()
36 - ),
37 - 'output-type' => 'array'
 36+ ),
 37+ 'default' => $egMapsGMapOverlays,
3838 ),
3939 );
4040 }
Index: trunk/extensions/Maps/GoogleMaps/Maps_GoogleMaps.php
@@ -54,10 +54,9 @@
5555
5656 $allowedTypes = self::getTypeNames();
5757
 58+ $egMapsServices[self::SERVICE_NAME]['parameters']['default'] = $egMapsGoogleMapsZoom;
 59+
5860 $egMapsServices[self::SERVICE_NAME]['parameters'] = array(
59 - 'zoom' => array(
60 - 'default' => $egMapsGoogleMapsZoom,
61 - ),
6261 'controls' => array(
6362 'type' => array('string', 'list'),
6463 'criteria' => array(
@@ -86,7 +85,7 @@
8786 'autozoom' => array(
8887 'type' => 'boolean',
8988 'aliases' => array('auto zoom', 'mouse zoom', 'mousezoom'),
90 - 'default' => $egMapsGoogleAutozoom ,
 89+ 'default' => $egMapsGoogleAutozoom,
9190 'output-type' => 'boolstr'
9291 ),
9392 'class' => array(),
@@ -225,7 +224,7 @@
226225 */
227226 public static function addOverlayOutput(&$output, $mapName, $overlays, $controls) {
228227 global $egMapsGMapOverlays, $egMapsGoogleOverlLoaded, $wgJsMimeType;
229 -
 228+
230229 // Check to see if there is an overlays control.
231230 $hasOverlayControl = in_string('overlays', $controls);
232231
Index: trunk/extensions/Maps/GoogleMaps/Maps_GoogleMapsDispPoint.php
@@ -27,7 +27,7 @@
2828 *
2929 */
3030 protected function setMapSettings() {
31 - global $egMapsGoogleMapsZoom, $egMapsGoogleMapsPrefix;
 31+ global $egMapsGoogleMapsZoom, $egMapsGoogleMapsPrefix, $egMapsGMapOverlays;
3232
3333 $this->elementNamePrefix = $egMapsGoogleMapsPrefix;
3434 $this->defaultZoom = $egMapsGoogleMapsZoom;
@@ -39,12 +39,9 @@
4040 'type' => array('string', 'list'),
4141 'criteria' => array(
4242 'is_google_overlay' => array()
43 - ),
44 - 'output-type' => 'array'
45 - ),
46 - 'zoom' => array(
47 - 'default' => '',
48 - )
 43+ ),
 44+ 'default' => $egMapsGMapOverlays,
 45+ ),
4946 );
5047 }
5148
Index: trunk/extensions/Maps/YahooMaps/Maps_YahooMapsDispPoint.php
@@ -32,13 +32,7 @@
3333 $this->elementNamePrefix = $egMapsYahooMapsPrefix;
3434 $this->defaultZoom = $egMapsYahooMapsZoom;
3535
36 - $this->markerStringFormat = 'getYMarkerData(lat, lon, "title", "label", "icon")';
37 -
38 - $this->spesificParameters = array(
39 - 'zoom' => array(
40 - 'default' => '',
41 - )
42 - );
 36+ $this->markerStringFormat = 'getYMarkerData(lat, lon, "title", "label", "icon")';
4337 }
4438
4539 /**
Index: trunk/extensions/Maps/YahooMaps/Maps_YahooMaps.php
@@ -53,10 +53,9 @@
5454
5555 $allowedTypes = MapsYahooMaps::getTypeNames();
5656
 57+ $egMapsServices[self::SERVICE_NAME]['parameters']['default'] = $egMapsYahooMapsZoom;
 58+
5759 $egMapsServices[self::SERVICE_NAME]['parameters'] = array(
58 - 'zoom' => array (
59 - 'default' => $egMapsYahooMapsZoom
60 - ),
6160 'controls' => array(
6261 'type' => array('string', 'list'),
6362 'criteria' => array(
Index: trunk/extensions/Maps/Maps_Settings.php
@@ -174,10 +174,10 @@
175175 # Available values: auto, large, small, large-original, small-original, zoom, type, type-menu, overview-map, scale, nav-label, overlays
176176 $egMapsGMapControls = array('auto', 'scale', 'type', 'overlays');
177177
178 -# Array. The default overlays for the Google Maps overlays control, and wether they should be shown at pageload.
 178+# Array. The default overlays for the Google Maps overlays control, and whether they should be shown at pageload.
179179 # This value will only be used when the user does not provide one.
180180 # Available values: photos, videos, wikipedia, webcams
181 -$egMapsGMapOverlays = array('photos' => false, 'videos' => false, 'wikipedia' => false, 'webcams' => false);
 181+$egMapsGMapOverlays = array('photos', 'videos', 'wikipedia', 'webcams');
182182
183183
184184

Status & tagging log