';
}
function generate_html_list_recursive($data, $statut, $filter, $id_filter, $depth, $class)
{
// begin with an empty html string
$html = '';
// loop through all items in this level
foreach($data as $key => &$item)
{
// echo "$key
";
// where only interested in numeric items
// as those are the actual children
if( !is_numeric( $key ) )
{
// otherwise continue
continue;
}
// we get all parents
// print_r($item);
// echo '
';
// we display link only on main levels
if($item['level_parent'] == 0) {
$class = ' level-' . $item['level_id']; // if root level we init $class to superior level
$html .= '' . PHP_EOL;
} else {
// @todo - enhance $class / selection system. Today only handle 2 levels
$class = 'level-'.$item['level_parent'].' level-' . $item['level_id']; // if not root level we concatenate classes
$html .= '' . PHP_EOL;
}
// we pass the level ID to the SQL query
if($filter == 'TAG') {
$projects = $GLOBALS['sql_object']->DBSelect(SQL_getProjectsList(0, 999, $statut, 'LEVEL_TAG', $item['level_id'], $id_filter));
} else {
$projects = $GLOBALS['sql_object']->DBSelect(SQL_getProjectsList(0, 999, $statut, 'LEVEL', $item['level_id']));
}
// // we sort values on level names
// // Obtain a list of columns
// foreach ($projects as $key => $row) {
// $level[$key] = $row['level_name'];
// }
// // Sort the data with level descending
// // Add $projects as the last parameter, to sort by the common key
// array_multisort($level, SORT_DESC, $projects);
if ($projects != 0) {
$html .= '