From d569d39e82a928b60def5518830dfe26466504f6 Mon Sep 17 00:00:00 2001 From: Jannik Schönartz Date: Tue, 27 Mar 2018 10:50:41 +0200 Subject: [usb-lock-off] Added language tags for the edit rule page. --- modules-available/usblockoff/lang/de/rule.json | 7 ++++++- modules-available/usblockoff/lang/en/rule.json | 7 ++++++- modules-available/usblockoff/page.inc.php | 16 ++++++++++------ .../usblockoff/templates/usb-edit-rule.html | 2 ++ 4 files changed, 24 insertions(+), 8 deletions(-) (limited to 'modules-available') 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(); -- cgit v1.2.3-55-g7522