r63615 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r63614‎ | r63615 | r63616 >
Date:20:47, 11 March 2010
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Only show warnings when Validators error level is high enough
Modified paths:
  • /trunk/extensions/UKGeocodingForMaps/GoogleMaps/UKG_GoogleMapsDispUkPoint.php (modified) (history)

Diff [purge]

Index: trunk/extensions/UKGeocodingForMaps/GoogleMaps/UKG_GoogleMapsDispUkPoint.php
@@ -68,11 +68,16 @@
6969 *
7070 */
7171 public function addSpecificMapHTML() {
72 - global $wgJsMimeType;
 72+ global $wgJsMimeType, $egValidatorErrorLevel;
7373
7474 $onloadFunctions = MapsGoogleMaps::addOverlayOutput( $this->output, $this->mapName, $this->overlays, $this->controls );
7575
76 - $couldNotGeocodeMsg = Xml::escapeJsString( wfMsg( 'ukgeocoding_couldNotGeocode' ) );
 76+ if ( $egValidatorErrorLevel >= Validator_ERRORS_WARN ) {
 77+ $couldNotGeocodeMsg = Xml::escapeJsString( wfMsg( 'ukgeocoding_couldNotGeocode' ) );
 78+ $showErrorJs = "document.getElementById( '{$this->mapName}_errors' ).innerHTML = '$couldNotGeocodeMsg';";
 79+ } else {
 80+ $showErrorJs = '';
 81+ }
7782
7883 $this->output .=<<<EOT
7984 <div id="$this->mapName"></div>
@@ -100,7 +105,7 @@
101106 if ( localSearch.results[0] ) {
102107 callbackFunction(new GLatLng(localSearch.results[0].lat, localSearch.results[0].lng), marker);
103108 } else {
104 - document.getElementById( '{$this->mapName}_errors' ).innerHTML = '$couldNotGeocodeMsg';
 109+ $showErrorJs
105110 }
106111 }
107112 );

Status & tagging log