summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJannik Schönartz2020-01-15 20:58:53 +0100
committerJannik Schönartz2020-01-15 20:58:53 +0100
commit1d5366f45f50202021e8108f6ff3779d6e5b9d9c (patch)
tree49098ee69af85dec5d3c9adfc9927def8cc998c2
parent[locationinfo] better calendar event font size scaling (diff)
downloadslx-admin-1d5366f45f50202021e8108f6ff3779d6e5b9d9c.tar.gz
slx-admin-1d5366f45f50202021e8108f6ff3779d6e5b9d9c.tar.xz
slx-admin-1d5366f45f50202021e8108f6ff3779d6e5b9d9c.zip
[sysconfig] Add screensaver customization module
-rw-r--r--modules-available/sysconfig/addmodule_screensaver.inc.php222
-rw-r--r--modules-available/sysconfig/inc/configmodule/screensaver.inc.php107
-rw-r--r--modules-available/sysconfig/lang/de/config-module.json2
-rw-r--r--modules-available/sysconfig/lang/de/template-tags.json21
-rw-r--r--modules-available/sysconfig/lang/en/config-module.json2
-rw-r--r--modules-available/sysconfig/lang/en/template-tags.json21
-rw-r--r--modules-available/sysconfig/templates/screensaver-start.html122
-rw-r--r--modules-available/sysconfig/templates/screensaver-text.html103
8 files changed, 600 insertions, 0 deletions
diff --git a/modules-available/sysconfig/addmodule_screensaver.inc.php b/modules-available/sysconfig/addmodule_screensaver.inc.php
new file mode 100644
index 00000000..c6f447ab
--- /dev/null
+++ b/modules-available/sysconfig/addmodule_screensaver.inc.php
@@ -0,0 +1,222 @@
+<?php
+
+/*
+ * Wizard for configuring the xscreensaver (client side).
+ */
+
+class Screensaver_Start extends AddModule_Base
+{
+ private $hasSummernote = false;
+ private $session_data;
+
+ protected function preprocessInternal()
+ {
+ /* Load or initialise session data */
+ if ($this->edit !== false) {
+ $this->session_data = array(
+ 'title' => $this->edit->title(),
+ 'qss' => $this->edit->getData('qss'),
+ 'messages' => $this->edit->getData('messages'),
+ 'texts' => $this->edit->getData('texts'),
+ );
+ } else {
+ $this->session_data = array(
+ 'title' => '',
+ 'qss' => '',
+ 'messages' => array(
+ 'General' => array(
+ 'shutdown' => '',
+ 'shutdown-locked' => '',
+ 'idle-kill' => '',
+ 'idle-kill-locked' => '',
+ 'no-timeout' => '',
+ 'no-timeout-locked' => '',
+ )
+ ),
+ 'texts' => array(
+ 'text-shutdown' => '',
+ 'text-shutdown-locked' => '',
+ 'text-idle-kill' => '',
+ 'text-idle-kill-locked' => '',
+ 'text-no-timeout' => '',
+ 'text-no-timeout-locked' => '',
+ ),
+ );
+ }
+
+ Session::set('data', $this->session_data);
+ Session::save();
+ }
+
+ protected function renderInternal()
+ {
+ /* Load summernote module if available */
+ $this->hasSummernote = Module::isAvailable('summernote');
+
+ Render::addDialog(Dictionary::translateFile('config-module', 'screensaver_title'), false, 'screensaver-start', array(
+ 'step' => 'Screensaver_Text',
+ 'next' => 'idle-kill',
+ 'edit' => $this->edit ? $this->edit->id() : 0,
+ 'id' => 'start',
+ 'title' => $this->session_data['title'],
+ 'qss' => $this->session_data['qss'],
+ ));
+ }
+
+}
+
+class Screensaver_Text extends AddModule_Base
+{
+ private $hasSummernote = false;
+ private $session_data;
+ private $id;
+
+ protected function preprocessInternal()
+ {
+ /* Load session data */
+ $this->session_data = Session::get('data');
+ $this->id = Request::post('id', '', 'string');
+
+ if ($this->id === 'start') {
+ Screensaver_Helper::processQssData($this->session_data);
+ } elseif ($this->id !== '') {
+ Screensaver_Helper::processScreensaverText($this->session_data, $this->id);
+ }
+
+ Session::set('data', $this->session_data);
+ Session::save();
+ }
+
+ protected function renderInternal()
+ {
+ /* Load summernote module if available */
+ $this->hasSummernote = Module::isAvailable('summernote');
+ $next = Request::post('next', '', 'string');
+
+ $data = array(
+ 'edit' => $this->edit ? $this->edit->id() : 0,
+ );
+
+ /* Prepare and translate labels for the frontend */
+ $data['id'] = $next;
+ /* Convert the id to a language tag (camelCase) styled string */
+ $tag = explode('-', $next);
+ foreach ($tag as $key => $value) {
+ $tag[$key] = ucwords($value);
+ }
+ $tag = implode($tag);
+
+ $data['title'] = Dictionary::translateFileModule('sysconfig', 'template-tags', 'lang_screenTitle' . $tag, true);
+ $data['description'] = Dictionary::translateFileModule('sysconfig', 'template-tags', 'lang_screenDescription' . $tag, true);;
+ $data['msg_value'] = $this->session_data['messages']['General'][$next];
+ $data['msg_locked_value'] = $this->session_data['messages']['General'][$next . '-locked'];
+ $data['text_value'] = $this->session_data['texts']['text-' . $next];
+ $data['text_locked_value'] = $this->session_data['texts']['text-' . $next . '-locked'];
+ $data['inherit_locked'] = $this->session_data['texts'][$next . '-inherit'];
+
+ if ($next === 'idle-kill') {
+ $data['next'] = 'no-timeout';
+ $data['step'] = 'Screensaver_Text';
+ } elseif ($next === 'no-timeout') {
+ $data['next'] = 'shutdown';
+ $data['step'] = 'Screensaver_Text';
+ } elseif ($next === 'shutdown') {
+ $data['step'] = 'Screensaver_Finish';
+ }
+
+ Render::addDialog(Dictionary::translateFile('config-module', 'screensaver_title'), false, 'screensaver-text', $data);
+ }
+}
+
+class Screensaver_Finish extends AddModule_Base
+{
+ protected function preprocessInternal()
+ {
+ /* Get session data */
+ $session_data = Session::get('data');
+
+ /* Process the last step */
+ Screensaver_Helper::processScreensaverText($session_data, Request::post('id', '', 'string'));
+
+ if (empty($session_data['title'])) {
+ Message::addError('missing-title');
+ Util::redirect('?do=SysConfig');
+ return;
+ }
+
+ /* Only create an instance, if it's a new one */
+ if ($this->edit !== false)
+ $module = $this->edit;
+ else
+ $module = ConfigModule::getInstance('Screensaver');
+
+ /* Set all the data to the module instance */
+ $module->setData('qss', $session_data['qss']);
+ $module->setData('messages', $session_data['messages']);
+ $module->setData('texts', $session_data['texts']);
+
+ /* Insert or update database entries */
+ if ($this->edit !== false)
+ $module->update($session_data['title']);
+ else
+ $module->insert($session_data['title']);
+
+ $module->generate($this->edit === false);
+
+ // Yay
+ if ($this->edit !== false)
+ Message::addSuccess('module-edited');
+ else
+ Message::addSuccess('module-added');
+ Util::redirect('?do=SysConfig');
+ }
+}
+
+class Screensaver_Helper
+{
+ public static function processQssData(&$session_data) {
+ /* Process post data from the Screensaver_Start */
+ $session_data['title'] = Request::post('title', $session_data['title'], 'string');
+ if (empty($session_data['title'])) {
+ Message::addError('missing-title');
+ Util::redirect('?do=SysConfig');
+ return;
+ }
+ $session_data['qss'] = Request::post('qss', $session_data['qss'], 'string');
+ $helperMode = Request::post('helper_mode', 'false', 'string');
+ if ($helperMode !== 'false') {
+ // Get all the helper variables and build the qss
+ $bg_color_1 = Request::post('bg_color_1', '#443', 'string');
+ $bg_color_2 = Request::post('bg_color_2', '#000', 'string');
+ $label_color = Request::post('label_color', '#f64', 'string');
+ $label_size = Request::post('label_size', '20', 'string');
+ $clock_color = Request::post('clock_color', '#999', 'string');
+ $clock_size = Request::post('clock_size', '20', 'string');
+ $header_color = Request::post('header_color', 'inherit', 'string');
+ $header_size = Request::post('header_size', '20', 'string');
+
+ $session_data['qss'] = "#Saver {\n background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 " .
+ $bg_color_1 . ", stop:1 " . $bg_color_2 . ")\n}\n\n" .
+ "QLabel {\n color: " . $label_color . ";\n font-size: " . $label_size . ";\n}\n\n" .
+ "#lblClock {\n color: " . $clock_color . ";\n font-size: " . $clock_size . ";\n}\n\n" .
+ "#lblHeader {\n color: " . $header_color . ";\n font-size: " . $header_size . ";\n}";
+ }
+ }
+
+ public static function processScreensaverText(&$session_data, $name) {
+ /* Process post data from the Screensaver_Text */
+ $session_data['messages']['General'][$name] = Request::post('msg_value', '', 'string');
+ $session_data['texts']['text-' . $name] = Request::post('text_value', '', 'string');
+ $inherit_locked = Request::post('inherit_locked', 'false', 'string');
+ $session_data['texts'][$name . '-inherit'] = $inherit_locked;
+
+ if ($inherit_locked !== 'false') {
+ $session_data['messages']['General'][$name . '-locked'] = $session_data['messages']['General'][$name];
+ $session_data['texts']['text-' . $name . '-locked'] = $session_data['texts']['text-' . $name];
+ } else {
+ $session_data['messages']['General'][$name . '-locked'] = Request::post('msg_locked_value', '', 'string');
+ $session_data['texts']['text-' . $name . '-locked'] = Request::post('text_locked_value', '', 'string');
+ }
+ }
+}
+
diff --git a/modules-available/sysconfig/inc/configmodule/screensaver.inc.php b/modules-available/sysconfig/inc/configmodule/screensaver.inc.php
new file mode 100644
index 00000000..813b040d
--- /dev/null
+++ b/modules-available/sysconfig/inc/configmodule/screensaver.inc.php
@@ -0,0 +1,107 @@
+<?php
+
+ConfigModule::registerModule(
+ ConfigModule_Screensaver::MODID, // ID
+ Dictionary::translateFileModule('sysconfig', 'config-module', 'screensaver_title'), // Title
+ Dictionary::translateFileModule('sysconfig', 'config-module', 'screensaver_description'), // Description
+ Dictionary::translateFileModule('sysconfig', 'config-module', 'group_generic'), // Group
+ true, // Only one per config?
+ 100 // Sort order
+);
+
+class ConfigModule_Screensaver extends ConfigModule
+{
+ const MODID = 'Screensaver';
+ const VERSION = 1;
+
+ protected function generateInternal($tgz, $parent)
+ {
+ /* Validate if all data are available */
+ if (!$this->validateConfig())
+ return false;
+
+ /* Give the Taskmanager the job and create the tgz */
+ $taskId = 'xscreensaver' . mt_rand() . '-' . microtime(true);
+
+ $task = Taskmanager::submit('MakeTarball', array(
+ 'id' => $taskId,
+ 'files' => $this->getFileArray(),
+ 'destination' => $tgz,
+ ), false);
+
+ return $task;
+ }
+
+ protected function moduleVersion()
+ {
+ return self::VERSION;
+ }
+
+ protected function validateConfig()
+ {
+ return isset($this->moduleData['qss']) &&
+ isset($this->moduleData['texts']) &&
+ isset($this->moduleData['texts']['text-idle-kill']) &&
+ isset($this->moduleData['texts']['text-no-timeout']) &&
+ isset($this->moduleData['texts']['text-shutdown']);
+ }
+
+ public function setData($key, $value)
+ {
+ switch ($key) {
+ case 'qss':
+ case 'texts':
+ case 'messages':
+ break;
+ default:
+ return false;
+ }
+ $this->moduleData[$key] = $value;
+ return true;
+ }
+
+ public function allowDownload()
+ {
+ return true;
+ }
+
+ /**
+ * Creates a map with filepath => file content
+ *
+ * @return array in the form of Map<String, byte[]>
+ */
+ private function getFileArray()
+ {
+ $files = array(
+ '/opt/openslx/xscreensaver/style.qss' => array_values(unpack('C*', $this->moduleData['qss'])),
+ '/opt/openslx/xscreensaver/text-idle-kill' => array_values(unpack('C*', $this->wrapHtmlTags('text-idle-kill'))),
+ '/opt/openslx/xscreensaver/text-no-timeout' => array_values(unpack('C*', $this->wrapHtmlTags('text-no-timeout'))),
+ '/opt/openslx/xscreensaver/text-shutdown' => array_values(unpack('C*', $this->wrapHtmlTags('text-shutdown'))),
+ );
+
+ /* Create the message.ini from the messages array */
+ $messages = '';
+ foreach ($this->moduleData['messages'] as $categorie => $array) {
+ $messages = $messages . '[' . $categorie . ']' . "\n";
+ foreach ($array as $key => $message) {
+ $messages = $messages . $key . '="' . $message . '"' . "\n";
+ }
+ }
+ $files['/opt/openslx/xscreensaver/messages.ini'] = array_values(unpack('C*', $messages));
+
+ /* Add locked files if there are any */
+ if (isset($this->moduleData['texts']['text-idle-kill-locked']))
+ $files['/opt/openslx/xscreensaver/text-idle-kill-locked'] = array_values(unpack('C*', $this->wrapHtmlTags('text-idle-kill-locked')));
+ if (isset($this->moduleData['texts']['text-no-timeout-locked']))
+ $files['/opt/openslx/xscreensaver/text-no-timeout-locked'] = array_values(unpack('C*', $this->wrapHtmlTags('text-no-timeout-locked')));
+ if (isset($this->moduleData['texts']['text-shutdown-locked']))
+ $files['/opt/openslx/xscreensaver/text-shutdown-locked'] = array_values(unpack('C*', $this->wrapHtmlTags('text-shutdown-locked')));
+
+ return $files;
+ }
+
+ private function wrapHtmlTags($text_name)
+ {
+ return '<html><body>' . $this->moduleData['texts'][$text_name] . '</body></html>';
+ }
+}
diff --git a/modules-available/sysconfig/lang/de/config-module.json b/modules-available/sysconfig/lang/de/config-module.json
index 4e178b65..ce168e74 100644
--- a/modules-available/sysconfig/lang/de/config-module.json
+++ b/modules-available/sysconfig/lang/de/config-module.json
@@ -11,6 +11,8 @@
"group_sshconfig": "SSH",
"ldapAuth_description": "Mit diesem Modul l\u00e4sst sich eine generische LDAP-Authentifizierung einrichten.",
"ldapAuth_title": "LDAP Authentifizierung",
+ "screensaver_title": "Bildschirmschoner anpassungen",
+ "screensaver_description": "Mit diesem Module können sie den Style (QSS) und die Texte des Bildschirmschoners anpassen.",
"sshconfig_description": "Mit diesem Modul l\u00e4sst sich steuern, ob und wie der sshd auf den gebooteten Clients startet, und welche Funktionen er zur Verf\u00fcgung stellt. Wenn Sie keinen sshd auf den Clients nutzen wollen, brauchen Sie kein solches Modul zu erstellen.",
"sshconfig_title": "SSH-D\u00e4mon"
} \ No newline at end of file
diff --git a/modules-available/sysconfig/lang/de/template-tags.json b/modules-available/sysconfig/lang/de/template-tags.json
index 1f6c0bdd..f42ce0f4 100644
--- a/modules-available/sysconfig/lang/de/template-tags.json
+++ b/modules-available/sysconfig/lang/de/template-tags.json
@@ -74,6 +74,9 @@
"lang_mapModeNativeFallback": "Nativ in der VM einbinden; Fallback auf VMware Shared Folders",
"lang_mapModeNone": "Verzeichnisse nicht durchreichen",
"lang_mapModeVmware": "VMware Shared Folders [VMwareTools]",
+ "lang_mode": "Modus",
+ "lang_modeEasy": "Vereinfachter Modus",
+ "lang_modeAdvanced": "Fortgeschrittener Modus",
"lang_modStillUsedBy": "Modul noch in Verwendung durch:",
"lang_moduleChoose": "Bitte w\u00e4hlen Sie aus, welche Art Konfigurationsmodul Sie erstellen m\u00f6chten.",
"lang_moduleConfiguration": "Konfigurationsmodule",
@@ -99,6 +102,24 @@
"lang_restartWizard": "Wizard neu starten",
"lang_rootKey": "root pubkey (\u00f6ffentlicher Schl\u00fcssel)",
"lang_rootKeyInfo": "Tragen Sie hier den \u00f6ffentlichen Schl\u00fcssel eines Schl\u00fcsselpaars ein, mit dem Sie sich als root-Benutzer an den Clients anmelden wollen. Lassen Sie das Feld leer, um diese Funktion nicht zu verwenden.",
+ "lang_screenBackground": "Hintergrund",
+ "lang_screenBackgroundDescription": " - Ein Hintergrund, bestehend aus einem zweifarbigem Gradienten.",
+ "lang_screenColor": "Farbe",
+ "lang_screenClock": "Uhr",
+ "lang_screenDescriptionIdleKill": "Ein Bildschirmschoner mit einem Timeout, nach dessen Ablauf alle Anwendungen, ohne weitere Nachfragen geschlossen werden und der Nutzer ausgeloggt wird.",
+ "lang_screenDescriptionNoTimeout": "Ein Bildschirmschoner ohne Timeout.",
+ "lang_screenDescriptionShutdown": "Ein Bildschirmschoner mit Timeout, nach dessen Ablauf der PC Heruntergefahren oder Neugestartet wird. Alle Anwendungen werden ohne weitere Nachfragen geschlossen.",
+ "lang_screenHeader": "Header",
+ "lang_screenLabel": "Label",
+ "lang_screenLocked": "Sperrbildschirm",
+ "lang_screenQss": "QSS",
+ "lang_screenSize": "Gr\u00f6ße",
+ "lang_screenTitleIdleKill": "Idle Kill",
+ "lang_screenTitleNoTimeout": "Ohne Timeout",
+ "lang_screenTitleShutdown": "Herunterfahren",
+ "lang_screenText": "Text",
+ "lang_screenTextInherit": "Werte Erben",
+ "lang_screenUnlocked": "Bildschirmschoner",
"lang_searchBase": "Suchbasis",
"lang_selectFile": "Bitte w\u00e4hlen Sie ein Archiv",
"lang_selectHomeAttribute": "Home-Attribut",
diff --git a/modules-available/sysconfig/lang/en/config-module.json b/modules-available/sysconfig/lang/en/config-module.json
index efe6f697..6485a61e 100644
--- a/modules-available/sysconfig/lang/en/config-module.json
+++ b/modules-available/sysconfig/lang/en/config-module.json
@@ -11,6 +11,8 @@
"group_sshconfig": "SSH",
"ldapAuth_description": "This module enables you to create a simple LDAP authentication module.",
"ldapAuth_title": "LDAP Authentication",
+ "screensaver_title": "Screensaver customization",
+ "screensaver_description": "With this module you can customize the style (QSS) and texts of the screensaver.",
"sshconfig_description": "Here you can set whether the sshd on the clients will start, and what options it will use.",
"sshconfig_title": "SSH daemon"
} \ No newline at end of file
diff --git a/modules-available/sysconfig/lang/en/template-tags.json b/modules-available/sysconfig/lang/en/template-tags.json
index 0e6d0223..cbdda4ac 100644
--- a/modules-available/sysconfig/lang/en/template-tags.json
+++ b/modules-available/sysconfig/lang/en/template-tags.json
@@ -74,6 +74,9 @@
"lang_mapModeNativeFallback": "Natively map inside VM; fallback to VMware Shared Folders",
"lang_mapModeNone": "Don't map shares at all",
"lang_mapModeVmware": "VMware Shared Folders [VMwareTools]",
+ "lang_mode": "Mode",
+ "lang_modeEasy": "Easy Mode",
+ "lang_modeAdvanced": "Advanced Mode",
"lang_modStillUsedBy": "Module still in use by:",
"lang_moduleChoose": "Please select which type of configuration module you want to create.",
"lang_moduleConfiguration": "Module Configuration",
@@ -99,6 +102,24 @@
"lang_restartWizard": "Restart wizard",
"lang_rootKey": "root pubkey",
"lang_rootKeyInfo": "Here you can add the public key of a keypair that you want to use for authentication as root-user. Leave this field blank to disable the feature.",
+ "lang_screenBackground": "Background",
+ "lang_screenBackgroundDescription": " - A background consisting of a gradient with two colors.",
+ "lang_screenColor": "Color",
+ "lang_screenClock": "Clock",
+ "lang_screenDescriptionIdleKill": "A screensaver with a timeout which on it's expiration will close all running applications without further requests and logout the user.",
+ "lang_screenDescriptionNoTimeout": "A screensaver without a timeout.",
+ "lang_screenDescriptionShutdown": "A screensaver with a timeout which on it's expiration the PC will shutdown or restart. All applications will be closed without further requests.",
+ "lang_screenHeader": "Header",
+ "lang_screenLabel": "Label",
+ "lang_screenLocked": "Lockscreen",
+ "lang_screenQss": "QSS",
+ "lang_screenSize": "Size",
+ "lang_screenTitleIdleKill": "Idle Kill",
+ "lang_screenTitleNoTimeout": "No Timeout",
+ "lang_screenTitleShutdown": "Shutdown",
+ "lang_screenText": "Text",
+ "lang_screenTextInherit": "Inherit Values",
+ "lang_screenUnlocked": "Screensaver",
"lang_searchBase": "Search Base",
"lang_selectFile": "Please select an archive",
"lang_selectHomeAttribute": "Home attribute",
diff --git a/modules-available/sysconfig/templates/screensaver-start.html b/modules-available/sysconfig/templates/screensaver-start.html
new file mode 100644
index 00000000..e3f55c63
--- /dev/null
+++ b/modules-available/sysconfig/templates/screensaver-start.html
@@ -0,0 +1,122 @@
+<form role="form" enctype="multipart/form-data" method="post" action="?do=SysConfig&amp;action=addmodule&amp;step={{step}}">
+ <input type="hidden" name="token" value="{{token}}">
+ <input type="hidden" name="next" value="{{next}}">
+ <input type="hidden" name="id" value="{{id}}">
+ <input type="hidden" name="edit" value="{{edit}}">
+
+ <div class="form-group">
+ <div class="input-group">
+ <span class="input-group-addon">{{lang_moduleName}}</span>
+ <input type="text" tabindex="1" name="title" value="{{title}}" class="form-control" autofocus required>
+ </div>
+ </div>
+
+ <input type="hidden" id="helper-mode" name="helper_mode" value="false">
+ <div class="form-group">
+ <div class="input-group btn-group">
+ <span class="input-group-addon">{{lang_mode}}</span>
+ <a class="btn btn-default" tabindex="2" id="btn-easy-mode" type="button" onclick="switchMode(1)">
+ <span class="glyphicon glyphicon-user"></span>
+ {{lang_modeEasy}}
+ </a>
+ <a class="btn btn-default active" tabindex="3" id="btn-advanced-mode" onclick="switchMode(0)">
+ <span class="glyphicon glyphicon-education"></span>
+ {{lang_modeAdvanced}}
+ </a>
+ </div>
+ </div>
+
+ <div class="form-group" id="advanced-mode">
+ <div class="input-group">
+ <span class="input-group-addon">{{lang_screenQss}}</span>
+ <textarea tabindex="4" name="qss" rows="20" class="form-control">{{qss}}</textarea>
+ </div>
+ </div>
+
+ <div id="easy-mode" hidden>
+ <div class="form-group">
+ <label>{{lang_screenBackground}}</label>
+ {{lang_screenBackgroundDescription}}
+ <div class="input-group">
+ <span class="input-group-addon slx-ga">{{lang_screenColor}} 1</span>
+ <input id="screensaver-background-color-1" tabindex="5" type="text" name="bg_color_1" value="" class="form-control" placeholder="#443">
+ </div>
+ <div class="input-group">
+ <span class="input-group-addon slx-ga">{{lang_screenColor}} 2</span>
+ <input id="screensaver-background-color-2" tabindex="6" type="text" name="bg_color_2" value="" class="form-control" placeholder="#000">
+ </div>
+ </div>
+
+ <div class="form-group">
+ <label >{{lang_screenLabel}}</label>
+ <div class="input-group">
+ <span class="input-group-addon slx-ga">{{lang_screenColor}}</span>
+ <input type="text" tabindex="7" name="label_color" value="" class="form-control" placeholder="#f64">
+ </div>
+ <div class="input-group">
+ <span class="input-group-addon slx-ga">{{lang_screenSize}}</span>
+ <input type="number" tabindex="8" name="label_size" value="" class="form-control" placeholder="20">
+ <span class="input-group-addon">pt</span>
+ </div>
+ </div>
+
+ <div class="form-group">
+ <label >{{lang_screenClock}}</label>
+ <div class="input-group">
+ <span class="input-group-addon slx-ga">{{lang_screenColor}}</span>
+ <input type="text" tabindex="9" name="clock_color" value="" class="form-control" placeholder="#999">
+ </div>
+ <div class="input-group">
+ <span class="input-group-addon slx-ga">{{lang_screenSize}}</span>
+ <input type="number" tabindex="10" name="clock_size" value="" class="form-control" placeholder="20">
+ <span class="input-group-addon">pt</span>
+ </div>
+ </div>
+
+ <div class="form-group">
+ <label >{{lang_screenHeader}}</label>
+ <div class="input-group">
+ <span class="input-group-addon slx-ga">{{lang_screenColor}}</span>
+ <input type="text" tabindex="11" name="header_color" value="" class="form-control" placeholder="">
+ </div>
+ <div class="input-group">
+ <span class="input-group-addon slx-ga">{{lang_screenSize}}</span>
+ <input type="number" tabindex="12" name="header_size" value="" class="form-control" placeholder="20">
+ <span class="input-group-addon">pt</span>
+ </div>
+ </div>
+ </div>
+
+ <hr>
+ <div class="btn-group">
+ <a class="btn btn-default" id="btn-back" tabindex="5" onclick="window.history.back()">{{lang_back}}</a>
+ </div>
+ <div class="btn-group pull-right">
+ <button type="submit" id="btn-next" tabindex="6" class="btn btn-primary">{{lang_next}} &raquo;</button>
+ </div>
+ <div class="clearfix"></div>
+</form>
+
+<script type="text/javascript">
+ function switchMode(mode) {
+ // 0 = advanced mode
+ // 1 = easy mode
+ if (mode === 0) {
+ $('#easy-mode').hide();
+ $('#advanced-mode').show();
+ $('#btn-easy-mode').removeClass('active');
+ $('#btn-advanced-mode').addClass('active');
+ $('#helper-mode').val('false');
+ $('#btn-back').prop('tabindex', 5);
+ $('#btn-next').prop('tabindex', 6);
+ } else if (mode === 1) {
+ $('#advanced-mode').hide();
+ $('#easy-mode').show();
+ $('#btn-advanced-mode').removeClass('active');
+ $('#btn-easy-mode').addClass('active');
+ $('#helper-mode').val('true');
+ $('#btn-back').prop('tabindex', 13);
+ $('#btn-next').prop('tabindex', 14);
+ }
+ }
+</script>
diff --git a/modules-available/sysconfig/templates/screensaver-text.html b/modules-available/sysconfig/templates/screensaver-text.html
new file mode 100644
index 00000000..c6516b80
--- /dev/null
+++ b/modules-available/sysconfig/templates/screensaver-text.html
@@ -0,0 +1,103 @@
+<form role="form" enctype="multipart/form-data" method="post" action="?do=SysConfig&amp;action=addmodule&amp;step={{step}}">
+ <input type="hidden" name="token" value="{{token}}">
+ <input type="hidden" name="next" value="{{next}}">
+ <input type="hidden" name="id" value="{{id}}">
+ <input type="hidden" name="edit" value="{{edit}}">
+
+ <div class="form-group">
+ <h4><label>{{title}}</label></h4>
+ <h5>{{description}}</h5>
+
+ <h4>{{lang_screenUnlocked}}</h4>
+ <div class="input-group">
+ <span class="input-group-addon slx-ga3">{{lang_title}}</span>
+ <input type="text" tabindex="1" name="msg_value" value="{{msg_value}}" class="form-control">
+ </div>
+ </div>
+
+ <div class="form-group">
+ <span class="input-group-addon top-addon">{{lang_screenText}}</span>
+ <textarea class="form-control summernote" id ="text-id" tabindex="2" name="text_value" rows="5" cols="30">{{text_value}}</textarea>
+ </div>
+ <hr>
+ <h4>{{lang_screenLocked}}</h4>
+ <input type="hidden" id="inherit_locked" name="inherit_locked" value="{{inherit_locked}}">
+ <div class="form-group">
+ <div class="input-group btn-group">
+ <span class="input-group-addon">{{lang_screenTextInherit}}</span>
+ <a class="btn btn-default" id="btn-inherit-on" type="button" onclick="switchMode(true)">
+ <span class="glyphicon glyphicon-ok"></span>
+ </a>
+ <a class="btn btn-default active" id="btn-inherit-off" onclick="switchMode(false)">
+ <span class="glyphicon glyphicon-remove"></span>
+ </a>
+ </div>
+ </div>
+
+ <div class="form-group">
+ <div class="input-group">
+ <span class="input-group-addon slx-ga3">{{lang_title}}</span>
+ <input type="text" id="msg-locked-id" tabindex="3" name="msg_locked_value" value="{{msg_locked_value}}" class="form-control">
+ </div>
+ </div>
+
+ <div class="form-group">
+ <span class="input-group-addon top-addon">{{lang_screenText}}</span>
+ <textarea class="form-control summernote" id ="text-locked-id" tabindex="4" name="text_locked_value" rows="5" cols="30">{{text_locked_value}}</textarea>
+ </div>
+
+ <div class="btn-group">
+ <a class="btn btn-default" onclick="window.history.back()">{{lang_back}}</a>
+ </div>
+ <div class="btn-group pull-right">
+ <button type="submit" class="btn btn-primary">{{lang_next}} &raquo;</button>
+ </div>
+ <div class="clearfix"></div>
+</form>
+
+<script type="text/javascript">
+ document.addEventListener("DOMContentLoaded", function () {
+ switchMode({{inherit_locked}});
+ }, false);
+
+
+ function switchMode(mode) {
+ // true = inherit on
+ // false = inherit off
+ if (mode) {
+ $('#msg-locked-id').prop('disabled', true);
+ $('#text-locked-id').summernote('disable');
+ $('#btn-inherit-on').addClass('active');
+ $('#btn-inherit-off').removeClass('active');
+ $('#inherit_locked').val(true);
+ } else {
+ $('#msg-locked-id').prop('disabled', false);
+ $('#text-locked-id').summernote('enable');
+ $('#btn-inherit-on').removeClass('active');
+ $('#btn-inherit-off').addClass('active');
+ $('#inherit_locked').val(false);
+ }
+ }
+</script>
+
+<style>
+ .slx-ga3 {
+ min-width: 16em;
+ text-align: left;
+ }
+
+ .top-addon {
+ border-right: 1px solid #ccc !important;
+ border-top-right-radius: 4px !important;
+ border-bottom-left-radius: 0 !important;
+ border-bottom-right-radius: 0 !important;
+ border-bottom: 0 !important;
+ }
+
+ /* Used to override some summernote css to get a proper addon header */
+ .note-editor.note-frame {
+ border-color: #ccc !important;
+ border-top-left-radius: 0 !important;
+ border-top-right-radius: 0 !important;
+ }
+</style> \ No newline at end of file