[mapguide-commits] r5913 - in trunk/MgDev/Web/src: mapviewerjava
mapviewernet mapviewerphp viewerfiles
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Fri Jun 3 09:24:59 EDT 2011
Author: jng
Date: 2011-06-03 06:24:59 -0700 (Fri, 03 Jun 2011)
New Revision: 5913
Modified:
trunk/MgDev/Web/src/mapviewerjava/mainframe.jsp
trunk/MgDev/Web/src/mapviewernet/mainframe.aspx
trunk/MgDev/Web/src/mapviewerphp/mainframe.php
trunk/MgDev/Web/src/viewerfiles/mainframe.templ
Log:
Port forward #301 and #1712 to trunk
Modified: trunk/MgDev/Web/src/mapviewerjava/mainframe.jsp
===================================================================
--- trunk/MgDev/Web/src/mapviewerjava/mainframe.jsp 2011-06-03 13:12:36 UTC (rev 5912)
+++ trunk/MgDev/Web/src/mapviewerjava/mainframe.jsp 2011-06-03 13:24:59 UTC (rev 5913)
@@ -238,13 +238,13 @@
String param = MessageFormat.format("navParams{0,number,integer}[{1,number,integer}] = new NavParam(\"{2}\", \"{3}\");\n", formatArgs);
paramObjs = paramObjs + param;
}
- for( int j = 0; j < invokeUrlCmd.GetLayerCount(); j++ )
- {
- Object[] formatArgs = { new Integer(navCmdIndex), new Integer(j), invokeUrlCmd.GetLayerNameAt(j) };
- String layer = MessageFormat.format("layers{0,number,integer}[{1,number,integer}] = \"{2}\";\n", formatArgs);
- layers = layers + layer;
- }
}
+ for( int j = 0; j < invokeUrlCmd.GetLayerCount(); j++ )
+ {
+ Object[] formatArgs = { new Integer(navCmdIndex), new Integer(j), invokeUrlCmd.GetLayerNameAt(j) };
+ String layer = MessageFormat.format("layers{0,number,integer}[{1,number,integer}] = \"{2}\";\n", formatArgs);
+ layers = layers + layer;
+ }
cmdObjects = cmdObjects + paramObjs + layers;
if(invokeUrlCmd.DisabledIfSelectionEmpty() || invokeUrlCmd.GetLayerCount() > 0)
Modified: trunk/MgDev/Web/src/mapviewernet/mainframe.aspx
===================================================================
--- trunk/MgDev/Web/src/mapviewernet/mainframe.aspx 2011-06-03 13:12:36 UTC (rev 5912)
+++ trunk/MgDev/Web/src/mapviewernet/mainframe.aspx 2011-06-03 13:24:59 UTC (rev 5913)
@@ -236,18 +236,17 @@
String layers = "var layers" + navCmdIndex + " = new Array();\n";
if (invokeUrlCmd.GetParameterCount() > 0)
{
- int j = 0;
- for (j = 0; j < invokeUrlCmd.GetParameterCount(); j++)
+ for (int j = 0; j < invokeUrlCmd.GetParameterCount(); j++)
{
String param = String.Format("navParams{0}[{1}] = new NavParam(\"{2}\", \"{3}\");\n", navCmdIndex, j, invokeUrlCmd.GetParameterNameAt(j), invokeUrlCmd.GetParameterValueAt(j));
parameters = parameters + param;
}
- for (j = 0; j < invokeUrlCmd.GetLayerCount(); j++)
- {
- String layer = String.Format("layers{0}[{1}] = \"{2}\";\n", navCmdIndex, j, invokeUrlCmd.GetLayerNameAt(j));
- layers = layers + layer;
- }
}
+ for (int j = 0; j < invokeUrlCmd.GetLayerCount(); j++)
+ {
+ String layer = String.Format("layers{0}[{1}] = \"{2}\";\n", navCmdIndex, j, invokeUrlCmd.GetLayerNameAt(j));
+ layers = layers + layer;
+ }
cmdObjects = cmdObjects + parameters + layers;
if (invokeUrlCmd.DisabledIfSelectionEmpty() || invokeUrlCmd.GetLayerCount() > 0)
Modified: trunk/MgDev/Web/src/mapviewerphp/mainframe.php
===================================================================
--- trunk/MgDev/Web/src/mapviewerphp/mainframe.php 2011-06-03 13:12:36 UTC (rev 5912)
+++ trunk/MgDev/Web/src/mapviewerphp/mainframe.php 2011-06-03 13:24:59 UTC (rev 5913)
@@ -251,12 +251,12 @@
$param = sprintf("navParams%d[%d] = new NavParam(\"%s\", \"%s\");\n", $navCmdIndex, $j, $cmd->GetParameterNameAt($j), $cmd->GetParameterValueAt($j));
$params = $params . $param;
}
- for($j = 0; $j < $cmd->GetLayerCount(); $j++)
- {
- $layer = sprintf("layers%d[%d] = \"%s\";\n", $navCmdIndex, $j, $cmd->GetLayerNameAt($j));
- $layers = $layers . $layer;
- }
}
+ for($j = 0; $j < $cmd->GetLayerCount(); $j++)
+ {
+ $layer = sprintf("layers%d[%d] = \"%s\";\n", $navCmdIndex, $j, $cmd->GetLayerNameAt($j));
+ $layers = $layers . $layer;
+ }
$cmdObjects = $cmdObjects . $params . $layers;
if($cmd->DisabledIfSelectionEmpty() || $cmd->GetLayerCount() > 0)
{
Modified: trunk/MgDev/Web/src/viewerfiles/mainframe.templ
===================================================================
--- trunk/MgDev/Web/src/viewerfiles/mainframe.templ 2011-06-03 13:12:36 UTC (rev 5912)
+++ trunk/MgDev/Web/src/viewerfiles/mainframe.templ 2011-06-03 13:24:59 UTC (rev 5913)
@@ -603,21 +603,24 @@
var layers = cmd.layerConstraints;
if(layers.length > 0)
{
- var disable = false;
+ var foundLayer = false;
var selLayers = GetMapFrame().GetSelectedLayers();
- for(var k=0; k < selLayers.length && !disable; k++)
+ for(var k=0; k < selLayers.length; k++)
{
var selLayer = selLayers[k];
for(var j = 0; j < layers.length; j++)
{
- if(selLayer.name != layers[j])
+ if(selLayer.name == layers[j])
{
- disable = true;
+ foundLayer = true;
break;
}
}
+
+ if (foundLayer)
+ break;
}
- if(disable)
+ if(!foundLayer)
{
if(EnableCommand(cmd, false))
stateChanged = true;
More information about the mapguide-commits
mailing list