"; $layout_datas = get_db_all_rows_field_filter ('tlayout_data', 'id_layout', $id_layout); $lines = array (); foreach ($layout_datas as $layout_data) { // Linked to other layout ?? - Only if not module defined if (($layout_data['id_layout_linked'] != 0) && ($layout_data['id_agente_modulo'] == 0)) { $status = return_status_layout ($layout_data['id_layout_linked']); } else { $id_agent = get_db_value ("id_agente", "tagente_estado", "id_agente_modulo", $layout_data['id_agente_modulo']); $id_agent_module_parent = get_db_value ("id_agente_modulo", "tlayout_data", "id", $layout_data["parent_item"]); // Item value $status = return_status_agent_module ($layout_data['id_agente_modulo']); if ($layout_data['no_link_color'] == 1) $status_parent = -1; else $status_parent = return_status_agent_module ($id_agent_module_parent); } // STATIC IMAGE (type = 0) // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if ($layout_data['type'] == 0) { // Link image //index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=1 // Draw image echo '
'; if ($show_links) { if ($layout_data['id_layout_linked'] == "" || $layout_data['id_layout_linked'] == 0) { echo ""; } else { echo ''; } } if ($status == 0) { if ($layout_data['width'] != "" && $layout_data['width'] != 0) echo ''; else echo ''; } else { if ($layout_data['width'] != "" && $layout_data['width'] != 0) echo ''; else echo ''; } echo ""; // Draw label echo "
"; echo $layout_data['label']; echo "
"; } // SINGLE GRAPH (type = 1) if ($layout_data['type'] == 1) { // single graph // Draw image echo '
'; if ($show_links) { if (($layout_data['id_layout_linked'] == "") || ($layout_data['id_layout_linked'] == 0)) { echo ''; } else { echo ''; } } echo ''; echo ""; echo "
"; } else if ($layout_data['type'] == 2) { $line['id'] = $layout_data['id']; $line['x'] = $layout_data['pos_x']; $line['y'] = $layout_data['pos_y']; $line['width'] = $layout_data['width']; $line['height'] = $layout_data['height']; $line['color'] = $layout_data['label_color']; array_push ($lines, $line); } // Get parent relationship - Create line data // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if ($layout_data["parent_item"] != "" && $layout_data["parent_item"] != 0) { $parent_x = get_layoutdata_x ($layout_data["parent_item"]); $parent_y = get_layoutdata_y ($layout_data["parent_item"]); $line['id'] = $layout_data['id']; $line['node_begin'] = 'layout-data-'.$layout_data["parent_item"]; $line['node_end'] = 'layout-data-'.$layout_data["id"]; $line['width'] = $parent_x + 15; $line['height'] = $parent_y + 15; $line['color'] = $status_parent ? '#00dd00' : '#dd0000'; array_push ($lines, $line); } } if ($draw_lines) { /* If you want lines in the map, call using Javascript: draw_lines (lines, id_div); on body load, where id_div is the id of the div which holds the map */ echo "\n".''."\n"; } // End main div echo ""; } function get_layout_data_types () { $types = array (0 => lang_string ("static_graph"), 1 => lang_string ("module_graph")); return $types; } ?>