minor fix menu
Former-commit-id: 6d0ca2d3d86af083c91a098326dc073d90187ab0
This commit is contained in:
parent
edefd16a21
commit
fb818064ed
|
@ -19,7 +19,7 @@ require_once 'include/functions_notifications.php';
|
|||
config_check();
|
||||
|
||||
|
||||
if ($_SESSION['menu_type'] == 'classic') {
|
||||
if ($config['menu_type'] == 'classic') {
|
||||
echo '<div id="header_table" class="header_table_classic">';
|
||||
} else {
|
||||
echo '<div id="header_table" class="header_table_collapsed">';
|
||||
|
|
|
@ -20,14 +20,12 @@ if (! isset($config['id_user'])) {
|
|||
<script type="text/javascript" language="javascript">
|
||||
|
||||
$(document).ready(function(){
|
||||
var menuType_value = localStorage.getItem("menuType");
|
||||
var menuType_value = "<?php echo $config['menu_type']; ?>";
|
||||
|
||||
if (menuType_value == 'classic') {
|
||||
$('ul.submenu').css('left', '214px');
|
||||
}
|
||||
else{
|
||||
if(menuType_value != 'collapsed'){
|
||||
localStorage.setItem("menuType", "collapsed");
|
||||
}
|
||||
$('ul.submenu').css('left', '59px');
|
||||
}
|
||||
});
|
||||
|
@ -47,11 +45,11 @@ if (isset($config['autohidden_menu']) && $config['autohidden_menu']) {
|
|||
}
|
||||
|
||||
// Menu container prepared to autohide menu
|
||||
|
||||
if ($_SESSION['menu_type']=='classic')
|
||||
if ($config['menu_type'] == 'classic') {
|
||||
echo '<div id="menu_full" class="menu_full_classic">';
|
||||
else
|
||||
} else {
|
||||
echo '<div id="menu_full" class="menu_full_collapsed">';
|
||||
}
|
||||
|
||||
$custom_logo = 'images/custom_logo/'.$config['custom_logo'];
|
||||
$custom_logo_collapsed = 'images/custom_logo/'.$config['custom_logo_collapsed'];
|
||||
|
@ -70,17 +68,19 @@ if (!defined('PANDORA_ENTERPRISE')) {
|
|||
|
||||
echo '<div class="logo_green"><a href="index.php?sec=main">';
|
||||
if (isset($config['custom_logo'])) {
|
||||
if ($_SESSION['menu_type']=='classic')
|
||||
if ($config['menu_type'] == 'classic') {
|
||||
echo html_print_image($custom_logo, true, ['border' => '0', 'width' => '215', 'alt' => $logo_title, 'class' => 'logo_full', 'style' => 'display:block']);
|
||||
else
|
||||
} else {
|
||||
echo html_print_image($custom_logo, true, ['border' => '0', 'width' => '215', 'alt' => $logo_title, 'class' => 'logo_full', 'style' => 'display:none']);
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($config['custom_logo_collapsed'])) {
|
||||
if ($_SESSION['menu_type']=='classic')
|
||||
if ($config['menu_type'] == 'classic') {
|
||||
echo html_print_image($custom_logo_collapsed, true, ['border' => '0', 'width' => '60', 'alt' => $logo_title, 'class' => 'logo_icon', 'style' => 'display:none']);
|
||||
else
|
||||
} else {
|
||||
echo html_print_image($custom_logo_collapsed, true, ['border' => '0', 'width' => '60', 'alt' => $logo_title, 'class' => 'logo_icon', 'style' => 'display:block']);
|
||||
}
|
||||
}
|
||||
|
||||
echo '</a></div>';
|
||||
|
@ -103,10 +103,11 @@ if (check_acl($config['id_user'], 0, 'AW')
|
|||
|
||||
require 'godmode/menu.php';
|
||||
|
||||
if ($_SESSION['menu_type']=='classic')
|
||||
if ($config['menu_type'] == 'classic') {
|
||||
echo '<div id="button_collapse" class="button_classic button_collapse"></div>';
|
||||
else
|
||||
} else {
|
||||
echo '<div id="button_collapse" class="button_collapsed button_collapse"></div>';
|
||||
}
|
||||
|
||||
// require ("links_menu.php");
|
||||
echo '</div>';
|
||||
|
|
|
@ -306,3 +306,9 @@ switch ($config['dbtype']) {
|
|||
}
|
||||
|
||||
// ======================================================================
|
||||
// Menu display mode.
|
||||
if ($_SESSION['menu_type']) {
|
||||
$config['menu_type'] = $_SESSION['menu_type'];
|
||||
} else {
|
||||
$config['menu_type'] = 'classic';
|
||||
}
|
||||
|
|
|
@ -1,26 +1,38 @@
|
|||
<?php
|
||||
|
||||
// Pandora FMS - http://pandorafms.com
|
||||
// ==================================================
|
||||
// Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
|
||||
// Please see http://pandorafms.org 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
|
||||
// as published by the Free Software Foundation; 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.
|
||||
|
||||
/**
|
||||
* @package Include
|
||||
* Auxiliary functions to manage menu.
|
||||
*
|
||||
* @category Include
|
||||
* @package Pandora FMS
|
||||
* @subpackage Menu
|
||||
* @version 1.0.0
|
||||
* @license See below
|
||||
*
|
||||
* ______ ___ _______ _______ ________
|
||||
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
||||
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2019 Artica Soluciones Tecnologicas
|
||||
* Please see http://pandorafms.org for full contribution list
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* 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.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
// Begin.
|
||||
global $config;
|
||||
|
||||
// Set session variable to store menu type (classic or collapsed) within this session
|
||||
// Set variable to store menu type (classic or collapsed).
|
||||
if (!empty(get_parameter('menuType'))) {
|
||||
$_SESSION['menu_type'] = get_parameter('menuType', 'classic');
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
@ -82,7 +94,7 @@ function menu_print_menu(&$menu)
|
|||
|
||||
$submenu = false;
|
||||
|
||||
if ($_SESSION['menu_type'] == 'classic') {
|
||||
if ($config['menu_type'] == 'classic') {
|
||||
$classes = [
|
||||
'menu_icon',
|
||||
'no_hidden_menu',
|
||||
|
@ -392,7 +404,7 @@ function menu_print_menu(&$menu)
|
|||
$length = strlen(__($main['text']));
|
||||
$padding_top = ( $length >= 18) ? 6 : 12;
|
||||
|
||||
if ($_SESSION['menu_type'] == 'classic') {
|
||||
if ($config['menu_type'] == 'classic') {
|
||||
$output .= '<div id="title_menu" class="title_menu_classic" style="padding-top:'.$padding_top.'px; display:none;">'.$main['text'].'</div>';
|
||||
} else {
|
||||
$output .= '<div id="title_menu" class="title_menu_collapsed" style="padding-top:'.$padding_top.'px; display:none;">'.$main['text'].'</div>';
|
||||
|
|
|
@ -1030,7 +1030,7 @@ if ($config['pure'] == 0) {
|
|||
echo '<div id="container"><div id="head">';
|
||||
include 'general/header.php';
|
||||
|
||||
if ($_SESSION['menu_type'] == 'classic') {
|
||||
if ($config['menu_type'] == 'classic') {
|
||||
echo '</div><div id="page" class="page_classic"><div id="menu">';
|
||||
} else {
|
||||
echo '</div><div id="page" class="page_collapsed"><div id="menu">';
|
||||
|
|
Loading…
Reference in New Issue