Run PHP-CS-Fixer on all files

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER
2022-08-07 10:52:23 +02:00
parent 69e118ad45
commit 6ec4b8a529
47 changed files with 2643 additions and 2831 deletions

View File

@@ -14,39 +14,40 @@ $available_themes = array();
* Array[1] = Is this a dark mode theme? (Sets background to black during page reloading to avoid white "flashing")
* Array[2] = Style sheet name
*/
$available_themes["default-light"] = array("Pi-hole default theme (light, default)", false, "default-light");
$available_themes["default-dark"] = array("Pi-hole midnight theme (dark)", true, "default-dark");
$available_themes["default-darker"] = array("Pi-hole deep-midnight theme (dark)", true, "default-darker");
$available_themes['default-light'] = array('Pi-hole default theme (light, default)', false, 'default-light');
$available_themes['default-dark'] = array('Pi-hole midnight theme (dark)', true, 'default-dark');
$available_themes['default-darker'] = array('Pi-hole deep-midnight theme (dark)', true, 'default-darker');
// Option to have the theme go with the device dark mode setting, always set the background to black to avoid flashing
$available_themes["default-auto"] = array("Pi-hole auto theme (light/dark)", true, "default-auto");
$available_themes["lcars"] = array("Star Trek LCARS theme (dark)", true, "lcars");
$available_themes['default-auto'] = array('Pi-hole auto theme (light/dark)', true, 'default-auto');
$available_themes['lcars'] = array('Star Trek LCARS theme (dark)', true, 'lcars');
$webtheme = "";
$webtheme = '';
// Try to load theme settings from setupVars.conf
if(isset($setupVars['WEBTHEME']))
if (isset($setupVars['WEBTHEME'])) {
$webtheme = $setupVars['WEBTHEME'];
// May be overwritten by settings tab
if(isset($_POST["field"]) &&
$_POST["field"] === "webUI" &&
isset($_POST["webtheme"])) {
$webtheme = $_POST["webtheme"];
}
if(!array_key_exists($webtheme,$available_themes)) {
// May be overwritten by settings tab
if (isset($_POST['field'])
&& 'webUI' === $_POST['field']
&& isset($_POST['webtheme'])) {
$webtheme = $_POST['webtheme'];
}
if (!array_key_exists($webtheme, $available_themes)) {
// Fallback to default (light) theme is property is not set
// or requested theme is not among the available
$webtheme = "default-auto";
$webtheme = 'default-auto';
}
$darkmode = $available_themes[$webtheme][1];
$theme = $available_themes[$webtheme][2];
function theme_selection() {
function theme_selection()
{
global $available_themes, $webtheme;
foreach ($available_themes as $key => $value) {
?><div><input type="radio" name="webtheme" value="<?php echo $key; ?>" id="webtheme_<?php echo $key; ?>" <?php if ($key === $webtheme){ ?>checked<?php } ?>>
?><div><input type="radio" name="webtheme" value="<?php echo $key; ?>" id="webtheme_<?php echo $key; ?>" <?php if ($key === $webtheme) { ?>checked<?php } ?>>
<label for="webtheme_<?php echo $key; ?>"><strong><?php echo $value[0]; ?></strong></label></div>
<?php
}