Updated PHP to preferred "elseif" single statement

This commit is contained in:
bergware
2016-10-29 09:24:54 +02:00
parent 3f62efe64c
commit f00238ff43
7 changed files with 8 additions and 8 deletions
+1 -1
View File
@@ -148,7 +148,7 @@ foreach ($allVMs as $name) {
if (!empty($vmtemplateicon)) {
if (file_exists($vmtemplateicon)) {
$vmicon = $vmtemplateicon;
} else if (file_exists("$docroot/plugins/dynamix.vm.manager/templates/images/" . $vmtemplateicon)) {
} elseif (file_exists("$docroot/plugins/dynamix.vm.manager/templates/images/" . $vmtemplateicon)) {
$vmicon = '/plugins/dynamix.vm.manager/templates/images/' . $vmtemplateicon;
}
}
+1 -1
View File
@@ -34,7 +34,7 @@ function show_map($menu, $level) {
$link="<a href='/{$page['name']}'>{$page['name']}</a>";
if ($page['Type'] == "menu") {
echo "{$level} ({$link}) - {$page['Title']}<br>";
} else if ($page['Type'] == "xmenu") {
} elseif ($page['Type'] == "xmenu") {
echo "{$level} [{$link}] - {$page['Title']}<br>";
} else {
echo "{$level} {$link} - {$page['Title']}<br>";
+1 -1
View File
@@ -27,7 +27,7 @@ if ($name == "") {
"exclude" => "",
"useCache" => "no",
"cow" => "auto"];
} else if (array_key_exists($name, $shares)) {
} elseif (array_key_exists($name, $shares)) {
/* edit existing share */
$share = $shares[$name];
} else {
+1 -1
View File
@@ -181,7 +181,7 @@ case 'port':
$mtu = file_get_contents("/sys/class/net/$port/mtu");
if (substr($port,0,4)=='bond') {
$ports[$i++] = exec("grep -Pom1 '^Bonding Mode: \K.+' /proc/net/bonding/$port").", mtu $mtu";
} else if ($port=='lo') {
} elseif ($port=='lo') {
$ports[$i++] = str_replace('yes','loopback',exec("ethtool lo|grep -Pom1 '^\s+Link detected: \K.+'"));
} else {
unset($info);
+1 -1
View File
@@ -92,7 +92,7 @@ function fs_info(&$disk) {
if ($disk['fsStatus']=='-') {
echo "<td colspan='5'></td>";
return;
} else if ($disk['fsStatus']=='Mounted') {
} elseif ($disk['fsStatus']=='Mounted') {
echo "<td>{$disk['fsType']}</td>";
echo "<td>".my_scale($disk['fsSize']*1024,$unit)." $unit</td>";
if ($display['text']%10==0) {
+2 -2
View File
@@ -69,8 +69,8 @@ case "attributes":
$color = "";
$highlight = strpos($info[8],'FAILING_NOW')!==false || ($select ? $info[5]>0 && $info[3]<=$info[5]*$level : $info[9]>0);
if (in_array($info[0], $events) && $highlight) $color = " class='warn'";
else if (in_array($info[0], $temps)) {
if ($info[9]>=$max) $color = " class='alert'"; else if ($info[9]>=$hot) $color = " class='warn'";
elseif (in_array($info[0], $temps)) {
if ($info[9]>=$max) $color = " class='alert'"; elseif ($info[9]>=$hot) $color = " class='warn'";
}
if ($info[8]=='-') $info[8] = 'Never';
if ($info[0]==9 && is_numeric($info[9])) duration($info[9]);
+1 -1
View File
@@ -338,7 +338,7 @@ if ($retval===0) {
exec("$notify -e \"Docker critical image disk utilization\" -s \"Alert [$server] - Docker image disk utilization of ${warn}%\" -d \"$info\" -i \"alert\"");
$saved[$item][$name] = $warn;
}
} else if ($warn>=$high2 && $high2>0) {
} elseif ($warn>=$high2 && $high2>0) {
if ($warn>$last) {
exec("$notify -e \"Docker high image disk utilization\" -s \"Warning [$server] - Docker image disk utilization of ${warn}%\" -d \"$info\" -i \"warning\"");
$saved[$item][$name] = $warn;