Revert "Add per-browser boxed layout setting"

This reverts commit c2683fb87bc50369753b279e179e7b5d0d1e60a9.

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER
2020-06-02 16:18:30 +02:00
committed by Adam Warner
parent 51dc473278
commit a4a678b584
4 changed files with 50 additions and 55 deletions

View File

@@ -162,37 +162,6 @@ function initCheckboxRadioStyle() {
}
}
function initBoxedLayout() {
function applyBoxedLayout(enabled) {
localStorage.setItem("boxedlayout", enabled);
if (enabled) {
$("body").addClass("layout-boxed");
} else {
$("body").removeClass("layout-boxed");
}
}
// Read from local storage, initialize if needed
var boxed = localStorage.getItem("boxedlayout");
if (boxed === null) {
boxed = true;
} else {
boxed = boxed === "true";
}
applyBoxedLayout(boxed);
// Add handler when on settings page
var boxedlayoutSelector = $("#boxedlayout-selector");
if (boxedlayoutSelector !== null) {
boxedlayoutSelector.prop("checked", boxed);
boxedlayoutSelector.change(function () {
var enabled = $(this).prop("checked");
applyBoxedLayout(enabled);
});
}
}
function initCPUtemp() {
function setCPUtemp(unit) {
localStorage.setItem("tempunit", tempunit);
@@ -250,7 +219,6 @@ $(function () {
// Apply per-browser styling settings
initCheckboxRadioStyle();
initBoxedLayout();
initCPUtemp();
if (typeof initpage === "function") {

View File

@@ -113,6 +113,35 @@
$token = $_SESSION['token'];
}
if(isset($setupVars['WEBUIBOXEDLAYOUT']))
{
if($setupVars['WEBUIBOXEDLAYOUT'] === "boxed")
{
$boxedlayout = true;
}
else
{
$boxedlayout = false;
}
}
else
{
$boxedlayout = true;
}
// Override layout setting if layout is changed via Settings page
if(isset($_POST["field"]))
{
if($_POST["field"] === "webUI" && isset($_POST["boxedlayout"]))
{
$boxedlayout = true;
}
elseif($_POST["field"] === "webUI" && !isset($_POST["boxedlayout"]))
{
$boxedlayout = false;
}
}
function pidofFTL()
{
return shell_exec("pidof pihole-FTL");
@@ -180,7 +209,7 @@
<script src="scripts/vendor/moment.min.js"></script>
<script src="scripts/vendor/Chart.min.js"></script>
</head>
<body class="hold-transition sidebar-mini">
<body class="hold-transition sidebar-mini <?php if($boxedlayout){ ?>layout-boxed<?php } ?>">
<noscript>
<!-- JS Warning -->
<div>

View File

@@ -538,6 +538,14 @@ function addStaticDHCPLease($mac, $ip, $hostname) {
{
pihole_execute('-a -e \''.$adminemail.'\'');
}
if(isset($_POST["boxedlayout"]))
{
pihole_execute('-a layout boxed');
}
else
{
pihole_execute('-a layout traditional');
}
if(isset($_POST["webtheme"]))
{
global $available_themes;