Read sidebar togglestate from cookie, conditonally load linkquality.js

This commit is contained in:
billz 2019-10-29 10:02:06 +00:00
parent f9b9329182
commit 7ca6a859ef
1 changed files with 7 additions and 2 deletions

View File

@ -45,9 +45,12 @@ if (!isset($_COOKIE['theme'])) {
} else { } else {
$theme = $_COOKIE['theme']; $theme = $_COOKIE['theme'];
} }
$theme_url = 'app/css/'.htmlspecialchars($theme, ENT_QUOTES); $theme_url = 'app/css/'.htmlspecialchars($theme, ENT_QUOTES);
if ($_COOKIE['sidebar'] == 'true' ) {
$toggleState = "toggled";
}
?><!DOCTYPE html> ?><!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
@ -99,7 +102,7 @@ $theme_url = 'app/css/'.htmlspecialchars($theme, ENT_QUOTES);
<!-- Page Wrapper --> <!-- Page Wrapper -->
<div id="wrapper"> <div id="wrapper">
<!-- Sidebar --> <!-- Sidebar -->
<ul class="navbar-nav sidebar sidebar-light d-none d-md-block accordion" id="accordionSidebar"> <ul class="navbar-nav sidebar sidebar-light d-none d-md-block accordion <?php echo $toggleState; ?>" id="accordionSidebar">
<!-- Sidebar - Brand --> <!-- Sidebar - Brand -->
<a class="sidebar-brand d-flex align-items-center justify-content-center" href="index.php?page=wlan0_info"> <a class="sidebar-brand d-flex align-items-center justify-content-center" href="index.php?page=wlan0_info">
<div class="sidebar-brand-icon"> <div class="sidebar-brand-icon">
@ -288,8 +291,10 @@ $theme_url = 'app/css/'.htmlspecialchars($theme, ENT_QUOTES);
<!-- Custom RaspAP JS --> <!-- Custom RaspAP JS -->
<script src="app/js/custom.js"></script> <script src="app/js/custom.js"></script>
<?php if ($page == "wlan0_info") { ?>
<!-- Link Quality Chart --> <!-- Link Quality Chart -->
<script src="app/js/linkquality.js"></script> <script src="app/js/linkquality.js"></script>
<?php }; ?>
<?php <?php
// Load non default JS/ECMAScript in footer. // Load non default JS/ECMAScript in footer.