2006-03-27 05:37:27 +02:00
|
|
|
<?php
|
2008-08-22 20:07:32 +02:00
|
|
|
|
|
|
|
// Pandora FMS - the Flexible Monitoring System
|
2008-08-21 23:07:20 +02:00
|
|
|
// ============================================
|
2008-08-22 20:07:32 +02:00
|
|
|
// Copyright (c) 2008 Artica Soluciones Tecnologicas, http://www.artica.es
|
|
|
|
// Please see http://pandora.sourceforge.net for full contribution list
|
|
|
|
|
2007-03-02 18:56:07 +01:00
|
|
|
// This program is free software; you can redistribute it and/or
|
|
|
|
// modify it under the terms of the GNU General Public License
|
2008-08-22 20:07:32 +02:00
|
|
|
// as published by the Free Software Foundation for version 2.
|
2007-03-02 18:56:07 +01:00
|
|
|
// 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
|
2008-08-22 20:07:32 +02:00
|
|
|
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
|
2008-12-19 22:45:20 +01:00
|
|
|
if (! isset ($config["id_user"])) {
|
2008-08-21 23:07:20 +02:00
|
|
|
require ("general/login_page.php");
|
2009-02-04 17:07:43 +01:00
|
|
|
exit ();
|
2006-03-27 05:37:27 +02:00
|
|
|
}
|
2008-12-19 22:45:20 +01:00
|
|
|
|
|
|
|
//This is a helper function to print menu items
|
2009-02-04 17:07:43 +01:00
|
|
|
function temp_print_menu ($menu, $classtype) {
|
|
|
|
static $idcounter = 0;
|
2008-12-19 22:45:20 +01:00
|
|
|
|
2009-02-04 17:07:43 +01:00
|
|
|
echo '<div class="menu">';
|
|
|
|
|
|
|
|
$sec = (string) get_parameter ('sec');
|
|
|
|
$sec2 = (string) get_parameter ('sec2');
|
|
|
|
|
|
|
|
echo '<ul class="'.$classtype.'">';
|
2008-12-19 22:45:20 +01:00
|
|
|
|
|
|
|
foreach ($menu as $mainsec => $main) {
|
2009-02-04 17:07:43 +01:00
|
|
|
if (! isset ($main['id'])) {
|
|
|
|
$id = 'menu_'.++$idcounter;
|
|
|
|
} else {
|
|
|
|
$id = $main['id'];
|
2009-01-07 11:42:38 +01:00
|
|
|
}
|
|
|
|
|
2009-02-04 17:07:43 +01:00
|
|
|
$submenu = false;
|
2009-02-06 22:18:03 +01:00
|
|
|
$classes = array ();
|
2009-02-04 17:07:43 +01:00
|
|
|
if (isset ($main["sub"])) {
|
|
|
|
$classes[] = 'has_submenu';
|
|
|
|
$submenu = true;
|
2009-01-07 11:42:38 +01:00
|
|
|
}
|
2009-02-04 17:07:43 +01:00
|
|
|
if (!isset ($main["refr"]))
|
|
|
|
$main["refr"] = 0;
|
2008-12-19 22:45:20 +01:00
|
|
|
|
|
|
|
if ($sec == $mainsec) {
|
2009-02-04 17:07:43 +01:00
|
|
|
$classes[] = 'selected';
|
2008-12-19 22:45:20 +01:00
|
|
|
} else {
|
2009-02-04 17:07:43 +01:00
|
|
|
$classes[] = 'not_selected';
|
2008-12-19 22:45:20 +01:00
|
|
|
}
|
|
|
|
|
2009-02-04 17:07:43 +01:00
|
|
|
$output = '';
|
|
|
|
|
|
|
|
if (! $submenu) {
|
2009-02-06 22:18:03 +01:00
|
|
|
$main["sub"] = array (); //Empty array won't go through foreach
|
2009-02-04 17:07:43 +01:00
|
|
|
}
|
2008-12-19 22:45:20 +01:00
|
|
|
|
2009-02-04 17:07:43 +01:00
|
|
|
$submenu_output = '';
|
|
|
|
$selected = false;
|
2009-02-06 22:18:03 +01:00
|
|
|
$visible = false;
|
|
|
|
|
2008-12-19 22:45:20 +01:00
|
|
|
foreach ($main["sub"] as $subsec2 => $sub) {
|
|
|
|
//Set class
|
2009-02-04 17:07:43 +01:00
|
|
|
if ($sec2 == $subsec2 && isset ($sub[$subsec2]["options"])
|
2009-01-07 11:42:38 +01:00
|
|
|
&& (get_parameter_get ($sub[$subsec2]["options"]["name"]) == $sub[$subsec2]["options"]["value"])) {
|
2009-02-05 10:17:28 +01:00
|
|
|
//If the subclass is selected and there are options and that options value is true
|
|
|
|
$class = 'submenu_selected';
|
2009-02-04 17:07:43 +01:00
|
|
|
$selected = true;
|
|
|
|
$visible = true;
|
|
|
|
} elseif ($sec2 == $subsec2 && !isset ($sub[$subsec2]["options"])) {
|
2008-12-19 22:45:20 +01:00
|
|
|
//If the subclass is selected and there are no options
|
2009-02-05 10:17:28 +01:00
|
|
|
$class = 'submenu_selected';
|
2009-02-04 17:07:43 +01:00
|
|
|
$selected = true;
|
|
|
|
$visible = true;
|
2008-12-19 22:45:20 +01:00
|
|
|
} else {
|
2009-02-06 22:18:03 +01:00
|
|
|
//Else it's not selected
|
2009-02-05 10:17:28 +01:00
|
|
|
$class = 'submenu_not_selected';
|
2008-12-19 22:45:20 +01:00
|
|
|
}
|
|
|
|
|
2009-02-04 17:07:43 +01:00
|
|
|
if (! isset ($sub["refr"])) {
|
2009-01-07 11:42:38 +01:00
|
|
|
$sub["refr"] = 0;
|
|
|
|
}
|
|
|
|
|
2008-12-19 22:45:20 +01:00
|
|
|
if (isset ($sub["type"]) && $sub["type"] == "direct") {
|
|
|
|
//This is an external link
|
2009-02-06 22:18:03 +01:00
|
|
|
$submenu_output .= '<li class="'.$class.'"><a href="'.$subsec2.'">'.$sub["text"]."</a></li>";
|
2008-12-19 22:45:20 +01:00
|
|
|
} else {
|
|
|
|
//This is an internal link
|
2009-01-07 11:42:38 +01:00
|
|
|
if (isset ($sub[$subsec2]["options"])) {
|
2008-12-19 22:45:20 +01:00
|
|
|
$link_add = "&".$sub[$subsec2]["options"]["name"]."=".$sub[$subsec2]["options"]["value"];
|
|
|
|
} else {
|
|
|
|
$link_add = "";
|
|
|
|
}
|
2009-02-04 17:07:43 +01:00
|
|
|
$submenu_output .= '<li'.($class ? ' class="'.$class.'"' : '').'>';
|
2009-02-09 Evi Vanoost <vanooste@rcbi.rochester.edu>
* general/header.php, general/footer.php: Made it comply with standards
* general/main_menu.php: Fixed some typo's.
* include/javascript/jquery.pandora.js: This was loading an extension
that has a separate file already
* include/functions.php: Added process_page_head and process_page_body
these are callback functions for ob_start and add functionality like
conditional loading and external scripts in the correct places. Also adds
override functionality to certain items (like refresh) from anywhere
* include/javascript/time_en.js: Added as a placeholder
* extensions/update_manager.php: Fixed some typos
* operation/agentes/exportdata.php, operation/agentes/networkmap.php,
operation/events/events.php, operation/extensions.php,
operation/incidents/incident_detail.php,
operation/reporting/reporting_viewer.php,
operation/visual_console/render_view.php,
godmode/agentes/alert_manager.php,
godmode/agentes/module_manager_editor.php,
godmode/agentes/planned_downtime.php,
godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/groups/configure_group.php, godmode/reporting/graph_builder.php,
godmode/reporting/map_builder.php, godmode/reporting/reporting_builder.php
godmode/snmpconsole/snmp_alert.php: Changed javascript, css and jquery
loading to the new buffer callback handlers.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1436 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-02-09 19:41:54 +01:00
|
|
|
$submenu_output .= '<a href="index.php?sec='.$mainsec.'&sec2='.$subsec2.($main["refr"] ? '&refr='.$main["refr"] : '').$link_add.'"'.($class == 'submenu_selected' ? ' style="font-weight:bold;"' : '').'>'.$sub["text"].'</a>';
|
|
|
|
$submenu_output .= '</li>';
|
2008-12-19 22:45:20 +01:00
|
|
|
}
|
|
|
|
}
|
2009-02-04 17:07:43 +01:00
|
|
|
|
|
|
|
//Print out the first level
|
2009-02-06 22:18:03 +01:00
|
|
|
$output .= '<li class="'.implode (" ", $classes).'" id="icon_'.$id.'">';
|
|
|
|
$output .= '<a href="index.php?sec='.$mainsec.'&sec2='.$main["sec2"].($main["refr"] ? '&refr='.$main["refr"] : '').'"'.(($selected || in_array ("selected", $classes)) ? ' style="font-weight:bold;"' : '').'>'.$main["text"].'</a>';
|
|
|
|
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>';
|
2009-02-04 17:07:43 +01:00
|
|
|
}
|
|
|
|
$output .= '</li>';
|
|
|
|
echo $output;
|
2008-12-19 22:45:20 +01:00
|
|
|
}
|
2009-02-04 17:07:43 +01:00
|
|
|
echo '</ul>';
|
2008-12-19 22:45:20 +01:00
|
|
|
//Invisible UL for adding border-top
|
2009-02-06 22:18:03 +01:00
|
|
|
echo '<ul style="height: 0px;"><li> </li></ul></div>';
|
2008-12-19 22:45:20 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
echo '<div class="tit bg">:: '.__('Operation').' ::</div>';
|
|
|
|
$menu = array ();
|
|
|
|
require ("operation/menu.php");
|
2009-02-04 17:07:43 +01:00
|
|
|
temp_print_menu ($menu, "operation");
|
2008-12-19 22:45:20 +01:00
|
|
|
|
|
|
|
echo '<div class="tit bg3">:: '.__('Administration').' ::</div>';
|
|
|
|
$menu = array ();
|
2008-08-21 23:07:20 +02:00
|
|
|
require ("godmode/menu.php");
|
2009-02-04 17:07:43 +01:00
|
|
|
temp_print_menu ($menu, "godmode");
|
2008-12-19 22:45:20 +01:00
|
|
|
unset ($menu);
|
|
|
|
|
2008-08-21 23:07:20 +02:00
|
|
|
require ("links_menu.php");
|
2009-01-07 11:42:38 +01:00
|
|
|
?>
|
2009-02-09 22:00:13 +01:00
|
|
|
<script type="text/javascript" language="javascript">
|
|
|
|
$(document).ready( function() {
|
|
|
|
$("li.has_submenu").bind("mouseenter", function() {
|
|
|
|
$(this).children("ul").slideDown ("slow");
|
|
|
|
});
|
|
|
|
|
|
|
|
$("li.has_submenu.not_selected").click (function() {
|
|
|
|
$(this).children("ul").slideToggle ("slow");
|
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|