[Mapbender-commits] r2777 - branches/2.5/http/php
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Wed Aug 13 17:58:13 EDT 2008
Author: astrid_emde
Date: 2008-08-13 17:58:13 -0400 (Wed, 13 Aug 2008)
New Revision: 2777
Modified:
branches/2.5/http/php/nestedSets.php
Log:
bugs fixed. have a look at:
http://trac.osgeo.org/mapbender/ticket/179#comment:8
still two errors remain
Modified: branches/2.5/http/php/nestedSets.php
===================================================================
--- branches/2.5/http/php/nestedSets.php 2008-08-13 17:07:19 UTC (rev 2776)
+++ branches/2.5/http/php/nestedSets.php 2008-08-13 21:58:13 UTC (rev 2777)
@@ -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);
}
*/
@@ -168,10 +169,11 @@
$v = array($right, $left, $right, $guiList);
$t = array("i", "i", "i", "s");
db_prep_query($sql, $v, $t);
-
+#echo $sql . " r:".$right." l:".$left." 2:".$guiList."<br>";
$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>";
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