[fusion-commits] r2028 - in trunk: text widgets widgets/Query/classes widgets/Theme

svn_fusion at osgeo.org svn_fusion at osgeo.org
Tue Dec 22 05:07:00 EST 2009


Author: christinebao
Date: 2009-12-22 05:06:59 -0500 (Tue, 22 Dec 2009)
New Revision: 2028

Modified:
   trunk/text/en
   trunk/text/en.json
   trunk/widgets/Query/classes/query.php
   trunk/widgets/Redline.js
   trunk/widgets/Theme/thememain.php
Log:
Fix ticket http://trac.osgeo.org/fusion/ticket/347.
GLOB: 4 new widgets EN strings are not localized yet.

This submission fixed the drop-down menus of Theme, Query and Redline.

Modified: trunk/text/en
===================================================================
--- trunk/text/en	2009-12-21 10:09:59 UTC (rev 2027)
+++ trunk/text/en	2009-12-22 10:06:59 UTC (rev 2028)
@@ -176,6 +176,14 @@
 QUERYZOOM               = Zoom
 QUERYSELECT             = Select
 QUERYERROR              = Error
+QUERYEQUALTO            = Equal to
+QUERYNOTEQUALTO         = Not equal to
+QUERYGREATTHAN          = Greater than
+QUERYGREATTHANEQUAL     = Greater than or equal to
+QUERYLESSTHAN           = Less than
+QUERYLESSTHANEQUAL      = Less than or equal to
+QUERYBEGIN              = Begins with
+QUERYCONTAINS           = Contains
 
 # Theme UI
 THEMETITLE              = Theme Layer
@@ -197,6 +205,11 @@
 THEMEBORDERCOLOR        = Border Color:
 THEMEAPPLY              = Apply
 THEMEERROR              = Error
+THEMEINDIVIDUAL         = Individual
+THEMEEQUAL              = Equal
+THEMESTANDARD           = Standard Deviation
+THEMEQUANTILE           = Quantile
+THEMEJENKS              = Jenks (Natural Breaks)
 
 # Redline UI
 REDLINEOPTIONS          = Digitizing Options

Modified: trunk/text/en.json
===================================================================
--- trunk/text/en.json	2009-12-21 10:09:59 UTC (rev 2027)
+++ trunk/text/en.json	2009-12-22 10:06:59 UTC (rev 2028)
@@ -52,6 +52,7 @@
 'printGenerate': 'Generate',
 'zoomRect': 'Zoom Rectangle',
 'maptipLinkText': 'Click for more information',
+'redlineLayerName': 'Digitizing Layer ',
 
 #Print UI
 'PRINTSHOWTITLE':'Show Title?'

Modified: trunk/widgets/Query/classes/query.php
===================================================================
--- trunk/widgets/Query/classes/query.php	2009-12-21 10:09:59 UTC (rev 2027)
+++ trunk/widgets/Query/classes/query.php	2009-12-22 10:06:59 UTC (rev 2028)
@@ -17,6 +17,9 @@
 //  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 //
 
+$fusionMGpath = '../../layers/MapGuide/php/';
+require_once $fusionMGpath . 'Common.php';
+
 require_once('property.php');
 require_once('feature.php');
 // require_once '../Common/JSON.php';
@@ -36,11 +39,27 @@
         $this->args = $args;
         $this->site = new MgSiteConnection();
         $this->site->Open(new MgUserInformation($args['SESSION']));
+        
+        SetLocalizedFilesPath(GetLocalizationPath());
+        if(isset($_REQUEST['locale'])) {
+            $locale = $_REQUEST['locale'];
+        } else {
+            $locale = GetDefaultLocale();
+        }
+        
+        $equalToLocal = GetLocalizedString('QUERYEQUALTO', $locale );
+        $notEqualToLocal = GetLocalizedString('QUERYNOTEQUALTO', $locale );
+        $greatThanLocal = GetLocalizedString('QUERYGREATTHAN', $locale );
+        $greatThanEqualLocal = GetLocalizedString('QUERYGREATTHANEQUAL', $locale );
+        $lessThanLocal = GetLocalizedString('QUERYLESSTHAN', $locale );
+        $lessThanEqualLocal = GetLocalizedString('QUERYLESSTHANEQUAL', $locale );
+        $beginLocal = GetLocalizedString('QUERYBEGIN', $locale );
+        $containsLocal = GetLocalizedString('QUERYCONTAINS', $locale );
 
-        $this->numOperators = array('Equal to', 'Not equal to', 'Greater than', 'Greater than or equal to', 'Less than', 'Less than or equal to');
+        $this->numOperators = array($equalToLocal, $notEqualToLocal, $greatThanLocal, $greatThanEqualLocal, $lessThanLocal, $lessThanEqualLocal);
         $this->numExpressions = array(' = %s', ' != %s', ' > %s', ' >= %s', ' < %s', ' <= %s');
 
-        $this->strOperators = array('Begins with', 'Contains', 'Equal to');
+        $this->strOperators = array($beginLocal, $containsLocal, $equalToLocal);
         $this->strExpressions = array(" like '%s%%'", " like '%%%s%%'", " = '%s'");
     }
 

Modified: trunk/widgets/Redline.js
===================================================================
--- trunk/widgets/Redline.js	2009-12-21 10:09:59 UTC (rev 2027)
+++ trunk/widgets/Redline.js	2009-12-22 10:06:59 UTC (rev 2028)
@@ -45,8 +45,11 @@
     // a reference to a redline taskPane
     taskPane: null,
 
-    // array of OL vector layer
-    vectorLayers: null,
+    // array of OL vector layer
+    vectorLayers: null,
+
+    // the default layer name
+    defaultLayerName: null,
 
     // the drawing controls
     drawControls: null,
@@ -72,8 +75,10 @@
     saveForm: null,
 
     initializeWidget: function(widgetTag) {
-        var json = widgetTag.extension;
-        this.mapWidget = Fusion.getWidgetById('Map');
+        var json = widgetTag.extension;
+        this.mapWidget = Fusion.getWidgetById('Map');
+
+        this.defaultLayerName = OpenLayers.i18n('redlineLayerName');
 
         // register Redline specific events
         this.registerEventID(Fusion.Event.REDLINE_FEATURE_ADDED);
@@ -97,11 +102,11 @@
  
         this.styleMap = new OpenLayers.StyleMap(defaultFeatureStyle);
         
-        // create one default layer, unless other redline widgets have created it
-        this.vectorLayers = this.mapWidget.oMapOL.getLayersByName('Digitizing Layer 0');
+        // create one default layer, unless other redline widgets have created it
+        this.vectorLayers = this.mapWidget.oMapOL.getLayersByName(this.defaultLayerName + '0');
     
-        if (!this.vectorLayers.length) {
-            this.vectorLayers[0] = new OpenLayers.Layer.Vector("Digitizing Layer 0", {styleMap: this.styleMap});
+        if (!this.vectorLayers.length) {
+            this.vectorLayers[0] = new OpenLayers.Layer.Vector(this.defaultLayerName + '0', { styleMap: this.styleMap });
             this.vectorLayers[0].redLineLayer = true;
             this.mapWidget.oMapOL.addLayers([this.vectorLayers[0]]);
         }
@@ -270,8 +275,8 @@
     },
     
     newLayerFromFile: function(fileName) {
-        var i = this.vectorLayers.length;
-        this.vectorLayers[i] = new OpenLayers.Layer.Vector("Digitizing layer "+this.vectorLayers.length, {
+        var i = this.vectorLayers.length;
+        this.vectorLayers[i] = new OpenLayers.Layer.Vector(this.defaultLayerName + this.vectorLayers.length, {
             strategies: [new OpenLayers.Strategy.Fixed()],
             protocol: new OpenLayers.Protocol.HTTP({
                 url: Fusion.getFusionURL() +"widgets/Redline/Redline.php?"+"file="+fileName,
@@ -288,8 +293,8 @@
         this.vectorLayers[layerIndex].destroy();
         this.vectorLayers.splice(layerIndex,1);
         // we always keep at least one vector layer
-        if (this.vectorLayers.length == 0) {
-            this.vectorLayers[0] = new OpenLayers.Layer.Vector("Digitizing Layer 0", {styleMap: this.styleMap});
+        if (this.vectorLayers.length == 0) {
+            this.vectorLayers[0] = new OpenLayers.Layer.Vector(this.defaultLayerName + '0', { styleMap: this.styleMap });
             this.mapWidget.oMapOL.addLayers([this.vectorLayers[0]]);
             this.vectorLayers[0].redLineLayer = true;
         }
@@ -303,14 +308,14 @@
             exist = false;
             var i = 0;
             while (!exist && i < this.vectorLayers.length) {
-                if (("Digitizing layer " + offset) == this.vectorLayers[i].name)
+                if ((this.defaultLayerName + offset) == this.vectorLayers[i].name)
                     exist = true;
                 i++;
             }
             if (exist)
                 offset++;
         }
-        return "Digitizing layer " + offset;
+        return this.defaultLayerName + offset;
     }
 });
 

Modified: trunk/widgets/Theme/thememain.php
===================================================================
--- trunk/widgets/Theme/thememain.php	2009-12-21 10:09:59 UTC (rev 2027)
+++ trunk/widgets/Theme/thememain.php	2009-12-22 10:06:59 UTC (rev 2028)
@@ -18,11 +18,11 @@
 //
     $fusionMGpath = '../../layers/MapGuide/php/';
     require_once $fusionMGpath . 'Common.php';
-    if(InitializationErrorOccurred())
-    {
-        DisplayInitializationErrorHTML();
-        exit;
-    }
+    if(InitializationErrorOccurred())
+    {
+        DisplayInitializationErrorHTML();
+        exit;
+    }
     require_once $fusionMGpath . 'Utilities.php';
     require_once $fusionMGpath . 'JSON.php';
     require_once 'classes/theme.php';
@@ -58,6 +58,11 @@
     $borderColorLocal = GetLocalizedString('THEMEBORDERCOLOR', $locale );
     $applyLocal = GetLocalizedString('THEMEAPPLY', $locale );
     $errorLocal = GetLocalizedString('THEMEERROR', $locale );
+    $individualLocal = GetLocalizedString('THEMEINDIVIDUAL', $locale );
+    $equalLocal = GetLocalizedString('THEMEEQUAL', $locale );
+    $standardDeviationLocal = GetLocalizedString('THEMESTANDARD', $locale );
+    $quantileLocal = GetLocalizedString('THEMEQUANTILE', $locale );
+    $jenksLocal = GetLocalizedString('THEMEJENKS', $locale );
 
     try
     {
@@ -107,7 +112,7 @@
         var session = '<?= $args['SESSION'] ?>';
         var mapName = '<?= $args['MAPNAME'] ?>';
 
-        var distNameArray = '<?php $json = new Services_JSON(); echo $json->encode($theme->distNameArray) ?>'.parseJSON();
+        var distNameArray = ['<?= $individualLocal ?>', '<?= $equalLocal ?>', '<?= $standardDeviationLocal ?>', '<?= $quantileLocal  ?>', '<?= $jenksLocal ?>']; 
         var distValueArray = '<?php $json = new Services_JSON(); echo $json->encode($theme->distValueArray) ?>'.parseJSON();
 
         var themeReqHandler = null;
@@ -475,7 +480,7 @@
     <tr><td colspan="2" align="right"><input class="Ctrl" type="button" value="<?php echo $applyLocal ?>" style="width: 60px;" onClick="ApplyTheme()"></td></tr>
 </table>
 
-<?php } else if ($errorDetail == null || (strlen($errorDetail) - strlen($errorMsg) < 5)) { ?>
+<?php } else if ($errorDetail == null || (strlen($errorDetail) - strlen($errorMsg) < 5)) { ?>
 
 <table class="RegText" border="0" cellspacing="0" width="100%%">
     <tr><td class="Title"><?php echo $errorLocal ?><hr></td></tr>



More information about the fusion-commits mailing list