Code

Updated comment handling
[gosa.git] / include / sieve / class_sieveElement_Require.inc
index c7138deb569e76f8eb22d79fecf2cda365c61d67..ee7f12a2d66f59d2ae050a0b814f5c48f0d9ecca 100644 (file)
@@ -4,12 +4,14 @@ class sieve_require
 {
   var $data = array();
   var $object_id = -1;
-  
-  function sieve_require($data,$object_id)
+  var $parent = NULL;  
+
+  function sieve_require($data,$object_id,$parent)
   {
+    $this->parent = $parent;
+    $this->object_id = $object_id;
     if($data != NULL){
 
-      $this->object_id = $object_id;
       foreach($data['ELEMENTS'] as $node ){
         if(in_array($node['class'],array("quoted-string","text"))){
           $this->data[] = preg_replace("/\"/","",$node['text']);
@@ -66,8 +68,12 @@ class sieve_require
 
   function get_sieve_script_part()
   {
+    if(count($this->data)){
     $tmp = sieve_create_strings($this->data);
     return("require ".$tmp.";\n");
+    }else{
+      return("");
+    }
   } 
     
   function execute()