r69030 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r69029‎ | r69030 | r69031 >
Date:22:57, 4 July 2010
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Changes for 0.6.4 - language support for OL
Modified paths:
  • /trunk/extensions/SemanticMaps/SemanticMaps.php (modified) (history)
  • /trunk/extensions/SemanticMaps/Services/OpenLayers/SM_OpenLayersFormInput.php (modified) (history)
  • /trunk/extensions/SemanticMaps/Services/OpenLayers/SM_OpenLayersFunctions.js (modified) (history)
  • /trunk/extensions/SemanticMaps/Services/OpenLayers/SM_OpenLayersQP.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMaps/Services/OpenLayers/SM_OpenLayersFunctions.js
@@ -10,7 +10,7 @@
1111 /**
1212 * This function holds specific functionality for the Open Layers form input of Semantic Maps
1313 */
14 -function makeFormInputOpenLayer(mapName, locationFieldName, lat, lon, zoom, marker_lat, marker_lon, layers, controls, height) {
 14+function makeFormInputOpenLayer( mapName, locationFieldName, lat, lon, zoom, marker_lat, marker_lon, layers, controls, height, langCode ) {
1515 var markers = Array();
1616
1717 // Show a starting marker only if marker coordinates are provided
@@ -57,9 +57,9 @@
5858 });
5959
6060 var clickHanler = new OpenLayers.Control.Click();
61 - controls.push(clickHanler);
 61+ controls.push(clickHanler);
6262
63 - var map = initOpenLayer(mapName, lon, lat, zoom, layers, controls, markers, height);
 63+ var map = initOpenLayer( mapName, lon, lat, zoom, layers, controls, markers, height, langCode );
6464
6565 // Make the map variable available for other functions
6666 if (!window.OLMaps) window.OLMaps = new Object;
@@ -95,4 +95,4 @@
9696 for (var i = 0; i < markerCollection.length; i++) {
9797 markerLayer.removeMarker(markerCollection[i]);
9898 }
99 -}
 99+}
\ No newline at end of file
Index: trunk/extensions/SemanticMaps/Services/OpenLayers/SM_OpenLayersQP.php
@@ -44,6 +44,8 @@
4545 * @see SMMapPrinter::addSpecificMapHTML()
4646 */
4747 protected function addSpecificMapHTML() {
 48+ global $wgLang;
 49+
4850 // TODO: refactor up like done in maps with display point
4951 $markerItems = array();
5052
@@ -67,6 +69,8 @@
6870
6971 $layerItems = $this->mService->createLayersStringAndLoadDependencies( $this->layers );
7072
 73+ $langCode = $wgLang->getCode();
 74+
7175 $this->mService->addDependency( Html::inlineScript( <<<EOT
7276 addOnloadHook(
7377 function() {
@@ -77,7 +81,8 @@
7882 $this->zoom,
7983 [$layerItems],
8084 [$this->controls],
81 - [$markersString]
 85+ [$markersString],
 86+ '$langCode'
8287 );
8388 }
8489 );
Index: trunk/extensions/SemanticMaps/Services/OpenLayers/SM_OpenLayersFormInput.php
@@ -65,7 +65,7 @@
6666 * @see MapsMapFeature::addSpecificMapHTML()
6767 */
6868 protected function addSpecificMapHTML() {
69 - global $wgOut;
 69+ global $wgOut, $wgLang;
7070
7171 $this->output .= Html::element(
7272 'div',
@@ -78,6 +78,8 @@
7979
8080 $layerItems = $this->mService->createLayersStringAndLoadDependencies( $this->layers );
8181
 82+ $langCode = $wgLang->getCode();
 83+
8284 $wgOut->addInlineScript( <<<EOT
8385 addOnloadHook(
8486 function() {
@@ -90,7 +92,8 @@
9193 {$this->markerCoords['lat']},
9294 {$this->markerCoords['lon']},
9395 [$layerItems],
94 - [$this->controls]
 96+ [$this->controls],
 97+ '$langCode'
9598 );
9699 }
97100 );
Index: trunk/extensions/SemanticMaps/SemanticMaps.php
@@ -35,7 +35,7 @@
3636
3737 // Only initialize the extension when all dependencies are present.
3838 if ( defined( 'Maps_VERSION' ) && defined( 'SMW_VERSION' ) ) {
39 - define( 'SM_VERSION', '0.6.4 a6' );
 39+ define( 'SM_VERSION', '0.6.4 a8' );
4040
4141 $useExtensionPath = version_compare( $wgVersion, '1.16', '>=' ) && isset( $wgExtensionAssetsPath ) && $wgExtensionAssetsPath;
4242 $smgScriptPath = ( $useExtensionPath ? $wgExtensionAssetsPath : $wgScriptPath . '/extensions' ) . '/SemanticMaps';

Status & tagging log