summaryrefslogtreecommitdiffstats
path: root/modules-available/locations
diff options
context:
space:
mode:
authorSimon Rettberg2021-03-17 10:49:20 +0100
committerSimon Rettberg2021-03-17 10:49:20 +0100
commit778cb1bbe477c7703c5c7a4d112e362091409c0f (patch)
treeb376138138f534550c7594f87b9fa4a0a2a60a22 /modules-available/locations
parent[rebootcontrol] Handle scheduler overlaps (diff)
downloadslx-admin-778cb1bbe477c7703c5c7a4d112e362091409c0f.tar.gz
slx-admin-778cb1bbe477c7703c5c7a4d112e362091409c0f.tar.xz
slx-admin-778cb1bbe477c7703c5c7a4d112e362091409c0f.zip
[locations/rebootcontrol] Formatting
Diffstat (limited to 'modules-available/locations')
-rw-r--r--modules-available/locations/pages/details.inc.php30
1 files changed, 21 insertions, 9 deletions
diff --git a/modules-available/locations/pages/details.inc.php b/modules-available/locations/pages/details.inc.php
index fd45646b..e400d492 100644
--- a/modules-available/locations/pages/details.inc.php
+++ b/modules-available/locations/pages/details.inc.php
@@ -93,10 +93,16 @@ class SubPage
$options = array();
// Sanity checks
- if ($woloffset > 15) $woloffset = 15;
- else if ($woloffset < 0) $woloffset = 0;
- if ($sdoffset > 15) $sdoffset = 15;
- else if ($sdoffset < 0) $sdoffset = 0;
+ if ($woloffset > 15) {
+ $woloffset = 15;
+ } elseif ($woloffset < 0) {
+ $woloffset = 0;
+ }
+ if ($sdoffset > 15) {
+ $sdoffset = 15;
+ } elseif ($sdoffset < 0) {
+ $sdoffset = 0;
+ }
// Set options
$options['wol'] = $wol;
@@ -115,8 +121,10 @@ class SubPage
private static function getTime($str)
{
$str = explode(':', $str);
- if (count($str) !== 2) return false;
- if ($str[0] < 0 || $str[0] > 23 || $str[1] < 0 || $str[1] > 59) return false;
+ if (count($str) !== 2)
+ return false;
+ if ($str[0] < 0 || $str[0] > 23 || $str[1] < 0 || $str[1] > 59)
+ return false;
return $str[0] * 60 + $str[1];
}
@@ -407,7 +415,8 @@ class SubPage
echo Render::parse('location-subnets', $data);
}
- private static function ajaxOpeningTimes($id) {
+ private static function ajaxOpeningTimes($id)
+ {
User::assertPermission('location.edit', $id);
$openTimes = Database::queryFirst("SELECT openingtime FROM `location` WHERE locationid = :id", array('id' => $id));
if ($openTimes !== false) {
@@ -424,13 +433,16 @@ class SubPage
$data['rebootcontrol'] = $rebootcontrol;
if ($rebootcontrol) {
$res = Database::queryFirst("SELECT * FROM `reboot_scheduler` WHERE locationid = :id", array('id' => $id));
- if ($res !== false) $data['scheduler-options'] = json_decode($res['options']);
+ if ($res !== false) {
+ $data['scheduler-options'] = json_decode($res['options']);
+ }
}
echo Render::parse('ajax-opening-location', $data);
}
- private static function isSimpleMode(&$array) {
+ private static function isSimpleMode(&$array)
+ {
if (empty($array))
return true;
// Decompose by day