http://www.mediawiki.org/wiki/Special:Code/MediaWiki/72190
Revision: 72190
Author: jeroendedauw
Date: 2010-09-02 09:53:32 +0000 (Thu, 02 Sep 2010)
Log Message:
-----------
Fixed exception occurring when using display_point(s)
Modified Paths:
--------------
trunk/extensions/Maps/ParserHooks/Maps_DisplayMap.php
trunk/extensions/Maps/ParserHooks/Maps_DisplayPoint.php
Modified: trunk/extensions/Maps/ParserHooks/Maps_DisplayMap.php
===================================================================
--- trunk/extensions/Maps/ParserHooks/Maps_DisplayMap.php 2010-09-02
09:03:00 UTC (rev 72189)
+++ trunk/extensions/Maps/ParserHooks/Maps_DisplayMap.php 2010-09-02
09:53:32 UTC (rev 72190)
@@ -108,13 +108,16 @@
// Get the instance of the service class.
$service = MapsMappingServices::getValidServiceInstance(
$parameters['mappingservice'], $this->getName() );
- /*
// Get an instance of the class handling the current parser
hook and service.
$mapClass = $service->getFeatureInstance( $this->getName() );
- return $mapClass->getMapHtml( $parameters );
- */
- return ''; // TODO
+ if ( $mapClass === false ) {
+ return ''; // TODO
+ }
+ else {
+ return ''; // TODO
+ //return $mapClass->getMapHtml( $parameters );
+ }
}
}
\ No newline at end of file
Modified: trunk/extensions/Maps/ParserHooks/Maps_DisplayPoint.php
===================================================================
--- trunk/extensions/Maps/ParserHooks/Maps_DisplayPoint.php 2010-09-02
09:03:00 UTC (rev 72189)
+++ trunk/extensions/Maps/ParserHooks/Maps_DisplayPoint.php 2010-09-02
09:53:32 UTC (rev 72190)
@@ -12,8 +12,6 @@
*/
class MapsDisplayPoint extends ParserHook {
- // Validator::addOutputFormat( 'geoPoints', array( __CLASS__,
'formatGeoPoints' ) );
-
/**
* No LST in pre-5.3 PHP *sigh*.
* This is to be refactored as soon as php >=5.3 becomes acceptable.
@@ -88,6 +86,8 @@
protected function getParameterInfo() {
global $egMapsMapWidth, $egMapsMapHeight,
$egMapsDefaultServices, $egMapsDefaultTitle, $egMapsDefaultLabel;
+ Validator::addOutputFormat( 'geoPoints', array( __CLASS__,
'formatGeoPoints' ) );
+
return array_merge( MapsMapper::getCommonParameters(), array(
// TODO
'width' => array(
@@ -152,13 +152,19 @@
public function render( array $parameters ) {
// Get the instance of the service class.
$service = MapsMappingServices::getValidServiceInstance(
$parameters['mappingservice'], $this->getName() );
- /*
+
// Get an instance of the class handling the current parser
hook and service.
$mapClass = $service->getFeatureInstance( $this->getName() );
return $mapClass->getMapHtml( $parameters );
- */
- return ''; // TODO
+
+ if ( $mapClass === false ) {
+ return ''; // TODO
+ }
+ else {
+ return ''; // TODO
+ //return $mapClass->getMapHtml( $parameters );
+ }
}
}
\ No newline at end of file
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs