mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
PSR2 Cleanup: /html edition
Travis tests for code conformance. Ignore warnings for now. Fixed all errors, left most warnings.
This commit is contained in:
@@ -46,8 +46,7 @@ if (!empty($_POST['type'])) {
|
||||
if ($_POST['type'] == 'generic') {
|
||||
$sql .= " AND ( type = ? OR type = '')";
|
||||
$param[] = $_POST['type'];
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$sql .= ' AND type = ?';
|
||||
$param[] = $_POST['type'];
|
||||
}
|
||||
@@ -57,8 +56,7 @@ if (!empty($_POST['state'])) {
|
||||
$sql .= ' AND status= ?';
|
||||
if (is_numeric($_POST['state'])) {
|
||||
$param[] = $_POST['state'];
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$param[] = str_replace(array('up', 'down'), array(1, 0), $_POST['state']);
|
||||
}
|
||||
}
|
||||
@@ -127,16 +125,14 @@ list($format, $subformat) = explode('_', $_POST['format']);
|
||||
foreach (dbFetchRows($sql, $param) as $device) {
|
||||
if (isset($bg) && $bg == $list_colour_b) {
|
||||
$bg = $list_colour_a;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$bg = $list_colour_b;
|
||||
}
|
||||
|
||||
if ($device['status'] == '0') {
|
||||
$extra = 'danger';
|
||||
$msg = $device['status_reason'];
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$extra = 'success';
|
||||
$msg = 'up';
|
||||
}
|
||||
@@ -197,8 +193,7 @@ foreach (dbFetchRows($sql, $param) as $device) {
|
||||
$os = $device['os_text'].'<br />'.$device['version'];
|
||||
if (extension_loaded('mbstring')) {
|
||||
$location = mb_substr($device['location'], 0, 32, 'utf8');
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$location = truncate($device['location'], 32, '');
|
||||
}
|
||||
|
||||
@@ -216,8 +211,7 @@ foreach (dbFetchRows($sql, $param) as $device) {
|
||||
if ($sensor_count) {
|
||||
$col_port .= ' <img src="images/icons/sensors.png" align=absmiddle /> '.$sensor_count;
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
}
|
||||
|
||||
$response[] = array(
|
||||
|
||||
Reference in New Issue
Block a user