$v) { if($v[parent] == NULL) { $childrens[] = $k; } } d_err($childrens); } else { $childrens = $GLOBALS['_region_array'][$tpl]['children']; // d_err($childrens); } */ $childrens = $GLOBALS['_region_array'][$tpl]['children']; if(is_array($childrens)) { //renderizzo children $offset = 0; $count = 0; $tot = count($childrens); foreach($childrens as $children) { $count++; $top = substr($GLOBALS['_region_array'][$tpl]['buffer'],$offset,$GLOBALS['_region_array'][$children]['start']-$offset); $offset = strlen($top)+$offset; $buffer.= $top; //ricorsione $buffer .= region_render($children); //metto la parte finale, mettere controllo se non serve if($count == $tot) { $buffer.= substr($GLOBALS['_region_array'][$tpl]['buffer'],$offset,$GLOBALS['_region_array'][$tpl]['size']); } //sostituisco variabili di template } } else { $buffer .= $GLOBALS['_region_array'][$tpl]['buffer']; } return $buffer; } ?>