PEAK XOOPS - Re: Fatall warning =( in englishin japanese

Re: Fatall warning =(

List posts in the topic

question Re: Fatall warning =(

msg# 1.1.1.3
depth:
3
Previous post - Next post | Parent - Children.1 | Posted on 2006/9/2 1:27
DuGris  二等兵   Posts: 4
another solution which seems more reliable and which will take all the possibilities

function &getElements($recurse = false){
	if (!$recurse) {
		return $this->_elements;
	} else {
		$ret = array();
		$count = count($this->_elements);
		for ($i = 0; $i < $count; $i++) {
			if ( is_object( $this->_elements[$i] ) ) {
				if (!$this->_elements[$i]->isContainer()) {
					$ret[] =& $this->_elements[$i];
				} else {
					$elements =& $this->_elements[$i]->getElements(true);
					$count2 = count($elements);
					for ($j = 0; $j < $count2; $j++) {
						$ret[] =& $elements[$j];
					}
					unset($elements);
				}
			}
		}
		return $ret;
	}
}
Votes:2 Average:0.00

Posts tree

  Advanced search


Login
Username or e-mail:

Password:

Remember Me

Lost Password?

Register now!