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
|
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.
|
2019-01-30 16:18:44 +01:00
|
|
|
if (! isset($config['id_user'])) {
|
|
|
|
include 'general/login_page.php';
|
|
|
|
exit();
|
2006-03-27 05:37:27 +02:00
|
|
|
}
|
2008-12-19 22:45:20 +01:00
|
|
|
|
2019-02-25 11:54:46 +01:00
|
|
|
?>
|
|
|
|
<script type="text/javascript" language="javascript">
|
|
|
|
|
|
|
|
$(document).ready(function(){
|
2019-02-26 10:43:59 +01:00
|
|
|
var menuType_value = localStorage.getItem("menuType");
|
2019-03-04 08:39:56 +01:00
|
|
|
if (menuType_value == 'collapsed' || menuType_value == '' || menuType_value == null || menuType_value == undefined) {
|
|
|
|
if(menuType_value == '' || menuType_value == null || menuType_value == undefined){
|
2019-02-26 10:43:59 +01:00
|
|
|
localStorage.setItem("menuType", "collapsed");
|
2019-02-25 11:54:46 +01:00
|
|
|
}
|
2019-03-04 08:39:56 +01:00
|
|
|
|
|
|
|
$('#menu_full').removeClass('menu_full_classic').addClass('menu_full_collapsed');
|
2019-02-25 11:54:46 +01:00
|
|
|
$('.logo_full').css('display','none');
|
|
|
|
$('.logo_icon').css('display','block');
|
|
|
|
$('div#title_menu').removeClass('title_menu_classic').addClass('title_menu_collapsed');
|
|
|
|
$('div#page').removeClass('page_classic').addClass('page_collapsed');
|
|
|
|
$('#header_table').removeClass('header_table_classic').addClass('header_table_collapsed');
|
|
|
|
$('#button_collapse').removeClass('button_classic').addClass('button_collapsed');
|
|
|
|
$('ul.submenu').css('left', '59px');
|
2019-03-04 08:39:56 +01:00
|
|
|
$('li.menu_icon').removeClass("no_hidden_menu").addClass('menu_icon_collapsed');
|
2019-02-25 11:54:46 +01:00
|
|
|
}
|
2019-03-04 08:39:56 +01:00
|
|
|
else if (menuType_value == 'classic') {
|
2019-02-25 11:54:46 +01:00
|
|
|
$('#menu_full').removeClass('menu_full_collapsed').addClass('menu_full_classic');
|
|
|
|
$('.logo_icon').css('display','none');
|
|
|
|
$('.logo_full').css('display','block');
|
|
|
|
$('div#title_menu').removeClass('title_menu_collapsed').addClass('title_menu_classic');
|
|
|
|
$('div#page').removeClass('page_collapsed').addClass('page_classic');
|
|
|
|
$('#header_table').removeClass('header_table_collapsed').addClass('header_table_classic');
|
|
|
|
$('#button_collapse').removeClass('button_collapsed').addClass('button_classic');
|
|
|
|
$('ul.submenu').css('left', '214px');
|
|
|
|
$('li.menu_icon').removeClass('menu_icon_collapsed').addClass("no_hidden_menu");
|
|
|
|
}
|
|
|
|
else{
|
|
|
|
console.log('else no ha elegido aun, default-else');
|
2019-02-26 10:43:59 +01:00
|
|
|
localStorage.setItem("menuType", "collapsed");
|
2019-02-25 11:54:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
// Set the height of the menu.
|
|
|
|
$(window).on('load', function (){
|
|
|
|
$("#menu_full").height($("#container").height());
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
</script>
|
|
|
|
<?php
|
2014-05-21 12:44:36 +02:00
|
|
|
$autohidden_menu = 0;
|
|
|
|
|
2019-01-30 16:18:44 +01:00
|
|
|
if (isset($config['autohidden_menu']) && $config['autohidden_menu']) {
|
|
|
|
$autohidden_menu = 1;
|
2014-05-21 12:44:36 +02:00
|
|
|
}
|
|
|
|
|
2013-02-20 14:48:46 +01:00
|
|
|
// Menu container prepared to autohide menu
|
2019-02-25 11:54:46 +01:00
|
|
|
echo '<div id="menu_full">';
|
|
|
|
|
|
|
|
echo '<div class="logo_green"><a href="index.php?sec=main">';
|
|
|
|
if (isset($config['custom_logo'])) {
|
2019-03-04 08:39:56 +01:00
|
|
|
echo html_print_image('images/custom_logo/'.$config['custom_logo'], true, ['border' => '0', 'width' => '215', 'alt' => 'Logo', 'class' => 'logo_full', 'style' => 'display:none']);
|
2019-02-25 11:54:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
if (isset($config['custom_logo_collapsed'])) {
|
2019-03-04 08:39:56 +01:00
|
|
|
echo html_print_image('images/custom_logo/'.$config['custom_logo_collapsed'], true, ['border' => '0', 'width' => '60', 'alt' => 'Logo', 'class' => 'logo_icon', 'style' => 'display:block']);
|
2019-02-25 11:54:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
echo '</a></div>';
|
2019-01-30 16:18:44 +01:00
|
|
|
|
|
|
|
// echo '<div class="tit bg titop">:: '.__('Operation').' ::</div>';
|
|
|
|
require 'operation/menu.php';
|
|
|
|
|
|
|
|
// Check all enterprise ACL used in godmenu items to print menu headers
|
|
|
|
if (check_acl($config['id_user'], 0, 'AW')
|
|
|
|
|| 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')
|
|
|
|
|| check_acl($config['id_user'], 0, 'EW')
|
|
|
|
|| check_acl($config['id_user'], 0, 'DW')
|
|
|
|
) {
|
|
|
|
// echo '<div class="tit bg3">:: '.__('Administration').' ::</div>';
|
2012-02-03 12:01:12 +01:00
|
|
|
}
|
|
|
|
|
2019-01-30 16:18:44 +01:00
|
|
|
require 'godmode/menu.php';
|
2009-02-10 21:29:45 +01:00
|
|
|
|
2019-02-25 11:54:46 +01:00
|
|
|
echo '<div id="button_collapse" class="button_collapse"></div>';
|
2019-03-04 08:39:56 +01:00
|
|
|
|
2019-02-25 11:54:46 +01:00
|
|
|
|
2019-01-30 16:18:44 +01:00
|
|
|
// require ("links_menu.php");
|
|
|
|
echo '</div>';
|
|
|
|
// menu_container
|
|
|
|
ui_require_jquery_file('cookie');
|
2019-03-04 08:39:56 +01:00
|
|
|
/*
|
|
|
|
$config_fixed_menu = false;
|
|
|
|
if (isset($config['fixed_menu'])) {
|
2019-01-30 16:18:44 +01:00
|
|
|
$config_fixed_menu = $config['fixed_menu'];
|
2019-03-04 08:39:56 +01:00
|
|
|
}*/
|
2019-01-30 16:18:44 +01:00
|
|
|
|
2014-09-16 12:40:05 +02:00
|
|
|
$config_fixed_header = false;
|
|
|
|
if (isset($config['fixed_header'])) {
|
2019-01-30 16:18:44 +01:00
|
|
|
$config_fixed_header = $config['fixed_header'];
|
2014-09-16 12:40:05 +02:00
|
|
|
}
|
2009-01-07 11:42:38 +01:00
|
|
|
?>
|
2015-03-26 13:12:48 +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[ */
|
2015-04-07 09:50:46 +02:00
|
|
|
|
2019-02-25 11:54:46 +01:00
|
|
|
|
|
|
|
|
2019-03-04 08:39:56 +01:00
|
|
|
//var classic_menu;
|
2019-02-25 11:54:46 +01:00
|
|
|
$('#button_collapse').on('click', function() {
|
|
|
|
if($('#menu_full').hasClass('menu_full_classic')){
|
2019-02-26 10:43:59 +01:00
|
|
|
localStorage.setItem("menuType", "collapsed");
|
2019-03-04 08:39:56 +01:00
|
|
|
$('ul.submenu').css('left', '59px');
|
2019-02-25 11:54:46 +01:00
|
|
|
}
|
|
|
|
else if($('#menu_full').hasClass('menu_full_collapsed')){
|
2019-02-26 10:43:59 +01:00
|
|
|
localStorage.setItem("menuType", "classic");
|
2019-03-04 08:39:56 +01:00
|
|
|
$('ul.submenu').css('left', '214px');
|
2019-02-25 11:54:46 +01:00
|
|
|
}
|
|
|
|
else{
|
|
|
|
console.log('else');
|
|
|
|
}
|
|
|
|
|
|
|
|
$('.logo_full').toggle();
|
|
|
|
$('.logo_icon').toggle();
|
|
|
|
$('#menu_full').toggleClass('menu_full_classic menu_full_collapsed');
|
|
|
|
$('#button_collapse').toggleClass('button_classic button_collapsed');
|
|
|
|
$('div#title_menu').toggleClass('title_menu_classic title_menu_collapsed');
|
|
|
|
$('div#page').toggleClass('page_classic page_collapsed');
|
|
|
|
$('#header_table').toggleClass('header_table_classic header_table_collapsed');
|
|
|
|
$('li.menu_icon').toggleClass("no_hidden_menu menu_icon_collapsed");
|
|
|
|
|
|
|
|
|
2019-03-04 08:39:56 +01:00
|
|
|
console.log('entra click: '+localStorage.menuType);
|
2019-02-25 11:54:46 +01:00
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-05-21 12:44:36 +02:00
|
|
|
var autohidden_menu = <?php echo $autohidden_menu; ?>;
|
2019-03-04 08:39:56 +01:00
|
|
|
//var fixed_menu =
|
|
|
|
<?php
|
|
|
|
// echo json_encode((bool) $config_fixed_menu);
|
|
|
|
?>
|
2019-03-04 09:52:05 +01:00
|
|
|
|
2019-01-30 16:18:44 +01:00
|
|
|
var fixed_header = <?php echo json_encode((bool) $config_fixed_header); ?>;
|
2014-08-05 15:16:54 +02:00
|
|
|
var id_user = "<?php echo $config['id_user']; ?>";
|
|
|
|
var cookie_name = id_user + '-pandora_menu_state';
|
|
|
|
var cookie_name_encoded = btoa(cookie_name);
|
2019-01-30 16:18:44 +01:00
|
|
|
var click_display = "<?php echo $config['click_display']; ?>";
|
2019-03-04 08:39:56 +01:00
|
|
|
//var classic_menu = parseInt("
|
|
|
|
<?php
|
|
|
|
// echo $config['classic_menu'];
|
|
|
|
?>
|
2019-03-04 09:52:05 +01:00
|
|
|
|
2019-03-04 08:39:56 +01:00
|
|
|
|
2017-02-13 13:50:28 +01:00
|
|
|
|
2019-02-25 11:54:46 +01:00
|
|
|
|
2014-05-21 12:44:36 +02:00
|
|
|
|
2014-08-05 15:16:54 +02:00
|
|
|
var menuState = $.cookie(cookie_name_encoded);
|
2014-08-04 14:17:13 +02:00
|
|
|
if (!menuState) {
|
2019-01-30 16:18:44 +01:00
|
|
|
menuState = {};
|
2014-08-04 14:17:13 +02:00
|
|
|
}
|
|
|
|
else {
|
2019-01-30 16:18:44 +01:00
|
|
|
menuState = JSON.parse(menuState);
|
|
|
|
open_submenus();
|
2014-08-04 18:50:36 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
function open_submenus () {
|
2019-01-30 16:18:44 +01:00
|
|
|
$.each(menuState, function (index, value) {
|
|
|
|
if (value)
|
|
|
|
$('div.menu>ul>li#' + index + '>ul').show();
|
|
|
|
});
|
|
|
|
$('div.menu>ul>li.selected>ul').removeClass('invisible');
|
2014-08-04 18:50:36 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
function close_submenus () {
|
2019-01-30 16:18:44 +01:00
|
|
|
$.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
|
|
|
}
|
|
|
|
|
2019-02-25 11:54:46 +01:00
|
|
|
|
2009-02-13 21:23:44 +01:00
|
|
|
/* ]]> */
|
2013-04-10 09:57:54 +02:00
|
|
|
</script>
|
2015-03-26 13:12:48 +01:00
|
|
|
|
|
|
|
<script type="text/javascript">
|
2019-01-30 16:18:44 +01:00
|
|
|
openTime = 0;
|
|
|
|
openTime2 = 0;
|
|
|
|
handsIn = 0;
|
|
|
|
handsIn2 = 0;
|
|
|
|
|
|
|
|
if(!click_display){
|
|
|
|
$('.menu_icon').mouseenter(function() {
|
|
|
|
table_hover = $(this);
|
|
|
|
handsIn = 1;
|
|
|
|
openTime = new Date().getTime();
|
|
|
|
$("ul#sub"+table_hover[0].id).show();
|
|
|
|
if( typeof(table_noHover) != 'undefined')
|
|
|
|
if ( "ul#sub"+table_hover[0].id != "ul#sub"+table_noHover[0].id )
|
|
|
|
$("ul#sub"+table_noHover[0].id).hide();
|
|
|
|
}).mouseleave(function() {
|
|
|
|
table_noHover = $(this);
|
|
|
|
handsIn = 0;
|
|
|
|
setTimeout(function() {
|
|
|
|
opened = new Date().getTime() - openTime;
|
|
|
|
if(opened > 3000 && handsIn == 0) {
|
|
|
|
openTime = 4000;
|
2019-02-25 11:54:46 +01:00
|
|
|
$("ul#sub"+table_noHover[0].id).hide(); //table_hover
|
2019-01-30 16:18:44 +01:00
|
|
|
}
|
|
|
|
}, 2500);
|
|
|
|
});
|
|
|
|
}else{
|
|
|
|
$(document).ready(function() {
|
|
|
|
if (autohidden_menu) {
|
|
|
|
$('.menu_icon').on("click", function() {
|
|
|
|
if( typeof(table_hover) != 'undefined'){
|
|
|
|
$("ul#sub"+table_hover[0].id).hide();
|
|
|
|
}
|
|
|
|
table_hover = $(this);
|
|
|
|
handsIn = 1;
|
|
|
|
openTime = new Date().getTime();
|
|
|
|
$("ul#sub"+table_hover[0].id).show();
|
|
|
|
}).mouseleave(function() {
|
|
|
|
table_noHover = $(this);
|
|
|
|
handsIn = 0;
|
|
|
|
setTimeout(function() {
|
|
|
|
opened = new Date().getTime() - openTime;
|
|
|
|
if(opened > 5000 && handsIn == 0) {
|
|
|
|
openTime = 6000;
|
2019-02-25 11:54:46 +01:00
|
|
|
$("ul#sub"+table_noHover[0].id).hide(); //table_hover
|
2019-01-30 16:18:44 +01:00
|
|
|
}
|
|
|
|
}, 5500);
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
$('.menu_icon').on("click", function() {
|
|
|
|
if( typeof(table_hover) != 'undefined'){
|
|
|
|
$("ul#sub"+table_hover[0].id).hide();
|
|
|
|
}
|
|
|
|
table_hover = $(this);
|
|
|
|
handsIn = 1;
|
|
|
|
openTime = new Date().getTime();
|
|
|
|
$("ul#sub"+table_hover[0].id).show();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2019-02-25 11:54:46 +01:00
|
|
|
$('.has_submenu').mouseenter(function() {
|
2019-01-30 16:18:44 +01:00
|
|
|
table_hover2 = $(this);
|
|
|
|
handsIn2 = 1;
|
|
|
|
openTime2 = new Date().getTime();
|
|
|
|
$("#sub"+table_hover2[0].id).show();
|
|
|
|
if( typeof(table_noHover2) != 'undefined')
|
|
|
|
if ( "ul#sub"+table_hover2[0].id != "ul#sub"+table_noHover2[0].id )
|
|
|
|
$("ul#sub"+table_noHover2[0].id).hide();
|
|
|
|
}).mouseleave(function() {
|
|
|
|
table_noHover2 = table_hover2;
|
|
|
|
handsIn2 = 0;
|
|
|
|
setTimeout(function() {
|
|
|
|
opened = new Date().getTime() - openTime2;
|
|
|
|
if(opened >= 3000 && handsIn2 == 0) {
|
|
|
|
openTime2 = 4000;
|
|
|
|
$("ul#sub"+table_hover2[0].id).hide();
|
|
|
|
}
|
|
|
|
}, 3500);
|
|
|
|
});
|
|
|
|
|
|
|
|
$(document).ready(function() {
|
2019-02-25 11:54:46 +01:00
|
|
|
|
2019-03-04 08:39:56 +01:00
|
|
|
if(!click_display){
|
|
|
|
$('#container').click(function() {
|
2019-01-30 16:18:44 +01:00
|
|
|
openTime = 4000;
|
|
|
|
if( typeof(table_hover) != 'undefined')
|
|
|
|
$("ul#sub"+table_hover[0].id).hide();
|
|
|
|
if( typeof(table_hover2) != 'undefined')
|
|
|
|
$("ul#sub"+table_hover2[0].id).hide();
|
2019-03-04 08:39:56 +01:00
|
|
|
|
|
|
|
console.log('m'); // cuando no es de click, pero pinchas (dentro o fuera) (¿sirve de algo?)
|
2019-01-30 16:18:44 +01:00
|
|
|
});
|
2019-03-04 08:39:56 +01:00
|
|
|
}else{
|
|
|
|
$('#main').click(function() {
|
2019-01-30 16:18:44 +01:00
|
|
|
openTime = 4000;
|
|
|
|
if( typeof(table_hover) != 'undefined')
|
|
|
|
$("ul#sub"+table_hover[0].id).hide();
|
|
|
|
if( typeof(table_hover2) != 'undefined')
|
|
|
|
$("ul#sub"+table_hover2[0].id).hide();
|
2019-03-04 08:39:56 +01:00
|
|
|
|
|
|
|
console.log('n'); //al pinchar fuera (es de click)
|
2019-01-30 16:18:44 +01:00
|
|
|
});
|
2019-03-04 08:39:56 +01:00
|
|
|
}
|
|
|
|
|
2019-01-30 16:18:44 +01:00
|
|
|
|
2019-03-04 08:39:56 +01:00
|
|
|
$('div.menu>ul>li>ul>li>a').click(function() {
|
|
|
|
openTime = 4000;
|
|
|
|
if( typeof(table_hover) != 'undefined')
|
|
|
|
$("ul#sub"+table_hover[0].id).hide();
|
|
|
|
if( typeof(table_hover2) != 'undefined')
|
|
|
|
$("ul#sub"+table_hover2[0].id).hide();
|
|
|
|
|
|
|
|
console.log('q'); //al pinchar en un enlace de un submenu
|
|
|
|
});
|
|
|
|
|
|
|
|
$('div.menu>ul>li>ul>li>ul>li>a').click(function() {
|
|
|
|
openTime = 4000;
|
|
|
|
if( typeof(table_hover) != 'undefined')
|
|
|
|
$("ul#sub"+table_hover[0].id).hide();
|
|
|
|
if( typeof(table_hover2) != 'undefined')
|
|
|
|
$("ul#sub"+table_hover2[0].id).hide();
|
|
|
|
|
|
|
|
console.log('r'); //al pinchar en un enlace de un sub-submenu
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|
2019-01-30 16:18:44 +01:00
|
|
|
|
2015-03-26 13:12:48 +01:00
|
|
|
</script>
|