r83437 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r83436‎ | r83437 | r83438 >
Date:05:48, 7 March 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
rem dead code
Modified paths:
  • /trunk/extensions/Maps/Maps.php (modified) (history)
  • /trunk/extensions/Maps/Maps_Settings.php (modified) (history)
  • /trunk/extensions/Maps/includes/services/OpenLayers/Maps_ParamOLLayers.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Maps/Maps.php
@@ -36,7 +36,7 @@
3737 die( '<b>Error:</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>.<br />' );
3838 }
3939 else {
40 - define( 'Maps_VERSION', '0.7.5.1' );
 40+ define( 'Maps_VERSION', '0.7.6 alpha' );
4141
4242 // The different coordinate notations.
4343 define( 'Maps_COORDS_FLOAT', 'float' );
Index: trunk/extensions/Maps/Maps_Settings.php
@@ -405,32 +405,7 @@
406406 'osm' => array( 'osmarender', 'osm-mapnik', 'osm-cyclemap' ),
407407 );
408408
409 - # Layer dependencie (MediaWiki >= 1.17).
410 - // http://maps.google.com/maps/api/js?sensor=false
411 - $egMapsOLLayerModules = array(/*
412 - 'ext.maps.ol.osm' => array(
413 - 'scripts' => array(
414 - 'OSM/OpenStreetMap.js',
415 - ),
416 - ),
417 - 'ext.maps.ol.yahoo' => array(
418 - 'scripts' => array(
419 - 'http://api.maps.yahoo.com/ajaxymap?v=3.0&appid=euzuro-openlayers',
420 - ),
421 - ),
422 - 'ext.maps.ol.bing' => array(
423 - 'scripts' => array(
424 - 'http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.1',
425 - ),
426 - ),
427 - 'ext.maps.ol.ol-wms' => array(
428 - 'scripts' => array(
429 - 'http://clients.multimap.com/API/maps/1.1/metacarta_04',
430 - ),
431 - )
432 - */);
433 -
434 - # Layer dependencies (MediaWiki < 1.17).
 409+ # Layer dependencies
435410 $egMapsOLLayerDependencies = array(
436411 'yahoo' => "<style type='text/css'> #controls {width: 512px;}</style><script src='http://api.maps.yahoo.com/ajaxymap?v=3.0&appid=euzuro-openlayers'></script>",
437412 'bing' => "<script type='$wgJsMimeType' src='http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.1'></script>",
Index: trunk/extensions/Maps/includes/services/OpenLayers/Maps_ParamOLLayers.php
@@ -90,12 +90,7 @@
9191
9292 $parameter->setValue( $egMapsUseRL ? $layerDefs : '[' . implode( ',', $layerDefs ) . ']' );
9393
94 - if ( $egMapsUseRL ) {
95 - MapsMappingServices::getServiceInstance( 'openlayers' )->addResourceModules( $this->getModules( $layerNames ) );
96 - }
97 - else {
98 - MapsMappingServices::getServiceInstance( 'openlayers' )->addLayerDependencies( $this->getDependencies( $layerNames ) );
99 - }
 94+ MapsMappingServices::getServiceInstance( 'openlayers' )->addLayerDependencies( $this->getDependencies( $layerNames ) );
10095
10196 }
10297
@@ -125,30 +120,4 @@
126121 return array_unique( $layerDependencies );
127122 }
128123
129 - /**
130 - * Returns the names of the resource modules for the provided layers.
131 - *
132 - * @since 0.7.3
133 - *
134 - * @param array $layerNames
135 - *
136 - * @return array
137 - */
138 - protected function getModules( array $layerNames ) {
139 - global $egMapsOLLayerModules, $egMapsOLAvailableLayers;
140 -
141 - $moduleNames = array();
142 -
143 - foreach ( $layerNames as $layerName ) {
144 - if ( array_key_exists( $layerName, $egMapsOLAvailableLayers ) // The layer must be defined in php
145 - && is_array( $egMapsOLAvailableLayers[$layerName] ) // The layer must be an array...
146 - && count( $egMapsOLAvailableLayers[$layerName] ) > 1 // ...with a second element...
147 - && array_key_exists( 'ext.maps.ol.' . $egMapsOLAvailableLayers[$layerName][1], $egMapsOLLayerModules ) ) { //...that is a dependency.
148 - $moduleNames[] = 'ext.maps.ol.' . $egMapsOLAvailableLayers[$layerName][1];
149 - }
150 - }
151 -
152 - return array_unique( $moduleNames );
153 - }
154 -
155124 }
\ No newline at end of file

Status & tagging log