http://www.mediawiki.org/wiki/Special:Code/MediaWiki/69030

Revision: 69030
Author:   jeroendedauw
Date:     2010-07-04 22:57:42 +0000 (Sun, 04 Jul 2010)

Log Message:
-----------
Changes for 0.6.4 - language support for OL

Modified Paths:
--------------
    trunk/extensions/SemanticMaps/SemanticMaps.php
    trunk/extensions/SemanticMaps/Services/OpenLayers/SM_OpenLayersFormInput.php
    trunk/extensions/SemanticMaps/Services/OpenLayers/SM_OpenLayersFunctions.js
    trunk/extensions/SemanticMaps/Services/OpenLayers/SM_OpenLayersQP.php

Modified: trunk/extensions/SemanticMaps/SemanticMaps.php
===================================================================
--- trunk/extensions/SemanticMaps/SemanticMaps.php      2010-07-04 22:57:41 UTC 
(rev 69029)
+++ trunk/extensions/SemanticMaps/SemanticMaps.php      2010-07-04 22:57:42 UTC 
(rev 69030)
@@ -35,7 +35,7 @@
 
 // Only initialize the extension when all dependencies are present.
 if ( defined( 'Maps_VERSION' ) && defined( 'SMW_VERSION' ) ) {
-       define( 'SM_VERSION', '0.6.4 a6' );
+       define( 'SM_VERSION', '0.6.4 a8' );
 
        $useExtensionPath = version_compare( $wgVersion, '1.16', '>=' ) && 
isset( $wgExtensionAssetsPath ) && $wgExtensionAssetsPath;
        $smgScriptPath  = ( $useExtensionPath ? $wgExtensionAssetsPath : 
$wgScriptPath . '/extensions' ) . '/SemanticMaps';     

Modified: 
trunk/extensions/SemanticMaps/Services/OpenLayers/SM_OpenLayersFormInput.php
===================================================================
--- 
trunk/extensions/SemanticMaps/Services/OpenLayers/SM_OpenLayersFormInput.php    
    2010-07-04 22:57:41 UTC (rev 69029)
+++ 
trunk/extensions/SemanticMaps/Services/OpenLayers/SM_OpenLayersFormInput.php    
    2010-07-04 22:57:42 UTC (rev 69030)
@@ -65,7 +65,7 @@
         * @see MapsMapFeature::addSpecificMapHTML()
         */
        protected function addSpecificMapHTML() {
-               global $wgOut;
+               global $wgOut, $wgLang;
                
                $this->output .= Html::element(
                        'div',
@@ -78,6 +78,8 @@
                
                $layerItems = 
$this->mService->createLayersStringAndLoadDependencies( $this->layers );
                
+               $langCode = $wgLang->getCode();
+               
                $wgOut->addInlineScript( <<<EOT
 addOnloadHook(
        function() {
@@ -90,7 +92,8 @@
                        {$this->markerCoords['lat']},
                        {$this->markerCoords['lon']},
                        [$layerItems],
-                       [$this->controls]
+                       [$this->controls],
+                       '$langCode'
                );
        }
 );

Modified: 
trunk/extensions/SemanticMaps/Services/OpenLayers/SM_OpenLayersFunctions.js
===================================================================
--- trunk/extensions/SemanticMaps/Services/OpenLayers/SM_OpenLayersFunctions.js 
2010-07-04 22:57:41 UTC (rev 69029)
+++ trunk/extensions/SemanticMaps/Services/OpenLayers/SM_OpenLayersFunctions.js 
2010-07-04 22:57:42 UTC (rev 69030)
@@ -10,7 +10,7 @@
 /**
  * This function holds specific functionality for the Open Layers form input 
of Semantic Maps
  */
-function makeFormInputOpenLayer(mapName, locationFieldName, lat, lon, zoom, 
marker_lat, marker_lon, layers, controls, height) {
+function makeFormInputOpenLayer( mapName, locationFieldName, lat, lon, zoom, 
marker_lat, marker_lon, layers, controls, height, langCode ) {
        var markers = Array();
 
        // Show a starting marker only if marker coordinates are provided
@@ -57,9 +57,9 @@
      });
      
        var clickHanler = new OpenLayers.Control.Click();
-     controls.push(clickHanler);
+       controls.push(clickHanler);
      
-     var map = initOpenLayer(mapName, lon, lat, zoom, layers, controls, 
markers, height);
+       var map = initOpenLayer( mapName, lon, lat, zoom, layers, controls, 
markers, height, langCode );
        
        // Make the map variable available for other functions
        if (!window.OLMaps) window.OLMaps = new Object;
@@ -95,4 +95,4 @@
        for (var i = 0; i < markerCollection.length; i++) {
                markerLayer.removeMarker(markerCollection[i]);
        }
-}
+}
\ No newline at end of file

Modified: trunk/extensions/SemanticMaps/Services/OpenLayers/SM_OpenLayersQP.php
===================================================================
--- trunk/extensions/SemanticMaps/Services/OpenLayers/SM_OpenLayersQP.php       
2010-07-04 22:57:41 UTC (rev 69029)
+++ trunk/extensions/SemanticMaps/Services/OpenLayers/SM_OpenLayersQP.php       
2010-07-04 22:57:42 UTC (rev 69030)
@@ -44,6 +44,8 @@
         * @see SMMapPrinter::addSpecificMapHTML()
         */
        protected function addSpecificMapHTML() {
+               global $wgLang;
+               
                // TODO: refactor up like done in maps with display point
                $markerItems = array();
                
@@ -67,6 +69,8 @@
                
                $layerItems = 
$this->mService->createLayersStringAndLoadDependencies( $this->layers );
                
+               $langCode = $wgLang->getCode();
+               
                $this->mService->addDependency( Html::inlineScript( <<<EOT
 addOnloadHook(
        function() {
@@ -77,7 +81,8 @@
                        $this->zoom,
                        [$layerItems],
                        [$this->controls],
-                       [$markersString]
+                       [$markersString],
+                       '$langCode'
                );
        }
 );



_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to