[fusion-commits] r2788 - in trunk: layers/MapGuide text widgets/Redline widgets/Redline/classes widgets/Redline/templates

svn_fusion at osgeo.org svn_fusion at osgeo.org
Wed Sep 18 23:01:58 PDT 2013


Author: jng
Date: 2013-09-18 23:01:58 -0700 (Wed, 18 Sep 2013)
New Revision: 2788

Modified:
   trunk/layers/MapGuide/MapGuideViewerApi.js
   trunk/text/en
   trunk/widgets/Redline/classes/markupeditor.php
   trunk/widgets/Redline/editmarkup.php
   trunk/widgets/Redline/templates/markuplayerdefinition_advanced.xml
Log:
#595, #597: Merge sandbox changes r2785, r2786 and r2787 to trunk

Modified: trunk/layers/MapGuide/MapGuideViewerApi.js
===================================================================
--- trunk/layers/MapGuide/MapGuideViewerApi.js	2013-09-19 05:17:50 UTC (rev 2787)
+++ trunk/layers/MapGuide/MapGuideViewerApi.js	2013-09-19 06:01:58 UTC (rev 2788)
@@ -51,11 +51,11 @@
     }
 }
 
-function SetSelectionXML(selectionXml) {
+function SetSelectionXML(selectionXml, bDoNotZoom) {
     //var Fusion = window.top.Fusion;
     var mapWidget = GetFusionMapWidget();
     if (mapWidget && mapWidget.isMapLoaded()) {
-        mapWidget.setSelection(selectionXml, true);
+        mapWidget.setSelection(selectionXml, !(bDoNotZoom || false));
     }
 }
 

Modified: trunk/text/en
===================================================================
--- trunk/text/en	2013-09-19 05:17:50 UTC (rev 2787)
+++ trunk/text/en	2013-09-19 06:01:58 UTC (rev 2788)
@@ -332,6 +332,8 @@
 REDLINEDELETEOBJECT     = Delete
 REDLINEUPDATETEXT       = Update Text
 REDLINEEDITCLOSE        = Close
+REDLINENOTEXT           = no text
+REDLINEMULTISELECTHELP  = To select multiple redline objects in the list above, hold down the CTRL key while selecting. To select a range of items, hold down the SHIFT key and select the first and last items.
 
 # Redline Upload
 REDLINEUPLOAD           = Upload Redline

Modified: trunk/widgets/Redline/classes/markupeditor.php
===================================================================
--- trunk/widgets/Redline/classes/markupeditor.php	2013-09-19 05:17:50 UTC (rev 2787)
+++ trunk/widgets/Redline/classes/markupeditor.php	2013-09-19 06:01:58 UTC (rev 2788)
@@ -229,6 +229,20 @@
         $result = $featureService->UpdateFeatures($featureSourceId, $commands, false);
         MarkupEditor::CleanupReaders($result);
     }
+    
+    function BuildFeatureFilter($propName)
+    {
+        $ids = $this->args["MARKUPFEATURE"];
+        if (is_array($ids)) {
+            $filters = array();
+            foreach ($ids as $id) {
+                array_push($filters, "$propName = $id");
+            }
+            return join(" OR ", $filters);
+        } else {
+            return "$propName = $ids";
+        }
+    }
 
     function DeleteMarkup()
     {
@@ -242,7 +256,7 @@
         $idName = $keyProp->GetName();
 
         $commands = new MgFeatureCommandCollection();
-        $commands->Add(new MgDeleteFeatures('Markup', $idName . ' = ' . $this->args['MARKUPFEATURE']));
+        $commands->Add(new MgDeleteFeatures('Markup', $this->BuildFeatureFilter($idName)));
 
         $result = $featureService->UpdateFeatures($featureSourceId, $commands, false);
         MarkupEditor::CleanupReaders($result);
@@ -263,7 +277,7 @@
         $propertyValues->Add(new MgStringProperty('Text', trim($this->args['UPDATETEXT'])));
 
         $commands = new MgFeatureCommandCollection();
-        $commands->Add(new MgUpdateFeatures('Markup', $propertyValues, $idName . ' = ' . $this->args['MARKUPFEATURE']));
+        $commands->Add(new MgUpdateFeatures('Markup', $propertyValues, $this->BuildFeatureFilter($idName)));
 
         $result = $featureService->UpdateFeatures($featureSourceId, $commands, false);
         MarkupEditor::CleanupReaders($result);
@@ -278,8 +292,15 @@
         $markupLayer = $map->GetLayers()->GetItem('_' . $this->GetMarkupName());
 
         $selection = new MgSelection($map);
-        $selection->AddFeatureIdInt32($markupLayer, $markupLayer->GetFeatureClassName(), (int) $this->args['MARKUPFEATURE']);
-
+        $className = $markupLayer->GetFeatureClassName();
+        $ids = $this->args['MARKUPFEATURE'];
+        if (is_array($ids)) {
+            foreach ($ids as $id) {
+                $selection->AddFeatureIdInt32($markupLayer, $className, (int) $id);
+            }
+        } else {
+            $selection->AddFeatureIdInt32($markupLayer, $className, (int) $ids);
+        }
         return $selection->ToXML();
     }
 }

Modified: trunk/widgets/Redline/editmarkup.php
===================================================================
--- trunk/widgets/Redline/editmarkup.php	2013-09-19 05:17:50 UTC (rev 2787)
+++ trunk/widgets/Redline/editmarkup.php	2013-09-19 06:01:58 UTC (rev 2788)
@@ -118,6 +118,8 @@
         $closeLocal = GetLocalizedString('REDLINEEDITCLOSE', $locale );
         $promptLabelLocal = GetLocalizedString('REDLINEPROMPTLABEL', $locale);
         $promptRedlineLabelsLocal = GetLocalizedString('REDLINEPROMPTFORLABELS', $locale);
+        $noTextLocal = GetLocalizedString('REDLINENOTEXT', $locale);
+        $multiHelpLocal = GetLocalizedString('REDLINEMULTISELECTHELP', $locale);
         
         if (array_key_exists("REDLINEPROMPT", $args) && strcmp($args["REDLINEPROMPT"], "on") == 0) {
             $checkState = " checked='checked'";
@@ -330,14 +332,33 @@
             SubmitCommand(CMD_ADD_POLYGON);
         }
 
+        function TrimString(str)
+        {
+            return (typeof String.prototype.trim == 'undefined') ? str.replace(/^\s+|\s+$/g, '') : str.trim();
+        }
+
+        function GetSelectedMarkupIds(mkEl)
+        {
+            var ids = [];
+            for (var i = 0; i < mkEl.options.length; i++) {
+                if (mkEl.options[i].selected) {
+                    ids.push(mkEl.options[i].value);
+                }
+            }
+            return ids;
+        }
+
         function SelectMarkup()
         {
             markupFeatures = document.getElementById("markupFeatures");
-
+            var featIds = GetSelectedMarkupIds(markupFeatures);
             reqParams = "MAPNAME=" + encodeURIComponent(mapName);
             reqParams += "&SESSION=" + encodeURIComponent(session);
             reqParams += "&OPENMARKUP=" + encodeURIComponent('<?= $args['OPENMARKUP']; ?>');
-            reqParams += "&MARKUPFEATURE=" + markupFeatures.value;
+            //reqParams += "&MARKUPFEATURE=" + markupFeatures.value;
+            for (var i = 0; i < featIds.length; i++) {
+                reqParams += "&MARKUPFEATURE[]=" + featIds[i];
+            }
 
             if(msie)
                 reqHandler = new ActiveXObject("Microsoft.XMLHTTP");
@@ -350,7 +371,7 @@
             reqHandler.send(reqParams);
             if(reqHandler.responseXML)
             {
-                SetSelectionXML(reqHandler.responseText);
+                SetSelectionXML(reqHandler.responseText, true /*bDoNotZoom*/);
             }
         }
 
@@ -387,10 +408,16 @@
             if (markupFeatures.selectedIndex >= 0)
             {
                 value = markupFeatures.options[markupFeatures.selectedIndex].text;
-                if (value != '[no text]')
-                    updateTextInput.value = value;
-                else
+                if (value.indexOf('[<?= $noTextLocal ?>]') < 0) {
+                    var tokens = value.split(":");
+                    if (tokens.length == 2) {
+                        updateTextInput.value = TrimString(tokens[1]);
+                    } else {
+                        updateTextInput.value = value;
+                    }
+                } else {
                     updateTextInput.value = '';
+                }
 
                 selectBtn.disabled = false;
                 deleteBtn.disabled = false;
@@ -426,7 +453,6 @@
 </head>
 
 <body onLoad="OnLoad()" onUnload="OnUnload()" marginwidth=5 marginheight=5 leftmargin=5 topmargin=5 bottommargin=5 rightmargin=5>
-
 <form action="editmarkup.php" method="post" enctype="application/x-www-form-urlencoded" id="editForm" target="_self">
 <table class="RegText" border="0" cellspacing="0" width="100%">
     <tr>
@@ -479,12 +505,12 @@
     </tr>
     <tr>
         <td class="RegText">
-            <select name="MARKUPFEATURE" size="15" class="Ctrl" id="markupFeatures" onChange="OnMarkupFeatureChange()" style="width: 100%">
+            <select name="MARKUPFEATURE[]" size="15" class="Ctrl" id="markupFeatures" onChange="OnMarkupFeatureChange()" multiple="multiple" style="width: 100%">
                 <?php
                     $selected = 'selected';
                     foreach($markupFeatures as $markupId => $markupText) {
                 ?>
-                <option value="<?= $markupId ?>" <?=$selected ?> ><?= (strlen($markupText) > 0) ? htmlentities($markupText, ENT_COMPAT, 'UTF-8') : '[no text]' ?></option>
+                <option value="<?= $markupId ?>" <?=$selected ?> ><?= (strlen($markupText) > 0) ? "$markupId: ".htmlentities($markupText, ENT_COMPAT, 'UTF-8') : "$markupId: [$noTextLocal]" ?></option>
                 <?php
                         $selected = '';
                     }
@@ -494,6 +520,10 @@
     </tr>
     <tr><td colspan="2" height="2px"></td></tr>
     <tr>
+        <td class="InfoText" colspan="2"><?= $multiHelpLocal ?></td>
+    </tr>
+    <tr><td colspan="2" height="2px"></td></tr>
+    <tr>
         <td colspan="2">
             <input class="Ctrl" id="selectBtn" type="button" onClick="SelectMarkup()" value="<?=$selectLocal?>" style="width:85px">
             <input class="Ctrl" id="deleteBtn" type="button" onClick="DeleteMarkup()" value="<?=$deleteLocal?>" style="width:85px">

Modified: trunk/widgets/Redline/templates/markuplayerdefinition_advanced.xml
===================================================================
--- trunk/widgets/Redline/templates/markuplayerdefinition_advanced.xml	2013-09-19 05:17:50 UTC (rev 2787)
+++ trunk/widgets/Redline/templates/markuplayerdefinition_advanced.xml	2013-09-19 06:01:58 UTC (rev 2788)
@@ -768,11 +768,11 @@
                     <Markup>'MTEXT'</Markup>
                   </Text>
                 </Graphics>
-                <LineUsage>
-                  <AngleControl>'FromAngle'</AngleControl>
+                <AreaUsage>
                   <Angle>%ROTATION%</Angle>
-                  <Repeat>1.0</Repeat>
-                </LineUsage>
+                  <RepeatX>100.0</RepeatX>
+                  <RepeatY>100.0</RepeatY>
+                </AreaUsage>
                 <ParameterDefinition>
                   <Parameter>
                     <Identifier>CONTENT</Identifier>



More information about the fusion-commits mailing list