[fusion-commits] r2813 - in trunk: text widgets widgets/QuickPlot widgets/widgetinfo

svn_fusion at osgeo.org svn_fusion at osgeo.org
Thu Nov 14 22:12:08 PST 2013


Author: jng
Date: 2013-11-14 22:12:08 -0800 (Thu, 14 Nov 2013)
New Revision: 2813

Modified:
   trunk/text/en
   trunk/widgets/QuickPlot.js
   trunk/widgets/QuickPlot/PlotAsPDF.php
   trunk/widgets/QuickPlot/QuickPlotPanel.js
   trunk/widgets/QuickPlot/QuickPlotPanel.php
   trunk/widgets/QuickPlot/QuickPlotPanel.templ
   trunk/widgets/widgetinfo/quickplot.xml
Log:
#607: Add QuickPlot support for:
 - Determining what element checkboxes in the QuickPlot UI are checked by default
 - Allowing the legal disclaimer to be toggleable through the QuickPlot UI. This checkbox is not shown if:
   - There is no disclaimer configured for this widget
   - A disclaimer has been configured for this widget and the AllowDisclaimerToggle extension property has been set to false

Modified: trunk/text/en
===================================================================
--- trunk/text/en	2013-11-14 07:34:51 UTC (rev 2812)
+++ trunk/text/en	2013-11-15 06:12:08 UTC (rev 2813)
@@ -468,6 +468,7 @@
 QUICKPLOT_SHOWNORTHARROW        = North Arrow
 QUICKPLOT_SHOWCOORDINTES        = Coordinates
 QUICKPLOT_SHOWSCALEBAR          = Scale Bar
+QUICKPLOT_SHOWDISCLAIMER        = Legal Disclaimer
 QUICKPLOT_ADVANCED_OPTIONS      = Advanced options
 QUICKPLOT_PREVIEW_ERROR         = The application resources required to generate the plot exceed the settings defined by the administrator
 QUICKPLOT_RESOLUTION_WARNING    = The current settings exceed the map resolution. Zooming out or increasing the scaling will help create a more legible plot

Modified: trunk/widgets/QuickPlot/PlotAsPDF.php
===================================================================
--- trunk/widgets/QuickPlot/PlotAsPDF.php	2013-11-14 07:34:51 UTC (rev 2812)
+++ trunk/widgets/QuickPlot/PlotAsPDF.php	2013-11-15 06:12:08 UTC (rev 2813)
@@ -14,6 +14,7 @@
     $showNorthArrow = array_key_exists("ShowNorthArrow", $_POST) && $_POST["ShowNorthArrow"] === "on";
     $showCoordinates = array_key_exists("ShowCoordinates", $_POST) && $_POST["ShowCoordinates"] === "on";
     $showScaleBar = array_key_exists("ShowScaleBar", $_POST) && $_POST["ShowScaleBar"] === "on";
+    $showDisclaimer = array_key_exists("ShowDisclaimer", $_POST) && $_POST["ShowDisclaimer"] === "on";
     $legendType = array_key_exists("LegendType", $_POST) ? $_POST["LegendType"] : "original";
     if (strcmp($legendType, "original") == 0) {
         // /mapguide
@@ -141,7 +142,10 @@
     }
 
     // Draw declaration
-    $mDec = DrawDeclaration(($mScale != NULL) ? ($mScale->x + $mScale->w) : 0);
+    if ($showDisclaimer)
+        $mDec = DrawDeclaration(($mScale != NULL) ? ($mScale->x + $mScale->w) : 0);
+    else
+        $mDec = new Metrics(0, 0, 0, 0);
     
     // Adjust width and height of the images we want to request to compensate for surrounding print elements that have been rendered
     

Modified: trunk/widgets/QuickPlot/QuickPlotPanel.js
===================================================================
--- trunk/widgets/QuickPlot/QuickPlotPanel.js	2013-11-14 07:34:51 UTC (rev 2812)
+++ trunk/widgets/QuickPlot/QuickPlotPanel.js	2013-11-15 06:12:08 UTC (rev 2813)
@@ -16,6 +16,17 @@
     var disclaimer = widget.disclaimer;
     document.getElementById("legalNotice").value = disclaimer;
     
+    //If there's no disclaimer, then this checkbox is useless, so hide it if that's the case
+    if (!disclaimer || disclaimer == "" || !widget.allowDisclaimerToggle)
+        document.getElementById("DisclaimerCtrl").style.display = "none";
+    
+    //Apply initial UI state    
+    document.getElementById("ShowLegendCheckBox").checked = widget.showLegend;
+    document.getElementById("ShowNorthArrowCheckBox").checked = widget.showNorthArrow;
+    document.getElementById("ShowCoordinatesCheckBox").checked = widget.showCoordinates;
+    document.getElementById("ShowScaleBarCheckBox").checked = widget.showScaleBar;
+    document.getElementById("ShowDisclaimerCheckBox").checked = widget.showLegalDisclaimer;
+    
     //set the paper list from the quick plot widget info
     if (widget.paperList.length > 0)
     {

Modified: trunk/widgets/QuickPlot/QuickPlotPanel.php
===================================================================
--- trunk/widgets/QuickPlot/QuickPlotPanel.php	2013-11-14 07:34:51 UTC (rev 2812)
+++ trunk/widgets/QuickPlot/QuickPlotPanel.php	2013-11-15 06:12:08 UTC (rev 2813)
@@ -9,7 +9,7 @@
     $sessionId = "";
     $us = "";
     $popup = "false";
-
+    
     GetRequestParameters();
 
     $templ = file_get_contents("QuickPlotPanel.templ");

Modified: trunk/widgets/QuickPlot/QuickPlotPanel.templ
===================================================================
--- trunk/widgets/QuickPlot/QuickPlotPanel.templ	2013-11-14 07:34:51 UTC (rev 2812)
+++ trunk/widgets/QuickPlot/QuickPlotPanel.templ	2013-11-15 06:12:08 UTC (rev 2813)
@@ -134,7 +134,7 @@
         <div class="HPlaceholder5px"></div>
         <fieldset>
             <legend>__#QUICKPLOT_SHOWELEMENTS#__</legend>        
-            <div class="Label">
+            <div class="Label" id="LegendCtrl">
                 <table cellspacing="0" cellpadding="0">
                     <tr>
                         <td><input type="checkbox" id="ShowLegendCheckBox" name="ShowLegend" /></td>
@@ -142,7 +142,7 @@
                     </tr>
                 </table>
             </div>
-            <div class="Label">
+            <div class="Label" id="NorthArrowCtrl">
                 <table cellspacing="0" cellpadding="0">
                     <tr>
                         <td><input type="checkbox" id="ShowNorthArrowCheckBox" name="ShowNorthArrow" /></td>
@@ -150,7 +150,7 @@
                     </tr>
                 </table>
             </div>
-            <div class="Label">
+            <div class="Label" id="CoordinatesCtrl">
                 <table cellspacing="0" cellpadding="0">
                     <tr>
                         <td><input type="checkbox" id="ShowCoordinatesCheckBox" name="ShowCoordinates" /></td>
@@ -158,7 +158,7 @@
                     </tr>
                 </table>
             </div>
-            <div class="Label">
+            <div class="Label" id="ScaleBarCtrl">
                 <table cellspacing="0" cellpadding="0">
                     <tr>
                         <td><input type="checkbox" id="ShowScaleBarCheckBox" name="ShowScaleBar" /></td>
@@ -166,6 +166,14 @@
                     </tr>
                 </table>
             </div>
+            <div class="Label" id="DisclaimerCtrl">
+                <table cellspacing="0" cellpadding="0">
+                    <tr>
+                        <td><input type="checkbox" id="ShowDisclaimerCheckBox" name="ShowDisclaimer" /></td>
+                        <td><label for="ShowDisclaimerCheckBox">__#QUICKPLOT_SHOWDISCLAIMER#__</label></td>
+                    </tr>
+                </table>
+            </div>
         </fieldset>
         <div class="HPlaceholder5px"></div>
         <div class="HPlaceholder5px"></div>

Modified: trunk/widgets/QuickPlot.js
===================================================================
--- trunk/widgets/QuickPlot.js	2013-11-14 07:34:51 UTC (rev 2812)
+++ trunk/widgets/QuickPlot.js	2013-11-15 06:12:08 UTC (rev 2813)
@@ -33,6 +33,18 @@
     showSubTitle: true,
     //Indicates whether cookies will be used to persist QuickPlot UI options
     persistPlotOptions: false,
+    //Indicates whether the legend checkbox in the Quick Plot UI is initially checked
+    showLegend: true,
+    //Indicates whether the north arrow checkbox in the Quick Plot UI is initially checked
+    showNorthArrow: false,
+    //Indicates whether the coordinates checkbox in the Quick Plot UI is initially checked
+    showCoordinates: false,
+    //Indicates whether the scale bar checkbox in the Quick Plot UI is initially checked
+    showScaleBar: false,
+    //Indicates whether the disclaimer checkbox is visible. This can be set to false to remove the ability for the user to toggle this element.
+    allowDisclaimerToggle: true,
+    //Indicates whether the disclaimer checkbox in the Quick Plot UI is initially checked
+    showLegalDisclaimer: true,
     
     initializeWidget: function(widgetTag) 
     {
@@ -118,6 +130,30 @@
             this.showCoordinatesInPreview = (json.ShowCoordinateLabels[0] == 'true');
         }
         
+        if (json.AllowDisclaimerToggle) {
+            this.allowDisclaimerToggle = (json.AllowDisclaimerToggle[0] == 'true');
+        }
+        
+        if (json.ShowLegend) {
+            this.showLegend = (json.ShowLegend[0] == 'true');
+        }
+        
+        if (json.ShowNorthArrow) {
+            this.showNorthArrow = (json.ShowNorthArrow[0] == 'true');
+        }
+        
+        if (json.ShowCoordinates) {
+            this.showCoordinates = (json.ShowCoordinates[0] == 'true');
+        }
+        
+        if (json.ShowScaleBar) {
+            this.showScaleBar = (json.ShowScaleBar[0] == 'true');
+        }
+        
+        if (json.ShowLegalDisclaimer) {
+            this.showLegalDisclaimer = (json.ShowLegalDisclaimer[0] == 'true');
+        }
+        
         if (json.RememberPlotOptions) {
             this.persistPlotOptions = (json.RememberPlotOptions[0] == 'true');
         }

Modified: trunk/widgets/widgetinfo/quickplot.xml
===================================================================
--- trunk/widgets/widgetinfo/quickplot.xml	2013-11-14 07:34:51 UTC (rev 2812)
+++ trunk/widgets/widgetinfo/quickplot.xml	2013-11-15 06:12:08 UTC (rev 2813)
@@ -80,4 +80,52 @@
         <DefaultValue>The materials available at this web site are for informational purposes only and do not constitute a legal document.</DefaultValue>
         <IsMandatory>false</IsMandatory>
     </Parameter>
+    <Parameter>
+        <Name>AllowDisclaimerToggle</Name>
+        <Description>Indicates whether the disclaimer element in the Quick Plot UI is shown by default (allowing it to be toggled). This is already hidden if there is no configured disclaimer, this option allows you to hide it if there is a configured disclaimer (ie. You always want to have the disclaimer in the final plot). Defaults to true if unspecified</Description>
+        <Type>boolean</Type>
+        <Label>AllowDisclaimerToggle</Label>
+        <DefaultValue>true</DefaultValue>
+        <IsMandatory>false</IsMandatory>
+    </Parameter>
+    <Parameter>
+        <Name>ShowLegend</Name>
+        <Description>Indicates whether the legend element in the Quick Plot UI is checked by default. Defaults to false if unspecified</Description>
+        <Type>boolean</Type>
+        <Label>ShowLegend</Label>
+        <DefaultValue>false</DefaultValue>
+        <IsMandatory>false</IsMandatory>
+    </Parameter>
+    <Parameter>
+        <Name>ShowNorthArrow</Name>
+        <Description>Indicates whether the north arrow element in the Quick Plot UI is checked by default. Defaults to false if unspecified</Description>
+        <Type>boolean</Type>
+        <Label>ShowNorthArrow</Label>
+        <DefaultValue>false</DefaultValue>
+        <IsMandatory>false</IsMandatory>
+    </Parameter>
+    <Parameter>
+        <Name>ShowCoordinates</Name>
+        <Description>Indicates whether the coordinates element in the Quick Plot UI is checked by default. Defaults to false if unspecified</Description>
+        <Type>boolean</Type>
+        <Label>ShowCoordinates</Label>
+        <DefaultValue>false</DefaultValue>
+        <IsMandatory>false</IsMandatory>
+    </Parameter>
+    <Parameter>
+        <Name>ShowScaleBar</Name>
+        <Description>Indicates whether the scale bar element in the Quick Plot UI is checked by default. Defaults to false if unspecified</Description>
+        <Type>boolean</Type>
+        <Label>ShowScaleBar</Label>
+        <DefaultValue>false</DefaultValue>
+        <IsMandatory>false</IsMandatory>
+    </Parameter>
+    <Parameter>
+        <Name>ShowLegalDisclaimer</Name>
+        <Description>Indicates whether the legal disclaimer element in the Quick Plot UI is checked by default. Has no effect if this widget has no disclaimer configured. Defaults to true if unspecified</Description>
+        <Type>boolean</Type>
+        <Label>ShowLegalDisclaimer</Label>
+        <DefaultValue>true</DefaultValue>
+        <IsMandatory>false</IsMandatory>
+    </Parameter>
 </WidgetInfo>



More information about the fusion-commits mailing list