[Mapbender-commits] r2811 - trunk/mapbender/http/php
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Fri Aug 15 04:54:51 EDT 2008
Author: christoph
Date: 2008-08-15 04:54:51 -0400 (Fri, 15 Aug 2008)
New Revision: 2811
Modified:
trunk/mapbender/http/php/nestedSets.php
Log:
merged w/ 2.5 branch
Modified: trunk/mapbender/http/php/nestedSets.php
===================================================================
--- trunk/mapbender/http/php/nestedSets.php 2008-08-15 08:49:45 UTC (rev 2810)
+++ trunk/mapbender/http/php/nestedSets.php 2008-08-15 08:54:51 UTC (rev 2811)
@@ -54,16 +54,16 @@
if(value == 'insert'){
/*
if(document.forms[0].title.value == ''){alert("Bitte geben Sie einen Titel an."); permission = false; return;}
- if(document.forms[0].left.value == ''){alert("W�hlen Sie eine Position."); permission = false; return;}
+ if(document.forms[0].left.value == ''){alert("Wählen Sie eine Position."); permission = false; return;}
*/
- if(document.forms[0].title.value == ''){alert("Please insert a title."); permission = false; return;}
+ if(document.forms[0].title.value == ''){alert("<?php echo _mb("Please insert a title.") ?>"); permission = false; return;}
if(document.forms[0].left.value == ''){alert("Please choose a position."); permission = false; return;}
- if(document.forms[0].wmsList.selectedIndex > 0 && document.forms[0].layer.selectedIndex == 0){alert("W�hlen Sie einen Layer."); permission = false; return;}
+ if(document.forms[0].wmsList.selectedIndex > 0 && document.forms[0].layer.selectedIndex == 0){alert("Wählen Sie einen Layer."); permission = false; return;}
if(permission == true){document.forms[0].action.value = "insert"; document.forms[0].submit();}
}
if(value == 'delete'){
- //permission = confirm("Soll das Objekt mit Inhalten gel�scht werden?");
+ //permission = confirm("Soll das Objekt mit Inhalten gelöscht werden?");
permission = confirm("Do you want to delete the object and the content of the object?");
if(permission == true){
document.forms[0].action.value = "delete";
@@ -73,7 +73,7 @@
if(value == 'update'){
/*
if(document.forms[0].title.value == ''){alert("Bitte geben Sie einen Titel an."); permission = false; return;}
- if(document.forms[0].left.value == ''){alert("Bitte w�hlen Sie eine Position."); permission = false; return;}
+ if(document.forms[0].left.value == ''){alert("Bitte wählen Sie eine Position."); permission = false; return;}
*/
if(document.forms[0].title.value == ''){alert("Please fill in a labeling."); permission = false; return;}
@@ -83,10 +83,10 @@
}
if(value == 'add'){
/*
- if(document.forms[0].left.value == ''){alert("Bitte w�hlen Sie eine Position."); permission = false; return;}
- if(document.forms[0].guiList.selectedIndex == 0){alert("Bitte w�hlen Sie eine GUI."); permission = false; return;}
- if(document.forms[0].wmsList.selectedIndex == 0){alert("Bitte w�hlen Sie einen WMS."); permission = false; return;}
- if(document.forms[0].layer.selectedIndex == 0){alert("Bitte w�hlen Sie eine Ebene."); permission = false; return;}
+ if(document.forms[0].left.value == ''){alert("Bitte wählen Sie eine Position."); permission = false; return;}
+ if(document.forms[0].guiList.selectedIndex == 0){alert("Bitte wählen Sie eine GUI."); permission = false; return;}
+ if(document.forms[0].wmsList.selectedIndex == 0){alert("Bitte wählen Sie einen WMS."); permission = false; return;}
+ if(document.forms[0].layer.selectedIndex == 0){alert("Bitte wählen Sie eine Ebene."); permission = false; return;}
*/
if(document.forms[0].left.value == ''){alert("Please fill in a position."); permission = false; return;}
@@ -112,7 +112,7 @@
}
if(isset($action) && $action == "insert"){
$temp = explode("###", $layer);
- $sql = "SELECT rgt FROM gui_treegde WHERE lft = $1 AND fkey_gui_id = $1";
+ $sql = "SELECT rgt FROM gui_treegde WHERE lft = $1 AND fkey_gui_id = $2";
$v = array($left, $guiList);
$t = array("i", "s");
$res = db_prep_query($sql, $v, $t);
@@ -124,15 +124,16 @@
$v = array($left, $guiList);
$t = array("i", "s");
db_prep_query($sql, $v, $t);
-
+#echo $sql . " 1: ".$left." 2:".$guiList."<br>";
$sql = "UPDATE gui_treegde SET lft=lft+2 WHERE lft >= $1 AND fkey_gui_id = $2";
$v = array($left, $guiList);
$t = array("i", "s");
db_prep_query($sql, $v, $t);
+#echo $sql . " 1: ".$left." 2:".$guiList."<br>";
$sql = "INSERT INTO gui_treegde(fkey_gui_id, fkey_layer_id, lft,rgt, ";
$sql .= "my_layer_title, layer, wms_id) VALUES($1, $2, $3, $4, $5, $6, $7)";
- #echo $sql . "<br>";
+#echo $sql . "<br>";
$v = array($guiList, $temp[0], $left, ($left+1), $name, $temp[1], $wmsList);
$t = array("s", "s", "i", "i", "s", "s", "s");
db_prep_query($sql, $v, $t);
@@ -146,7 +147,7 @@
db_query($sql);
#hier ist noch was falsch
$sql = "INSERT INTO gui_treegde(fkey_gui_id,my_layer_title,lft,rgt,layer) VALUES('".$guiList."','new',".$left.",".($left+1).",'new')";
- echo $sql . "<br />";
+ #echo $sql . "<br />";
db_query($sql);
}
*/
@@ -164,14 +165,15 @@
$t = array("i", "i", "s");
db_prep_query($sql, $v, $t);
- $sql = "UPDATE gui_treegde SET lft=lft-(($1 - $2 + 1)) WHERE lft > $3 AND fkey_gui_id = $4";
- $v = array($right, $left, $right, $guiList);
- $t = array("i", "i", "i", "s");
+ $sql = "UPDATE gui_treegde SET lft=lft-$1 WHERE lft > $2 AND fkey_gui_id = $3";
+ $v = array($right-$left+1, $right, $guiList);
+ $t = array("i", "i", "s");
db_prep_query($sql, $v, $t);
-
- $sql = "UPDATE gui_treegde SET rgt=rgt-(($1 - $2 + 1)) WHERE rgt > $3 AND fkey_gui_id = $4";
- $v = array($right, $left, $right, $guiList);
- $t = array("i", "i", "i", "s");
+#echo $sql . " r:".$right." l:".$left." 2:".$guiList."<br>";
+ $sql = "UPDATE gui_treegde SET rgt=rgt-$1 WHERE rgt > $2 AND fkey_gui_id = $3";
+ $v = array($right-$left+1, $right, $guiList);
+ $t = array("i", "i", "s");
+#echo $sql . " r:".$right." l:".$left." 2:".$guiList."<br>";
db_prep_query($sql, $v, $t);
}
}
@@ -193,12 +195,12 @@
$sql_val = "SELECT * FROM gui_treegde WHERE lft = $1 AND fkey_gui_id = $2";
$v = array($left, $guiList);
$t = array("i", "s");
- $res = db_prep_query($sql_val, $v, $t);
+ $res_val = db_prep_query($sql_val, $v, $t);
$sql = "UPDATE gui_treegde SET ";
$sql .= "fkey_layer_id = $1, layer = $2, wms_id = $3 ";
$sql .= "WHERE lft = $4 AND fkey_gui_id = $5";
-
+
$v = array();
$t = array("s", "s", "s", "i", "s");
@@ -222,7 +224,6 @@
else {
array_push($v, $wmsList);
}
-
array_push($v, $left);
array_push($v, $guiList);
db_prep_query($sql, $v, $t);
More information about the Mapbender_commits
mailing list