From: hickert Date: Fri, 23 Mar 2007 06:58:49 +0000 (+0000) Subject: Updated tree class && reject also supports "text" reasons X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=d201b00cb1254a5c14e3be8ab8ffe3bc49773ed8;p=gosa.git Updated tree class && reject also supports "text" reasons git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5867 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/include/sieve/class_semantics.inc b/include/sieve/class_semantics.inc index 44a376829..1f34d6063 100644 --- a/include/sieve/class_semantics.inc +++ b/include/sieve/class_semantics.inc @@ -141,7 +141,7 @@ class Semantics 'valid_after' => $this->nonTestCommands_, 'arguments' => array( array('class' => 'string', 'occurrences' => '1', 'values' => array( - array('occurrences' => '1', 'regex' => '".*"', 'name' => 'reason') + array('occurrences' => '1', 'regex' => '("|).*("|)', 'name' => 'reason') )) ) ); @@ -610,4 +610,4 @@ class Semantics } } -?> \ No newline at end of file +?> diff --git a/include/sieve/class_tree.inc b/include/sieve/class_tree.inc index 920b809ce..37198f0cd 100644 --- a/include/sieve/class_tree.inc +++ b/include/sieve/class_tree.inc @@ -99,27 +99,6 @@ class Tree return $this->nodes_[$node_id]; } - function getLastNode($parent_id) - { - $childs = $this->getChilds($parent_id); - - for ($i=count($childs); $i>0; --$i) - { - $node = $this->getNode($childs[$i-1]); - if ($node['text'] == '{') - { - // return command owning the block - return $this->getNode($parent_id); - } - if ($node['class'] != 'comment') - { - return $node; - } - } - - return $this->getNode($parent_id); - } - function setDumpFunc($callback) { if ($callback == NULL || is_callable($callback)) @@ -140,12 +119,12 @@ class Tree if ($last) { $infix = '`--- '; - $c_prefix = $prefix . ' '; + $child_prefix = $prefix . ' '; } else { $infix = '|--- '; - $c_prefix = $prefix . '| '; + $child_prefix = $prefix . '| '; } $node = $this->nodes_[$node_id]; @@ -158,18 +137,17 @@ class Tree $this->dump_ .= "$prefix$infix$node\n"; } - $childs = $this->childs_[$node_id]; - for ($i=0; $ichilds_[$node_id])) { - $c_last = false; - if ($i+1 == count($childs)) + $childs = $this->childs_[$node_id]; + $last_child = count($childs); + + for ($i=1; $i <= $last_child; ++$i) { - $c_last = true; + $this->doDump_($childs[$i-1], $child_prefix, ($i == $last_child ? true : false)); } - - $this->doDump_($childs[$i], $c_prefix, $c_last); } } } -?> +?> \ No newline at end of file