From b036a5191310067b6273e45bd442e7d33f051b3b Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 5 Apr 2007 12:41:19 +0000 Subject: [PATCH] Added simple direct add of sieve elements. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5993 594d385d-05f5-0310-b6e9-bd551577e9d8 --- include/sieve/class_sieveElement_Require.inc | 9 ++++++++- include/sieve/class_sieveManagement.inc | 8 ++++++-- include/sieve/templates/object_container.tpl | 19 ++++++++++++++++--- setup/license.txt | 2 -- 4 files changed, 30 insertions(+), 8 deletions(-) diff --git a/include/sieve/class_sieveElement_Require.inc b/include/sieve/class_sieveElement_Require.inc index 0a781daad..9ef9e2985 100644 --- a/include/sieve/class_sieveElement_Require.inc +++ b/include/sieve/class_sieveElement_Require.inc @@ -5,6 +5,7 @@ class sieve_require var $data = array(); var $object_id = -1; var $parent = NULL; + var $skip_save_object =FALSE; function sieve_require($data,$object_id,$parent) { @@ -35,11 +36,17 @@ class sieve_require if(!in_array($str,$current)){ $this->data[] = $str; } - $this->data = array_unique($this->data);; + $this->data = array_unique($this->data); + $this->skip_save_object = TRUE; } function save_object() { + if($this->skip_save_object){ + $this->skip_save_object = FALSE; + return; + } + /* Get the values should check for, they are seperated by , */ if(isset($_POST['require_'.$this->object_id])){ $vls = stripslashes($_POST['require_'.$this->object_id]); diff --git a/include/sieve/class_sieveManagement.inc b/include/sieve/class_sieveManagement.inc index e382838df..dfc76229a 100644 --- a/include/sieve/class_sieveManagement.inc +++ b/include/sieve/class_sieveManagement.inc @@ -848,15 +848,19 @@ class sieveManagement extends plugin foreach($data as $key => $obj){ if(isset($obj->object_id) && preg_match("/^Add_Object_Top_".$obj->object_id."_/",$name) && $once){ $once = FALSE; - $this->add_new_element = TRUE; + $this->add_element_type = $_POST['element_type_'.$obj->object_id]; + $this->add_new_element = FALSE; $this->add_new_id = $obj->object_id; $this->add_above_below = "above"; + $this->add_new_element_to_current_script($this->add_element_type,$this->add_new_id,$this->add_above_below); } if(isset($obj->object_id) && preg_match("/^Add_Object_Bottom_".$obj->object_id."_/",$name) && $once){ $once = FALSE; - $this->add_new_element = TRUE; + $this->add_element_type = $_POST['element_type_'.$obj->object_id]; + $this->add_new_element = FALSE; $this->add_new_id = $obj->object_id; $this->add_above_below = "below"; + $this->add_new_element_to_current_script($this->add_element_type,$this->add_new_id,$this->add_above_below); } if(isset($obj->object_id) && preg_match("/^Remove_Object_".$obj->object_id."_/",$name) && $once){ diff --git a/include/sieve/templates/object_container.tpl b/include/sieve/templates/object_container.tpl index 025843014..49027a5b6 100644 --- a/include/sieve/templates/object_container.tpl +++ b/include/sieve/templates/object_container.tpl @@ -16,13 +16,26 @@ title='{t}Remove this object{/t}' alt='R' class='center'> {t}Remove this element{/t} + + + - {t}Add a new element above{/t} - - {t}Add a new element below{/t} diff --git a/setup/license.txt b/setup/license.txt index b2a748eac..9140f02bf 100644 --- a/setup/license.txt +++ b/setup/license.txt @@ -1,5 +1,3 @@ - -

Nur aus Joomla kopiert, bitte prüfen

Table of Contents * GNU GENERAL PUBLIC LICENSE -- 2.30.2