if (is_numeric($part)) { switch($type) { case "tree": $tree_id = $part; break; case "leaf": $leaf_id = $part; break; case "dqi": $device_group_type = array("dqi", $part); break; case "dq": $device_group_type = array("dq", $part); break; case "gt": $device_group_type = array("gt", $part); break; default: break; } }else{ $type = trim($part); } } } } get_graph_tree_content($tree_id, $leaf_id, $device_group_type); exit();
function get_graph_tree_graphs() { include_once(dirname(__FILE__) . "/../../lib/html_tree.php"); include_once(CACTI_BASE_PATH . "/lib/timespan_settings.php"); /* Make sure nothing is cached */ header("Cache-Control: must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); header("Expires: ". gmdate("D, d M Y H:i:s", mktime(date("H"), date("i"), date("s"), date("m")-1, date("d"), date("Y")))." GMT"); header("Last-Modified: ". gmdate("D, d M Y H:i:s")." GMT"); /* parse the id string * prototypes: * tree_id, tree_id_leaf_id, tree_id_leaf_id_hgd_dq * tree_id_leaf_id_hgd_dqi, tree_id_leaf_id_hgd_gt */ $tree_id = 0; $leaf_id = 0; $device_group_type = array('na', 0); if (!isset($_REQUEST["id"])) { if (isset($_SESSION["sess_graph_navigation"])) { $_REQUEST["id"] = $_SESSION["sess_graph_navigation"]; } } if (isset($_REQUEST["id"])) { $_SESSION["sess_graph_navigation"] = $_REQUEST["id"]; $id_array = explode("_", $_REQUEST["id"]); $type = ""; if (sizeof($id_array)) { foreach($id_array as $part) { if (is_numeric($part)) { switch($type) { case "tree": $tree_id = $part; break; case "leaf": $leaf_id = $part; break; case "dqi": $device_group_type = array("dqi", $part); break; case "dq": $device_group_type = array("dq", $part); break; case "gt": $device_group_type = array("gt", $part); break; default: break; } }else{ $type = trim($part); } } } } get_graph_tree_content($tree_id, $leaf_id, $device_group_type); exit(); }