private function digToc($id, array $header, array &$headers){
		$keys = array_keys($headers);
		krsort($keys);
		$done = false;
		foreach( $keys as $key ){
			if( $headers[$key]['level'] < $header['level'] ){
				if( !$this->digToc($id, $header, $headers[$key]['children']) ){
					$headers[$key]['children'][$id] = $header;
				}
				return true;
			}
		}
		return false;
	}
private function digToc($id, array $header, array &$headers){
		$keys = array_keys($headers);
		krsort($keys);
		$done = false;
		foreach( $keys as $key ){
			if( $headers[$key]['level'] < $header['level'] ){
				if( !$this->digToc($id, $header, $headers[$key]['children']) ){
					$headers[$key]['children'][$id] = $header;
				}
				return true;
			}
		}
		return false;
	}
private function digToc ( $ id , array $ header , array & $ headers ) { $ keys = array_keys ( $ headers ) ; krsort ( $ keys ) ; $ done = false ; foreach ( $ keys as $ key ) { if ( $ headers [ $ key ] [ 'level' ] < $ header [ 'level' ] ) { if ( ! $ this -> digToc ( $ id , $ header , $ headers [ $ key ] [ 'children' ] ) ) { $ headers [ $ key ] [ 'children' ] [ $ id ] = $ header ; } return true ; } } return false ; }
Arrange toc elements

@param string $id
@param array $header
@param array $headers

@return bool
Arrange toc elements