Added preload schecked values into snmp browser treeview
Former-commit-id: d8a3317d849263ff732cbf3a7a7714f4b41917d5
This commit is contained in:
parent
ca243c46fb
commit
e088b412cd
|
@ -27,7 +27,7 @@ $nfdump_date_format = 'Y/m/d.H:i:s';
|
|||
* @param id string Level ID. Do not set, used for recursion.
|
||||
* @param depth string Branch depth. Do not set, used for recursion.
|
||||
*/
|
||||
function snmp_browser_print_tree($tree, $id=0, $depth=0, $last=0, $last_array=[], $sufix=false)
|
||||
function snmp_browser_print_tree($tree, $id=0, $depth=0, $last=0, $last_array=[], $sufix=false, $checked=[])
|
||||
{
|
||||
static $url = false;
|
||||
|
||||
|
@ -108,7 +108,8 @@ function snmp_browser_print_tree($tree, $id=0, $depth=0, $last=0, $last_array=[]
|
|||
|
||||
$checkbox_name_sufix = ($sufix === true) ? '_'.$level : '';
|
||||
$checkbox_name = 'create_'.$sub_id.$checkbox_name_sufix;
|
||||
echo html_print_checkbox($checkbox_name, 0, false, true, false, '').' <span>'.$level.'</span>';
|
||||
$status = (!empty($checked) && isset($checked[$level]));
|
||||
echo html_print_checkbox($checkbox_name, 0, $status, true, false, '').' <span>'.$level.'</span>';
|
||||
if (isset($sub_level['__VALUE__'])) {
|
||||
echo '<span class="value" style="display: none;"> = '.$sub_level['__VALUE__'].'</span>';
|
||||
}
|
||||
|
@ -116,7 +117,7 @@ function snmp_browser_print_tree($tree, $id=0, $depth=0, $last=0, $last_array=[]
|
|||
echo '</li>';
|
||||
|
||||
// Recursively print sub levels.
|
||||
snmp_browser_print_tree($sub_level, $sub_id, ($depth + 1), ($count == $total ? 1 : 0), $last_array, $sufix);
|
||||
snmp_browser_print_tree($sub_level, $sub_id, ($depth + 1), ($count == $total ? 1 : 0), $last_array, $sufix, $checked);
|
||||
|
||||
$count++;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue