From fd4a7f5e409113c4d808d3cc8ba01a6822faa6e3 Mon Sep 17 00:00:00 2001 From: hickert Date: Mon, 26 Mar 2007 12:19:19 +0000 Subject: [PATCH] Some style fixes. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5886 594d385d-05f5-0310-b6e9-bd551577e9d8 --- include/sieve/class_My_Tree.inc | 34 ++++++++++++------- .../sieve/templates/block_indent_start.tpl | 11 ++---- include/sieve/templates/block_indent_stop.tpl | 6 ---- include/sieve/templates/element_else.tpl | 4 +-- include/sieve/templates/element_elsif.tpl | 4 +-- .../templates/object_container_clear.tpl | 17 ++++------ 6 files changed, 35 insertions(+), 41 deletions(-) diff --git a/include/sieve/class_My_Tree.inc b/include/sieve/class_My_Tree.inc index eec29858a..38d252302 100644 --- a/include/sieve/class_My_Tree.inc +++ b/include/sieve/class_My_Tree.inc @@ -66,16 +66,16 @@ class My_Tree extends Tree } foreach($this->pap as $key => $object){ if(is_object($object)){ - $end = $this->get_block_end($key); + $end = $this->get_block_end($key,false); - if($end != $key && get_class($object) == "sieve_if") { - $ends[$end] = $end; - $this->dump_ .= $block_indent_start; - } - $this->dump_ .= preg_replace("/>/",">\n",$object->execute()); if(isset($ends[$key])){ $this->dump_ .= $block_indent_stop; } + $this->dump_ .= preg_replace("/>/",">\n",$object->execute()); + if($end != $key && in_array(get_class($object),array("sieve_if","sieve_else","sieve_elsif"))) { + $ends[$end] = $end; + $this->dump_ .= $block_indent_start; + } } } @@ -380,7 +380,7 @@ class My_Tree extends Tree /* This function returns the id of the element * where the current block ends */ - function get_block_end($start) + function get_block_end($start,$complete = TRUE) { /* Only execute if this is a really a block element. * Block elements is only sieve_if @@ -403,12 +403,22 @@ class My_Tree extends Tree $block_depth --; } - if( $block_depth == 0 && - $class == "sieve_block_end" && - !in_array($next_class,array("sieve_else","sieve_elsif"))){ - $end = TRUE; - $start --; + if($complete){ + if( $block_depth == 0 && + $class == "sieve_block_end" && + !in_array($next_class,array("sieve_else","sieve_elsif"))){ + $end = TRUE; + $start --; + } + }else{ + + if( $block_depth == 0 && + $class == "sieve_block_end" ){ + $end = TRUE; + $start --; + } } + $start ++; $class = get_class($this->pap[$start]); diff --git a/include/sieve/templates/block_indent_start.tpl b/include/sieve/templates/block_indent_start.tpl index 017a104c0..016943a05 100644 --- a/include/sieve/templates/block_indent_start.tpl +++ b/include/sieve/templates/block_indent_start.tpl @@ -1,13 +1,6 @@ - +
- diff --git a/include/sieve/templates/element_else.tpl b/include/sieve/templates/element_else.tpl index 5c420914f..739fd0550 100644 --- a/include/sieve/templates/element_else.tpl +++ b/include/sieve/templates/element_else.tpl @@ -1,6 +1,6 @@ -
+ - - - - - - - - -
- -
diff --git a/include/sieve/templates/block_indent_stop.tpl b/include/sieve/templates/block_indent_stop.tpl index 470449e21..62ee76e63 100644 --- a/include/sieve/templates/block_indent_stop.tpl +++ b/include/sieve/templates/block_indent_stop.tpl @@ -1,11 +1,5 @@
- -
+
- diff --git a/include/sieve/templates/element_elsif.tpl b/include/sieve/templates/element_elsif.tpl index 9c41e304a..4da7c47fc 100644 --- a/include/sieve/templates/element_elsif.tpl +++ b/include/sieve/templates/element_elsif.tpl @@ -1,6 +1,6 @@ -
+ {t}Else{/t}
+
- diff --git a/include/sieve/templates/object_container_clear.tpl b/include/sieve/templates/object_container_clear.tpl index 24d66fd94..d96a2ab6f 100644 --- a/include/sieve/templates/object_container_clear.tpl +++ b/include/sieve/templates/object_container_clear.tpl @@ -1,12 +1,9 @@ -
+ {t}Else If{/t} {$Contents}
- - -
-   - - - - + + + + -
+   + {t}Move down{/t} @@ -19,7 +16,7 @@
+ %%OBJECT_CONTENT%% -- 2.30.2