Index: trunk/extensions/Maps/OpenLayers/Maps_OpenLayersDispPoint.php |
— | — | @@ -33,13 +33,7 @@ |
34 | 34 | $this->elementNamePrefix = $egMapsOpenLayersPrefix; |
35 | 35 | $this->defaultZoom = $egMapsOpenLayersZoom; |
36 | 36 | |
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")'; |
44 | 38 | } |
45 | 39 | |
46 | 40 | /** |
Index: trunk/extensions/Maps/OpenLayers/Maps_OpenLayers.php |
— | — | @@ -53,10 +53,9 @@ |
54 | 54 | private static function initializeParams() { |
55 | 55 | global $egMapsServices, $egMapsOLLayers, $egMapsOLControls, $egMapsOpenLayersZoom; |
56 | 56 | |
| 57 | + $egMapsServices[self::SERVICE_NAME]['parameters']['default'] = $egMapsOpenLayersZoom; |
| 58 | + |
57 | 59 | $egMapsServices[self::SERVICE_NAME]['parameters'] = array( |
58 | | - 'zoom' => array( |
59 | | - 'default' => $egMapsOpenLayersZoom, |
60 | | - ), |
61 | 60 | 'controls' => array( |
62 | 61 | 'type' => array('string', 'list'), |
63 | 62 | 'criteria' => array( |
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.5.1 a7'); |
| 37 | + define('Maps_VERSION', '0.5.1 a8'); |
38 | 38 | |
39 | 39 | $egMapsScriptPath = $wgScriptPath . '/extensions/Maps'; |
40 | 40 | $egMapsIP = $IP . '/extensions/Maps'; |
— | — | @@ -103,26 +103,19 @@ |
104 | 104 | $wgAutoloadClasses[$values['class']] = $values['local'] ? $egMapsIP . '/' . $values['file'] : $IP . '/extensions/' . $values['file']; |
105 | 105 | if (method_exists($values['class'], 'initialize')) call_user_func(array($values['class'], 'initialize')); |
106 | 106 | } |
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 | | - } |
125 | 107 | } |
126 | 108 | |
| 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 | + |
127 | 120 | return true; |
128 | 121 | } |
129 | 122 | |
Index: trunk/extensions/Maps/OpenStreetMap/Maps_OSM.php |
— | — | @@ -51,10 +51,9 @@ |
52 | 52 | global $wgLang; |
53 | 53 | global $egMapsServices, $egMapsOSMZoom, $egMapsOSMControls; |
54 | 54 | |
| 55 | + $egMapsServices[self::SERVICE_NAME]['parameters']['default'] = $egMapsOSMZoom; |
| 56 | + |
55 | 57 | $egMapsServices[self::SERVICE_NAME]['parameters'] = array( |
56 | | - 'zoom' => array( |
57 | | - 'default' => $egMapsOSMZoom, |
58 | | - ), |
59 | 58 | 'controls' => array( |
60 | 59 | 'type' => array('string', 'list'), |
61 | 60 | 'criteria' => array( |
Index: trunk/extensions/Maps/OpenStreetMap/Maps_OSMDispPoint.php |
— | — | @@ -32,13 +32,7 @@ |
33 | 33 | $this->elementNamePrefix = $egMapsOSMPrefix; |
34 | 34 | $this->defaultZoom = $egMapsOSMZoom; |
35 | 35 | |
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")'; |
43 | 37 | } |
44 | 38 | |
45 | 39 | /** |
Index: trunk/extensions/Maps/Maps_Mapper.php |
— | — | @@ -62,18 +62,6 @@ |
63 | 63 | } |
64 | 64 | |
65 | 65 | /** |
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 | | - /** |
78 | 66 | * Returns a valid service. When an invalid service is provided, the default one will be returned. |
79 | 67 | * Aliases are also chancged into the main service names @see MapsMapper::getMainServiceName(). |
80 | 68 | * |
Index: trunk/extensions/Maps/GoogleMaps/Maps_GoogleMapsDispMap.php |
— | — | @@ -22,7 +22,7 @@ |
23 | 23 | * |
24 | 24 | */ |
25 | 25 | protected function setMapSettings() { |
26 | | - global $egMapsGoogleMapsZoom, $egMapsGoogleMapsPrefix; |
| 26 | + global $egMapsGoogleMapsZoom, $egMapsGoogleMapsPrefix, $egMapsGMapOverlays; |
27 | 27 | |
28 | 28 | $this->elementNamePrefix = $egMapsGoogleMapsPrefix; |
29 | 29 | $this->defaultZoom = $egMapsGoogleMapsZoom; |
— | — | @@ -32,8 +32,8 @@ |
33 | 33 | 'type' => array('string', 'list'), |
34 | 34 | 'criteria' => array( |
35 | 35 | 'is_google_overlay' => array() |
36 | | - ), |
37 | | - 'output-type' => 'array' |
| 36 | + ), |
| 37 | + 'default' => $egMapsGMapOverlays, |
38 | 38 | ), |
39 | 39 | ); |
40 | 40 | } |
Index: trunk/extensions/Maps/GoogleMaps/Maps_GoogleMaps.php |
— | — | @@ -54,10 +54,9 @@ |
55 | 55 | |
56 | 56 | $allowedTypes = self::getTypeNames(); |
57 | 57 | |
| 58 | + $egMapsServices[self::SERVICE_NAME]['parameters']['default'] = $egMapsGoogleMapsZoom; |
| 59 | + |
58 | 60 | $egMapsServices[self::SERVICE_NAME]['parameters'] = array( |
59 | | - 'zoom' => array( |
60 | | - 'default' => $egMapsGoogleMapsZoom, |
61 | | - ), |
62 | 61 | 'controls' => array( |
63 | 62 | 'type' => array('string', 'list'), |
64 | 63 | 'criteria' => array( |
— | — | @@ -86,7 +85,7 @@ |
87 | 86 | 'autozoom' => array( |
88 | 87 | 'type' => 'boolean', |
89 | 88 | 'aliases' => array('auto zoom', 'mouse zoom', 'mousezoom'), |
90 | | - 'default' => $egMapsGoogleAutozoom , |
| 89 | + 'default' => $egMapsGoogleAutozoom, |
91 | 90 | 'output-type' => 'boolstr' |
92 | 91 | ), |
93 | 92 | 'class' => array(), |
— | — | @@ -225,7 +224,7 @@ |
226 | 225 | */ |
227 | 226 | public static function addOverlayOutput(&$output, $mapName, $overlays, $controls) { |
228 | 227 | global $egMapsGMapOverlays, $egMapsGoogleOverlLoaded, $wgJsMimeType; |
229 | | - |
| 228 | + |
230 | 229 | // Check to see if there is an overlays control. |
231 | 230 | $hasOverlayControl = in_string('overlays', $controls); |
232 | 231 | |
Index: trunk/extensions/Maps/GoogleMaps/Maps_GoogleMapsDispPoint.php |
— | — | @@ -27,7 +27,7 @@ |
28 | 28 | * |
29 | 29 | */ |
30 | 30 | protected function setMapSettings() { |
31 | | - global $egMapsGoogleMapsZoom, $egMapsGoogleMapsPrefix; |
| 31 | + global $egMapsGoogleMapsZoom, $egMapsGoogleMapsPrefix, $egMapsGMapOverlays; |
32 | 32 | |
33 | 33 | $this->elementNamePrefix = $egMapsGoogleMapsPrefix; |
34 | 34 | $this->defaultZoom = $egMapsGoogleMapsZoom; |
— | — | @@ -39,12 +39,9 @@ |
40 | 40 | 'type' => array('string', 'list'), |
41 | 41 | 'criteria' => array( |
42 | 42 | 'is_google_overlay' => array() |
43 | | - ), |
44 | | - 'output-type' => 'array' |
45 | | - ), |
46 | | - 'zoom' => array( |
47 | | - 'default' => '', |
48 | | - ) |
| 43 | + ), |
| 44 | + 'default' => $egMapsGMapOverlays, |
| 45 | + ), |
49 | 46 | ); |
50 | 47 | } |
51 | 48 | |
Index: trunk/extensions/Maps/YahooMaps/Maps_YahooMapsDispPoint.php |
— | — | @@ -32,13 +32,7 @@ |
33 | 33 | $this->elementNamePrefix = $egMapsYahooMapsPrefix; |
34 | 34 | $this->defaultZoom = $egMapsYahooMapsZoom; |
35 | 35 | |
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")'; |
43 | 37 | } |
44 | 38 | |
45 | 39 | /** |
Index: trunk/extensions/Maps/YahooMaps/Maps_YahooMaps.php |
— | — | @@ -53,10 +53,9 @@ |
54 | 54 | |
55 | 55 | $allowedTypes = MapsYahooMaps::getTypeNames(); |
56 | 56 | |
| 57 | + $egMapsServices[self::SERVICE_NAME]['parameters']['default'] = $egMapsYahooMapsZoom; |
| 58 | + |
57 | 59 | $egMapsServices[self::SERVICE_NAME]['parameters'] = array( |
58 | | - 'zoom' => array ( |
59 | | - 'default' => $egMapsYahooMapsZoom |
60 | | - ), |
61 | 60 | 'controls' => array( |
62 | 61 | 'type' => array('string', 'list'), |
63 | 62 | 'criteria' => array( |
Index: trunk/extensions/Maps/Maps_Settings.php |
— | — | @@ -174,10 +174,10 @@ |
175 | 175 | # Available values: auto, large, small, large-original, small-original, zoom, type, type-menu, overview-map, scale, nav-label, overlays |
176 | 176 | $egMapsGMapControls = array('auto', 'scale', 'type', 'overlays'); |
177 | 177 | |
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. |
179 | 179 | # This value will only be used when the user does not provide one. |
180 | 180 | # Available values: photos, videos, wikipedia, webcams |
181 | | -$egMapsGMapOverlays = array('photos' => false, 'videos' => false, 'wikipedia' => false, 'webcams' => false); |
| 181 | +$egMapsGMapOverlays = array('photos', 'videos', 'wikipedia', 'webcams'); |
182 | 182 | |
183 | 183 | |
184 | 184 | |