r65978 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r65977‎ | r65978 | r65979 >
Date:05:12, 6 May 2010
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Fixed bug in forms for new coordinates
Modified paths:
  • /trunk/extensions/SemanticMaps/Features/FormInputs/SM_FormInput.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMaps/Features/FormInputs/SM_FormInput.php
@@ -79,7 +79,7 @@
8080 // If this happens in any way, it could be a big vunerability, so throw an exception.
8181 throw new Exception( 'Attempt to override a class field during map property assignment. Field name: ' . $paramName );
8282 }
83 - }
 83+ }
8484 }
8585
8686 $this->errorList = $manager->getErrorList();
@@ -122,16 +122,9 @@
123123 $this->infoFieldName = $this->elementNamePrefix . '_info_' . $this->elementNr . '_' . $sfgTabIndex;
124124
125125 // Create the non specific form HTML.
126 - if ( $this->markerCoords === false ) {
127 - $coords = 'null, null';
128 - }
129 - else {
130 - $coords = MapsCoordinateParser::formatCoordinates( $this->markerCoords );
131 - }
132 -
133126 $this->output .= Html::input(
134127 $input_name,
135 - $coords,
 128+ $this->markerCoords ? MapsCoordinateParser::formatCoordinates( $this->markerCoords ) : '',
136129 'text',
137130 array(
138131 'size' => 42,
@@ -150,6 +143,15 @@
151144
152145 if ( $this->enableGeocoding ) $this->addGeocodingField();
153146
 147+ if ( $this->markerCoords === false ) {
 148+ $this->markerCoords = array(
 149+ 'lat' => 'null',
 150+ 'lon' => 'null'
 151+ );
 152+ $this->centreLat = 'null';
 153+ $this->centreLon = 'null';
 154+ }
 155+
154156 $this->addSpecificMapHTML();
155157
156158 return array( $this->output . $this->errorList, '' );
@@ -175,7 +177,7 @@
176178 }
177179 function convertLngToDMS (val) {
178180 return Math.abs(val) + "$deg " + ( val < 0 ? "$w" : "$e" );
179 -}
 181+}
180182 EOT
181183 );
182184 }

Status & tagging log