svn commit: r676 - trunk/mapbender/http/php/nestedSets.php

astrid_emde at osgeo.org astrid_emde at osgeo.org
Fri Jul 21 05:39:44 EDT 2006


Author: astrid_emde
Date: 2006-07-21 09:39:44+0000
New Revision: 676

Modified:
   trunk/mapbender/http/php/nestedSets.php

Log:
little error when you delete an element, but you didn't choose onde is fixed

Modified: trunk/mapbender/http/php/nestedSets.php
Url: https://mapbender.osgeo.org/source/browse/mapbender/trunk/mapbender/http/php/nestedSets.php?view=diff&rev=676&p1=trunk/mapbender/http/php/nestedSets.php&p2=trunk/mapbender/http/php/nestedSets.php&r1=675&r2=676
==============================================================================
--- trunk/mapbender/http/php/nestedSets.php	(original)
+++ trunk/mapbender/http/php/nestedSets.php	2006-07-21 09:39:44+0000
@@ -68,7 +68,7 @@
 	}
 	if(value == 'delete'){
 		//permission = confirm("Soll das Objekt mit Inhalten gelöscht werden?");
-		permission = confirm("Do you want to delete the object and the content if the object?");
+		permission = confirm("Do you want to delete the object and the content of the object?");
 		if(permission == true){
 		document.forms[0].action.value = "delete"; 
 		document.forms[0].submit();
@@ -150,16 +150,18 @@
 	}
 	*/
 }
-if(isset($action) && $action == "delete"){
-	$sql = "SELECT rgt FROM gui_treegde WHERE lft =". $left." AND fkey_gui_id = '".$guiList."'";
-	$res = db_query($sql);
-	$right = db_result($res,0,"rgt");
-	$sql = "DELETE FROM gui_treegde WHERE lft BETWEEN ".$left." and ".$right." AND fkey_gui_id = '".$guiList."'";
-	db_query($sql);
-	$sql = "UPDATE gui_treegde SET lft=lft-((".$right."-".$left."+1)) WHERE lft>".$right." AND fkey_gui_id = '".$guiList."'";
-	db_query($sql);
-	$sql = "UPDATE gui_treegde SET rgt=rgt-((".$right."-".$left."+1)) WHERE rgt>".$right." AND fkey_gui_id = '".$guiList."'";
-	db_query($sql);
+if(isset($action) && $action == "delete"){	
+	if($left){
+		$sql = "SELECT rgt FROM gui_treegde WHERE lft =". $left." AND fkey_gui_id = '".$guiList."'";
+		$res = db_query($sql);
+		$right = db_result($res,0,"rgt");
+		$sql = "DELETE FROM gui_treegde WHERE lft BETWEEN ".$left." and ".$right." AND fkey_gui_id = '".$guiList."'";
+		db_query($sql);
+		$sql = "UPDATE gui_treegde SET lft=lft-((".$right."-".$left."+1)) WHERE lft>".$right." AND fkey_gui_id = '".$guiList."'";
+		db_query($sql);
+		$sql = "UPDATE gui_treegde SET rgt=rgt-((".$right."-".$left."+1)) WHERE rgt>".$right." AND fkey_gui_id = '".$guiList."'";
+		db_query($sql);
+	}
 }
 if(isset($action) && $action == "update"){
 	$temp = explode("###", $layer);




More information about the Mapbender_commits mailing list