2009-03-02 Esteban Sanchez <estebans@artica.es>

* 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
This commit is contained in:
esanchezm 2009-03-02 13:43:15 +00:00
parent 67d2e3bda9
commit 6c09f221bd
28 changed files with 342 additions and 871 deletions

View File

@ -1,3 +1,43 @@
2009-03-02 Esteban Sanchez <estebans@artica.es>
* 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 <estebans@artica.es> 2009-02-27 Esteban Sanchez <estebans@artica.es>
* godmode/groups/configure_group.php: Removed javascript console.log * godmode/groups/configure_group.php: Removed javascript console.log

View File

@ -21,116 +21,17 @@ if (! isset ($config["id_user"])) {
exit (); exit ();
} }
//This is a helper function to print menu items require_once ('include/functions_menu.php');
function temp_print_menu ($menu, $classtype) {
static $idcounter = 0;
echo '<div class="menu">';
$sec = (string) get_parameter ('sec');
$sec2 = (string) get_parameter ('sec2');
echo '<ul class="'.$classtype.'">';
foreach ($menu as $mainsec => $main) {
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 .= '<li class="'.$class.'"><a href="'.$subsec2.'">'.$sub["text"]."</a></li>";
} else {
//This is an internal link
if (isset ($sub[$subsec2]["options"])) {
$link_add = "&amp;".$sub[$subsec2]["options"]["name"]."=".$sub[$subsec2]["options"]["value"];
} else {
$link_add = "";
}
$submenu_output .= '<li'.($class ? ' class="'.$class.'"' : '').'>';
$submenu_output .= '<a href="index.php?sec='.$mainsec.'&amp;sec2='.$subsec2.($main["refr"] ? '&amp;refr='.$main["refr"] : '').$link_add.'">'.$sub["text"].'</a>';
$submenu_output .= '</li>';
}
}
//Print out the first level
$output .= '<li class="'.implode (" ", $classes).'" id="icon_'.$id.'">';
$output .= '<a href="index.php?sec='.$mainsec.'&amp;sec2='.$main["sec2"].($main["refr"] ? '&amp;refr='.$main["refr"] : '').'">'.$main["text"].'</a><img class="toggle" src="include/styles/images/toggle.png" alt="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 .= '<ul class="submenu'.($visible ? '' : ' invisible').'">';
$output .= $submenu_output;
$output .= '</ul>';
}
$output .= '</li>';
echo $output;
}
echo '</ul>';
//Invisible UL for adding border-top
echo '<ul style="height: 0px;"><li>&nbsp;</li></ul></div>';
}
echo '<div class="tit bg">:: '.__('Operation').' ::</div>'; echo '<div class="tit bg">:: '.__('Operation').' ::</div>';
$menu = array (); $menu = array ();
require ("operation/menu.php"); require ("operation/menu.php");
temp_print_menu ($menu, "operation"); print_menu ($menu);
echo '<div class="tit bg3">:: '.__('Administration').' ::</div>'; echo '<div class="tit bg3">:: '.__('Administration').' ::</div>';
$menu = array (); $menu = array ();
require ("godmode/menu.php"); require ("godmode/menu.php");
temp_print_menu ($menu, "godmode"); print_menu ($menu);
unset ($menu); unset ($menu);
require ("links_menu.php"); require ("links_menu.php");

View File

@ -16,7 +16,7 @@
// along with this program; if not, write to the Free Software // along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // 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'); $get_network_component = (bool) get_parameter ('get_network_component');
$snmp_walk = (bool) get_parameter ('snmp_walk'); $snmp_walk = (bool) get_parameter ('snmp_walk');
$get_module_component = (bool) get_parameter ('get_module_component'); $get_module_component = (bool) get_parameter ('get_module_component');

View File

@ -29,7 +29,7 @@ if (! give_acl ($config['id_user'], 0, "LM")) {
exit; exit;
} }
if (defined ('AJAX')) { if (is_ajax ()) {
$get_alert_action = (bool) get_parameter ('get_alert_action'); $get_alert_action = (bool) get_parameter ('get_alert_action');
if ($get_alert_action) { if ($get_alert_action) {
$id = (int) get_parameter ('id'); $id = (int) get_parameter ('id');

View File

@ -29,7 +29,7 @@ if (! give_acl ($config['id_user'], 0, "LM")) {
exit; exit;
} }
if (defined ('AJAX')) { if (is_ajax ()) {
$get_alert_command = (bool) get_parameter ('get_alert_command'); $get_alert_command = (bool) get_parameter ('get_alert_command');
if ($get_alert_command) { if ($get_alert_command) {
$id = (int) get_parameter ('id'); $id = (int) get_parameter ('id');

View File

@ -50,7 +50,7 @@ if ($delete_alert) {
$result = delete_alert_compound ($id); $result = delete_alert_compound ($id);
print_error_message ($result, __('Successfully deleted'), print_error_message ($result, __('Successfully deleted'),
__('Could not be deleted')); __('Could not be deleted'));
if (defined ('AJAX')) if (is_ajax ())
return; return;
} }
@ -59,7 +59,7 @@ if ($enable_alert) {
$result = set_alerts_compound_disable ($id, false); $result = set_alerts_compound_disable ($id, false);
print_error_message ($result, __('Successfully enabled'), print_error_message ($result, __('Successfully enabled'),
__('Could not be enabled')); __('Could not be enabled'));
if (defined ('AJAX')) if (is_ajax ())
return; return;
} }
@ -68,7 +68,7 @@ if ($disable_alert) {
$result = set_alerts_compound_disable ($id, true); $result = set_alerts_compound_disable ($id, true);
print_error_message ($result, __('Successfully disabled'), print_error_message ($result, __('Successfully disabled'),
__('Could not be disabled')); __('Could not be disabled'));
if (defined ('AJAX')) if (is_ajax ())
return; return;
} }

View File

@ -17,7 +17,7 @@
check_login (); check_login ();
if (defined ('AJAX')) { if (is_ajax ()) {
$get_agent_alerts_simple = (bool) get_parameter ('get_agent_alerts_simple'); $get_agent_alerts_simple = (bool) get_parameter ('get_agent_alerts_simple');
$disable_alert = (bool) get_parameter ('disable_alert'); $disable_alert = (bool) get_parameter ('disable_alert');
$enable_alert = (bool) get_parameter ('enable_alert'); $enable_alert = (bool) get_parameter ('enable_alert');

View File

@ -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'); $get_template_tooltip = (bool) get_parameter ('get_template_tooltip');
if ($get_template_tooltip) { if ($get_template_tooltip) {

View File

@ -29,7 +29,7 @@ if (! give_acl($config['id_user'], 0, "PM")) {
return; return;
} }
if (defined ('AJAX')) { if (is_ajax ()) {
$get_group_json = (bool) get_parameter ('get_group_json'); $get_group_json = (bool) get_parameter ('get_group_json');
$get_group_agents = (bool) get_parameter ('get_group_agents'); $get_group_agents = (bool) get_parameter ('get_group_agents');

View File

@ -24,6 +24,8 @@ if ((! give_acl ($config['id_user'], 0, "LM")) && (! give_acl ($config['id_user'
return; return;
} }
$menu['class'] = 'godmode';
if (give_acl ($config['id_user'], 0, "AW")) { if (give_acl ($config['id_user'], 0, "AW")) {
$menu["gagente"]["text"] = __('Manage agents'); $menu["gagente"]["text"] = __('Manage agents');
$menu["gagente"]["sec2"] = "godmode/agentes/modificar_agente"; $menu["gagente"]["sec2"] = "godmode/agentes/modificar_agente";

View File

@ -70,7 +70,7 @@ if ($create_layout) {
} else { } else {
echo '<h3 class="err">'.__('Not created. Error inserting data').'</h3>'; echo '<h3 class="err">'.__('Not created. Error inserting data').'</h3>';
} }
if (defined ('AJAX')) { if (is_ajax ()) {
exit; exit;
} }
} }
@ -110,7 +110,7 @@ if ($update_layout) {
} else { } else {
echo '<h3 class="err">'.__('Update layout failed').'</h3>'; echo '<h3 class="err">'.__('Update layout failed').'</h3>';
} }
if (defined ('AJAX')) { if (is_ajax ()) {
exit; exit;
} }
} }
@ -122,7 +122,7 @@ if ($get_background_info) {
$info['width'] = $info[0]; $info['width'] = $info[0];
$info['height'] = $info[1]; $info['height'] = $info[1];
} }
if (defined ('AJAX')) { if (is_ajax ()) {
echo json_encode ($info); echo json_encode ($info);
exit; exit;
} }
@ -134,7 +134,7 @@ if ($get_layout_data) {
if ($layout_data['id_agente_modulo']) if ($layout_data['id_agente_modulo'])
$layout_data['id_agent'] = give_agent_id_from_module_id ($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); echo json_encode ($layout_data);
exit; exit;
} }
@ -173,7 +173,7 @@ if ($create_layout_data) {
} else { } else {
echo '<h3 class="error">'.__('Not created. Error inserting data').'</h3>'; echo '<h3 class="error">'.__('Not created. Error inserting data').'</h3>';
} }
if (defined ('AJAX')) { if (is_ajax ()) {
exit; exit;
} }
} }
@ -191,7 +191,7 @@ if ($update_layout_data_coords) {
array ('pos_x' => $layout_data_x, 'pos_y' => $layout_data_y), array ('pos_x' => $layout_data_x, 'pos_y' => $layout_data_y),
array ('id' => $id_layout_data)); array ('id' => $id_layout_data));
if (defined ('AJAX')) { if (is_ajax ()) {
exit; exit;
} }
} }
@ -207,7 +207,7 @@ if ($delete_layout_data) {
process_sql_delete ('tlayout_data', array ('id' => $id_layout_data)); process_sql_delete ('tlayout_data', array ('id' => $id_layout_data));
} }
if (defined ('AJAX')) { if (is_ajax ()) {
exit; exit;
} }
} }

View File

@ -28,7 +28,7 @@ if (! give_acl ($config['id_user'], 0, "AW")) {
exit; exit;
} }
if (defined ('AJAX')) { if (is_ajax ()) {
$get_report_type_data_source = (bool) get_parameter ('get_report_type_data_source'); $get_report_type_data_source = (bool) get_parameter ('get_report_type_data_source');
if ($get_report_type_data_source) { if ($get_report_type_data_source) {

View File

@ -28,9 +28,7 @@ if (! give_acl ($config['id_user'], 0, "PM") || ! dame_admin ($config['id_user']
} }
// Load enterprise extensions // Load enterprise extensions
if (file_exists( $config["homedir"] . "/enterprise/godmode/setup/setup.php")) { enterprise_include ('godmode/setup/setup.php');
include $config["homedir"] . "/enterprise/godmode/setup/setup.php";
}
$update_settings = (bool) get_parameter ('update_settings'); $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'"); process_sql ("UPDATE tconfig SET VALUE='".$config["compact_header"]."' WHERE token = 'compact_header'");
} }
require_once ('include/functions_themes.php');
echo "<h2>".__('Setup')." &gt; "; echo "<h2>".__('Setup')." &gt; ";
echo __('General configuration')."</h2>"; echo __('General configuration')."</h2>";
$file_styles = list_files('include/styles/', "pandora", 1, 0);
$table->width = '90%'; $table->width = '90%';
$table->data = array (); $table->data = array ();
$table->data[0][0] = __('Language code for Pandora'); $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[11][1] = print_input_text ('loginhash_pwd', $config["loginhash_pwd"], '', 15, 15, true);
$table->data[13][0] = __('Style template'); $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][0] = __('Block size for pagination');
$table->data[14][1] = print_input_text ('block_size', $config["block_size"], '', 5, 5, true); $table->data[14][1] = print_input_text ('block_size', $config["block_size"], '', 5, 5, true);

View File

@ -895,4 +895,15 @@ function safe_sql_string ($string) {
return $string; return $string;
return mysql_escape_string ($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');
}
?> ?>

View File

@ -0,0 +1,128 @@
<?php
// Pandora FMS - the Flexible Monitoring System
// ============================================
// Copyright (c) 2008 Artica Soluciones Tecnologicas, http://www.artica.es
// Please see http://pandora.sourceforge.net for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public License (LGPL)
// as published by the Free Software Foundation for version 2.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
/**
* Prints a complete menu structure.
*
* @param array Menu structure to print.
*/
function print_menu (&$menu) {
static $idcounter = 0;
echo '<div class="menu">';
$sec = (string) get_parameter ('sec');
$sec2 = (string) get_parameter ('sec2');
echo '<ul'.(isset ($menu['class']) ? ' class="'.$menu['class'].'"' : '').'>';
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 .= '<li class="'.$class.'"><a href="'.$subsec2.'">'.$sub["text"]."</a></li>";
} else {
//This is an internal link
if (isset ($sub[$subsec2]["options"])) {
$link_add = "&amp;".$sub[$subsec2]["options"]["name"]."=".$sub[$subsec2]["options"]["value"];
} else {
$link_add = "";
}
$submenu_output .= '<li'.($class ? ' class="'.$class.'"' : '').'>';
$submenu_output .= '<a href="index.php?sec='.$mainsec.'&amp;sec2='.$subsec2.($main["refr"] ? '&amp;refr='.$main["refr"] : '').$link_add.'">'.$sub["text"].'</a>';
$submenu_output .= '</li>';
}
}
//Print out the first level
$output .= '<li class="'.implode (" ", $classes).'" id="icon_'.$id.'">';
$output .= '<a href="index.php?sec='.$mainsec.'&amp;sec2='.$main["sec2"].($main["refr"] ? '&amp;refr='.$main["refr"] : '').'">'.$main["text"].'</a><img class="toggle" src="include/styles/images/toggle.png" alt="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 .= '<ul class="submenu'.($visible ? '' : ' invisible').'">';
$output .= $submenu_output;
$output .= '</ul>';
}
$output .= '</li>';
echo $output;
}
echo '</ul>';
//Invisible UL for adding border-top
echo '<ul style="height: 0px;"><li>&nbsp;</li></ul></div>';
}
?>

View File

@ -0,0 +1,44 @@
<?php
// Pandora FMS - the Flexible Monitoring System
// ============================================
// Copyright (c) 2008 Artica Soluciones Tecnologicas, http://www.artica.es
// Please see http://pandora.sourceforge.net for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public License (LGPL)
// as published by the Free Software Foundation for version 2.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
/**
* Get a list of CSS themes installed.
*
* @return array An indexed array with the file name in the index and the theme
* name (if available) as the value.
*/
function get_css_themes () {
$theme_dir = 'include/styles/';
$files = list_files ($theme_dir, "pandora", 1, 0);
$retval = array ();
foreach ($files as $file) {
$data = implode ('', file ($theme_dir.'/'.$file));
preg_match ('|Name:(.*)$|mi', $data, $name);
if (isset ($name[1]))
$retval[$file] = trim ($name[1]);
else
$retval[$file] = $file;
}
return $retval;
}
?>

View File

@ -566,6 +566,7 @@ function process_page_head ($string, $bitfield) {
<meta name="keywords" content="pandora, monitoring, system, GPL, software" /> <meta name="keywords" content="pandora, monitoring, system, GPL, software" />
<meta name="robots" content="index, follow" /> <meta name="robots" content="index, follow" />
<link rel="icon" href="images/pandora.ico" type="image/ico" /> <link rel="icon" href="images/pandora.ico" type="image/ico" />
<link rel="stylesheet" href="include/styles/common.css" type="text/css"/>
<!--[if gte IE 6]> <!--[if gte IE 6]>
<link rel="stylesheet" href="include/styles/ie.css" type="text/css"/> <link rel="stylesheet" href="include/styles/ie.css" type="text/css"/>
<![endif]-->'; <![endif]-->';
@ -580,7 +581,7 @@ function process_page_head ($string, $bitfield) {
//Load CSS //Load CSS
if (empty ($config['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 //Style should go first

View File

@ -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%;
}

View File

@ -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 // Pandora FMS - the Flexible Monitoring System
// ============================================= // =============================================
// Copyright (c) 2004-2008 Sancho Lerena, slerena@gmail.comnt // Copyright (c) 2004-2008 Sancho Lerena, slerena@gmail.comnt
@ -855,26 +860,6 @@ ol.steps li.visited {
color: #999 !important; 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 { fieldset {
border: 2px solid #E9F3D2; border: 2px solid #E9F3D2;
padding: 0 0 0 10px; padding: 0 0 0 10px;
@ -908,34 +893,6 @@ div.actions_container label {
font-weight: normal; font-weight: normal;
font-style: italic; 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 styles */
.timeEntry_control { .timeEntry_control {

View File

@ -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 // Pandora FMS - the Free monitoring system
// ======================================== // ========================================
// Copyright (c) 2004-2007 Sancho Lerena, slerena@gmail.com // Copyright (c) 2004-2007 Sancho Lerena, slerena@gmail.com

View File

@ -1,4 +1,9 @@
/* /*
Author: The Pandora FMS team
Name: Minimal theme
Description: A minimal layout
// Pandora FMS - the Free monitoring system // Pandora FMS - the Free monitoring system
// ======================================== // ========================================
// Copyright (c) 2004-2007 Sancho Lerena, slerena@gmail.com // Copyright (c) 2004-2007 Sancho Lerena, slerena@gmail.com

View File

@ -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 // Pandora FMS - the Free monitoring system
// ======================================== // ========================================
// Copyright (c) 2004-2007 Sancho Lerena, slerena@gmail.com // Copyright (c) 2004-2007 Sancho Lerena, slerena@gmail.com

View File

@ -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 // Pandora FMS - the Free monitoring system
// ======================================== // ========================================
// Copyright (c) 2004-2007 Sancho Lerena, slerena@gmail.com // 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. // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/ */
@import url(op.css); @import url(pandora.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;
}
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 { div#container {
margin: 0 auto;
width: 95%; 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 { div#page {
background: #fff; width: auto;
clear: both;
border-bottom: solid 5px #786;
border-top: solid 5px #786;
background: #FFF;
} }
div#main { div#main {
width: auto; width: auto;
min-height: 800px; float: none;
float: both;
padding-left: 0px; padding-left: 0px;
padding-top: 0px; padding-top: 0px;
padding-bottom: 20px; padding-bottom: 20px;
margin-left: 180px; margin-left: 180px;
background-color: #fefefe; margin-right: 20px;
background-image: url(../../images/backgrounds/background4.jpg);
}
div#menu {
width: 155px;
float: left;
}
div#page>div#menu {
width: 157px;
} }
div#head { div#head {
font-size: 8pt; width: auto;
height: 60px;
background: url(../../images/header.jpg);
border-bottom: solid 2px #555;
} }
div#foot { div#foot {
font-size: 7pt; width: auto;
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;
} }

View File

@ -27,7 +27,7 @@ if (! give_acl ($config['id_user'], 0, "AR")) {
exit; exit;
} }
if (defined ('AJAX')) { if (is_ajax ()) {
$get_agent_module_last_value = (bool) get_parameter ('get_agent_module_last_value'); $get_agent_module_last_value = (bool) get_parameter ('get_agent_module_last_value');
if ($get_agent_module_last_value) { if ($get_agent_module_last_value) {

View File

@ -23,7 +23,7 @@ enterprise_include ('operation/agentes/ver_agente.php');
check_login (); check_login ();
if (defined ('AJAX')) { if (is_ajax ()) {
$get_agent_json = (bool) get_parameter ('get_agent_json'); $get_agent_json = (bool) get_parameter ('get_agent_json');
$get_agent_modules_json = (bool) get_parameter ('get_agent_modules_json'); $get_agent_modules_json = (bool) get_parameter ('get_agent_modules_json');
$get_agent_status_tooltip = (bool) get_parameter ("get_agent_status_tooltip"); $get_agent_status_tooltip = (bool) get_parameter ("get_agent_status_tooltip");

View File

@ -29,7 +29,7 @@ if (! give_acl ($config["id_user"], 0, "IR")) {
return; return;
} }
if (defined ('AJAX')) { if (is_ajax ()) {
$get_event_tooltip = (bool) get_parameter ('get_event_tooltip'); $get_event_tooltip = (bool) get_parameter ('get_event_tooltip');
if ($get_event_tooltip) { if ($get_event_tooltip) {

View File

@ -22,6 +22,8 @@ if (! isset ($config['id_user'])) {
enterprise_include ('operation/menu.php'); enterprise_include ('operation/menu.php');
$menu['class'] = 'operation';
// Agent read, Server read // Agent read, Server read
if (give_acl ($config['id_user'], 0, "AR")) { if (give_acl ($config['id_user'], 0, "AR")) {

View File

@ -133,7 +133,7 @@ if (isset ($_GET["new_msg"])) { //create message
} }
if (isset ($_GET["read_message"]) || !isset ($_GET["new_msg"])) { if (isset ($_GET["read_message"]) || !isset ($_GET["new_msg"])) {
if (empty ($config["pure"]) && !defined ('AJAX')) { if (empty ($config["pure"]) && !is_ajax ()) {
echo "<h2>".__('Messages')." &gt; ".__('Message overview').'</h2>'; echo "<h2>".__('Messages')." &gt; ".__('Message overview').'</h2>';
} }
@ -145,7 +145,7 @@ if (isset ($_GET["read_message"]) || !isset ($_GET["new_msg"])) {
$messages = get_message_overview ($order, $order_dir); $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 '<p>'.__('You have').' <b>'.$num_messages.'</b> '.print_image ("images/email.png", true).' '.__('unread message(s)').'.</p>'; echo '<p>'.__('You have').' <b>'.$num_messages.'</b> '.print_image ("images/email.png", true).' '.__('unread message(s)').'.</p>';
} }