PHP8 support

This commit is contained in:
bergware
2023-02-04 17:10:53 +01:00
parent b60b3ffa4b
commit e3c69ae80c
3 changed files with 11 additions and 10 deletions

View File

@@ -1,6 +1,6 @@
<?PHP
/* Copyright 2005-2022, Lime Technology
* Copyright 2012-2022, Bergware International.
/* Copyright 2005-2023, Lime Technology
* Copyright 2012-2023, Bergware International.
* Copyright 2015, Dan Landon.
*
* This program is free software; you can redistribute it and/or
@@ -89,7 +89,7 @@ if (file_exists("/var/run/apcupsd.pid")) {
elseif (isset($load)) $status[5] = ($load<90 ? "<td $green>" : "<td $red>").$status[5]."</td>";
$status[6] = $output ? ((!$volt || ($minv<$output && $output<$maxv) ? "<td $green>" : "<td $red>").$status[6].($freq ? " ~ $freq Hz" : "")."</td>") : $status[6];
}
if (!$rows) $result[] = "<tr><td colspan='4' style='text-align:center'>"._('No information available')."</td></tr>";
if (empty($rows)) $result[] = "<tr><td colspan='4' style='text-align:center'>"._('No information available')."</td></tr>";
echo "<tr class='ups'>",implode($status),"</tr>\n",implode($result);
?>

View File

@@ -46,6 +46,7 @@ foreach ($other as $network) {
}
}
$include = $include6 = $address = $address6 = $gateway = $gateway6 = $unset = $protocol = [];
$wide = false;
foreach ($custom as $network) {
if (in_array($network,$slaves)) continue;
$ip4 = exec("ip -4 addr show $network|awk '/inet /{print $2;exit}'");

View File

@@ -3,8 +3,8 @@ Title="Parity Check"
Tag="calendar"
---
<?PHP
/* Copyright 2012-2020, Bergware International.
* Copyright 2005-2020, Lime Technology
/* Copyright 2012-2023, Bergware International.
* Copyright 2005-2023, Lime Technology
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License version 2,
@@ -199,8 +199,8 @@ _(Write corrections to parity disk)_:
_(Cumulative parity check)_:
: <select name="cumulative" onchange="showCumulative(this.value,'slow')" <?=$parity['mode']>1?'':'disabled'?>>
<?=mk_option($parity['cumulative'], "", _("No"))?>
<?=mk_option($parity['cumulative'], "1", _("Yes"))?>
<?=mk_option($parity['cumulative']??'', "", _("No"))?>
<?=mk_option($parity['cumulative']??'', "1", _("Yes"))?>
</select>
:parity_cumulative_check_help:
@@ -208,8 +208,8 @@ _(Cumulative parity check)_:
<div markdown="1" id="cumulative" style="display:none">
_(Accumulation frequency)_:
: <select name="frequency">
<?=mk_option($parity['frequency'], "1", _("Daily"))?>
<?=mk_option($parity['frequency'], "7", _("Weekly"),$parity['mode']==2 ? 'disabled' : '')?>
<?=mk_option($parity['frequency']??'', "1", _("Daily"))?>
<?=mk_option($parity['frequency']??'', "7", _("Weekly"),$parity['mode']==2 ? 'disabled' : '')?>
</select>
:parity_accumulation_frequency_help:
@@ -217,7 +217,7 @@ _(Accumulation frequency)_:
_(Accumulation duration)_:
: <select name="duration">
<?for ($h=1; $h<24; $h++):?>
<?=mk_option($parity['duration'], $h, $h.' '._('hour'.($h==1?'':'s')))?>
<?=mk_option($parity['duration']??'', $h, $h.' '._('hour'.($h==1?'':'s')))?>
<?endfor;?>
</select>