[fusion-commits] r2752 - in trunk: text widgets widgets/Redline widgets/widgetinfo

svn_fusion at osgeo.org svn_fusion at osgeo.org
Thu Jul 25 22:25:18 PDT 2013


Author: jng
Date: 2013-07-25 22:25:18 -0700 (Thu, 25 Jul 2013)
New Revision: 2752

Modified:
   trunk/text/en
   trunk/widgets/Redline.js
   trunk/widgets/Redline/editmarkup.php
   trunk/widgets/widgetinfo/redline.xml
Log:
#583: Prompt for redline labels on a per-redline basis and not as a global setting. To achieve this, we simply have a checkbox field on the "Edit Redline" page that controls whether a prompt will be made. Checked = Prompt. Un-checked = do not prompt.

This eliminates the need for the "PromptForRedlineLabels" extension property and this has been remove from the widgetinfo xml and widget code as a result.

Modified: trunk/text/en
===================================================================
--- trunk/text/en	2013-07-26 04:18:53 UTC (rev 2751)
+++ trunk/text/en	2013-07-26 05:25:18 UTC (rev 2752)
@@ -318,6 +318,7 @@
 REDLINEEDITPOLYGONHELP  = Click the map to define each point of the polygon, Double Click on the final point to end.
 REDLINEEDITCIRCLEHELP   = Click on the map and drag the mouse out to the desired radius to define your circle. Release the mouse button to finish.
 REDLINEPROMPTLABEL      = Enter a label for the redline item
+REDLINEPROMPTFORLABELS  = Include labels
 REDLINEADD              = Add Redline
 REDLINEDIGITIZE         = Digitize Redline
 REDLINEOBJECTPOINT      = Point

Modified: trunk/widgets/Redline/editmarkup.php
===================================================================
--- trunk/widgets/Redline/editmarkup.php	2013-07-26 04:18:53 UTC (rev 2751)
+++ trunk/widgets/Redline/editmarkup.php	2013-07-26 05:25:18 UTC (rev 2752)
@@ -23,6 +23,7 @@
     
     $defaultFormat = null;
     $defaultGeomType = null;
+    $checkState = "";
 
     if (array_key_exists("REDLINEFORMAT", $args) && array_key_exists("REDLINEGEOMTYPE", $args)) {
         if (strcmp($args["REDLINEFORMAT"], "SDF") == 0) {
@@ -116,6 +117,11 @@
         $updateLocal = GetLocalizedString('REDLINEUPDATETEXT', $locale );
         $closeLocal = GetLocalizedString('REDLINEEDITCLOSE', $locale );
         $promptLabelLocal = GetLocalizedString('REDLINEPROMPTLABEL', $locale);
+        $promptRedlineLabelsLocal = GetLocalizedString('REDLINEPROMPTFORLABELS', $locale);
+        
+        if (array_key_exists("REDLINEPROMPT", $args) && strcmp($args["REDLINEPROMPT"], "on") == 0) {
+            $checkState = " checked='checked'";
+        }
     }
     catch (MgException $e)
     {
@@ -224,11 +230,16 @@
             SetDigitizeInfo(EDIT_POLYGON_HELP);
             DigitizePolygon(OnPolyonDigitized);
         }
+        
+        function PromptForRedlineLabels()
+        {
+            return document.getElementById("chkPromptForRedlineLabels").checked;
+        }
 
         function PromptAndSetMarkupText()
         {
             var widget = Fusion.getWidgetsByType("Redline")[0];
-            if (widget.promptForRedlineLabels) {
+            if (PromptForRedlineLabels()) {
                 var textInput = document.getElementById("textInput");
 
                 textLabel = window.prompt("<?=$promptLabelLocal?>", "");
@@ -449,6 +460,12 @@
     </tr>
     <tr><td colspan="2" height="2px"></td></tr>
     <tr>
+        <td colspan="2">
+            <input type="checkbox" class="Ctrl" id="chkPromptForRedlineLabels" name="REDLINEPROMPT" <?= $checkState ?> /> <?= $promptRedlineLabelsLocal ?>
+        </td>
+    </tr>
+    <tr><td colspan="2" height="2px"></td></tr>
+    <tr>
         <td class="InfoText" colspan="2" id="digitizeInfo"></td>
     </tr>
     <tr><td colspan="2"></td></tr>

Modified: trunk/widgets/Redline.js
===================================================================
--- trunk/widgets/Redline.js	2013-07-26 04:18:53 UTC (rev 2751)
+++ trunk/widgets/Redline.js	2013-07-26 05:25:18 UTC (rev 2752)
@@ -45,9 +45,6 @@
     // a reference to a redline taskPane
     taskPane: null,
 
-    // Indicates whether to prompt for text labels on recorded redlines
-    promptForRedlineLabels: false,
-
     // Indicates whether to autogenerate redline layer names or to prompt the user for one.
     autogenerateLayerNames: true,
 
@@ -68,9 +65,6 @@
         var json = widgetTag.extension;
         this.mapWidget = Fusion.getWidgetById('Map');
 
-        if (json.PromptForRedlineLabels)
-            this.promptForRedlineLabels = (json.PromptForRedlineLabels[0] == "true");
-
         if (json.AutogenerateLayerNames)
             this.autogenerateLayerNames = (json.AutogenerateLayerNames[0] == "true");
 

Modified: trunk/widgets/widgetinfo/redline.xml
===================================================================
--- trunk/widgets/widgetinfo/redline.xml	2013-07-26 04:18:53 UTC (rev 2751)
+++ trunk/widgets/widgetinfo/redline.xml	2013-07-26 05:25:18 UTC (rev 2752)
@@ -18,14 +18,6 @@
         <DefaultValue>TaskPane</DefaultValue>
     </Parameter>
     <Parameter>
-        <Name>PromptForRedlineLabels</Name>
-        <Description>Indicates whether to prompt the user for label input when recording redlines. Default is false</Description>
-        <Type>boolean</Type>
-        <Label>PromptForRedlineLabels</Label>
-        <DefaultValue>false</DefaultValue>
-        <IsMandatory>false</IsMandatory>
-    </Parameter>
-    <Parameter>
         <Name>AutogenerateLayerNames</Name>
         <Description>Indicates whether to prompt the auto-generate redline layer names when creating a new redline layer or to prompt the user. Default is true (don't prompt)</Description>
         <Type>boolean</Type>



More information about the fusion-commits mailing list