[Mapbender-commits] r3459 - trunk/mapbender/http/php

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Wed Jan 14 16:03:54 EST 2009


Author: marc
Date: 2009-01-14 16:03:54 -0500 (Wed, 14 Jan 2009)
New Revision: 3459

Modified:
   trunk/mapbender/http/php/mod_editElements.php
Log:
some layout modifications +
function to change a gui_type see http://trac.osgeo.org/mapbender/ticket/344

Modified: trunk/mapbender/http/php/mod_editElements.php
===================================================================
--- trunk/mapbender/http/php/mod_editElements.php	2009-01-14 20:59:47 UTC (rev 3458)
+++ trunk/mapbender/http/php/mod_editElements.php	2009-01-14 21:03:54 UTC (rev 3459)
@@ -34,6 +34,7 @@
 <title>Edit Elements</title>
 <?php
 include '../include/dyn_css.php';
+
 ?>
 <style type="text/css">
    <!--
@@ -51,7 +52,7 @@
    }
    .buttonbar{
    	position:absolute;
-   	top:60px;
+   	top:80px;
    	left:10px;
    }
    .guiList1_text{
@@ -90,12 +91,16 @@
    }
    .myForm{
    	position:absolute;
-   	top:90px;
+   	top:110px;
    	left:10px;
    }
    .textfield{
       width:277px
    }
+   .gui_type_text{
+   font-size:80%;
+   margin-top:
+   }
    .textfield_small{
       width:150px
    }
@@ -109,7 +114,7 @@
 </style>
 <?php
 # handle database updates etc.....
-if(isset($mySave) && ($mySave == '1' || $mySave == '2')) {
+if(isset($mySave) && ($mySave == '1' || $mySave == '2' || $mySave == '3')) {
 	# check module-permission ---------------------------------------------------------
 	# e_attributes
 	# e_js_file
@@ -221,6 +226,14 @@
 		$res = db_prep_query($sql,$v,$t);
 	}
 
+  elseif ($mySave == '3') {
+		$sql = "UPDATE gui SET gui_type = $1 WHERE gui_id = $2";
+		$v = array($guiType,$guiId);
+		$t = array('s','s');
+		$res = db_prep_query($sql,$v,$t);
+	}
+
+
 }
 if(isset($myDelete) && $myDelete == '1'){
 	$sql = "DELETE FROM gui_element WHERE e_id = $1 AND fkey_gui_id = $2";   
@@ -286,8 +299,8 @@
 	db_commit();
 }
 # end
-echo "<script language='javascript'>";
-echo "var guiIDs = new Array();";
+echo "<script type='text/javascript'>\n";
+echo "var guiIDs = new Array();\n";
 if(isset($guiList1)){
 	$sql = "SELECT e_id FROM gui_element WHERE  fkey_gui_id = $1";
 	$v = array($guiList1);
@@ -295,7 +308,7 @@
 	$res = db_prep_query($sql,$v,$t);
 	$cnt = 0;
 	while($row = db_fetch_array($res)){
-		echo  "guiIDs[".$cnt."] = '".$row["e_id"]."'; ";
+		echo  "guiIDs[".$cnt."] = '".$row["e_id"]."';\n ";
 		$cnt++;
 	}
 }
@@ -372,6 +385,29 @@
 	}
 }
 
+
+function editType(){
+  var newType = document.form1.newType.value;
+  
+  if (newType=="wms_container"){
+  var adminText = "\n Hint:\n Gui Type \"WMS Container\"  will not be displayed in login interface ";
+  }
+  else {
+  var adminText = "";
+  }
+  
+  var confirmType = confirm("Are you sure to change the Gui Type to   \"" +newType+ "\"" +adminText); 
+  if (confirmType == true) {
+		document.form1.guiType.value = newType;
+		document.form1.mySave.value = 3;
+		document.form1.submit();
+	}
+	else{
+  document.form1.newType.value = document.form1.guiType.value;
+  }
+}
+
+
 // -->
 </script>
 </head>
@@ -401,7 +437,8 @@
 		$gui_id_own[$count]=$row["gui_id"];
 		$gui_name_own[$count]=$row["gui_name"];
 		$gui_description_own[$count]=$row["gui_description"];
-		$count++;
+		$gui_type_own[$count]=$row["gui_type"];
+    $count++;
 	}
 
 	$v = array();
@@ -422,6 +459,7 @@
 		$gui_id_perm[$count]= $row["gui_id"];
 		$gui_name_perm[$count]=$row["gui_name"];
 		$gui_description_perm[$count]=$row["gui_description"];
+		$gui_type_perm[$count]=$row["gui_type"];
 		$count++;
 	}
 
@@ -441,7 +479,9 @@
 		for ($i=0; $i<count($gui_id_own);$i++){
 			echo "<input type='hidden'  name='guiDesc_" . $gui_name_own[$i] . "' value='" . $gui_description_own[$i] . "' >\n";
 		    echo "<input type='hidden'  name='guiId_" . $gui_name_own[$i] . "' value='" . $gui_id_own[$i] . "' >\n";
-		}
+		    echo "<input type='hidden'  name='guiType_" . $gui_name_own[$i] . "' value='" . $gui_type_own[$i] . "' >\n";
+		
+    }
 		echo "<input type='hidden'  name='guiList2' value='' >\n";
 	}
 	else{
@@ -457,10 +497,32 @@
 		  $Id = "guiId_" . $guiList1;
 		  $guiId = $$Id;
 	   }
+	   if (!$guiType) {
+		  $Type = "guiType_" . $guiList1;
+		  $guiType = $$Type;
+	   }
 
 	   echo "&nbsp;&nbsp;<br /><span style='font-size:75%'>(" . $guiDesc;
 	   echo	" <input type='button' class='' name='' value='edit' onclick='editDesc()'> ) </span>\n";
-	   echo "</div>\n";
+	   echo "<br /><font class='gui_type_text'>Change GUI Type:</font>";
+     echo  "<select name='newType' id='' onchange='editType()' >";
+	   echo	" <option value='..'> ... </option>\n";   
+     echo	" <option value='admin'";
+       if ($guiType == "admin") echo "selected='selected'>Admin</option>\n";
+       else echo ">Admin</option>\n";
+     echo	" <option value='map'";
+       if ($guiType == "map") echo "selected='selected'>Map</option>\n";
+      else echo ">Map</option>\n";
+      echo	" <option value='digitize'";
+       if ($guiType == "digitize") echo "selected='selected'>Digitize</option>\n";
+       else echo ">Digitize</option>\n";
+    echo	" <option value='wms_container'";
+       if ($guiType == "wms_container") echo "selected='selected'>WMS Container</option>\n";
+      else echo ">WMS Container</option>\n";
+     
+     echo "</select>";
+     echo "<br />";
+     echo "</div>\n";
 	   echo "<div class='buttonbar'>\n";
 	   echo "<input type='button' class='' name='' value='save' onclick='thisSave()'> \n";
 	   echo "<input type='button' class='' name='' value='delete' onclick='thisDelete()'> \n";
@@ -473,9 +535,13 @@
 	   		"\"edit application\", " .
 	   		"\"width=500,height=500,dependent\");'> \n";
 	   echo "</div>\n";
+	   
+	   
 	   echo "<input type='hidden'  name='guiList1' value='".$guiList1."' >\n";
-	   echo "<input type='hidden'  name='guiId' value='".$guiId."' >\n";
-	   echo "<input type='hidden'  name='guiDesc' value='".$guiDesc."' >\n";
+	   echo "<input type='hidden'  name='guiId'    value='".$guiId."' >\n";
+	   echo "<input type='hidden'  name='guiDesc'  value='".$guiDesc."' >\n";
+     echo "<input type='hidden'  name='guiType'   value='".$guiType."' >\n";
+
 	}
 	#Depot
 	if(isset($guiList1)){



More information about the Mapbender_commits mailing list