http://www.mediawiki.org/wiki/Special:Code/MediaWiki/73770
Revision: 73770
Author: jeroendedauw
Date: 2010-09-26 05:16:25 +0000 (Sun, 26 Sep 2010)
Log Message:
-----------
Changes for 0.7 - partially adapted the display_points parser hook to use
Validator 0.4
Modified Paths:
--------------
trunk/extensions/Maps/includes/features/Maps_BasePointMap.php
trunk/extensions/Maps/includes/parserHooks/Maps_DisplayPoint.php
trunk/extensions/Maps/includes/services/GoogleMaps/Maps_GoogleMapsDispPoint.php
trunk/extensions/Maps/includes/services/GoogleMaps3/Maps_GoogleMaps3DispPoint.php
trunk/extensions/Maps/includes/services/OpenLayers/Maps_OpenLayersDispPoint.php
trunk/extensions/Maps/includes/services/YahooMaps/Maps_YahooMapsDispPoint.php
Modified: trunk/extensions/Maps/includes/features/Maps_BasePointMap.php
===================================================================
--- trunk/extensions/Maps/includes/features/Maps_BasePointMap.php
2010-09-26 05:04:25 UTC (rev 73769)
+++ trunk/extensions/Maps/includes/features/Maps_BasePointMap.php
2010-09-26 05:16:25 UTC (rev 73770)
@@ -77,25 +77,27 @@
* mapping services, calling the specific methods and finally returning
the resulting output.
*
* @param array $params
+ * @param Parser $parser
*
* @return html
*/
- public final function getMapHtml( array $params ) {
+ public final function getMapHtml( array $params, Parser $parser ) {
$this->setMapProperties( $params );
$this->setMarkerData();
$this->setCentre();
+ // TODO
if ( count( $this->markerData ) <= 1 && $this->zoom == 'null' )
{
$this->zoom = $this->service->getDefaultZoom();
}
$this->markerJs = $this->service->createMarkersJs(
$this->markerData );
- $this->addSpecificMapHTML();
+ $this->addSpecificMapHTML( $parser );
- $this->service->addDependencies( $this->parser );
+ $this->service->addDependencies( $parser );
return $this->output;
}
@@ -112,6 +114,7 @@
$this->title = $parser->parse( $this->title, $wgTitle, new
ParserOptions() )->getText();
$this->label = $parser->parse( $this->label, $wgTitle, new
ParserOptions() )->getText();
+ /* TODO
// Each $args is an array containg the coordinate set as first
element, possibly followed by meta data.
foreach ( $this->coordinates as $args ) {
$markerData = MapsCoordinateParser::parseCoordinates(
array_shift( $args ) );
@@ -159,6 +162,7 @@
$this->markerData[] = $markerData;
}
+ */
}
/**
Modified: trunk/extensions/Maps/includes/parserHooks/Maps_DisplayPoint.php
===================================================================
--- trunk/extensions/Maps/includes/parserHooks/Maps_DisplayPoint.php
2010-09-26 05:04:25 UTC (rev 73769)
+++ trunk/extensions/Maps/includes/parserHooks/Maps_DisplayPoint.php
2010-09-26 05:16:25 UTC (rev 73770)
@@ -84,7 +84,7 @@
* @return array
*/
protected function getParameterInfo() {
- global $egMapsMapWidth, $egMapsMapHeight,
$egMapsDefaultServices, $egMapsDefaultTitle, $egMapsDefaultLabel;
+ global $egMapsMapWidth, $egMapsMapHeight,
$egMapsDefaultServices, $egMapsDefaultTitle, $egMapsDefaultLabel,
$egMapsDefaultMapCentre;
// TODO
//Validator::addOutputFormat( 'geoPoints', array( __CLASS__,
'formatGeoPoints' ) );
@@ -164,18 +164,12 @@
*/
public function render( array $parameters ) {
// Get the instance of the service class.
- $service = MapsMappingServices::getValidServiceInstance(
$parameters['mappingservice'], $this->getName() );
+ $service = MapsMappingServices::getServiceInstance(
$parameters['mappingservice'], $this->getName() );
// Get an instance of the class handling the current parser
hook and service.
$mapClass = $service->getFeatureInstance( $this->getName() );
- if ( $mapClass === false ) {
- return ''; // TODO
- }
- else {
- return ''; // TODO
- //return $mapClass->getMapHtml( $parameters );
- }
+ return $mapClass->getMapHtml( $parameters, $this->parser );
}
}
\ No newline at end of file
Modified:
trunk/extensions/Maps/includes/services/GoogleMaps/Maps_GoogleMapsDispPoint.php
===================================================================
---
trunk/extensions/Maps/includes/services/GoogleMaps/Maps_GoogleMapsDispPoint.php
2010-09-26 05:04:25 UTC (rev 73769)
+++
trunk/extensions/Maps/includes/services/GoogleMaps/Maps_GoogleMapsDispPoint.php
2010-09-26 05:16:25 UTC (rev 73770)
@@ -28,7 +28,7 @@
/**
* @see MapsBaseMap::addSpecificMapHTML
*/
- public function addSpecificMapHTML() {
+ public function addSpecificMapHTML( Parser $parser ) {
$mapName = $this->service->getMapId();
$this->service->addOverlayOutput( $this->output, $mapName,
$this->overlays, $this->controls );
@@ -42,7 +42,7 @@
wfMsg( 'maps-loading-map' )
);
- $this->parser->getOutput()->addHeadItem(
+ $parser->getOutput()->addHeadItem(
Html::inlineScript(
<<<EOT
addOnloadHook(
Modified:
trunk/extensions/Maps/includes/services/GoogleMaps3/Maps_GoogleMaps3DispPoint.php
===================================================================
---
trunk/extensions/Maps/includes/services/GoogleMaps3/Maps_GoogleMaps3DispPoint.php
2010-09-26 05:04:25 UTC (rev 73769)
+++
trunk/extensions/Maps/includes/services/GoogleMaps3/Maps_GoogleMaps3DispPoint.php
2010-09-26 05:16:25 UTC (rev 73770)
@@ -1,32 +1,20 @@
<?php
/**
- * File holding the MapsGoogleMaps3DispPoint class.
+ * Class for handling the display_point(s) parser functions with Google Maps
v3.
*
* @file Maps_GoogleMaps3DispPoint.php
* @ingroup MapsGoogleMaps3
*
* @author Jeroen De Dauw
*/
-
-if ( !defined( 'MEDIAWIKI' ) ) {
- die( 'Not an entry point.' );
-}
-
-/**
- * Class for handling the display_point(s) parser functions with Google Maps
v3.
- *
- * @ingroup MapsGoogleMaps3
- *
- * @author Jeroen De Dauw
- */
final class MapsGoogleMaps3DispPoint extends MapsBasePointMap {
/**
* @see MapsBaseMap::addSpecificMapHTML
*
*/
- public function addSpecificMapHTML() {
+ public function addSpecificMapHTML( Parser $parser ) {
$mapName = $this->service->getMapId();;
$this->output .= Html::element(
@@ -38,7 +26,7 @@
null
);
- $this->parser->getOutput()->addHeadItem(
+ $parser->getOutput()->addHeadItem(
Html::inlineScript( <<<EOT
addOnloadHook(
function() {
Modified:
trunk/extensions/Maps/includes/services/OpenLayers/Maps_OpenLayersDispPoint.php
===================================================================
---
trunk/extensions/Maps/includes/services/OpenLayers/Maps_OpenLayersDispPoint.php
2010-09-26 05:04:25 UTC (rev 73769)
+++
trunk/extensions/Maps/includes/services/OpenLayers/Maps_OpenLayersDispPoint.php
2010-09-26 05:16:25 UTC (rev 73770)
@@ -1,29 +1,19 @@
<?php
/**
- * File holding the MapsOpenLayersDispPoint class.
+ * Class for handling the display_point(s) parser functions with OpenLayers.
*
* @file Maps_OpenLayersDispPoint.php
* @ingroup MapsOpenLayers
*
* @author Jeroen De Dauw
*/
-
-if ( !defined( 'MEDIAWIKI' ) ) {
- die( 'Not an entry point.' );
-}
-
-/**
- * Class for handling the display_point(s) parser functions with OpenLayers.
- *
- * @author Jeroen De Dauw
- */
class MapsOpenLayersDispPoint extends MapsBasePointMap {
/**
* @see MapsBaseMap::addSpecificMapHTML
*/
- public function addSpecificMapHTML() {
+ public function addSpecificMapHTML( Parser $parser ) {
global $wgLang;
$layerItems =
$this->service->createLayersStringAndLoadDependencies( $this->layers );
@@ -41,7 +31,7 @@
$langCode = $wgLang->getCode();
- $this->parser->getOutput()->addHeadItem(
+ $parser->getOutput()->addHeadItem(
Html::inlineScript( <<<EOT
addOnloadHook(
function() {
Modified:
trunk/extensions/Maps/includes/services/YahooMaps/Maps_YahooMapsDispPoint.php
===================================================================
---
trunk/extensions/Maps/includes/services/YahooMaps/Maps_YahooMapsDispPoint.php
2010-09-26 05:04:25 UTC (rev 73769)
+++
trunk/extensions/Maps/includes/services/YahooMaps/Maps_YahooMapsDispPoint.php
2010-09-26 05:16:25 UTC (rev 73770)
@@ -1,29 +1,19 @@
<?php
/**
- * File holding the MapsYahooMapsDispPoint class.
+ * Class for handling the display_point(s) parser functions with Yahoo! Maps.
*
* @file Maps_YahooMapsDispPoint.php
* @ingroup MapsYahooMaps
*
* @author Jeroen De Dauw
*/
-
-if ( !defined( 'MEDIAWIKI' ) ) {
- die( 'Not an entry point.' );
-}
-
-/**
- * Class for handling the display_point(s) parser functions with Yahoo! Maps.
- *
- * @author Jeroen De Dauw
- */
class MapsYahooMapsDispPoint extends MapsBasePointMap {
/**
* @see MapsBaseMap::addSpecificMapHTML
*/
- public function addSpecificMapHTML() {
+ public function addSpecificMapHTML( Parser $parser ) {
$mapName = $this->service->getMapId();
$this->output .= Html::element(
@@ -35,7 +25,7 @@
wfMsg( 'maps-loading-map' )
);
- $this->parser->getOutput()->addHeadItem(
+ $parser->getOutput()->addHeadItem(
Html::inlineScript( <<<EOT
addOnloadHook(
function() {
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs