Code

Added simple direct add of sieve elements.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 5 Apr 2007 12:41:19 +0000 (12:41 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 5 Apr 2007 12:41:19 +0000 (12:41 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5993 594d385d-05f5-0310-b6e9-bd551577e9d8

include/sieve/class_sieveElement_Require.inc
include/sieve/class_sieveManagement.inc
include/sieve/templates/object_container.tpl
setup/license.txt

index 0a781daadee488c6571210dfbf1a534f512785e6..9ef9e2985849b2d1e92bcba2759a707bca0ceeaa 100644 (file)
@@ -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]);
index e382838dfd040c477700514710a437295bf9601e..dfc76229aacefc9d06993d9e0f61a87b2fb99655 100644 (file)
@@ -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){
index 02584301475ca15427ebee16ca436c121c93f1cd..49027a5b6d088fda774d3af38dab884b0ed24cf8 100644 (file)
                                title='{t}Remove this object{/t}' alt='R' class='center'>
                        <a href='{$plug}&amp;Remove_Object_ID={$ID}'>{t}Remove this element{/t}</a>
 
+       
+                       <select name='element_type_{$ID}'>
+                               <option value='sieve_comment'>comment</option>
+                               <option value='sieve_fileinto'>sieve_fileinto</option>
+                               <option value='sieve_keep'>sieve_keep</option>
+                               <option value='sieve_discard'>sieve_discard</option>
+                               <option value='sieve_redirect'>sieve_redirect</option>
+                               <option value='sieve_reject'>sieve_reject</option>
+                               <option value='sieve_require'>sieve_require</option>
+                               <option value='sieve_stop'>sieve_stop</option>
+                               <option value='sieve_vacation'>sieve_vacation</option>
+                               <option value='sieve_if'>sieve_if</option>
+                               <option value='sieve_elsif'>sieve_elsif</option>
+                               <option value='sieve_else'>sieve_else</option>
+                       </select>
+
                        <input type='image' src='images/sieve_add_new_top.png' name='Add_Object_Top_{$ID}'
                                alt='{t}Add new{/t}' title='{t}Add a new new object on top of this one.{/t}' class='center'>
-                       <a href='{$plug}&amp;Add_Object_Top_ID={$ID}'>{t}Add a new element above{/t}</a>
-
                        <input type='image' src='images/sieve_add_new_bottom.png' name='Add_Object_Bottom_{$ID}'
                                alt='{t}Add new{/t}' title='{t}Add a new new object at the bottom of this one.{/t}' class='center'>     
-                       <a href='{$plug}&amp;Add_Object_Bottom_ID={$ID}'>{t}Add a new element below{/t}</a>
                </td>
        </tr>
        <tr>
index b2a748eac9a07b49d8b0aa8ee77300f82364137d..9140f02bff2b6c5d9c1f30019e159fddaaedeac9 100644 (file)
@@ -1,5 +1,3 @@
-
-<h1> Nur aus Joomla kopiert, bitte prüfen </h1>
 Table of Contents
 
     * GNU GENERAL PUBLIC LICENSE