r54566 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r54565‎ | r54566 | r54567 >
Date:02:35, 7 August 2009
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Changes for 0.3
Modified paths:
  • /trunk/extensions/SemanticMaps/GoogleMaps/SM_GoogleMaps.php (modified) (history)
  • /trunk/extensions/SemanticMaps/GoogleMaps/SM_GoogleMapsFormInput.php (modified) (history)
  • /trunk/extensions/SemanticMaps/OpenLayers/SM_OpenLayers.php (modified) (history)
  • /trunk/extensions/SemanticMaps/OpenLayers/SM_OpenLayersFormInput.php (modified) (history)
  • /trunk/extensions/SemanticMaps/SM_MapPrinter.php (modified) (history)
  • /trunk/extensions/SemanticMaps/YahooMaps/SM_YahooMaps.php (modified) (history)
  • /trunk/extensions/SemanticMaps/YahooMaps/SM_YahooMapsFormInput.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMaps/YahooMaps/SM_YahooMaps.php
@@ -39,12 +39,12 @@
4040 protected function doMapServiceLoad() {
4141 global $egYahooMapsOnThisPage;
4242
43 - MapsYahooMaps::addYMapDependencies($this->output);
 43+ MapsYahooMapsUtils::addYMapDependencies($this->output);
4444 $egYahooMapsOnThisPage++;
4545
4646 $this->elementNr = $egYahooMapsOnThisPage;
4747
48 - $this->defaultParams = MapsYahooMaps::getDefaultParams();
 48+ $this->defaultParams = MapsYahooMapsUtils::getDefaultParams();
4949 }
5050
5151 /**
@@ -54,13 +54,13 @@
5555 protected function addSpecificMapHTML() {
5656 global $wgJsMimeType;
5757
58 - $this->type = MapsYahooMaps::getYMapType($this->type);
59 - $this->controls = MapsYahooMaps::createControlsString($this->controls);
 58+ $this->type = MapsYahooMapsUtils::getYMapType($this->type);
 59+ $this->controls = MapsYahooMapsUtils::createControlsString($this->controls);
6060
6161 MapsUtils::makePxValue($this->width);
6262 MapsUtils::makePxValue($this->height);
6363
64 - $this->autozoom = MapsYahooMaps::getAutozoomJSValue($this->autozoom);
 64+ $this->autozoom = MapsYahooMapsUtils::getAutozoomJSValue($this->autozoom);
6565
6666 $markerItems = array();
6767
Index: trunk/extensions/SemanticMaps/YahooMaps/SM_YahooMapsFormInput.php
@@ -29,7 +29,7 @@
3030
3131 $this->earthZoom = 17;
3232
33 - $this->defaultParams = MapsYahooMaps::getDefaultParams();
 33+ $this->defaultParams = MapsYahooMapsUtils::getDefaultParams();
3434 $this->defaultZoom = $egMapsYahooMapsZoom;
3535 }
3636
@@ -42,7 +42,7 @@
4343
4444 if (empty($egYahooMapsOnThisPage)) {
4545 $egYahooMapsOnThisPage = 0;
46 - MapsYahooMaps::addYMapDependencies($this->output);
 46+ MapsYahooMapsUtils::addYMapDependencies($this->output);
4747 }
4848 $egYahooMapsOnThisPage++;
4949
@@ -56,15 +56,15 @@
5757 protected function addSpecificMapHTML() {
5858 global $wgJsMimeType;
5959
60 - $type = MapsYahooMaps::getYMapType($this->type);
 60+ $type = MapsYahooMapsUtils::getYMapType($this->type);
6161
62 - $controlItems = MapsYahooMaps::createControlsString($this->controls);
 62+ $controlItems = MapsYahooMapsUtils::createControlsString($this->controls);
6363
64 - $width = $this->width . 'px';
65 - $height = $this->height . 'px';
 64+ MapsUtils::makePxValue($this->width);
 65+ MapsUtils::makePxValue($this->height);
6666
6767 $this->output .="
68 - <div id='".$this->mapName."' style='width: $width; height: $height;'></div>
 68+ <div id='".$this->mapName."' style='width: $this->width; height: $this->height;'></div>
6969
7070 <script type='$wgJsMimeType'>/*<![CDATA[*/
7171 addLoadEvent(makeFormInputYahooMap('".$this->mapName."', '".$this->coordsFieldName."', ".$this->centre_lat.", ".$this->centre_lon.", ".$this->zoom.", ".$this->marker_lat.", ".$this->marker_lon.", $type, [$controlItems], ".$this->autozoom."));
Index: trunk/extensions/SemanticMaps/OpenLayers/SM_OpenLayers.php
@@ -32,7 +32,7 @@
3333 $this->elementNamePrefix = $egMapsOpenLayersPrefix;
3434 $this->defaultZoom = $egMapsOpenLayersZoom;
3535
36 - $this->defaultParams = MapsOpenLayers::getDefaultParams();
 36+ $this->defaultParams = MapsOpenLayersUtils::getDefaultParams();
3737 }
3838
3939 /**
@@ -42,7 +42,7 @@
4343 protected function doMapServiceLoad() {
4444 global $egOpenLayersOnThisPage;
4545
46 - MapsOpenLayers::addOLDependencies($this->output);
 46+ MapsOpenLayersUtils::addOLDependencies($this->output);
4747 $egOpenLayersOnThisPage++;
4848
4949 $this->elementNr = $egOpenLayersOnThisPage;
@@ -55,10 +55,10 @@
5656 protected function addSpecificMapHTML() {
5757 global $wgJsMimeType;
5858
59 - $controlItems = MapsOpenLayers::createControlsString($this->controls);
 59+ $controlItems = MapsOpenLayersUtils::createControlsString($this->controls);
6060
6161 MapsMapper::enforceArrayValues($this->layers);
62 - $layerItems = MapsOpenLayers::createLayersStringAndLoadDependencies($this->output, $this->layers);
 62+ $layerItems = MapsOpenLayersUtils::createLayersStringAndLoadDependencies($this->output, $this->layers);
6363
6464 MapsUtils::makePxValue($this->width);
6565 MapsUtils::makePxValue($this->height);
Index: trunk/extensions/SemanticMaps/OpenLayers/SM_OpenLayersFormInput.php
@@ -29,7 +29,7 @@
3030
3131 $this->earthZoom = 1;
3232
33 - $this->defaultParams = MapsOpenLayers::getDefaultParams();
 33+ $this->defaultParams = MapsOpenLayersUtils::getDefaultParams();
3434 $this->defaultZoom = $egMapsOpenLayersZoom;
3535 }
3636
@@ -40,7 +40,7 @@
4141 protected function doMapServiceLoad() {
4242 global $egOpenLayersOnThisPage;
4343
44 - MapsOpenLayers::addOLDependencies($this->output);
 44+ MapsOpenLayersUtils::addOLDependencies($this->output);
4545 $egOpenLayersOnThisPage++;
4646
4747 $this->elementNr = $egOpenLayersOnThisPage;
@@ -53,9 +53,9 @@
5454 protected function addSpecificMapHTML() {
5555 global $wgJsMimeType;
5656
57 - $controlItems = MapsOpenLayers::createControlsString($this->controls);
 57+ $controlItems = MapsOpenLayersUtils::createControlsString($this->controls);
5858
59 - $layerItems = MapsOpenLayers::createLayersStringAndLoadDependencies($this->output, $this->layers);
 59+ $layerItems = MapsOpenLayersUtils::createLayersStringAndLoadDependencies($this->output, $this->layers);
6060
6161 $width = $this->width . 'px';
6262 $height = $this->height . 'px';
Index: trunk/extensions/SemanticMaps/SM_MapPrinter.php
@@ -207,9 +207,11 @@
208208 */
209209 private function setCentre() {
210210 if (strlen($this->centre) > 0) {
 211+ // If a centre value is set, use it.
211212 list($this->centre_lat, $this->centre_lon) = MapsUtils::getLatLon($this->centre);
212213 }
213214 else {
 215+ // If centre is not set, set the values to null, to be auto determined by the JS of the mapping API.
214216 $this->centre_lat = 'null';
215217 $this->centre_lon = 'null';
216218 }
Index: trunk/extensions/SemanticMaps/GoogleMaps/SM_GoogleMaps.php
@@ -34,7 +34,7 @@
3535
3636 $this->defaultZoom = $egMapsGoogleMapsZoom;
3737
38 - $this->defaultParams = MapsGoogleMaps::getDefaultParams();
 38+ $this->defaultParams = MapsGoogleMapsUtils::getDefaultParams();
3939 }
4040
4141 /**
@@ -46,7 +46,7 @@
4747
4848 if (empty($egGoogleMapsOnThisPage)) {
4949 $egGoogleMapsOnThisPage = 0;
50 - MapsGoogleMaps::addGMapDependencies($this->output);
 50+ MapsGoogleMapsUtils::addGMapDependencies($this->output);
5151 }
5252
5353 $egGoogleMapsOnThisPage++;
@@ -61,14 +61,14 @@
6262 protected function addSpecificMapHTML() {
6363 global $wgJsMimeType;
6464
65 - $enableEarth = MapsGoogleMaps::getEarthValue($this->earth);
 65+ $enableEarth = MapsGoogleMapsUtils::getEarthValue($this->earth);
6666 $this->earth = MapsMapper::getJSBoolValue($enableEarth);
6767
6868 // Get the Google Maps names for the control and map types
69 - $this->type = MapsGoogleMaps::getGMapType($this->type, $enableEarth);
70 - $control = MapsGoogleMaps::getGControlType($this->controls);
 69+ $this->type = MapsGoogleMapsUtils::getGMapType($this->type, $enableEarth);
 70+ $control = MapsGoogleMapsUtils::getGControlType($this->controls);
7171
72 - $this->autozoom = MapsGoogleMaps::getAutozoomJSValue($this->autozoom);
 72+ $this->autozoom = MapsGoogleMapsUtils::getAutozoomJSValue($this->autozoom);
7373
7474 $markerItems = array();
7575
Index: trunk/extensions/SemanticMaps/GoogleMaps/SM_GoogleMapsFormInput.php
@@ -31,7 +31,7 @@
3232
3333 $this->earthZoom = 1;
3434
35 - $this->defaultParams = MapsGoogleMaps::getDefaultParams();
 35+ $this->defaultParams = MapsGoogleMapsUtils::getDefaultParams();
3636 $this->defaultZoom = $egMapsGoogleMapsZoom;
3737 }
3838
@@ -45,7 +45,7 @@
4646
4747 if (empty($egGoogleMapsOnThisPage)) {
4848 $egGoogleMapsOnThisPage = 0;
49 - MapsGoogleMaps::addGMapDependencies($this->output);
 49+ MapsGoogleMapsUtils::addGMapDependencies($this->output);
5050 }
5151
5252 $egGoogleMapsOnThisPage++;
@@ -63,8 +63,8 @@
6464 $enableEarth = $this-earth == 'on' || $this->earth == 'yes';
6565 $earth = $enableEarth ? 'true' : 'false';
6666
67 - $this->type = MapsGoogleMaps::getGMapType($this->type, $enableEarth);
68 - $control = MapsGoogleMaps::getGControlType($this->controls);
 67+ $this->type = MapsGoogleMapsUtils::getGMapType($this->type, $enableEarth);
 68+ $control = MapsGoogleMapsUtils::getGControlType($this->controls);
6969
7070 $this->output .= "
7171 <div id='".$this->mapName."' class='".$this->class."'></div>

Status & tagging log