index 0d718b2e517746c7cd7e9c94868d815887e09fb3..8792f98f7a855b60f86f76dadf77a43b21b99ea3 100644 (file)
var $mode_stack = array();
var $pap = array();
+ var $parent = NULL;
+
+ function My_Tree(&$root,$parent)
+ {
+ $this->parent = $parent;
+ $this->_construct($root);
+ }
function execute()
{
$class_name= "sieve_".$type ;
if(class_exists($class_name)){
- $this->pap[] = new $class_name($data,$id);
+ $this->pap[] = new $class_name($data,$id,$this);
}else{
echo "<font color='red'>Missing : ".$class_name."</font>"."<br>";
}
function remove_object($key_id)
{
$class = get_class($this->pap[$key_id]);
- if(in_array($class,array("sieve_if"))){
+ if(in_array($class,array("sieve_if","sieve_elsif","sieve_else"))){
$block_start= $key_id;
$block_end = $this->get_block_end($key_id);
+
for($i = $block_start ; $i <= $block_end ; $i ++ ){
unset($this->pap[$i]);
}
/* Only execute if this is a really a block element.
* Block elements is only sieve_if
*/
- if(in_array(get_class($this->pap[$start]),array("sieve_if"))){
+ if(in_array(get_class($this->pap[$start]),array("sieve_if","sieve_elsif","sieve_else"))){
$class = get_class($this->pap[$start]);
$next_class = get_class($this->pap[$start+1]);
}
$start ++;
$class = get_class($this->pap[$start]);
- $next_class = get_class($this->pap[$start+1]);
+
+ if(isset($this->pap[$start+1])){
+ $next_class = get_class($this->pap[$start+1]);
+ }else{
+ $next_class ="";
+ }
}
}
return($start);