From: hickert Date: Mon, 26 Mar 2007 09:09:46 +0000 (+0000) Subject: Added links to action texts X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=268e810bbf8753b6e267b5e935ec99d131bb71d8;p=gosa.git Added links to action texts git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5883 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/include/sieve/class_My_Tree.inc b/include/sieve/class_My_Tree.inc index 839f82e5f..eec29858a 100644 --- a/include/sieve/class_My_Tree.inc +++ b/include/sieve/class_My_Tree.inc @@ -238,6 +238,11 @@ class My_Tree extends Tree return; } + if(!isset($this->pap[$key_id])){ + trigger_error(_("Can't remove element with object_id=".$key_id.", there is no object with this identifier. Remove aborted.")); + return(false); + } + $class = get_class($this->pap[$key_id]); if(in_array($class,array("sieve_if","sieve_elsif","sieve_else"))){ $block_start= $key_id; diff --git a/include/sieve/class_sieveManagement.inc b/include/sieve/class_sieveManagement.inc index da9a10978..37dd2ec31 100644 --- a/include/sieve/class_sieveManagement.inc +++ b/include/sieve/class_sieveManagement.inc @@ -779,6 +779,55 @@ class sieveManagement extends plugin { if($this->current_handler){ + if(isset($_GET['Add_Object_Top_ID'])){ + $this->add_new_element = TRUE; + $this->add_new_id = $_GET['Add_Object_Top_ID']; + $this->add_above_below = "above"; + } + + if(isset($_GET['Add_Object_Bottom_ID'])){ + $this->add_new_element = TRUE; + $this->add_new_id = $_GET['Add_Object_Bottom_ID']; + $this->add_above_below = "below"; + } + + if(isset($_GET['Remove_Object_ID'])){ + $found_id = -1; + foreach($this->current_handler->tree_->pap as $key => $element){ + if($element->object_id == $_GET['Remove_Object_ID']){ + $found_id = $key; + } + } + if($found_id != -1 ){ + $this->current_handler->tree_->remove_object($found_id); + } + } + + if(isset($_GET['Move_Up_Object_ID'])){ + $found_id = -1; + foreach($this->current_handler->tree_->pap as $key => $element){ + if($element->object_id == $_GET['Move_Up_Object_ID']){ + $found_id = $key; + } + } + if($found_id != -1 ){ + $this->current_handler->tree_->move_up_down($found_id,"up"); + } + } + + if(isset($_GET['Move_Down_Object_ID'])){ + $found_id = -1; + foreach($this->current_handler->tree_->pap as $key => $element){ + if($element->object_id == $_GET['Move_Down_Object_ID']){ + $found_id = $key; + } + } + if($found_id != -1 ){ + $this->current_handler->tree_->move_up_down($found_id,"down"); + } + } + + /* Check if there is an add object requested */ $data = $this->current_handler->tree_->pap; diff --git a/include/sieve/templates/object_container.tpl b/include/sieve/templates/object_container.tpl index 71b68806a..f9ddb0fe9 100644 --- a/include/sieve/templates/object_container.tpl +++ b/include/sieve/templates/object_container.tpl @@ -6,19 +6,23 @@ - {t}Move down{/t} + {t}Move down{/t} + - {t}Move up{/t} + {t}Move up{/t} + - {t}Remove this element{/t} + {t}Remove this element{/t} + - {t}Add a new element above{/t} + {t}Add a new element above{/t} + - {t}Add a new element below{/t} + {t}Add a new element below{/t}