$logo_title, "border" => '0')); ?> id = "header_table"; $table->class = "none"; $table->cellpadding = 0; $table->cellspacing = 0; $table->head = array (); $table->data = array (); $table->style[0] = $table->style['clippy'] = $table->style[1] = $table->style[3] = $table->style[4] = $table->style[5] = $table->style[6] = $table->style[8] = $table->style[9] = $table->style['qr'] = 'width: 22px; text-align:center; height: 22px; padding-right: 9px;padding-left: 9px;'; $table->style[7] = 'width: 20px; padding-right: 9px;'; $table->style['searchbar'] = 'width: 180px; min-width: 180px;'; $table->style[11] = 'padding-left: 10px; padding-right: 5px;width: 16px;'; $table->width = "100%"; $table->styleTable = 'margin: auto; margin-top: 0px;'; $table->rowclass[0] = ''; $table->data[0][11] = ui_print_help_tip (__("Blank characters are used as AND conditions"), true); // Search bar $search_bar = '
'; if (!isset($config['search_keywords'])) { $search_bar .= ''; } else { if (strlen($config['search_keywords']) == 0) $search_bar .= ''; else $search_bar .= ''; } $search_bar .= ''; //$search_bar .= 'onClick="javascript: document.quicksearch.submit()"'; $search_bar .= ""; $search_bar .= '
'; $table->data[0]['searchbar'] = $search_bar; // Servers check $servers = array(); $servers["all"] = (int) db_get_value ('COUNT(id_server)','tserver'); $servers["up"] = (int) servers_check_status (); $servers["down"] = $servers["all"] - $servers["up"]; if ($servers["up"] == 0) { //All Servers down or no servers at all $servers_check_img = html_print_image("images/header_down.png", true, array("alt" => 'cross', "class" => 'bot', 'title' => __('All systems').': '.__('Down'))); } elseif ($servers["down"] != 0) { //Some servers down $servers_check_img = html_print_image("images/header_warning.png", true, array("alt" => 'error', "class" => 'bot', 'title' => $servers["down"].' '.__('servers down'))); } else { //All servers up $servers_check_img = html_print_image("images/header_ready.png", true, array("alt" => 'ok', "class" => 'bot', 'title' => __('All systems').': '.__('Ready'))); } unset ($servers); // Since this is the header, we don't like to trickle down variables. $servers_link_open = ''; $servers_link_close = ''; if ($config['show_qr_code_header'] == 0){ $show_qr_code_header = 'display: none;'; } else { $show_qr_code_header = 'display: inline;'; } $table->data[0]['qr'] = ''; echo ""; ?> data[0]['clippy'] = '' . html_print_image( "images/clippy_icon.png", true, array("id" => 'clippy', "class" => 'clippy', "alt" => __('Pandora FMS assistant'), 'title' => __('Pandora FMS assistant'))) . ''; } $table->data[0][0] = $servers_link_open . $servers_check_img . $servers_link_close; //======= Autorefresh code ============================= $autorefresh_txt = ''; $autorefresh_additional = ''; $ignored_params = array ('agent_config' => false, 'code' => false); if (!isset($_GET['sec2'])) { $_GET['sec2'] = ''; } if (!isset($_GET['refr'])) { $_GET['refr'] = null; } if ($config['autorefresh_white_list'] !== null && array_search($_GET['sec2'], $config['autorefresh_white_list']) !== false) { $autorefresh_img = html_print_image("images/header_refresh.png", true, array("class" => 'bot', "alt" => 'lightning', 'title' => __('Configure autorefresh'))); if ($_GET['refr']) { $autorefresh_txt .= ' ('.date ("i:s", $config["refr"]).')'; } $ignored_params['refr'] = ''; $values = get_refresh_time_array(); $autorefresh_additional = ''; unset ($values); $autorefresh_link_open_img = ''; if ($_GET['refr']) { $autorefresh_link_open_txt = ''; } else { $autorefresh_link_open_txt = ''; } $autorefresh_link_close = ''; } else { $autorefresh_img = html_print_image("images/header_refresh_disabled.png", true, array("class" => 'bot autorefresh_disabled', "alt" => 'lightning', 'title' => __('Disabled autorefresh'))); $ignored_params['refr'] = false; $autorefresh_link_open_img = ''; $autorefresh_link_open_txt = ''; $autorefresh_link_close = ''; } $table->data[0][1] = $autorefresh_link_open_img . $autorefresh_img . $autorefresh_link_close; $table->data[0][2] = $autorefresh_link_open_txt . $autorefresh_txt . $autorefresh_link_close . $autorefresh_additional; //====================================================== $check_minor_release_available = false; $pandora_management = check_acl($config['id_user'], 0, "PM"); $check_minor_release_available = db_check_minor_relase_available (); if ($check_minor_release_available) { set_pandora_error_for_header('There are one or more minor releases waiting for update, there are required administrator permissions', 'minor release/s available'); } echo ''; if ($config["alert_cnt"] > 0) { $maintenance_link = 'javascript:'; $maintenance_title = __("System alerts detected - Please fix as soon as possible"); $maintenance_class = $maintenance_id = 'show_systemalert_dialog white'; $maintenance_link_open_txt = ''; $maintenance_link_open_img = ''; $maintenance_link_close = ''; if (!$pandora_management) { $maintenance_img = ''; } else { $maintenance_img = $maintenance_link_open_img . html_print_image("images/header_yellow.png", true, array( "title" => __('You have %d warning(s)', $config["alert_cnt"]), "id" => "yougotalert", "class" => "bot")) . $maintenance_link_close; } } else { if (!$pandora_management) { $maintenance_img = ''; } else { $maintenance_img = html_print_image ("images/header_ready.png", true, array ("title" => __('There are not warnings'), "id" => "yougotalert", "class" => "bot")); } } $table->data[0][3] = $maintenance_img; // Main help icon $table->data[0][4] = ''.html_print_image("images/header_help.png", true, array( "title" => __('Main help'), "id" => "helpmodal", "class" => "modalpopup")).''; // Logout $table->data[0][5] = ''; $table->data[0][5] .= html_print_image("images/header_logout.png", true, array("alt" => __('Logout'), "class" => 'bot', "title" => __('Logout'))); $table->data[0][5] .= ''; // User if (is_user_admin ($config["id_user"]) == 1) $table->data[0][6] = html_print_image("images/header_user_admin.png" , true, array("title" => __('Edit my user'), "class" => 'bot', "alt" => 'user')); else $table->data[0][6] = html_print_image("images/header_user.png" , true, array("title" => __('Edit my user'), "class" => 'bot', "alt" => 'user')); $table->data[0][6] = '' . $table->data[0][6] . ''; $table->data[0][7] = ' (' . $config["id_user"] . ')'; // Chat messages $table->data[0][8] = ""; // Messages $msg_cnt = messages_get_count ($config["id_user"]); if ($msg_cnt > 0) { echo ''; $table->data[0][9] = ''; $table->data[0][9] .= html_print_image ("images/header_email.png", true, array ("title" => __('You have %d unread message(s)', $msg_cnt), "id" => "yougotmail", "class" => "bot", 'style' => 'width:24px;')); $table->data[0][9] .= ''; } html_print_table($table); unset($table); ?>