summaryrefslogtreecommitdiffstats
path: root/modules-available
diff options
context:
space:
mode:
authorJannik Schönartz2018-03-27 10:50:41 +0200
committerJannik Schönartz2018-03-27 10:50:41 +0200
commitd569d39e82a928b60def5518830dfe26466504f6 (patch)
treeae6d57987bc7389b76028cc642773cd2cd8798d7 /modules-available
parent[usb-lock-off] Removed warnings in JS/JQuery (diff)
downloadslx-admin-d569d39e82a928b60def5518830dfe26466504f6.tar.gz
slx-admin-d569d39e82a928b60def5518830dfe26466504f6.tar.xz
slx-admin-d569d39e82a928b60def5518830dfe26466504f6.zip
[usb-lock-off] Added language tags for the edit rule page.
Diffstat (limited to 'modules-available')
-rw-r--r--modules-available/usblockoff/lang/de/rule.json7
-rw-r--r--modules-available/usblockoff/lang/en/rule.json7
-rw-r--r--modules-available/usblockoff/page.inc.php16
-rw-r--r--modules-available/usblockoff/templates/usb-edit-rule.html2
4 files changed, 24 insertions, 8 deletions
diff --git a/modules-available/usblockoff/lang/de/rule.json b/modules-available/usblockoff/lang/de/rule.json
index 394c44fe..c0f462df 100644
--- a/modules-available/usblockoff/lang/de/rule.json
+++ b/modules-available/usblockoff/lang/de/rule.json
@@ -1,7 +1,12 @@
{
- "abr_helptext": "allow: Autorisiert das Gerät.\u000Dblock: Blockiert das Gerät.\u000Dreject: Entfernt das Gerät aus dem System.",
+ "target": "Aktion",
+ "target_helptext": "allow: Autorisiert das Gerät.\u000Dblock: Blockiert das Gerät.\u000Dreject: Entfernt das Gerät aus dem System.",
"id": "ID",
"id_helptext": "ID des USB-Geräts.",
+ "vid": "Hersteller ID",
+ "vid_helptext": "Die eindeutige ID des Herstellers.",
+ "pid": "Produkt ID",
+ "pid_helptext": "Die Herstellerspezifische ID des Produktes.",
"serial": "Seriennummer",
"serial_helptext": "Seriennummer des USB-Geräts.",
"name": "Name",
diff --git a/modules-available/usblockoff/lang/en/rule.json b/modules-available/usblockoff/lang/en/rule.json
index 46c8bf08..07f92227 100644
--- a/modules-available/usblockoff/lang/en/rule.json
+++ b/modules-available/usblockoff/lang/en/rule.json
@@ -1,7 +1,12 @@
{
- "abr_helptext": "allow: authorize the device.\u000Dblock: block the device.\u000DReject: remove the device from the system.",
+ "target": "Action",
+ "target_helptext": "allow: authorize the device.\u000Dblock: block the device.\u000DReject: remove the device from the system.",
"id": "ID",
"id_helptext": "ID of the USB-device.",
+ "vid": "Vendor ID",
+ "vid_helptext": "The unique ID of the vendor.",
+ "pid": "Product ID",
+ "pid_helptext": "The vendor specific ID of the product.",
"serial": "Serialnumber",
"serial_helptext": "Serialnumber of the USB-device.",
"name": "Name",
diff --git a/modules-available/usblockoff/page.inc.php b/modules-available/usblockoff/page.inc.php
index e2ebf11c..b667e1c8 100644
--- a/modules-available/usblockoff/page.inc.php
+++ b/modules-available/usblockoff/page.inc.php
@@ -180,7 +180,7 @@ class Page_usblockoff extends Page
'active' => false,
'value' => 'reject',
));
- $setting['helptext'] = array('helptext' => Dictionary::translateFile('rule', 'abr_helptext'));
+ $setting['helptext'] = array('helptext' => Dictionary::translateFile('rule', 'target_helptext'));
$setting['property'] = 'action';
$setting['settingHtml'] = Render::parse('server-prop-dropdown', (array)$setting);
$settings[] = $setting;
@@ -219,10 +219,10 @@ class Page_usblockoff extends Page
while ($attribute = $query->fetch(PDO::FETCH_ASSOC)) {
$attributesHtml = '';
$attr = array(
- 'title' => $attribute['prop'], // TODO: Dictionary::translateFile(' ...
+ 'title' => Dictionary::translateFile('rule', $attribute['prop']),
'property' => $attribute['prop'],
'currentvalue' => $attribute['value'],
- 'helptext' => "TODO", // TODO Dict bla bla..
+ 'helptext' => Dictionary::translateFile('rule', $attribute['prop'] . "_helptext"),
);
if ($attribute['prop'] === 'target') {
@@ -251,10 +251,12 @@ class Page_usblockoff extends Page
$pid = $id[1];
// Vendor ID
- $attr['title'] = "VID";
+ $attr['title'] = Dictionary::translateFile('rule', 'vid');
$attr['select_list'] = array();
$attr['toTextButton'] = true;
$attr['property'] = 'vid';
+ $attr['helptext'] = Dictionary::translateFile('rule', "vid_helptext");
+
$attr['select_list'][] = array(
'option' => $idList[$vid]['name'],
@@ -268,9 +270,11 @@ class Page_usblockoff extends Page
);
// Product ID
- $attr['title'] = "PID";
+ $attr['title'] = Dictionary::translateFile('rule', 'pid');
$attr['select_list'] = array();
$attr['property'] = 'pid';
+ $attr['helptext'] = Dictionary::translateFile('rule', "pid_helptext");
+
$attr['select_list'][] = array(
'option' => $idList[$vid]['products'][$pid],
@@ -379,7 +383,7 @@ class Page_usblockoff extends Page
'active' => ($target == 'reject' ? true : false),
'value' => 'reject',
));
- $setting['helptext'] = array('helptext' => Dictionary::translateFile('rule', 'abr_helptext'));
+ $setting['helptext'] = array('helptext' => Dictionary::translateFile('rule', 'target_helptext'));
$setting['property'] = 'action';
$setting['settingHtml'] = Render::parse('server-prop-dropdown', (array)$setting);
$settings[] = $setting;
diff --git a/modules-available/usblockoff/templates/usb-edit-rule.html b/modules-available/usblockoff/templates/usb-edit-rule.html
index e2bc5b65..8f31fdd9 100644
--- a/modules-available/usblockoff/templates/usb-edit-rule.html
+++ b/modules-available/usblockoff/templates/usb-edit-rule.html
@@ -32,6 +32,8 @@
var idArray = {{{usbJson}}};
document.addEventListener("DOMContentLoaded", function() {
+ $('a.btn[title]').tooltip({placement: "auto", html: true});
+
$('.switch-input').click(function() {
var $op = $(this).parent().find('select');
var val = $op.val();