From 304e4be112f8563c0e77710229989dfc2152679a Mon Sep 17 00:00:00 2001 From: Vanessa Gil Date: Tue, 30 Sep 2014 12:11:10 +0200 Subject: [PATCH] Only show user's tags in monitor detail (tree view). Ticket #1356. --- pandora_console/include/functions_treeview.php | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/pandora_console/include/functions_treeview.php b/pandora_console/include/functions_treeview.php index 764069f895..3c8ba46c52 100755 --- a/pandora_console/include/functions_treeview.php +++ b/pandora_console/include/functions_treeview.php @@ -112,13 +112,19 @@ function treeview_printModuleTable($id_module, $server_data = false) { $tags = array(); } + $user_tags = tags_get_user_tags($config["id_user"]); + foreach ($tags as $k => $v) { - $tag_name = tags_get_name($v); - if (empty($tag_name)) { + if (!array_key_exists($v, $user_tags)) { //only show user's tags. unset($tags[$k]); - } - else { - $tags[$k] = $tag_name; + } else { + $tag_name = tags_get_name($v); + if (empty($tag_name)) { + unset($tags[$k]); + } + else { + $tags[$k] = $tag_name; + } } }