Index: trunk/extensions/Maps/Maps.php |
— | — | @@ -36,7 +36,7 @@ |
37 | 37 | echo '<b>Warning:</b> You need to have <a href="http://www.mediawiki.org/wiki/Extension:Validator">Validator</a> installed in order to use <a href="http://www.mediawiki.org/wiki/Extension:Maps">Maps</a>.'; |
38 | 38 | } |
39 | 39 | else { |
40 | | - define( 'Maps_VERSION', '0.7 alpha-4' ); |
| 40 | + define( 'Maps_VERSION', '0.7 alpha-5' ); |
41 | 41 | |
42 | 42 | // The different coordinate notations. |
43 | 43 | define( 'Maps_COORDS_FLOAT', 'float' ); |
Index: trunk/extensions/Maps/includes/services/GoogleMaps3/Maps_GoogleMaps3DispMap.php |
— | — | @@ -25,7 +25,7 @@ |
26 | 26 | /** |
27 | 27 | * @see MapsBaseMap::addSpecificMapHTML() |
28 | 28 | */ |
29 | | - public function addSpecificMapHTML() { |
| 29 | + public function addSpecificMapHTML( Parser $parser ) { |
30 | 30 | $mapName = $this->service->getMapId(); |
31 | 31 | |
32 | 32 | $this->output .= Html::element( |
— | — | @@ -37,7 +37,7 @@ |
38 | 38 | null |
39 | 39 | ); |
40 | 40 | |
41 | | - $this->parser->getOutput()->addHeadItem( |
| 41 | + $parser->getOutput()->addHeadItem( |
42 | 42 | Html::inlineScript( <<<EOT |
43 | 43 | addOnloadHook( |
44 | 44 | function() { |
Index: trunk/extensions/Maps/includes/services/YahooMaps/Maps_YahooMapsDispMap.php |
— | — | @@ -18,7 +18,7 @@ |
19 | 19 | /** |
20 | 20 | * @see MapsBaseMap::addSpecificMapHTML() |
21 | 21 | */ |
22 | | - public function addSpecificMapHTML() { |
| 22 | + public function addSpecificMapHTML( Parser $parser ) { |
23 | 23 | $mapName = $this->service->getMapId(); |
24 | 24 | |
25 | 25 | $this->output .= Html::element( |
— | — | @@ -30,7 +30,7 @@ |
31 | 31 | wfMsg( 'maps-loading-map' ) |
32 | 32 | ); |
33 | 33 | |
34 | | - $this->parser->getOutput()->addHeadItem( |
| 34 | + $parser->getOutput()->addHeadItem( |
35 | 35 | Html::inlineScript( <<<EOT |
36 | 36 | addOnloadHook( |
37 | 37 | function() { |
Index: trunk/extensions/Maps/includes/services/YahooMaps/Maps_YahooMaps.php |
— | — | @@ -45,7 +45,7 @@ |
46 | 46 | protected function initParameterInfo( array &$params ) { |
47 | 47 | global $egMapsYahooAutozoom, $egMapsYahooMapsType, $egMapsYahooMapsTypes, $egMapsYahooMapsZoom, $egMapsYMapControls; |
48 | 48 | |
49 | | - //$params['zoom']->addCriterion( new CriterionInRange( 1, 13 ) ); |
| 49 | + //$params['zoom']->addCriteria( new CriterionInRange( 1, 13 ) ); |
50 | 50 | //$params['zoom']->setDefault( self::getDefaultZoom() ); |
51 | 51 | |
52 | 52 | $params['controls'] = new ListParameter( |
Index: trunk/extensions/Maps/includes/services/OpenLayers/Maps_OpenLayersDispMap.php |
— | — | @@ -18,7 +18,7 @@ |
19 | 19 | /** |
20 | 20 | * @see MapsBaseMap::addSpecificMapHTML() |
21 | 21 | */ |
22 | | - public function addSpecificMapHTML() { |
| 22 | + public function addSpecificMapHTML( Parser $parser ) { |
23 | 23 | global $wgLang; |
24 | 24 | |
25 | 25 | $layerItems = $this->service->createLayersStringAndLoadDependencies( $this->layers ); |
— | — | @@ -36,7 +36,7 @@ |
37 | 37 | |
38 | 38 | $langCode = $wgLang->getCode(); |
39 | 39 | |
40 | | - $this->parser->getOutput()->addHeadItem( |
| 40 | + $parser->getOutput()->addHeadItem( |
41 | 41 | Html::inlineScript( <<<EOT |
42 | 42 | addOnloadHook( |
43 | 43 | function() { |
Index: trunk/extensions/Maps/includes/services/OpenLayers/Maps_OpenLayers.php |
— | — | @@ -43,7 +43,7 @@ |
44 | 44 | protected function initParameterInfo( array &$params ) { |
45 | 45 | global $egMapsOLLayers, $egMapsOLControls, $egMapsOpenLayersZoom; |
46 | 46 | |
47 | | - //$params['zoom']->addCriterion( new CriterionInRange( 0, 19 ) ); |
| 47 | + //$params['zoom']->addCriteria( new CriterionInRange( 0, 19 ) ); |
48 | 48 | //$params['zoom']->setDefault( self::getDefaultZoom() ); |
49 | 49 | |
50 | 50 | $params['controls'] = new ListParameter( |
Index: trunk/extensions/Maps/includes/services/GoogleMaps/Maps_GoogleMapsDispMap.php |
— | — | @@ -28,7 +28,7 @@ |
29 | 29 | /** |
30 | 30 | * @see MapsBaseMap::addSpecificMapHTML() |
31 | 31 | */ |
32 | | - public function addSpecificMapHTML() { |
| 32 | + public function addSpecificMapHTML( Parser $parser ) { |
33 | 33 | $mapName = $this->service->getMapId(); |
34 | 34 | |
35 | 35 | $this->service->addOverlayOutput( $this->output, $mapName, $this->overlays, $this->controls ); |
— | — | @@ -42,7 +42,7 @@ |
43 | 43 | wfMsg( 'maps-loading-map' ) |
44 | 44 | ); |
45 | 45 | |
46 | | - $this->parser->getOutput()->addHeadItem( |
| 46 | + $parser->getOutput()->addHeadItem( |
47 | 47 | Html::inlineScript( <<<EOT |
48 | 48 | addOnloadHook( |
49 | 49 | function() { |
Index: trunk/extensions/Maps/includes/services/GoogleMaps/Maps_GoogleMaps.php |
— | — | @@ -45,7 +45,7 @@ |
46 | 46 | protected function initParameterInfo( array &$params ) { |
47 | 47 | global $egMapsGoogleMapsType, $egMapsGoogleMapsTypes, $egMapsGoogleAutozoom, $egMapsGMapControls, $egMapsGMapOverlays; |
48 | 48 | |
49 | | - //$params['zoom']->addCriterion( new CriterionInRange( 0, 20 ) ); |
| 49 | + //$params['zoom']->addCriteria( new CriterionInRange( 0, 20 ) ); |
50 | 50 | //$params['zoom']->setDefault( self::getDefaultZoom() ); |
51 | 51 | |
52 | 52 | $params['controls'] = new ListParameter( |
— | — | @@ -104,6 +104,7 @@ |
105 | 105 | ListParameter::DEFAULT_DELIMITER, |
106 | 106 | Parameter::TYPE_STRING, |
107 | 107 | $egMapsGMapOverlays, |
| 108 | + array(), |
108 | 109 | array( |
109 | 110 | new CriterionGoogleOverlay( self::$overlayData ) |
110 | 111 | ) |
Index: trunk/extensions/Maps/includes/services/OSM/Maps_OSMDispMap.php |
— | — | @@ -29,7 +29,7 @@ |
30 | 30 | * |
31 | 31 | * @since 0.6.4 |
32 | 32 | */ |
33 | | - public function addSpecificMapHTML() { |
| 33 | + public function addSpecificMapHTML( Parser $parser ) { |
34 | 34 | $this->output .= Html::element( |
35 | 35 | 'iframe', |
36 | 36 | array( |
Index: trunk/extensions/Maps/includes/parserHooks/Maps_DisplayMap.php |
— | — | @@ -97,18 +97,12 @@ |
98 | 98 | */ |
99 | 99 | public function render( array $parameters ) { |
100 | 100 | // Get the instance of the service class. |
101 | | - $service = MapsMappingServices::getValidServiceInstance( $parameters['mappingservice'], $this->getName() ); |
| 101 | + $service = MapsMappingServices::getServiceInstance( $parameters['mappingservice'], $this->getName() ); |
102 | 102 | |
103 | 103 | // Get an instance of the class handling the current parser hook and service. |
104 | 104 | $mapClass = $service->getFeatureInstance( $this->getName() ); |
105 | 105 | |
106 | | - if ( $mapClass === false ) { |
107 | | - return ''; // TODO |
108 | | - } |
109 | | - else { |
110 | | - return ''; // TODO |
111 | | - //return $mapClass->getMapHtml( $parameters ); |
112 | | - } |
| 106 | + return $mapClass->getMapHtml( $parameters, $this->parser ); |
113 | 107 | } |
114 | 108 | |
115 | 109 | } |
\ No newline at end of file |
Index: trunk/extensions/Maps/includes/Maps_CoordinateParser.php |
— | — | @@ -13,9 +13,10 @@ |
14 | 14 | * regex to also accept dm and dd, which can give unexpected results in certain |
15 | 15 | * usecases. The different seperator support could also be made nice. |
16 | 16 | * |
| 17 | + * @since 0.6 |
| 18 | + * |
17 | 19 | * @file Maps_CoordinateParser.php |
18 | 20 | * @ingroup Maps |
19 | | - * @since 0.6 |
20 | 21 | * |
21 | 22 | * @author Jeroen De Dauw |
22 | 23 | */ |
Index: trunk/extensions/Maps/includes/iMappingService.php |
— | — | @@ -1,25 +1,15 @@ |
2 | 2 | <?php |
3 | 3 | |
4 | 4 | /** |
5 | | - * File holding interface iMapParserFunction. |
| 5 | + * Interface that should be implemented by all mapping feature classes. |
6 | 6 | * |
| 7 | + * @since 0.6.3 |
| 8 | + * |
7 | 9 | * @file iMappingService.php |
8 | 10 | * @ingroup Maps |
9 | 11 | * |
10 | 12 | * @author Jeroen De Dauw |
11 | 13 | */ |
12 | | - |
13 | | -if ( !defined( 'MEDIAWIKI' ) ) { |
14 | | - die( 'Not an entry point.' ); |
15 | | -} |
16 | | - |
17 | | -/** |
18 | | - * Interface that should be implemented by all mapping feature classes. |
19 | | - * |
20 | | - * @since 0.6.3 |
21 | | - * |
22 | | - * @author Jeroen De Dauw |
23 | | - */ |
24 | 14 | interface iMappingService { |
25 | 15 | |
26 | 16 | /** |
Index: trunk/extensions/Maps/includes/Maps_DistanceParser.php |
— | — | @@ -1,21 +1,9 @@ |
2 | 2 | <?php |
3 | 3 | |
4 | 4 | /** |
5 | | - * File holding class MapsDistanceParser. |
6 | | - * |
7 | | - * @file Maps_DistanceParser.php |
8 | | - * @ingroup Maps |
9 | | - * |
10 | | - * @author Jeroen De Dauw |
11 | | - */ |
12 | | - |
13 | | -if ( !defined( 'MEDIAWIKI' ) ) { |
14 | | - die( 'Not an entry point.' ); |
15 | | -} |
16 | | - |
17 | | -/** |
18 | 5 | * Static class for distance validation and parsing. Internal representatations are in meters. |
19 | 6 | * |
| 7 | + * @file Maps_DistanceParser.php |
20 | 8 | * @ingroup Maps |
21 | 9 | * |
22 | 10 | * @since 0.6 |
Index: trunk/extensions/Maps/includes/features/Maps_BaseMap.php |
— | — | @@ -79,10 +79,11 @@ |
80 | 80 | * mapping services, calling the specific methods and finally returning the resulting output. |
81 | 81 | * |
82 | 82 | * @param array $params |
| 83 | + * @param Parser $parser |
83 | 84 | * |
84 | 85 | * @return html |
85 | 86 | */ |
86 | | - public final function getMapHtml( array $params ) { |
| 87 | + public final function getMapHtml( array $params, Parser $parser ) { |
87 | 88 | $this->setMapProperties( $params ); |
88 | 89 | |
89 | 90 | $this->setCentre(); |
— | — | @@ -91,9 +92,9 @@ |
92 | 93 | $this->zoom = $this->service->getDefaultZoom(); |
93 | 94 | } |
94 | 95 | |
95 | | - $this->addSpecificMapHTML(); |
| 96 | + $this->addSpecificMapHTML( $parser ); |
96 | 97 | |
97 | | - $this->service->addDependencies( $this->parser ); |
| 98 | + $this->service->addDependencies( $parser ); |
98 | 99 | |
99 | 100 | return $this->output; |
100 | 101 | } |