From b78f63385386095fe71558d80cb701f89dc8cc40 Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Thu, 30 Mar 2023 18:27:03 +0200 Subject: [PATCH] #9771 new function for draw tree and fixed bugs --- pandora_console/include/functions_ui.php | 119 +++++++++++++++++++++++ 1 file changed, 119 insertions(+) diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index da2c86f941..da9b7e6c8e 100755 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -7858,5 +7858,124 @@ function ui_print_fav_menu($id_element, $url, $label, $section) $output .= '

'.__('Title').'

'; $output .= html_print_input_text('label_fav_menu', '', '', 25, 255, true, false, true); $output .= ''; + return $output; +} + + +function ui_print_tree( + $tree, + $id=0, + $depth=0, + $last=0, + $last_array=[], + $sufix=false, + $descriptive_ids=false, + $previous_id='' +) { + static $url = false; + $output = ''; + + // Get the base URL for images. + if ($url === false) { + $url = ui_get_full_url('operation/tree', false, false, false); + } + + // Leaf. + if (empty($tree['__LEAVES__'])) { + return ''; + } + + $count = 0; + $total = (count(array_keys($tree['__LEAVES__'])) - 1); + $last_array[$depth] = $last; + $class = 'item_'.$depth; + + if ($depth > 0) { + $output .= '