r54319 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r54318‎ | r54319 | r54320 >
Date:22:43, 3 August 2009
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Refactoring for 0.3
Modified paths:
  • /trunk/extensions/SemanticMaps/GoogleMaps/SM_GoogleMapsFormInput.php (modified) (history)
  • /trunk/extensions/SemanticMaps/OpenLayers/SM_OpenLayersFormInput.php (modified) (history)
  • /trunk/extensions/SemanticMaps/SM_FormInput.php (modified) (history)
  • /trunk/extensions/SemanticMaps/YahooMaps/SM_YahooMapsFormInput.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMaps/YahooMaps/SM_YahooMapsFormInput.php
@@ -16,10 +16,10 @@
1717 final class SMYahooMapsFormInput extends SMFormInput {
1818
1919 /**
20 - * @see SMFormInput::setFormInputSettings()
 20+ * @see MapsMapFeature::setMapSettings()
2121 *
2222 */
23 - protected function setFormInputSettings() {
 23+ protected function setMapSettings() {
2424 global $egMapsYahooMapsZoom;
2525
2626 $this->elementNamePrefix = 'map_yahoo';
@@ -30,7 +30,7 @@
3131 }
3232
3333 /**
34 - * @see SMFormInput::doMapServiceLoad()
 34+ * @see MapsMapFeature::doMapServiceLoad()
3535 *
3636 */
3737 protected function doMapServiceLoad() {
@@ -38,7 +38,7 @@
3939
4040 if (empty($egYahooMapsOnThisPage)) {
4141 $egYahooMapsOnThisPage = 0;
42 - MapsYahooMaps::addYMapDependencies($this->formOutput);
 42+ MapsYahooMaps::addYMapDependencies($this->output);
4343 }
4444 $egYahooMapsOnThisPage++;
4545
@@ -46,10 +46,10 @@
4747 }
4848
4949 /**
50 - * @see SMFormInput::addSpecificFormInputHTML()
 50+ * @see MapsMapFeature::addSpecificMapHTML()
5151 *
5252 */
53 - protected function addSpecificFormInputHTML() {
 53+ protected function addSpecificMapHTML() {
5454 global $wgJsMimeType;
5555
5656 $type = MapsYahooMaps::getYMapType($this->type);
@@ -59,7 +59,7 @@
6060 $width = $this->width . 'px';
6161 $height = $this->height . 'px';
6262
63 - $this->formOutput .="
 63+ $this->output .="
6464 <div id='".$this->mapName."' style='width: $width; height: $height;'></div>
6565
6666 <script type='$wgJsMimeType'>/*<![CDATA[*/
@@ -74,7 +74,7 @@
7575 protected function manageGeocoding() {
7676 global $egYahooMapsKey;
7777 $this->enableGeocoding = strlen(trim($egYahooMapsKey)) > 0;
78 - if ($this->enableGeocoding) MapsYahooMaps::addYMapDependencies($this->formOutput);
 78+ if ($this->enableGeocoding) MapsYahooMaps::addYMapDependencies($this->output);
7979 }
8080
8181
Index: trunk/extensions/SemanticMaps/OpenLayers/SM_OpenLayersFormInput.php
@@ -16,10 +16,10 @@
1717 final class SMOpenLayersFormInput extends SMFormInput {
1818
1919 /**
20 - * @see SMFormInput::setFormInputSettings()
 20+ * @see MapsMapFeature::setMapSettings()
2121 *
2222 */
23 - protected function setFormInputSettings() {
 23+ protected function setMapSettings() {
2424 global $egMapsOpenLayersZoom;
2525
2626 $this->elementNamePrefix = 'open_layer';
@@ -30,33 +30,33 @@
3131 }
3232
3333 /**
34 - * @see SMFormInput::doMapServiceLoad()
 34+ * @see MapsMapFeature::doMapServiceLoad()
3535 *
3636 */
3737 protected function doMapServiceLoad() {
3838 global $egOpenLayersOnThisPage;
3939
40 - MapsOpenLayers::addOLDependencies($this->formOutput);
 40+ MapsOpenLayers::addOLDependencies($this->output);
4141 $egOpenLayersOnThisPage++;
4242
4343 $this->elementNr = $egOpenLayersOnThisPage;
4444 }
4545
4646 /**
47 - * @see SMFormInput::addSpecificFormInputHTML()
 47+ * @see MapsMapFeature::addSpecificMapHTML()
4848 *
4949 */
50 - protected function addSpecificFormInputHTML() {
 50+ protected function addSpecificMapHTML() {
5151 global $wgJsMimeType;
5252
5353 $controlItems = MapsOpenLayers::createControlsString($this->controls);
5454
55 - $layerItems = MapsOpenLayers::createLayersStringAndLoadDependencies($this->formOutput, $this->layers);
 55+ $layerItems = MapsOpenLayers::createLayersStringAndLoadDependencies($this->output, $this->layers);
5656
5757 $width = $this->width . 'px';
5858 $height = $this->height . 'px';
5959
60 - $this->formOutput .="
 60+ $this->output .="
6161 <div id='".$this->mapName."' style='width: $width; height: $height; background-color: #cccccc;'></div>
6262
6363 <script type='$wgJsMimeType'>/*<![CDATA[*/
Index: trunk/extensions/SemanticMaps/SM_FormInput.php
@@ -16,7 +16,7 @@
1717 abstract class SMFormInput extends MapsMapFeature {
1818
1919 /**
20 - * Detrmine if geocoding will be enabled and load the required dependencies.
 20+ * Determine if geocoding will be enabled and load the required dependencies.
2121 */
2222 protected abstract function manageGeocoding();
2323
@@ -31,6 +31,8 @@
3232
3333 private $startingCoords ='';
3434
 35+ private $coordinates;
 36+
3537 /**
3638 * This function is a hook for Semantic Forms, and returns the HTML needed in
3739 * the form to handle coordinate data.
@@ -42,7 +44,7 @@
4345
4446 $this->manageGeocoding();
4547
46 - $this->setFormInputSettings();
 48+ $this->setMapSettings();
4749
4850 $this->doMapServiceLoad();
4951
@@ -61,7 +63,7 @@
6264 $this->infoFieldName = $this->elementNamePrefix.'_info_'.$this->elementNr;
6365
6466 // Create the non specific form HTML
65 - $this->formOutput .= "
 67+ $this->output .= "
6668 <input id='".$this->coordsFieldName."' name='$input_name' type='text' value='$this->startingCoords' size='40' tabindex='$sfgTabIndex'>
6769 <span id='".$this->infoFieldName."' class='error_message'></span>";
6870
@@ -75,16 +77,16 @@
7678 $not_found_text = wfMsg('semanticmaps_notfound');
7779
7880 $adress_field = smfGetDynamicInput($this->geocodeFieldName, $enter_address_here_text, 'size="30" name="geocode" style="color: #707070" tabindex="'.$sfgTabIndex.'"');
79 - $this->formOutput .= "
 81+ $this->output .= "
8082 <p>
8183 $adress_field
8284 <input type='submit' onClick=\"$this->showAddresFunction(document.forms['createbox'].$this->geocodeFieldName.value, '$this->mapName', '$this->coordsFieldName', '$not_found_text'); return false\" value='$lookup_coordinates_text' />
8385 </p>";
8486 }
8587
86 - $this->addSpecificFormInputHTML();
 88+ $this->addSpecificMapHTML();
8789
88 - return array($this->formOutput, '');
 90+ return array($this->output, '');
8991 }
9092
9193 /**
Index: trunk/extensions/SemanticMaps/GoogleMaps/SM_GoogleMapsFormInput.php
@@ -18,10 +18,10 @@
1919 final class SMGoogleMapsFormInput extends SMFormInput {
2020
2121 /**
22 - * @see SMFormInput::setFormInputSettings()
 22+ * @see MapsMapFeature::setMapSettings()
2323 *
2424 */
25 - protected function setFormInputSettings() {
 25+ protected function setMapSettings() {
2626 global $egMapsGoogleMapsZoom;
2727
2828 $this->elementNamePrefix = 'map_google';
@@ -33,7 +33,7 @@
3434
3535
3636 /**
37 - * @see SMFormInput::doMapServiceLoad()
 37+ * @see MapsMapFeature::doMapServiceLoad()
3838 *
3939 */
4040 protected function doMapServiceLoad() {
@@ -41,7 +41,7 @@
4242
4343 if (empty($egGoogleMapsOnThisPage)) {
4444 $egGoogleMapsOnThisPage = 0;
45 - MapsGoogleMaps::addGMapDependencies($this->formOutput);
 45+ MapsGoogleMaps::addGMapDependencies($this->output);
4646 }
4747
4848 $egGoogleMapsOnThisPage++;
@@ -50,10 +50,10 @@
5151 }
5252
5353 /**
54 - * @see SMFormInput::addSpecificFormInputHTML()
 54+ * @see MapsMapFeature::addSpecificFormInputHTML()
5555 *
5656 */
57 - protected function addSpecificFormInputHTML() {
 57+ protected function addSpecificMapHTML() {
5858 global $wgJsMimeType;
5959
6060 $enableEarth = $this-earth == 'on' || $this->earth == 'yes';
@@ -62,7 +62,7 @@
6363 $this->type = MapsGoogleMaps::getGMapType($this->type, $enableEarth);
6464 $control = MapsGoogleMaps::getGControlType($this->controls);
6565
66 - $this->formOutput .= "
 66+ $this->output .= "
6767 <div id='".$this->mapName."' class='".$this->class."'></div>
6868
6969 <script type='$wgJsMimeType'>/*<![CDATA[*/
@@ -78,7 +78,7 @@
7979 protected function manageGeocoding() {
8080 global $egGoogleMapsKey;
8181 $this->enableGeocoding = strlen(trim($egGoogleMapsKey)) > 0;
82 - if ($this->enableGeocoding) MapsGoogleMaps::addGMapDependencies($this->formOutput);
 82+ if ($this->enableGeocoding) MapsGoogleMaps::addGMapDependencies($this->output);
8383 }
8484
8585 }

Status & tagging log