r74254 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r74253‎ | r74254 | r74255 >
Date:15:05, 4 October 2010
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Changes for 0.7 - made compatible with Validator 0.4
Modified paths:
  • /trunk/extensions/SemanticMaps/includes/queryprinters/SM_MapPrinter.php (modified) (history)
  • /trunk/extensions/SemanticMaps/includes/queryprinters/SM_Mapper.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMaps/includes/queryprinters/SM_MapPrinter.php
@@ -190,14 +190,18 @@
191191
192192 $validator->validateParameters();
193193
194 - $showMap = $validator->hasFatalError();
 194+ $fatalError = $validator->hasFatalError();
195195
196 - if ( $showMap ) {
197 - $validator->formatParameters();
 196+ if ( $fatalError === false ) {
198197 $this->setMapProperties( $validator->getParameterValues() );
199198 }
 199+ else {
 200+ $this->output = '<span class="errorbox">' .
 201+ htmlspecialchars( wfMsgExt( 'validator-fatal-error', 'parsemag', $error->getMessage() ) ) .
 202+ '</span>';
 203+ }
200204
201 - return $showMap;
 205+ return !$fatalError;
202206 }
203207
204208 /**
Index: trunk/extensions/SemanticMaps/includes/queryprinters/SM_Mapper.php
@@ -23,7 +23,7 @@
2424 */
2525 public function __construct( $format, $inline ) {
2626 global $egMapsDefaultServices;
27 -
 27+
2828 // TODO: allow service parameter to override the default
2929 // Note: if this is allowed, then the getParameters should only return the base parameters.
3030 if ( $format == 'map' ) $format = $egMapsDefaultServices['qp'];

Status & tagging log