[fusion-commits] r2504 - in trunk: text widgets/Redline widgets/Redline/classes

svn_fusion at osgeo.org svn_fusion at osgeo.org
Wed Jan 4 00:12:13 EST 2012


Author: jng
Date: 2012-01-03 21:12:13 -0800 (Tue, 03 Jan 2012)
New Revision: 2504

Modified:
   trunk/text/en
   trunk/widgets/Redline/classes/markupcommand.php
   trunk/widgets/Redline/markupmain.php
Log:
#508: Improve redline widget usability (part 3): Add a download button for Redline Layers on Map. The reason we don't use the same download button for both lists is because we don't know which one to download if both lists have a selected item.

Modified: trunk/text/en
===================================================================
--- trunk/text/en	2012-01-04 04:57:38 UTC (rev 2503)
+++ trunk/text/en	2012-01-04 05:12:13 UTC (rev 2504)
@@ -222,7 +222,7 @@
 REDLINEREFRESH          = Refresh
 REDLINEEDIT             = Add/Edit Redlines
 REDLINEREMOVEFROMMAP    = Remove From Map
-REDLINEDOWNLOADSDF      = Download
+REDLINEDOWNLOADSDF      = Download Data
 REDLINEUPLOADSDF        = Upload
 REDLINEEDITSTYLE        = Edit Style
 REDLINECREATEFAILURE    = Failed to create redline

Modified: trunk/widgets/Redline/classes/markupcommand.php
===================================================================
--- trunk/widgets/Redline/classes/markupcommand.php	2012-01-04 04:57:38 UTC (rev 2503)
+++ trunk/widgets/Redline/classes/markupcommand.php	2012-01-04 05:12:13 UTC (rev 2504)
@@ -11,6 +11,7 @@
     const Download  = 7;
     const Upload = 8;
     const EditStyle = 9;
+    const DownloadDataFromLayer = 10;
 }
 
 ?>
\ No newline at end of file

Modified: trunk/widgets/Redline/markupmain.php
===================================================================
--- trunk/widgets/Redline/markupmain.php	2012-01-04 04:57:38 UTC (rev 2503)
+++ trunk/widgets/Redline/markupmain.php	2012-01-04 05:12:13 UTC (rev 2504)
@@ -53,6 +53,11 @@
             case MarkupCommand::Download:
                 $markupManager->DownloadMarkup();
                 break;
+            case MarkupCommand::DownloadDataFromLayer:
+                //The opened markup layer is the one we want to download
+                $markupManager->SetArgument("MARKUPLAYER", $args["OPENMARKUP"]);
+                $markupManager->DownloadMarkup();
+                break;
 			}
 		}
 		
@@ -110,6 +115,7 @@
         var CMD_DOWNLOAD = <?= MarkupCommand::Download ?>;
         var CMD_UPLOAD = <?= MarkupCommand::Upload ?>;
         var CMD_EDITSTYLE = <?= MarkupCommand::EditStyle ?>;
+        var CMD_DOWNLOAD_LAYER_DATA = <?= MarkupCommand::DownloadDataFromLayer ?>;
 			
 		function SubmitCommand(cmd)
 		{
@@ -211,18 +217,21 @@
 			var editBtn = document.getElementById("editBtn");
 			var closeBtn = document.getElementById("closeBtn");
             var editStyleBtn = document.getElementById("editStyleBtn");
+            var downloadDataBtn = document.getElementById("downloadDataBtn");
 			
 			if (openSelect.options.length > 0 && openSelect.selectedIndex >= 0)
 			{
 				editBtn.disabled = false;
 				closeBtn.disabled = false;
                 editStyleBtn.disabled = false;
+                downloadDataBtn.disabled = false;
 			}
 			else
 			{
 				editBtn.disabled = true;
 				closeBtn.disabled = true;
                 editStyleBtn.disabled = true;
+                downloadDataBtn.disabled = true;
 			}
             
             if (openSelect.options.length > 0) {
@@ -305,6 +314,7 @@
 			<input class="Ctrl" type="button" id="editBtn" onClick="SubmitCommand(CMD_EDIT)" value="<?=$addEditLocal?>" style="width:125px">
 			<input class="Ctrl" type="button" id="closeBtn" onClick="SubmitCommand(CMD_CLOSE)" value="<?=$removeFromMapLocal?>" style="width:125px">
             <input class="Ctrl" type="button" id="editStyleBtn" onClick="SubmitCommand(CMD_EDITSTYLE)" value="<?=$editStyleLocal?>" style="width:125px">
+            <input class="Ctrl" type="button" id="downloadDataBtn" onClick="SubmitCommand(CMD_DOWNLOAD_LAYER_DATA)" value="<?=$downloadLocal?>" style="width:125px">
 			<br><br>
 		</td>
 	</tr>



More information about the fusion-commits mailing list