diff --git a/pandora_console/godmode/reporting/visual_console_builder.elements.php b/pandora_console/godmode/reporting/visual_console_builder.elements.php index 1d3d2be19d..6d67a8ab43 100755 --- a/pandora_console/godmode/reporting/visual_console_builder.elements.php +++ b/pandora_console/godmode/reporting/visual_console_builder.elements.php @@ -158,8 +158,18 @@ foreach ($layoutDatas as $layoutData) { //First row - //Label and color label - $table->data[$i + 1][0] = ''; + //Label + if ($layoutData['type'] != ICON) { + $table->data[$i + 1][0] = '' . + html_print_input_hidden('label_' . $idLayoutData, $layoutData['label'], true) . + '' . __('Edit label') .'' . + ''; + } + else { + //Icon haven't the label. + $table->data[$i + 1][0] = ''; + } + diff --git a/pandora_console/include/functions_visual_map.php b/pandora_console/include/functions_visual_map.php index eab65bb6a9..0581956078 100755 --- a/pandora_console/include/functions_visual_map.php +++ b/pandora_console/include/functions_visual_map.php @@ -121,6 +121,23 @@ function visual_map_print_item($mode = "read", $layoutData, $link = true; } break; + case ICON: + if ($layoutData['id_layout_linked'] > 0) { + $link = true; + } + elseif (preg_match('//', $layoutData['label'], $matches)) { + // Link to an URL + if ($layoutData['enable_link']) { + $link = true; + } + } + elseif (preg_match('/^.*(http:\/\/)((.)+).*$/i', $layoutData['label'])) { + // Link to an URL + if ($layoutData['enable_link']) { + $link = true; + } + } + break; } } @@ -210,6 +227,31 @@ function visual_map_print_item($mode = "read", $layoutData, 'index.php?sec=reporting&sec2=operation/visual_console/render_view&pure='.$config["pure"].'&id='.$layoutData["id_layout_linked"]; } break; + case ICON: + $url_icon = ""; + if ($layoutData['id_layout_linked'] != 0) { + // Link to a map + if (empty($layoutData['id_metaconsole'])) { + $url = 'index.php?sec=reporting&sec2=operation/visual_console/render_view&pure='.$config["pure"].'&id='.$layoutData["id_layout_linked"]; + } + else { + $pure = get_parameter('pure', 0); + $url = 'index.php?sec=screen&sec2=screens/screens&action=visualmap&pure=' . $pure . '&id_visualmap=' . $layoutData["id_layout_linked"] . '&refr=0'; + } + } + elseif (preg_match('//', $layoutData['label'], $matches)) { + // Link to an URL + if ($layoutData['enable_link']) { + $url = strip_tags($matches[1]); + } + } + elseif (preg_match('/^.*(http:\/\/)((.)+).*$/i', $layoutData['label'])) { + // Link to an URL + if ($layoutData['enable_link']) { + $url = strip_tags($layoutData['label']); + } + } + break; } } @@ -251,6 +293,8 @@ function visual_map_print_item($mode = "read", $layoutData, $sizeStyle = 'width: ' . $width . 'px; height: ' . $height . 'px;'; $imageSize = 'width="' . $width . '" height="' . $height . '"'; } + + $z_index = 4; break; case PERCENTILE_BAR: case PERCENTILE_BUBBLE: @@ -514,6 +558,25 @@ function visual_map_print_item($mode = "read", $layoutData, echo '' . '' . ''; } + if ($proportion != 1) { + if (is_file($config['homedir'] . '/' . $img)) + $infoImage = getimagesize($config['homedir'] . '/' . $img); + + if ($width != 0) { + $width = (integer)($proportion * $width); + } + else { + $width = (integer)($proportion * $infoImage[0]); + } + + if ($height != 0) { + $height = (integer)($proportion * $height); + } + else { + $height = (integer)($proportion * $infoImage[1]); + } + } + if (($width != 0) && ($height != 0)) echo html_print_image($img, true, array("class" => "image", @@ -1441,84 +1504,8 @@ function visual_map_print_visual_map ($id_layout, $show_links = true, case ICON: - $z_index = 4; - if ($resizedMap) - echo ''; - else - echo ''; - - $endTagA = false; - if ($show_links) { - $url_icon = ""; - if ($layout_data['id_layout_linked'] > 0) { - // Link to a map - if (empty($layout_data['id_metaconsole'])) { - echo ''; - } - else { - $pure = get_parameter('pure', 0); - echo ''; - } - $endTagA = true; - } - elseif (preg_match('//', $layout_data['label'], $matches)) { - // Link to an URL - if ($layout_data['enable_link']) { - $url_icon = strip_tags($matches[1]); - - echo ''; - $endTagA = true; - } - } - elseif (preg_match('/^.*(http:\/\/)((.)+).*$/i', $layout_data['label'])) { - // Link to an URL - if ($layout_data['enable_link']) { - $url_icon = strip_tags($layout_data['label']); - - echo ''; - $endTagA = true; - } - } - } - - $img_style = array (); - $img_style["title"] = strip_tags($layout_data["label"]); - - if (!empty ($layout_data["width"])) { - $img_style["width"] = $layout_data["width"]; - } - if (!empty ($layout_data["height"])) { - $img_style["height"] = $layout_data["height"]; - } - - $img = "images/console/icons/".$layout_data["image"] . ".png"; - - if (is_file($config['homedir'] . '/' . $img)) - $infoImage = getimagesize($config['homedir'] . '/' . $img); - - if (!empty ($layout_data["width"])) { - if ($resizedMap) - $img_style["width"] = (integer)($proportion * $layout_data["width"]); - else - $img_style["width"] = $layout_data["width"]; - } - else - $img_style["width"] = (integer)($proportion * $infoImage[0]); - - if (!empty ($layout_data["height"])) { - if ($resizedMap) - $img_style["height"] = (integer)($proportion * $img_style["height"]); - else - $img_style["height"] = $layout_data["height"]; - } - else - $img_style["height"] = (integer)($proportion * $infoImage[1]); - - html_print_image ($metaconsole_hack . $img, false, $img_style); - - if ($endTagA) echo ""; - - echo ""; + visual_map_print_item("read", $layout_data, + $proportion, $show_links); break;