'; $layout_datas = get_db_all_rows_field_filter ('tlayout_data', 'id_layout', $id_layout); $lines = array (); if ($layout_datas !== false) { foreach ($layout_datas as $layout_data) { // **************************************************************** // Get parent status (Could be an agent, module, map, others doesnt have parent info) // **************************************************************** if ($layout_data["parent_item"] != 0){ $id_agent_module_parent = get_db_value ("id_agente_modulo", "tlayout_data", "id", $layout_data["parent_item"]); $id_agent_parent = get_db_value ("id_agent", "tlayout_data", "id", $layout_data["parent_item"]); $id_layout_linked = get_db_value ("id_layout_linked", "tlayout_data", "id", $layout_data["parent_item"]); // Module if ($id_agent_module_parent != 0) { $status_parent = get_agentmodule_status ($id_agent_module_parent); // Agent } elseif ($id_agent_parent != 0) { $status_parent = get_agent_status ($id_agent_parent); } // Another layout/map elseif ($id_layout_linked != 0) { $status_parent = get_layout_status ($id_layout_linked); } else { $status_parent = 3; } } else { $id_agent_module_parent = 0; $status_parent = 3; } // **************************************************************** // Get STATUS of current object // **************************************************************** // Linked to other layout ?? - Only if not module defined if ($layout_data['id_layout_linked'] != 0) { $status = get_layout_status ($layout_data['id_layout_linked']); // Single object } elseif ($layout_data["type"] == 0) { // Status for a simple module if ($layout_data['id_agente_modulo'] != 0) { $status = get_agentmodule_status ($layout_data['id_agente_modulo']); $id_agent = get_db_value ("id_agente", "tagente_estado", "id_agente_modulo", $layout_data['id_agente_modulo']); // Status for a whole agent, if agente_modulo was == 0 } elseif ($layout_data['id_agent'] != 0) { $status = get_agent_status ($layout_data["id_agent"]); if ($status == -1) // get_agent_status return -1 for unknown! $status = 3; $id_agent = $layout_data["id_agent"]; } else { $status = 3; $id_agent = 0; } } else { // If it's a graph, a progress bar or a data tag, ALWAYS report // status OK (=0) to avoid confussions here. $status = 0; } // **************************************************************** // STATIC IMAGE (type = 0) // **************************************************************** if ($layout_data['type'] == 0) { // Link image //index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=1 if ($status == 0) // Bad monitor $z_index = 3; elseif ($status == 2) // Warning $z_index = 2; elseif ($status == 4) // Alert $z_index = 4; else $z_index = 1; // Print BAD over good // Draw image if ($resizedMap) echo '