summaryrefslogtreecommitdiffstats
path: root/modules-available/locationinfo/page.inc.php
diff options
context:
space:
mode:
authorSimon Rettberg2025-05-20 15:11:24 +0200
committerSimon Rettberg2025-05-20 15:11:24 +0200
commit9f1904985868385f8e4f3acc3e168f521fd0b36b (patch)
tree4f2493a72d403d7e33c1dbda26e040f016c2574c /modules-available/locationinfo/page.inc.php
parent[inc/User] Fix types (diff)
downloadslx-admin-9f1904985868385f8e4f3acc3e168f521fd0b36b.tar.gz
slx-admin-9f1904985868385f8e4f3acc3e168f521fd0b36b.tar.xz
slx-admin-9f1904985868385f8e4f3acc3e168f521fd0b36b.zip
[locationinfo] URLpanel: Browser accept-language and screen rotation
Add configuration options to specify screen rotation and languages the browser will request from web servers via Accept-Language header.
Diffstat (limited to 'modules-available/locationinfo/page.inc.php')
-rw-r--r--modules-available/locationinfo/page.inc.php11
1 files changed, 10 insertions, 1 deletions
diff --git a/modules-available/locationinfo/page.inc.php b/modules-available/locationinfo/page.inc.php
index 1a58131f..decaa8f2 100644
--- a/modules-available/locationinfo/page.inc.php
+++ b/modules-available/locationinfo/page.inc.php
@@ -347,6 +347,11 @@ class Page_LocationInfo extends Page
}
$bookmarkString = substr($bookmarkString, 0, -1);
+ $rotation = strtolower(Request::post('screen-rotation', '', 'string'));
+ if (!in_array($rotation, ['', 'left', 'right', 'inverted'])) {
+ $rotation = '';
+ }
+
$conf = array(
'url' => Request::post('url', 'https://www.bwlehrpool.de/', 'string'),
'insecure-ssl' => Request::post('insecure-ssl', 0, 'int'),
@@ -359,7 +364,9 @@ class Page_LocationInfo extends Page
'hw-video' => Request::post('hw-video', '0', 'bool'),
'bookmarks' => $bookmarkString ?: '',
'allow-tty' => Request::post('allow-tty', '', 'string'),
- 'zoom-factor' => Request::post('zoom-factor', 100, 'int'),
+ 'zoom-factor' => max(0, Request::post('zoom-factor', 100, 'int')),
+ 'language' => str_replace(['_', ' '], ['-', ''], Request::post('language', '', 'string')),
+ 'screen-rotation' => $rotation,
);
return array('config' => $conf, 'locationids' => []);
}
@@ -1007,6 +1014,8 @@ class Page_LocationInfo extends Page
'panelname' => $panel['panelname'],
'url' => $config['url'],
'zoom-factor' => $config['zoom-factor'],
+ 'language' => $config['language'],
+ 'screen-rotation' => $config['screen-rotation'],
'ssl_checked' => $config['insecure-ssl'] ? 'checked' : '',
'reloadminutes' => (int)$config['reload-minutes'],
'whitelist' => str_replace("\n", "\r\n", $config['whitelist']),