Working in the fusion of code of edition and view.

This commit is contained in:
mdtrooper 2014-11-18 12:41:15 +01:00
parent 6008df9fc9
commit c509a3195d
1 changed files with 104 additions and 81 deletions

View File

@ -54,6 +54,11 @@ function visual_map_print_item($mode = "read", $layoutData,
require_once ($config["homedir"] . '/include/functions_graph.php'); require_once ($config["homedir"] . '/include/functions_graph.php');
require_once ($config["homedir"] . '/include/functions_custom_graphs.php'); require_once ($config["homedir"] . '/include/functions_custom_graphs.php');
//~ enterprise_hook("enterprise_visual_map_print_item",
//~ array($layout_data, $status, $colorStatus,
//~ 'operation', $resizedMap, $proportion));
$width = $layoutData['width']; $width = $layoutData['width'];
$height = $max_percentile = $layoutData['height']; $height = $max_percentile = $layoutData['height'];
$top = $layoutData['pos_y']; $top = $layoutData['pos_y'];
@ -102,6 +107,13 @@ function visual_map_print_item($mode = "read", $layoutData,
break; break;
} }
$element_enterprise = array();
if (enterprise_installed()) {
$element_enterprise = enterprise_visual_map_print_item(
$mode, $layoutData, $proportion, $show_links);
}
$link = false; $link = false;
$url = "#"; $url = "#";
@ -530,6 +542,11 @@ function visual_map_print_item($mode = "read", $layoutData,
} }
} }
break; break;
default:
if (!empty($element_enterprise)) {
$url = $element_enterprise['url'];
}
break;
} }
} }
@ -682,7 +699,9 @@ function visual_map_print_item($mode = "read", $layoutData,
$class .= "icon"; $class .= "icon";
break; break;
default: default:
//enterprise_hook if (!empty($element_enterprise)) {
$class .= $element_enterprise['class'];
}
break; break;
} }
@ -871,8 +890,9 @@ function visual_map_print_item($mode = "read", $layoutData,
} }
break; break;
default: default:
enterprise_hook("enterprise_visual_map_print_item", if (!empty($element_enterprise)) {
array($layoutData, $status, $colorStatus)); echo $element_enterprise['item'];
}
break; break;
} }
@ -1743,85 +1763,88 @@ function visual_map_print_visual_map ($id_layout, $show_links = true,
$status = visual_map_get_status_element($layout_data); $status = visual_map_get_status_element($layout_data);
switch ($status) { //~ switch ($status) {
case VISUAL_MAP_STATUS_CRITICAL_BAD: //~ case VISUAL_MAP_STATUS_CRITICAL_BAD:
//Critical (BAD) //~ //Critical (BAD)
$colorStatus = COL_CRITICAL; //~ $colorStatus = COL_CRITICAL;
break; //~ break;
case VISUAL_MAP_STATUS_CRITICAL_ALERT: //~ case VISUAL_MAP_STATUS_CRITICAL_ALERT:
//Critical (ALERT) //~ //Critical (ALERT)
$colorStatus = COL_ALERTFIRED; //~ $colorStatus = COL_ALERTFIRED;
break; //~ break;
case VISUAL_MAP_STATUS_NORMAL: //~ case VISUAL_MAP_STATUS_NORMAL:
//Normal (OK) //~ //Normal (OK)
$colorStatus = COL_NORMAL; //~ $colorStatus = COL_NORMAL;
break; //~ break;
case VISUAL_MAP_STATUS_WARNING: //~ case VISUAL_MAP_STATUS_WARNING:
//Warning //~ //Warning
$colorStatus = COL_WARNING; //~ $colorStatus = COL_WARNING;
break; //~ break;
case VISUAL_MAP_STATUS_UNKNOWN: //~ case VISUAL_MAP_STATUS_UNKNOWN:
default: //~ default:
//Unknown //~ //Unknown
$colorStatus = COL_UNKNOWN; //~ $colorStatus = COL_UNKNOWN;
// Default is Grey (Other) //~ // Default is Grey (Other)
break; //~ break;
} //~ }
switch ($layout_data['type']) {
case GROUP_ITEM:
case STATIC_GRAPH:
visual_map_print_item("read", $layout_data, visual_map_print_item("read", $layout_data,
$proportion, $show_links); $proportion, $show_links);
break;
//~ switch ($layout_data['type']) {
//~ case GROUP_ITEM:
case LABEL: //~ case STATIC_GRAPH:
visual_map_print_item("read", $layout_data, //~ visual_map_print_item("read", $layout_data,
$proportion, $show_links); //~ $proportion, $show_links);
break; //~ break;
//~
//~
//~
case ICON: //~ case LABEL:
visual_map_print_item("read", $layout_data, //~ visual_map_print_item("read", $layout_data,
$proportion, $show_links); //~ $proportion, $show_links);
break; //~ break;
//~
//~
//~
case SIMPLE_VALUE: //~ case ICON:
case SIMPLE_VALUE_MAX: //~ visual_map_print_item("read", $layout_data,
case SIMPLE_VALUE_MIN: //~ $proportion, $show_links);
case SIMPLE_VALUE_AVG: //~ break;
visual_map_print_item("read", $layout_data, //~
$proportion, $show_links); //~
break; //~
//~ case SIMPLE_VALUE:
//~ case SIMPLE_VALUE_MAX:
//~ case SIMPLE_VALUE_MIN:
case PERCENTILE_BAR: //~ case SIMPLE_VALUE_AVG:
case PERCENTILE_BUBBLE: //~ visual_map_print_item("read", $layout_data,
visual_map_print_item("read", $layout_data, //~ $proportion, $show_links);
$proportion, $show_links); //~ break;
break; //~
//~
//~
//~ case PERCENTILE_BAR:
case MODULE_GRAPH: //~ case PERCENTILE_BUBBLE:
visual_map_print_item("read", $layout_data, //~ visual_map_print_item("read", $layout_data,
$proportion, $show_links); //~ $proportion, $show_links);
break; //~ break;
//~
//~
//~
default: //~ case MODULE_GRAPH:
enterprise_hook("enterprise_visual_map_print_item", //~ visual_map_print_item("read", $layout_data,
array($layout_data, $status, $colorStatus, //~ $proportion, $show_links);
'operation', $resizedMap, $proportion)); //~ break;
break; //~
} //~
//~
//~ default:
//~ enterprise_hook("enterprise_visual_map_print_item",
//~ array($layout_data, $status, $colorStatus,
//~ 'operation', $resizedMap, $proportion));
//~ break;
//~ }
} }
if ($draw_lines) { if ($draw_lines) {