From 3ed0b823c03ae930aa0093f380bbaa2d5d76d8b5 Mon Sep 17 00:00:00 2001 From: Esteban Sanchez Date: Mon, 2 Mar 2009 13:43:15 +0000 Subject: [PATCH] 2009-03-02 Esteban Sanchez * include/functions_menu.php: Added to repository. Functions for menu. * operation/menu.php, godmode/menu.php: Added class to menu due to changes in print_menu(). * general/main_menu.php: temp_print_menu() moved to functions_menu.php * include/functions_themes.php: Added to repository. Implement functions relative to themes (only CSS themes list at this moment). * include/styles/pandora.css, include/styles/pandora_black.css, include/styles/pandora_minimal.css, include/styles/pandora_red.css: Added author, name and description comments to adopt to new get_themes() interface. * include/styles/pandora_width.css: Improved and make lighter by simply rewrite some classes. * include/functions.php: Added is_ajax(). * godmode/agentes/module_manager_editor.php, godmode/alerts/alert_actions.php, godmode/alerts/alert_commands.php, godmode/alerts/alert_compounds.php, godmode/alerts/alert_list.php, godmode/alerts/alert_templates.php, godmode/groups/group_list.php, godmode/reporting/map_builder.php, godmode/reporting/reporting_builder.php, operation/agentes/estado_agente.php, operation/agentes/ver_agente.php, operation/events/events.php, operation/messages/message.php: Use is_ajax() * godmode/setup/setup.php: Use enterprise_include() instead of manual checking. Use get_css_themes() to show the theme list. * include/styles/common.css: Added to repository. Minimal styles to make pandora works and common with all the CSS themes. * include/functions_ui.php: Added common.css file. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1496 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 40 + pandora_console/general/main_menu.php | 105 +-- .../godmode/agentes/module_manager_editor.php | 2 +- .../godmode/alerts/alert_actions.php | 2 +- .../godmode/alerts/alert_commands.php | 2 +- .../godmode/alerts/alert_compounds.php | 6 +- pandora_console/godmode/alerts/alert_list.php | 2 +- .../godmode/alerts/alert_templates.php | 2 +- pandora_console/godmode/groups/group_list.php | 2 +- pandora_console/godmode/menu.php | 2 + .../godmode/reporting/map_builder.php | 14 +- .../godmode/reporting/reporting_builder.php | 2 +- pandora_console/godmode/setup/setup.php | 10 +- pandora_console/include/functions.php | 11 + pandora_console/include/functions_menu.php | 128 ++++ pandora_console/include/functions_themes.php | 44 ++ pandora_console/include/functions_ui.php | 3 +- pandora_console/include/styles/common.css | 53 ++ pandora_console/include/styles/pandora.css | 53 +- .../include/styles/pandora_black.css | 5 + .../include/styles/pandora_minimal.css | 5 + .../include/styles/pandora_red.css | 5 + .../include/styles/pandora_width.css | 703 +----------------- .../operation/agentes/estado_agente.php | 2 +- .../operation/agentes/ver_agente.php | 2 +- pandora_console/operation/events/events.php | 2 +- pandora_console/operation/menu.php | 2 + .../operation/messages/message.php | 4 +- 28 files changed, 342 insertions(+), 871 deletions(-) create mode 100644 pandora_console/include/functions_menu.php create mode 100644 pandora_console/include/functions_themes.php create mode 100644 pandora_console/include/styles/common.css diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 9bdb7ec438..667e96bbbf 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,43 @@ +2009-03-02 Esteban Sanchez + + * include/functions_menu.php: Added to repository. Functions for menu. + + * operation/menu.php, godmode/menu.php: Added class to menu due to + changes in print_menu(). + + * general/main_menu.php: temp_print_menu() moved to functions_menu.php + + * include/functions_themes.php: Added to repository. Implement + functions relative to themes (only CSS themes list at this moment). + + * include/styles/pandora.css, include/styles/pandora_black.css, + include/styles/pandora_minimal.css, include/styles/pandora_red.css: + Added author, name and description comments to adopt to new + get_themes() interface. + + * include/styles/pandora_width.css: Improved and make lighter by + simply rewrite some classes. + + * include/functions.php: Added is_ajax(). + + * godmode/agentes/module_manager_editor.php, + godmode/alerts/alert_actions.php, godmode/alerts/alert_commands.php, + godmode/alerts/alert_compounds.php, godmode/alerts/alert_list.php, + godmode/alerts/alert_templates.php, godmode/groups/group_list.php, + godmode/reporting/map_builder.php, + godmode/reporting/reporting_builder.php, + operation/agentes/estado_agente.php, operation/agentes/ver_agente.php, + operation/events/events.php, operation/messages/message.php: Use + is_ajax() + + * godmode/setup/setup.php: Use enterprise_include() instead of manual + checking. Use get_css_themes() to show the theme list. + + * include/styles/common.css: Added to repository. Minimal styles to + make pandora works and common with all the CSS themes. + + * include/functions_ui.php: Added common.css file. + 2009-02-27 Esteban Sanchez * godmode/groups/configure_group.php: Removed javascript console.log diff --git a/pandora_console/general/main_menu.php b/pandora_console/general/main_menu.php index f905430eb7..5e7526ae9d 100644 --- a/pandora_console/general/main_menu.php +++ b/pandora_console/general/main_menu.php @@ -21,116 +21,17 @@ if (! isset ($config["id_user"])) { exit (); } -//This is a helper function to print menu items -function temp_print_menu ($menu, $classtype) { - static $idcounter = 0; - - echo ''; -} +require_once ('include/functions_menu.php'); echo '
:: '.__('Operation').' ::
'; $menu = array (); require ("operation/menu.php"); -temp_print_menu ($menu, "operation"); +print_menu ($menu); echo '
:: '.__('Administration').' ::
'; $menu = array (); require ("godmode/menu.php"); -temp_print_menu ($menu, "godmode"); +print_menu ($menu); unset ($menu); require ("links_menu.php"); diff --git a/pandora_console/godmode/agentes/module_manager_editor.php b/pandora_console/godmode/agentes/module_manager_editor.php index 1522ac3523..0a40be8004 100644 --- a/pandora_console/godmode/agentes/module_manager_editor.php +++ b/pandora_console/godmode/agentes/module_manager_editor.php @@ -16,7 +16,7 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -if (defined ('AJAX')) { +if (is_ajax ()) { $get_network_component = (bool) get_parameter ('get_network_component'); $snmp_walk = (bool) get_parameter ('snmp_walk'); $get_module_component = (bool) get_parameter ('get_module_component'); diff --git a/pandora_console/godmode/alerts/alert_actions.php b/pandora_console/godmode/alerts/alert_actions.php index 36327cd5c2..ddfb9fb3ee 100644 --- a/pandora_console/godmode/alerts/alert_actions.php +++ b/pandora_console/godmode/alerts/alert_actions.php @@ -29,7 +29,7 @@ if (! give_acl ($config['id_user'], 0, "LM")) { exit; } -if (defined ('AJAX')) { +if (is_ajax ()) { $get_alert_action = (bool) get_parameter ('get_alert_action'); if ($get_alert_action) { $id = (int) get_parameter ('id'); diff --git a/pandora_console/godmode/alerts/alert_commands.php b/pandora_console/godmode/alerts/alert_commands.php index aafa44e2db..b764ab4ea9 100644 --- a/pandora_console/godmode/alerts/alert_commands.php +++ b/pandora_console/godmode/alerts/alert_commands.php @@ -29,7 +29,7 @@ if (! give_acl ($config['id_user'], 0, "LM")) { exit; } -if (defined ('AJAX')) { +if (is_ajax ()) { $get_alert_command = (bool) get_parameter ('get_alert_command'); if ($get_alert_command) { $id = (int) get_parameter ('id'); diff --git a/pandora_console/godmode/alerts/alert_compounds.php b/pandora_console/godmode/alerts/alert_compounds.php index dea63c1353..f487b58502 100644 --- a/pandora_console/godmode/alerts/alert_compounds.php +++ b/pandora_console/godmode/alerts/alert_compounds.php @@ -50,7 +50,7 @@ if ($delete_alert) { $result = delete_alert_compound ($id); print_error_message ($result, __('Successfully deleted'), __('Could not be deleted')); - if (defined ('AJAX')) + if (is_ajax ()) return; } @@ -59,7 +59,7 @@ if ($enable_alert) { $result = set_alerts_compound_disable ($id, false); print_error_message ($result, __('Successfully enabled'), __('Could not be enabled')); - if (defined ('AJAX')) + if (is_ajax ()) return; } @@ -68,7 +68,7 @@ if ($disable_alert) { $result = set_alerts_compound_disable ($id, true); print_error_message ($result, __('Successfully disabled'), __('Could not be disabled')); - if (defined ('AJAX')) + if (is_ajax ()) return; } diff --git a/pandora_console/godmode/alerts/alert_list.php b/pandora_console/godmode/alerts/alert_list.php index feb718a2d8..25ce70961e 100644 --- a/pandora_console/godmode/alerts/alert_list.php +++ b/pandora_console/godmode/alerts/alert_list.php @@ -17,7 +17,7 @@ check_login (); -if (defined ('AJAX')) { +if (is_ajax ()) { $get_agent_alerts_simple = (bool) get_parameter ('get_agent_alerts_simple'); $disable_alert = (bool) get_parameter ('disable_alert'); $enable_alert = (bool) get_parameter ('enable_alert'); diff --git a/pandora_console/godmode/alerts/alert_templates.php b/pandora_console/godmode/alerts/alert_templates.php index e45184d0f0..12ae8ee3ee 100644 --- a/pandora_console/godmode/alerts/alert_templates.php +++ b/pandora_console/godmode/alerts/alert_templates.php @@ -30,7 +30,7 @@ if (! give_acl ($config['id_user'], 0, "LM")) { } -if (defined ('AJAX')) { +if (is_ajax ()) { $get_template_tooltip = (bool) get_parameter ('get_template_tooltip'); if ($get_template_tooltip) { diff --git a/pandora_console/godmode/groups/group_list.php b/pandora_console/godmode/groups/group_list.php index 3a77cd3391..c938744804 100644 --- a/pandora_console/godmode/groups/group_list.php +++ b/pandora_console/godmode/groups/group_list.php @@ -29,7 +29,7 @@ if (! give_acl($config['id_user'], 0, "PM")) { return; } -if (defined ('AJAX')) { +if (is_ajax ()) { $get_group_json = (bool) get_parameter ('get_group_json'); $get_group_agents = (bool) get_parameter ('get_group_agents'); diff --git a/pandora_console/godmode/menu.php b/pandora_console/godmode/menu.php index 7bf4eea021..4bb51b51bf 100644 --- a/pandora_console/godmode/menu.php +++ b/pandora_console/godmode/menu.php @@ -24,6 +24,8 @@ if ((! give_acl ($config['id_user'], 0, "LM")) && (! give_acl ($config['id_user' return; } +$menu['class'] = 'godmode'; + if (give_acl ($config['id_user'], 0, "AW")) { $menu["gagente"]["text"] = __('Manage agents'); $menu["gagente"]["sec2"] = "godmode/agentes/modificar_agente"; diff --git a/pandora_console/godmode/reporting/map_builder.php b/pandora_console/godmode/reporting/map_builder.php index 7f60f275b3..e74f5b13aa 100644 --- a/pandora_console/godmode/reporting/map_builder.php +++ b/pandora_console/godmode/reporting/map_builder.php @@ -70,7 +70,7 @@ if ($create_layout) { } else { echo '

'.__('Not created. Error inserting data').'

'; } - if (defined ('AJAX')) { + if (is_ajax ()) { exit; } } @@ -110,7 +110,7 @@ if ($update_layout) { } else { echo '

'.__('Update layout failed').'

'; } - if (defined ('AJAX')) { + if (is_ajax ()) { exit; } } @@ -122,7 +122,7 @@ if ($get_background_info) { $info['width'] = $info[0]; $info['height'] = $info[1]; } - if (defined ('AJAX')) { + if (is_ajax ()) { echo json_encode ($info); exit; } @@ -134,7 +134,7 @@ if ($get_layout_data) { if ($layout_data['id_agente_modulo']) $layout_data['id_agent'] = give_agent_id_from_module_id ($layout_data['id_agente_modulo']); - if (defined ('AJAX')) { + if (is_ajax ()) { echo json_encode ($layout_data); exit; } @@ -173,7 +173,7 @@ if ($create_layout_data) { } else { echo '

'.__('Not created. Error inserting data').'

'; } - if (defined ('AJAX')) { + if (is_ajax ()) { exit; } } @@ -191,7 +191,7 @@ if ($update_layout_data_coords) { array ('pos_x' => $layout_data_x, 'pos_y' => $layout_data_y), array ('id' => $id_layout_data)); - if (defined ('AJAX')) { + if (is_ajax ()) { exit; } } @@ -207,7 +207,7 @@ if ($delete_layout_data) { process_sql_delete ('tlayout_data', array ('id' => $id_layout_data)); } - if (defined ('AJAX')) { + if (is_ajax ()) { exit; } } diff --git a/pandora_console/godmode/reporting/reporting_builder.php b/pandora_console/godmode/reporting/reporting_builder.php index 62d44dc109..4d88b981c5 100644 --- a/pandora_console/godmode/reporting/reporting_builder.php +++ b/pandora_console/godmode/reporting/reporting_builder.php @@ -28,7 +28,7 @@ if (! give_acl ($config['id_user'], 0, "AW")) { exit; } -if (defined ('AJAX')) { +if (is_ajax ()) { $get_report_type_data_source = (bool) get_parameter ('get_report_type_data_source'); if ($get_report_type_data_source) { diff --git a/pandora_console/godmode/setup/setup.php b/pandora_console/godmode/setup/setup.php index 9759be1020..82850653a5 100644 --- a/pandora_console/godmode/setup/setup.php +++ b/pandora_console/godmode/setup/setup.php @@ -28,9 +28,7 @@ if (! give_acl ($config['id_user'], 0, "PM") || ! dame_admin ($config['id_user'] } // Load enterprise extensions -if (file_exists( $config["homedir"] . "/enterprise/godmode/setup/setup.php")) { - include $config["homedir"] . "/enterprise/godmode/setup/setup.php"; -} +enterprise_include ('godmode/setup/setup.php'); $update_settings = (bool) get_parameter ('update_settings'); @@ -81,11 +79,11 @@ if ($update_settings) { process_sql ("UPDATE tconfig SET VALUE='".$config["compact_header"]."' WHERE token = 'compact_header'"); } +require_once ('include/functions_themes.php'); + echo "

".__('Setup')." > "; echo __('General configuration')."

"; -$file_styles = list_files('include/styles/', "pandora", 1, 0); - $table->width = '90%'; $table->data = array (); $table->data[0][0] = __('Language code for Pandora'); @@ -126,7 +124,7 @@ $table->data[11][0] = __('Auto login (Hash) password'); $table->data[11][1] = print_input_text ('loginhash_pwd', $config["loginhash_pwd"], '', 15, 15, true); $table->data[13][0] = __('Style template'); -$table->data[13][1] = print_select ($file_styles, 'style', $config["style"], '', '', '', true); +$table->data[13][1] = print_select (get_css_themes (), 'style', $config["style"], '', '', '', true); $table->data[14][0] = __('Block size for pagination'); $table->data[14][1] = print_input_text ('block_size', $config["block_size"], '', 5, 5, true); diff --git a/pandora_console/include/functions.php b/pandora_console/include/functions.php index 5da7d46c84..1c4c1cf974 100644 --- a/pandora_console/include/functions.php +++ b/pandora_console/include/functions.php @@ -895,4 +895,15 @@ function safe_sql_string ($string) { return $string; return mysql_escape_string ($string); } + +/** + * Checks if current execution is under an AJAX request. + * + * This functions checks if an 'AJAX' constant is defined + * + * @return bool True if the request was done via AJAX. False otherwise + */ +function is_ajax () { + return defined ('AJAX'); +} ?> diff --git a/pandora_console/include/functions_menu.php b/pandora_console/include/functions_menu.php new file mode 100644 index 0000000000..3e82cff03e --- /dev/null +++ b/pandora_console/include/functions_menu.php @@ -0,0 +1,128 @@ +'; + + $sec = (string) get_parameter ('sec'); + $sec2 = (string) get_parameter ('sec2'); + + echo ''; + + foreach ($menu as $mainsec => $main) { + if ($mainsec == 'class') + continue; + + if (! isset ($main['id'])) { + $id = 'menu_'.++$idcounter; + } else { + $id = $main['id']; + } + + $submenu = false; + $classes = array (); + if (isset ($main["sub"])) { + $classes[] = 'has_submenu'; + $submenu = true; + } + if (!isset ($main["refr"])) + $main["refr"] = 0; + + if ($sec == $mainsec) { + $classes[] = 'selected'; + } else { + $classes[] = 'not_selected'; + } + + $output = ''; + + if (! $submenu) { + $main["sub"] = array (); //Empty array won't go through foreach + } + + $submenu_output = ''; + $selected = false; + $visible = false; + + foreach ($main["sub"] as $subsec2 => $sub) { + //Set class + if ($sec2 == $subsec2 && isset ($sub[$subsec2]["options"]) + && (get_parameter_get ($sub[$subsec2]["options"]["name"]) == $sub[$subsec2]["options"]["value"])) { + //If the subclass is selected and there are options and that options value is true + $class = 'submenu_selected'; + $selected = true; + $visible = true; + } elseif ($sec2 == $subsec2 && !isset ($sub[$subsec2]["options"])) { + //If the subclass is selected and there are no options + $class = 'submenu_selected'; + $selected = true; + $visible = true; + } else { + //Else it's not selected + $class = 'submenu_not_selected'; + } + + if (! isset ($sub["refr"])) { + $sub["refr"] = 0; + } + + if (isset ($sub["type"]) && $sub["type"] == "direct") { + //This is an external link + $submenu_output .= '
  • '.$sub["text"]."
  • "; + } else { + //This is an internal link + if (isset ($sub[$subsec2]["options"])) { + $link_add = "&".$sub[$subsec2]["options"]["name"]."=".$sub[$subsec2]["options"]["value"]; + } else { + $link_add = ""; + } + $submenu_output .= ''; + $submenu_output .= ''.$sub["text"].''; + $submenu_output .= ''; + } + } + + //Print out the first level + $output .= '
  • '; + $output .= ''.$main["text"].'toggle'; + if ($submenu_output != '') { + //WARNING: IN ORDER TO MODIFY THE VISIBILITY OF MENU'S AND SUBMENU'S (eg. with cookies) YOU HAVE TO ADD TO THIS ELSEIF. DON'T MODIFY THE CSS + if ($visible || in_array ("selected", $classes)) { + $visible = true; + } + $output .= ''; + } + $output .= '
  • '; + echo $output; + } + echo ''; + //Invisible UL for adding border-top + echo '
    •  
    '; +} + +?> diff --git a/pandora_console/include/functions_themes.php b/pandora_console/include/functions_themes.php new file mode 100644 index 0000000000..7e872a4171 --- /dev/null +++ b/pandora_console/include/functions_themes.php @@ -0,0 +1,44 @@ + diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index f4b8c7fd48..b71fad7858 100644 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -566,6 +566,7 @@ function process_page_head ($string, $bitfield) { + '; @@ -580,7 +581,7 @@ function process_page_head ($string, $bitfield) { //Load CSS if (empty ($config['css'])) { - $config['css'] = array (); //If it's empty, false or not init set array to empty just in case + $config['css'] = array (); } //Style should go first diff --git a/pandora_console/include/styles/common.css b/pandora_console/include/styles/common.css new file mode 100644 index 0000000000..f9e44e571f --- /dev/null +++ b/pandora_console/include/styles/common.css @@ -0,0 +1,53 @@ +/* Common useful styles */ +.invisible { + display: none; +} +.left { clear: left; float: left;} +.right { clear: right; float: right;} +.clear { clear:both; } +.top { + vertical-align: top; + margin-top: 0; + padding-top: 0; +} +img.left { + margin-right:1em; + margin-bottom:1.8em; +} +img.right { + margin-left:1em; + margin-bottom:1.8em; +} +.text-right { + text-align:right; +} + +/* Debug styles */ +pre.debug, div.backtrace { + font-family: monospace !important; + text-align: left; + padding: 10px; + margin: 5px; + border: 1px solid black; +} +div.backtrace ol { + margin: 0; + padding-left: 20px; +} +pre.debug { + background-color: #fff55f; +} +div.debug, div.database_debug_title, div.debug a, div.debug a:hover { + background-color: white; + color: black; + text-align: left; +} +div.debug a, div.debug a:hover, div.parameters { + text-decoration: underline; +} +div.database_debug_title { + font-size: 15pt; + margin-top: 15px; + padding: 5px; + width: 95%; +} diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index e801c8bb6f..0b270532d3 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -1,4 +1,9 @@ /* + +Author: The Pandora FMS team +Name: Default theme +Description: The default Pandora FMS theme layout + // Pandora FMS - the Flexible Monitoring System // ============================================= // Copyright (c) 2004-2008 Sancho Lerena, slerena@gmail.comnt @@ -855,26 +860,6 @@ ol.steps li.visited { color: #999 !important; } -/* Common useful styles */ -.left { clear: left; float: left;} -.right { clear: right; float: right;} -.clear { clear:both; } -.top { - vertical-align: top; - margin-top: 0; - padding-top: 0; -} -img.left { - margin-right:1em; - margin-bottom:1.8em; -} -img.right { - margin-left:1em; - margin-bottom:1.8em; -} -.text-right { - text-align:right; -} fieldset { border: 2px solid #E9F3D2; padding: 0 0 0 10px; @@ -908,34 +893,6 @@ div.actions_container label { font-weight: normal; font-style: italic; } -pre.debug, div.backtrace { - font-family: monospace !important; - text-align: left; - padding: 10px; - margin: 5px; - border: 1px solid black; -} -div.backtrace ol { - margin: 0; - padding-left: 20px; -} -pre.debug { - background-color: #fff55f; -} -div.debug, div.database_debug_title, div.debug a, div.debug a:hover { - background-color: white; - color: black; - text-align: left; -} -div.debug a, div.debug a:hover, div.parameters { - text-decoration: underline; -} -div.database_debug_title { - font-size: 15pt; - margin-top: 15px; - padding: 5px; - width: 95%; -} /* timeEntry styles */ .timeEntry_control { diff --git a/pandora_console/include/styles/pandora_black.css b/pandora_console/include/styles/pandora_black.css index 338ac5e0b4..06e747bd63 100644 --- a/pandora_console/include/styles/pandora_black.css +++ b/pandora_console/include/styles/pandora_black.css @@ -1,4 +1,9 @@ /* + +Author: The Pandora FMS team +Name: Black theme +Description: A theme with a dark style + // Pandora FMS - the Free monitoring system // ======================================== // Copyright (c) 2004-2007 Sancho Lerena, slerena@gmail.com diff --git a/pandora_console/include/styles/pandora_minimal.css b/pandora_console/include/styles/pandora_minimal.css index 1c281f95a1..a82a537c81 100644 --- a/pandora_console/include/styles/pandora_minimal.css +++ b/pandora_console/include/styles/pandora_minimal.css @@ -1,4 +1,9 @@ /* + +Author: The Pandora FMS team +Name: Minimal theme +Description: A minimal layout + // Pandora FMS - the Free monitoring system // ======================================== // Copyright (c) 2004-2007 Sancho Lerena, slerena@gmail.com diff --git a/pandora_console/include/styles/pandora_red.css b/pandora_console/include/styles/pandora_red.css index cc3eb675bb..e7989b0e84 100644 --- a/pandora_console/include/styles/pandora_red.css +++ b/pandora_console/include/styles/pandora_red.css @@ -1,4 +1,9 @@ /* + +Author: The Pandora FMS team +Name: Red theme +Description: A red theme for Pandora FMS + // Pandora FMS - the Free monitoring system // ======================================== // Copyright (c) 2004-2007 Sancho Lerena, slerena@gmail.com diff --git a/pandora_console/include/styles/pandora_width.css b/pandora_console/include/styles/pandora_width.css index 60ec2a680c..de35b674fb 100644 --- a/pandora_console/include/styles/pandora_width.css +++ b/pandora_console/include/styles/pandora_width.css @@ -1,4 +1,9 @@ /* + +Author: The Pandora FMS team +Name: Variable width +Description: A theme with a variable width layout + // Pandora FMS - the Free monitoring system // ======================================== // Copyright (c) 2004-2007 Sancho Lerena, slerena@gmail.com @@ -23,712 +28,26 @@ // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -@import url(op.css); -@import url(god.css); -@import url(link.css); -@import url(tip.css); -* { - font-family: verdana, sans-serif; - font-size: 8pt; -} -body { - text-align: center; -} -input, textarea { - border: 1px solid #ddd; - font: verdana, sans-serif; - font-size: 8pt; -} -textarea { - padding: 5px; - height: 100px; - font-family: verdana, sans-serif; - font-size: 8pt; -} -textarea.conf_editor { - padding: 5px; - width: 650; - height: 350; - font-family: verdana, sans-serif; - font-size: 8pt; -} -input { - padding: 2px 3px 4px 3px; -} -input.button { - margin: 0; - font: bold, Arial, Sans-serif; - border: 1px solid #ccc; - background: #fff; - padding: 2px 3px; - margin: 10px 15px; -} -select { - padding: 0px; - border:1px solid #ddd; - font-family: verdana, sans-serif; - font-size: 8pt; -} -checkbox { - padding: 4px; - border:1px solid #eee; -} -h1, h2, h3, h4 { - font: bold 1em Arial, Sans-serif; - text-transform: uppercase; - color: #786; - padding-bottom: 4px; - padding-top: 7px; -} -h1 { - font-size: 16px; -} -h2 { - font-size: 15px; -} -h3 { - font-size: 14px; -} -h4 { - margin-bottom: 2px; - padding-bottom: 0px; - padding-top: 5px; - font-size: 13px; - color: #000; -} -a { - color: #486787; - text-decoration: none; -} -a:hover { - color: #003a3a; - text-decoration: underline; -} -a.white_bold { - color: #eee; - text-decoration: none; - font-weight: bold; -} +@import url(pandora.css); -a.white_grey_bold { - color: #999; - text-decoration: none; - font-weight: bold; -} - -a.white { - color: #eee; - text-decoration: none; -} -p.center { - text-align: center; -} -h1#log { - font-size: 18px; - margin-bottom: 0px; - color: #000; -} -h1#log_f { - color: #f00; - border-bottom: 1px solid #f00; - padding-bottom: 3px; -} -div#login { - margin: 0 auto; - margin-top: 200px; - width: 460px; - border-left: solid 1px #000; - border-top: solid 1px #000; - border-bottom: solid 2px #000; - border-right: solid 2px #000 -} -div#login_in, #login_f { - margin: 0 auto; - width: 400px; -} -div#login_f { - margin-top: 10px; - margin-bottom: 25px; -} -div#noaccess { - width: 350px; - padding-left: 40px; -} -div#activity{ - padding-top: 18px; - padding-bottom: 18px; -} -div#noa { - float: right; - padding-right: 50px; - margin-top: 25px; -} -div#db_f { - text-align: justify; - margin: auto; - padding: 0.5em; - width: 55em; - margin-top: 3em; -} -div#db_ftxt { - float: right; - padding-top: 10px; -} div#container { - margin: 0 auto; width: 95%; - text-align: left; - border-left: solid 2px #000; - border-right: solid 2px #000; - border-top: solid 2px #000; - margin-top: 5px; } div#page { - background: #fff; - clear: both; - border-bottom: solid 5px #786; - border-top: solid 5px #786; - background: #FFF; + width: auto; } div#main { width: auto; - min-height: 800px; - float: both; + float: none; padding-left: 0px; padding-top: 0px; padding-bottom: 20px; margin-left: 180px; - background-color: #fefefe; - background-image: url(../../images/backgrounds/background4.jpg); -} - -div#menu { - width: 155px; - float: left; -} -div#page>div#menu { - width: 157px; + margin-right: 20px; } div#head { - font-size: 8pt; - height: 60px; - background: url(../../images/header.jpg); - border-bottom: solid 2px #555; + width: auto; } div#foot { - font-size: 7pt; - margin-top: solid 2px #000; - padding-top: 5px; - padding-bottom: 5px; - text-align: center; - background: #000; - clear: both; -} -#ver { - margin-bottom: 25px; -} -#ip { - margin-top: 10px; - margin-bottom: 5px; -} -label { - display: block; - float: left; - padding-top: 4px; -} -th > label { - padding-top: 7px; -} -input:hover { - background-color: #d4dccd; -} -input.chk {margin-right: 0px; - border: 0px none; - height: 14px; -} -input.datos { - background-color: #f5f5f5; -} -input.datos_readonly { - background-color: #050505; -} -input.login { - border-color: #786; - background-color: #f5f5f5; - margin: 2px 0 8px; - width: 90px; -} -input.sub { - font-weight: bold; - border-bottom-color: #708090; - border-right-color: #708090; - -moz-border-radius: 5%; - font-size: 8pt; -} -input.next { - padding-right: 21px; - background: #e5e5e5 url(../../images/go.png) no-repeat right 2px; -} -input.upd { - padding-right: 21px; - background: #e5e5e5 url(../../images/upd.png) no-repeat right 3px; -} -input.wand { - padding-right: 21px; - background: #e5e5e5 url(../../images/wand.png) no-repeat right 3px; -} -input.delete { - padding-right: 21px; - background: #e5e5e5 url(../../images/cross.png) no-repeat right 3px; -} -input.search { - padding-right: 21px; - background: #e5e5e5 url(../../images/zoom.png) no-repeat right 3px; -} -input.copy { - padding-right: 21px; - background: #e5e5e5 url(../../images/copy.png) no-repeat right 3px; -} -input.ok { - padding-right: 21px; - background: #e5e5e5 url(../../images/ok.png) no-repeat right 3px; -} -table, img { - border: 0px; -} -th { - color: #fff; - background-color: #786; -} -td.datos, td.datost, td.datosb , td.datos_id, td.datosf9 { - background-color: #f9f9f9; -} -td.datos2, td.datos2t, td.datos2b, td.datos2_id , td.datos2f9 { - background-color: #efefef; -} -td.datos3 { - background-color: #d4ddc6; -} -td.datos_id { - color: #1a313a; -} -td.datos_jus, td.datos2_jus { - text-align: justify; -} -.bg { /* op menu */ - background-color: #786; -} -.bg2 { /* main page */ - background-color: #d84437; -} -.bg3 { /* godmode */ - background-color: #d84437; -} -.bg4 { /* links */ - background-color: #5385bf; -} -.bg, .bg2, .bg3, .bg4 { - position: relative; - height: 20px; - width: 100%; -} -.f10, #ip { - font-size: 7pt; - text-align: center; -} -.f9, .f9i, .f9b, td.f9, td.f9i, td.datosf9, td.datos2f9 { - font-size: 6.5pt; -} -.f9i, .redi { - font-style: italic; -} -.jus { - text-align: justify; - width: 700px; -} -.tit { - padding-top: 3px; -} -.tit, .titb { - font-weight: bold; - color: #fff; - text-align: center; -} -.suc { - color: #5a8629; - background: url(../../images/suc.png) no-repeat 1px; - padding: 4px 1px 6px 30px; -} -.error { - background: url(../../images/err.png) no-repeat; - padding: 4px 1px 6px 30px; -} -.red , .redb, .redi, .error { - color: #f00; -} -.sep { - margin-left: 30px; - border-bottom: 1px solid #708090; - width: 100%; -} -.green { - color: #5a8629; -} -.yellow { - color: #F3C500; -} -.greenb { - color: #00aa00; -} -.grey { - color: #808080; - font-weight: bold; -} -.redb, .greenb, td.datos_id, td.datos2_id, f9b { - font-weight: bold; -} -.p10 { - padding-top: 1px; - padding-bottom: 0px; -} -.p21 { - padding-top: 2px; - padding-bottom: 1px; -} -.w120 { - width: 120px; -} -.w130, #table-agent-configuration select { - width: 130px; -} -.w135 { - width: 135px; -} -.w155, #table_layout_data select { - width: 155px; -} -.top, .top_red, .bgt, td.datost, td.datos2t { - vertical-align: top; -} -.top_red { - background: #ff0000; -} -.bot, .titb, td.datosb { - vertical-align: bottom; -} -.msg { - margin-top: 15px; - text-align: justify; -} -ul.mn { - list-style: none; - padding: 0px 0px 0px 0px; - margin: 0px 0px 0px 0px; - line-height: 24px; -} -.gr { - font-size: 10pt; - font-weight: bold; -} -a.mn, .gr { - font-family: Arial, Verdana, sans-serif, Helvetica; -} -div.nf { - background: url(../../images/info.png) no-repeat; - color: #ac4444; - margin-left: 7px; - padding: 2px 1px 6px 25px; -} -div.title_line { - background-color: #4e682c; - height: 5px; - width: 762px; -} -#menu_tab_frame { - background: #D84437; - min-height: 22px; - padding-left: 0px; - float:right; - border-bottom: 1px solid #778866; -} -#menu_tab_frame_view { - background: #66AA44; - min-height: 22px; - padding-left: 0px; - float:right; - border-bottom: 1px solid #778866; -} -#menu_tab .mn, #menu_tab ul, #menu_tab .mn ul { - padding: 0px; - list-style: none; - margin: 0px; -} -#menu_tab .mn li { - float: right; - position: relative; -} -#menu_tab li a, #menu_tab li.nomn a { - background: #d4ddc6; - padding: 2px 10px 2px 10px; - color: #333; - border-left: 2px solid #778866; - font-weight: bold; - line-height: 18px; -} -#menu_tab li.nomn_high a { - background: #799E48; - color: #fff; - padding: 2px 10px 2px 10px; - border-left: 2px solid #778866; - font-weight: bold; - line-height: 18px; -} - -#menu_tab .mn li a { - display: block; - text-decoration: none; -} -#menu_tab li.nomn:hover a, li.nomn:hover_high a -#menu_tab li:hover ul a:hover { - background: #799E48; - color: #fff; -} -#menu_tab li:hover a { - background: #b2b08a url("../images/arrow.png") no-repeat right 3px; -} -#menu_tab li:hover ul a, #menu_tab .mn ul { - background: #db6351; - border-top: none; -} -/* TAB TITLE */ -#menu_tab_left .mn, #menu_tab_left ul, #menu_tab_left .mn ul { - padding: 0px 0px 0px 0px; - list-style: none; - margin: 0px 0px 0px 2px; -} -#menu_tab_left .mn li { - float: left; - position: relative; -} -#menu_tab_left li a { - background: #d84437; - padding: 2px 10px 2px 10px; - color: #fff; - font-weight: bold; - line-height: 18px; -} -#menu_tab_left .mn li a { - display: block; - text-decoration: none; -} -#menu_tab_left li.view a { - background: #6a4; - padding: 2px 10px 2px 10px; - color: #fff; - font-weight: bold; - line-height: 18px; -} -span.users { - background: url(../../images/group.png) no-repeat; -} -span.agents { - background: url(../../images/bricks.png) no-repeat; -} -span.data { - background: url(../../images/data.png) no-repeat; -} -span.alerts { - background: url(../../images/bell.png) no-repeat; -} -span.time { - background: url(../../images/hourglass.png) no-repeat; -} -span.net { - background: url(../../images/network.png) no-repeat; -} -span.master { - background: url(../../images/master.png) no-repeat; -} -span.wmi { - background: url(../../images/wmi.png) no-repeat; -} -span.prediction { - background: url(../../images/chart_bar.png) no-repeat; -} -span.plugin { - background: url(../../images/plugin.png) no-repeat; -} -span.export { - background: url(../../images/database_refresh.png) no-repeat; -} -span.snmp { - background: url(../../images/snmp.png) no-repeat; -} -span.binary { - background: url(../../images/binary.png) no-repeat; -} -span.recon { - background: url(../../images/recon.png) no-repeat; -} -span.rmess { - background: url(../../images/email_open.png) no-repeat; -} -span.nrmess { - background: url(../../images/email.png) no-repeat; -} - -/* This kind of span do not have any sense, should be replaced on PHP code -by a real img in code. They are not useful because insert too much margin around -(for example, not valid to use in the table of server view */ - -span.users, span.agents, span.data, span.alerts, span.time, span.net, -span.master, span.snmp, span.binary, span.recon, span.wmi, span.prediction, -span.plugin, span.plugin, span.export { - margin-left: 4px; - margin-top: 10px; - padding: 4px 8px 12px 30px; - display: block; -} -span.rmess, span.nrmess { - margin-left: 14px; - padding: 1px 0px 10px 30px; - display: block; -} -/* New styles for data box */ -.databox, .databox_color, .databox_frame { - margin-bottom: 15px; - margin-top: 5px; - margin-left: 0px; - border: 1px solid #f2f2f2; -} -.databox { - background-color: #fafafa; -} -.databox_color { - border-left: 4px solid #786; -} -#head_l { - float: left; - margin: 0; - padding: 0; -} -#head_r { - float: right; - text-align: right; - margin-right: 10px; - padding-top: 10px; -} -#head_m { - position: absolute; - padding-top: 6px; - padding-left: 200px; -} -span#logo_text1 { - font: bolder 3em Arial, Sans-serif; - letter-spacing: -2px; - color: #eee; -} -span#logo_text2 { - font: 3em Arial, Sans-serif; - letter-spacing: -2px; - color: #aaa; -} -.bb0 { - border-bottom: 0px; -} -.bt0 { - border-top: 0px; -} - -.action-buttons { - text-align: right; -} - -#table-add-item select, #table-add-sla select { - width: 180px; -} - -/* classes for event priorities. Sits now in functions.php */ -.datos_green, .datos_greenf9 { - background-color: #BBFFA4; -} - -.datos_red, .datos_redf9 { - background-color: #FFC0B5; -} - -.datos_yellow, .datos_yellowf9 { - background-color: #F4FFBF; -} - -.datos_blue, .datos_bluef9 { - background-color: #CDE2EA; -} - -.datos_grey, .datos_greyf9 { - background-color: #E4E4E4; -} - -.datos_greyf9, .datos_bluef9, .datos_greenf9, .datos_redf9, .datos_yellowf9 { - font-size: 6.5pt; -} - -td.datos_greyf9, td.datos_bluef9, td.datos_greenf9, td.datos_redf9, td.datos_yellowf9 { - padding: 5px 5px 5px 5px; -} -/* end of classes for event priorities */ - -div#main_pure { - background-color: #fefefe; - text-align: left; - margin-bottom: 25px; - margin-top: 10px; - margin-left: 10px; - margin-right: 10px; -} - -#table-agent-configuration radio { - margin-right: 40px; -} - -.ui-draggable { - cursor:move; -} - -#layout_trash_drop { - float: right; - width: 300px; - height: 180px; - background: #fff url("../../images/trash.png") no-repeat bottom left; -} - -#layout_trash_drop div { - display: block; -} - -#layout_editor_drop { - float: left; - width: 300px; -} - -.agent_reporting { - margin: 5px; - padding: 5px; -} - -.report_table, .agent_reporting { - border: #CCC outset 3px; -} - -.img_help { - cursor: help; -} -#loading { - position:fixed; - width: 200px; - margin-left: 35%; - text-align:center; - top:300px; - background-color: #999999; - padding: 20px; + width: auto; } diff --git a/pandora_console/operation/agentes/estado_agente.php b/pandora_console/operation/agentes/estado_agente.php index 96fb68648b..0d2ebe54cc 100644 --- a/pandora_console/operation/agentes/estado_agente.php +++ b/pandora_console/operation/agentes/estado_agente.php @@ -27,7 +27,7 @@ if (! give_acl ($config['id_user'], 0, "AR")) { exit; } -if (defined ('AJAX')) { +if (is_ajax ()) { $get_agent_module_last_value = (bool) get_parameter ('get_agent_module_last_value'); if ($get_agent_module_last_value) { diff --git a/pandora_console/operation/agentes/ver_agente.php b/pandora_console/operation/agentes/ver_agente.php index 135045385e..d16176795e 100644 --- a/pandora_console/operation/agentes/ver_agente.php +++ b/pandora_console/operation/agentes/ver_agente.php @@ -23,7 +23,7 @@ enterprise_include ('operation/agentes/ver_agente.php'); check_login (); -if (defined ('AJAX')) { +if (is_ajax ()) { $get_agent_json = (bool) get_parameter ('get_agent_json'); $get_agent_modules_json = (bool) get_parameter ('get_agent_modules_json'); $get_agent_status_tooltip = (bool) get_parameter ("get_agent_status_tooltip"); diff --git a/pandora_console/operation/events/events.php b/pandora_console/operation/events/events.php index 07024e3a27..13c54d7639 100644 --- a/pandora_console/operation/events/events.php +++ b/pandora_console/operation/events/events.php @@ -29,7 +29,7 @@ if (! give_acl ($config["id_user"], 0, "IR")) { return; } -if (defined ('AJAX')) { +if (is_ajax ()) { $get_event_tooltip = (bool) get_parameter ('get_event_tooltip'); if ($get_event_tooltip) { diff --git a/pandora_console/operation/menu.php b/pandora_console/operation/menu.php index 7a2396201c..9939149ae9 100644 --- a/pandora_console/operation/menu.php +++ b/pandora_console/operation/menu.php @@ -22,6 +22,8 @@ if (! isset ($config['id_user'])) { enterprise_include ('operation/menu.php'); +$menu['class'] = 'operation'; + // Agent read, Server read if (give_acl ($config['id_user'], 0, "AR")) { diff --git a/pandora_console/operation/messages/message.php b/pandora_console/operation/messages/message.php index 2146ca1508..5ef40b439e 100644 --- a/pandora_console/operation/messages/message.php +++ b/pandora_console/operation/messages/message.php @@ -133,7 +133,7 @@ if (isset ($_GET["new_msg"])) { //create message } if (isset ($_GET["read_message"]) || !isset ($_GET["new_msg"])) { - if (empty ($config["pure"]) && !defined ('AJAX')) { + if (empty ($config["pure"]) && !is_ajax ()) { echo "

    ".__('Messages')." > ".__('Message overview').'

    '; } @@ -145,7 +145,7 @@ if (isset ($_GET["read_message"]) || !isset ($_GET["new_msg"])) { $messages = get_message_overview ($order, $order_dir); - if ($num_messages > 0 && empty ($config["pure"]) && !defined ('AJAX')) { + if ($num_messages > 0 && empty ($config["pure"]) && !is_ajax ()) { echo '

    '.__('You have').' '.$num_messages.' '.print_image ("images/email.png", true).' '.__('unread message(s)').'.

    '; }