r80484 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r80483‎ | r80484 | r80485 >
Date:01:18, 18 January 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Threw out more b/c code
Modified paths:
  • /branches/Maps0.8/includes/services/GoogleMaps/Maps_GoogleMaps.php (modified) (history)
  • /branches/Maps0.8/includes/services/OpenLayers/Maps_OpenLayers.php (modified) (history)
  • /branches/Maps0.8/includes/services/OpenLayers/Maps_ParamOLLayers.php (modified) (history)

Diff [purge]

Index: branches/Maps0.8/includes/services/OpenLayers/Maps_ParamOLLayers.php
@@ -29,7 +29,7 @@
3030 * @since 0.7
3131 */
3232 public function manipulate( Parameter &$parameter, array &$parameters ) {
33 - global $egMapsOLLayerGroups, $egMapsOLAvailableLayers, $egMapsUseRL;
 33+ global $egMapsOLLayerGroups, $egMapsOLAvailableLayers;
3434
3535 $layerDefs = array();
3636 $layerNames = array();
@@ -88,15 +88,9 @@
8989 }
9090 }
9191
92 - $parameter->setValue( $egMapsUseRL ? $layerDefs : '[' . implode( ',', $layerDefs ) . ']' );
 92+ $parameter->setValue( $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 - }
100 -
 94+ MapsMappingServices::getServiceInstance( 'openlayers' )->addResourceModules( $this->getModules( $layerNames ) );
10195 }
10296
10397 /**
Index: branches/Maps0.8/includes/services/OpenLayers/Maps_OpenLayers.php
@@ -31,7 +31,7 @@
3232 * @since 0.7
3333 */
3434 public function addParameterInfo( array &$params ) {
35 - global $egMapsOLLayers, $egMapsOLControls, $egMapsUseRL;
 35+ global $egMapsOLLayers, $egMapsOLControls;
3636
3737 $params['zoom']->addCriteria( new CriterionInRange( 0, 19 ) );
3838 $params['zoom']->setDefault( self::getDefaultZoom() );
@@ -43,12 +43,6 @@
4444 new ParamManipulationFunctions( 'strtolower' )
4545 );
4646
47 - if ( !$egMapsUseRL ) {
48 - $params['controls']->addManipulations(
49 - new ParamManipulationImplode( ',', "'" )
50 - );
51 - }
52 -
5347 $params['layers'] = new ListParameter( 'layers' );
5448 $params['layers']->addManipulations( new MapsParamOLLayers() );
5549 $params['layers']->setDoManipulationOfDefault( true );
@@ -107,27 +101,6 @@
108102 }
109103
110104 /**
111 - * @see MapsMappingService::getDependencies
112 - *
113 - * @return array
114 - */
115 - protected function getDependencies() {
116 - global $egMapsStyleVersion, $egMapsScriptPath, $egMapsUseRL;
117 -
118 - if ( $egMapsUseRL ) {
119 - return array();
120 - }
121 - else {
122 - return array(
123 - Html::linkedStyle( "$egMapsScriptPath/includes/services/OpenLayers/OpenLayers/theme/default/style.css" ),
124 - Html::linkedScript( "$egMapsScriptPath/includes/services/OpenLayers/OpenLayers/OpenLayers.js?$egMapsStyleVersion" ),
125 - Html::linkedScript( "$egMapsScriptPath/includes/services/OpenLayers/OpenLayerFunctions.js?$egMapsStyleVersion" ),
126 - Html::inlineScript( 'initOLSettings(200, 100); var msgMarkers = ' . Xml::encodeJsVar( wfMsg( 'maps-markers' ) ) . ';' )
127 - );
128 - }
129 - }
130 -
131 - /**
132105 * Returns the names of all supported controls.
133106 * This data is a copy of the one used to actually translate the names
134107 * into the controls, since this resides client side, in OpenLayerFunctions.js.
Index: branches/Maps0.8/includes/services/GoogleMaps/Maps_GoogleMaps.php
@@ -211,7 +211,7 @@
212212 */
213213 protected function getDependencies() {
214214 global $wgLang;
215 - global $egGoogleMapsKeys, $egGoogleMapsKey, $egMapsStyleVersion, $egMapsScriptPath, $egMapsUseRL;
 215+ global $egGoogleMapsKeys, $egGoogleMapsKey, $egMapsStyleVersion, $egMapsScriptPath;
216216
217217 $langCode = self::getMappedLanguageCode( $wgLang->getCode() );
218218
@@ -223,11 +223,6 @@
224224 'var googleLangCode = '. json_encode( $langCode ) . ';'
225225 );
226226
227 - if ( !$egMapsUseRL ) {
228 - $dependencies[] = Html::linkedScript( "$egMapsScriptPath/includes/services/GoogleMaps/ext.maps.googlemaps2.js?$egMapsStyleVersion" );
229 - $dependencies[] = Html::inlineScript( 'var msgOverlays = ' . Xml::encodeJsVar( wfMsg( 'maps_overlays' ) ) . ';' );
230 - }
231 -
232227 return $dependencies;
233228 }
234229

Follow-up revisions

RevisionCommit summaryAuthorDate
r80486follow up to r80484jeroendedauw02:17, 18 January 2011

Status & tagging log