Code

Updated comment handling
[gosa.git] / include / sieve / class_My_Parser.inc
index 698fbbadf33eebd4fb03ab54ff5346b5c7ce123c..912422360f1cedd5cc95741e3c2ff4375ed6fa2d 100644 (file)
@@ -7,30 +7,15 @@ define("SIEVE_INDENT_TAB","  ");
  */
 class My_Parser extends Parser 
 {
+       var $parent = NULL;
 
-       function execute()
+       function My_Parser($parent)
        {
-               /* Create dump of current sieve script */
-               if(isset($_POST['Save_Copy'])){
-
-                       /* force download dialog */
-                       header("Content-type: application/tiff\n");
-                       if (preg_match('/MSIE 5.5/', $HTTP_USER_AGENT) ||
-                                       preg_match('/MSIE 6.0/', $HTTP_USER_AGENT)) {
-                               header('Content-Disposition: filename="dump.script"');
-                       } else {
-                               header('Content-Disposition: attachment; filename="dump.script"');
-                       }
-                       header("Content-transfer-encoding: binary\n");
-                       header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
-                       header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
-                       header("Cache-Control: no-cache");
-                       header("Pragma: no-cache");
-                       header("Cache-Control: post-check=0, pre-check=0");
-                       echo $this->get_sieve_script(); 
-                       exit(); 
-               }
+               $this->parent = $parent;
+       }
 
+       function execute()
+       {
                $ret = $this->dumpParseTree();
                return($ret);
        }
@@ -50,7 +35,7 @@ class My_Parser extends Parser
        {
         $this->status_text = "incomplete";
         $this->script_ = $script;
-        $this->tree_ = new My_Tree(@Scanner::scriptStart());
+        $this->tree_ = new My_Tree(@Scanner::scriptStart(),$this);
         $this->tree_->setDumpFunc(array(&$this, 'dumpToken_'));
         $this->scanner_ = new Scanner($this->script_);
         $this->scanner_->setCommentFunc(array($this, 'comment_'));