2006-03-27 05:37:27 +02:00
|
|
|
<?php
|
2008-08-22 20:07:32 +02:00
|
|
|
|
2009-06-08 20:26:14 +02:00
|
|
|
// Pandora FMS - http://pandorafms.com
|
|
|
|
// ==================================================
|
2011-03-17 Raul Mateos <raulofpandora@gmail.com>
* extensions/dbmanager.php, extensions/pandora_logs.php, general/*.php,
index.php, ajax.php, operation/search_*.php, operation/menu.php,
operation/extensions.php, godmode/menu.php, godmode/extensions.php,
admin_access_logs.php: Cleaned code and updated page disclaimers.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4108 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2011-03-17 23:01:01 +01:00
|
|
|
// Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
|
|
|
|
// Please see http://pandorafms.org for full contribution list
|
2008-08-22 20:07:32 +02:00
|
|
|
|
2007-03-02 18:56:07 +01:00
|
|
|
// This program is free software; you can redistribute it and/or
|
2011-03-23 Raul Mateos <raulofpandora@gmail.com>
* extensions/ssh_console.php, extensions/vnc_view.php,
extensions/update_manager.php, extensions/users_connected.php,
extensions/extension_uploader.php, extensions/insert_data.php,
extensions/module_groups.php, extensions/plugin_registration.php,
extensions/agent_modules.php, extensions/resource_registration.php,
extensions/resource_exportation.php, extensions/dbmanager.php,
extensions/pandora_logs.php, general/*.php, ajax.php,
operation/search_*.php, operation/menu.php, operation/extensions.php,
godmode/menu.php, godmode/extensions.php, godmode/admin_access_logs.php:
CReverted unwanted license changes.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4126 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2011-03-23 17:13:28 +01:00
|
|
|
// modify it under the terms of the GNU General Public License
|
2011-03-17 Raul Mateos <raulofpandora@gmail.com>
* extensions/dbmanager.php, extensions/pandora_logs.php, general/*.php,
index.php, ajax.php, operation/search_*.php, operation/menu.php,
operation/extensions.php, godmode/menu.php, godmode/extensions.php,
admin_access_logs.php: Cleaned code and updated page disclaimers.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4108 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2011-03-17 23:01:01 +01:00
|
|
|
// as published by the Free Software Foundation; 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
|
2011-03-17 Raul Mateos <raulofpandora@gmail.com>
* extensions/dbmanager.php, extensions/pandora_logs.php, general/*.php,
index.php, ajax.php, operation/search_*.php, operation/menu.php,
operation/extensions.php, godmode/menu.php, godmode/extensions.php,
admin_access_logs.php: Cleaned code and updated page disclaimers.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4108 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2011-03-17 23:01:01 +01:00
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
2007-03-02 18:56:07 +01:00
|
|
|
// GNU General Public License for more details.
|
2009-06-08 20:26:14 +02:00
|
|
|
|
2008-08-22 20:07:32 +02:00
|
|
|
|
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
|
|
|
|
2014-05-21 12:44:36 +02:00
|
|
|
$autohidden_menu = 0;
|
|
|
|
|
|
|
|
if (isset ($config["autohidden_menu"]) && $config["autohidden_menu"]) {
|
|
|
|
$autohidden_menu = 1;
|
|
|
|
}
|
|
|
|
|
2014-05-27 10:57:20 +02:00
|
|
|
$menu_container_id = '';
|
2014-05-21 12:44:36 +02:00
|
|
|
if ($autohidden_menu) {
|
|
|
|
$menu_container_id = 'menu_container';
|
|
|
|
}
|
|
|
|
|
2013-02-20 14:48:46 +01:00
|
|
|
// Menu container prepared to autohide menu
|
2014-05-21 12:44:36 +02:00
|
|
|
echo '<div id="' . $menu_container_id . '">';
|
2013-02-20 14:48:46 +01:00
|
|
|
|
2013-04-10 09:57:54 +02:00
|
|
|
echo '<div class="tit bg titop">:: '.__('Operation').' ::</div>';
|
2008-12-19 22:45:20 +01:00
|
|
|
require ("operation/menu.php");
|
|
|
|
|
2012-02-03 12:01:12 +01:00
|
|
|
//Check all enterprise ACL used in godmenu items to print menu headers
|
|
|
|
if (check_acl ($config['id_user'], 0, "AW") ||
|
2012-07-10 11:21:19 +02:00
|
|
|
check_acl ($config['id_user'], 0, "PM") ||
|
|
|
|
check_acl ($config['id_user'], 0, "LM") ||
|
|
|
|
check_acl ($config['id_user'], 0, "UM") ||
|
|
|
|
check_acl ($config['id_user'], 0, "LW") ||
|
|
|
|
check_acl ($config['id_user'], 0, "IW") ||
|
2012-12-28 18:06:17 +01:00
|
|
|
check_acl ($config['id_user'], 0, "EW") ||
|
2012-07-10 11:21:19 +02:00
|
|
|
check_acl ($config['id_user'], 0, "DW")) {
|
|
|
|
|
|
|
|
echo '<div class="tit bg3">:: '.__('Administration').' ::</div>';
|
2012-02-03 12:01:12 +01:00
|
|
|
}
|
|
|
|
|
2008-08-21 23:07:20 +02:00
|
|
|
require ("godmode/menu.php");
|
2008-12-19 22:45:20 +01:00
|
|
|
|
2008-08-21 23:07:20 +02:00
|
|
|
require ("links_menu.php");
|
2009-02-10 21:29:45 +01:00
|
|
|
|
2013-02-20 14:48:46 +01:00
|
|
|
echo '</div>'; //menu_container
|
|
|
|
|
2011-04-13 18:11:02 +02:00
|
|
|
ui_require_jquery_file ('cookie');
|
2009-01-07 11:42:38 +01:00
|
|
|
?>
|
2009-02-09 22:00:13 +01:00
|
|
|
<script type="text/javascript" language="javascript">
|
2009-02-13 21:23:44 +01:00
|
|
|
/* <![CDATA[ */
|
2014-05-21 12:44:36 +02:00
|
|
|
|
|
|
|
var autohidden_menu = <?php echo $autohidden_menu; ?>;
|
2014-08-04 18:50:36 +02:00
|
|
|
var fixed_menu = <?php echo json_encode((bool)$config['fixed_menu']); ?>;
|
2014-05-21 12:44:36 +02:00
|
|
|
|
2014-08-04 14:17:13 +02:00
|
|
|
var menuState = $.cookie(btoa('pandora_menu_state'));
|
|
|
|
if (!menuState) {
|
|
|
|
menuState = {};
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
menuState = JSON.parse(menuState);
|
2014-08-04 18:50:36 +02:00
|
|
|
open_submenus();
|
|
|
|
}
|
|
|
|
|
|
|
|
function open_submenus () {
|
2014-08-04 14:17:13 +02:00
|
|
|
$.each(menuState, function (index, value) {
|
|
|
|
if (value)
|
|
|
|
$('div.menu>ul>li#' + index + '>ul').show();
|
|
|
|
});
|
2014-08-04 18:50:36 +02:00
|
|
|
$('div.menu>ul>li.selected>ul').removeClass('invisible');
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function close_submenus () {
|
|
|
|
$.each(menuState, function (index, value) {
|
|
|
|
if (value)
|
|
|
|
$('div.menu>ul>li#' + index + '>ul').hide();
|
|
|
|
});
|
|
|
|
$('div.menu>ul>li.selected>ul').addClass('invisible');
|
2014-08-04 14:17:13 +02:00
|
|
|
}
|
|
|
|
|
2009-02-09 22:00:13 +01:00
|
|
|
$(document).ready( function() {
|
2014-08-04 18:50:36 +02:00
|
|
|
|
2014-08-04 14:17:13 +02:00
|
|
|
$("img.toggle").click (function (e) {
|
2009-02-11 17:55:04 +01:00
|
|
|
//In case the links gets activated, we don't want to follow link
|
2014-08-04 14:17:13 +02:00
|
|
|
e.preventDefault();
|
|
|
|
|
|
|
|
var menuItem = $(this).parent();
|
|
|
|
var submenu = menuItem.children("ul");
|
|
|
|
|
|
|
|
if (submenu.is(":visible")) {
|
|
|
|
submenu.slideUp();
|
|
|
|
|
|
|
|
if (typeof menuState[menuItem.attr('id')] != 'undefined')
|
|
|
|
delete menuState[menuItem.attr('id')];
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
submenu.slideDown();
|
|
|
|
|
|
|
|
menuState[menuItem.attr('id')] = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
$.cookie(btoa('pandora_menu_state'), JSON.stringify(menuState), {expires: 7});
|
2009-02-09 22:00:13 +01:00
|
|
|
});
|
2013-02-20 14:48:46 +01:00
|
|
|
|
2014-08-04 18:50:36 +02:00
|
|
|
if (fixed_menu) {
|
|
|
|
$('div#menu')
|
|
|
|
.css('position', 'fixed')
|
|
|
|
.css('z-index', '9000')
|
|
|
|
.css('left', '0')
|
|
|
|
.css('top', $('div#head').innerHeight() + 'px')
|
|
|
|
.css('height', '100%')
|
|
|
|
.css('overflow', 'hidden')
|
|
|
|
.hover(function (e) {
|
|
|
|
if (!autohidden_menu) {
|
|
|
|
$(this).css('overflow', 'auto').children('div').css('width', 'auto');
|
|
|
|
}
|
|
|
|
}, function (e) {
|
|
|
|
if (!autohidden_menu) {
|
|
|
|
$(this).css('overflow', 'hidden').children('div').css('width', '100%');
|
|
|
|
}
|
|
|
|
})
|
|
|
|
.children('div')
|
|
|
|
.css('margin-bottom', $('div#head').innerHeight() + 'px');
|
|
|
|
}
|
|
|
|
|
|
|
|
if (autohidden_menu) {
|
|
|
|
|
|
|
|
$('#menu_container').hover (handlerIn, handlerOut);
|
|
|
|
var openTime = 0;
|
|
|
|
var handsIn = 0;
|
|
|
|
|
|
|
|
$('#main').css('margin-left', '50px');
|
|
|
|
hide_menu_pretty();
|
|
|
|
|
|
|
|
function handlerIn() {
|
|
|
|
handsIn = 1;
|
|
|
|
if (openTime == 0) {
|
|
|
|
show_menu();
|
|
|
|
openTime = new Date().getTime();
|
|
|
|
|
|
|
|
// Close in 1 second if is not closed manually
|
|
|
|
setTimeout(function() {
|
|
|
|
if(openTime > 0 && handsIn == 0) {
|
|
|
|
hide_menu();
|
|
|
|
openTime = 0;
|
|
|
|
}
|
|
|
|
}, 1000);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function handlerOut() {
|
|
|
|
handsIn = 0;
|
|
|
|
var openedTime = new Date().getTime() - openTime;
|
2013-02-20 14:48:46 +01:00
|
|
|
|
2014-08-04 18:50:36 +02:00
|
|
|
if (openedTime > 1000) {
|
|
|
|
hide_menu();
|
|
|
|
openTime = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function show_menu () {
|
|
|
|
$('#menu_container').animate({"left": "+=80px"}, 200, function () {
|
|
|
|
if (fixed_menu) {
|
|
|
|
$('#menu_container').parent().css('overflow', 'auto');
|
2013-02-20 14:48:46 +01:00
|
|
|
}
|
2014-08-04 18:50:36 +02:00
|
|
|
});
|
|
|
|
show_menu_pretty();
|
2013-02-20 14:48:46 +01:00
|
|
|
}
|
|
|
|
|
2014-08-04 18:50:36 +02:00
|
|
|
function show_menu_pretty() {
|
|
|
|
open_submenus();
|
|
|
|
$('div.menu ul li').css('background-position', '');
|
|
|
|
$('ul.submenu li a, li.menu_icon a, li.links a, div.menu>ul>li>img.toggle').show();
|
|
|
|
$('.titop').css('color', 'white');
|
|
|
|
$('.bg3').css('color', 'white');
|
|
|
|
$('.bg4').css('color', 'white');
|
|
|
|
}
|
|
|
|
|
|
|
|
function hide_menu () {
|
|
|
|
if (fixed_menu) {
|
|
|
|
$('#menu_container').parent().css('overflow', 'hidden');
|
|
|
|
}
|
|
|
|
$('#menu_container').animate({"left": "-=80px"}, 100);
|
|
|
|
hide_menu_pretty();
|
|
|
|
}
|
|
|
|
|
|
|
|
function hide_menu_pretty() {
|
|
|
|
close_submenus();
|
|
|
|
$('div.menu li').css('background-position', '85px 5px');
|
|
|
|
$('ul.submenu li a, li.menu_icon a, li.links a, div.menu>ul>li>img.toggle').hide();
|
|
|
|
$('.titop').css('color', $('.titop').css('background-color'));
|
|
|
|
$('.bg3').css('color', $('.bg3').css('background-color'));
|
|
|
|
$('.bg4').css('color', $('.bg4').css('background-color'));
|
2013-02-20 14:48:46 +01:00
|
|
|
}
|
2014-05-21 12:44:36 +02:00
|
|
|
}
|
2009-02-09 22:00:13 +01:00
|
|
|
});
|
2009-02-13 21:23:44 +01:00
|
|
|
/* ]]> */
|
2013-04-10 09:57:54 +02:00
|
|
|
</script>
|