summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a73f69f)
raw | patch | inline | side by side (parent: a73f69f)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 9 Mar 2007 13:09:50 +0000 (13:09 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 9 Mar 2007 13:09:50 +0000 (13:09 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5763 594d385d-05f5-0310-b6e9-bd551577e9d8
include/sieve/class_My_Tree.inc | patch | blob | history |
index a8321a4502bef0c73afe47e197e0ff0135c85b6a..c7d08c8a757475d42837ff61556ebeea77856852 100644 (file)
function move_single_element_to($from,$to)
{
- if($from == $to) return;
+ if($from == $to) {
+ return;
+ }
$ret = array();
-
-
$tmp = $this->pap;
-# $tmp = array();
- # foreach($this->pap as $class){
- # $tmp[] = get_class($class);
- # }
+ $begin = array();
+ $middle = array();
+ $end = array();
+ $element = $this->pap[$from];
if($from > $to ){
- $element = $this->pap[$from];
-
- $begin = array();
- $middle = array();
- $end = array();
-
/* Get all element in fron to element to move */
if($from != 0){
$begin = array_slice($tmp,0,$to);
foreach($end as $data){
$ret[] = $data;
}
-
-# print_a(array("Anfang" => $begin ,$element, "middle" => $middle, "end" => $end));
-
$this->pap = $ret;
}
if($from < $to ){
- $element = $this->pap[$from];
-
- $begin = array();
- $middle = array();
- $end = array();
-
/* Get all element in fron to element to move */
if($from != 0){
$begin = array_slice($tmp,0,$from);
"sieve_fileinto",
"sieve_redirect",
"sieve_discard",
- "sieve_block_end");
+ "sieve_block_start"
+ );
+
+ $allowed_to_add_before = array("sieve_keep",
+ "sieve_require",
+ "sieve_stop",
+ "sieve_reject",
+ "sieve_fileinto",
+ "sieve_redirect",
+ "sieve_discard",
+ "sieve_if",
+ "sieve_block_end"
+ );
if($direction == "down"){
$test = $this->pap;
while($key_id >=0 ){
$current_class = get_class($test[$key_id]);
- if(in_array($current_class, $allowed_to_add_after)){
+ if(in_array($current_class, $allowed_to_add_before)){
return($key_id);
}
$key_id --;