summaryrefslogtreecommitdiffstats
path: root/modules-available
diff options
context:
space:
mode:
authorChristian Hofmaier2018-03-20 11:43:46 +0100
committerChristian Hofmaier2018-03-20 11:43:46 +0100
commitb777775f1c4d4424d393e3b1750a8ac2164cbbd1 (patch)
treebfdea3dbfdd8443a4a2fe341ae9deaac6511dba4 /modules-available
parent[usb-lock-off] config names can now be as long as they want to + fixed table ... (diff)
downloadslx-admin-b777775f1c4d4424d393e3b1750a8ac2164cbbd1.tar.gz
slx-admin-b777775f1c4d4424d393e3b1750a8ac2164cbbd1.tar.xz
slx-admin-b777775f1c4d4424d393e3b1750a8ac2164cbbd1.zip
[usb-lock-off] disabled add buttons if configuration isn't added to db yet
Diffstat (limited to 'modules-available')
-rw-r--r--modules-available/usblockoff/lang/de/template-tags.json3
-rw-r--r--modules-available/usblockoff/lang/en/template-tags.json3
-rw-r--r--modules-available/usblockoff/page.inc.php10
-rw-r--r--modules-available/usblockoff/templates/usb-rules-config.html14
4 files changed, 21 insertions, 9 deletions
diff --git a/modules-available/usblockoff/lang/de/template-tags.json b/modules-available/usblockoff/lang/de/template-tags.json
index 096bdd19..c8092cd1 100644
--- a/modules-available/usblockoff/lang/de/template-tags.json
+++ b/modules-available/usblockoff/lang/de/template-tags.json
@@ -47,5 +47,6 @@
"lang_assignMenu": "Zuweisungsmenü",
"lang_serverName": "Servername",
"lang_configuration": "Konfiguration",
- "lang_usb-lock-off": "USB Lock-Off"
+ "lang_usb-lock-off": "USB Lock-Off",
+ "lang_disabledButtons_helptext": "Sie müssen zuerst die Konfiguration speichern, um Regeln hinzufügen zu können."
}
diff --git a/modules-available/usblockoff/lang/en/template-tags.json b/modules-available/usblockoff/lang/en/template-tags.json
index 99764776..282c83a0 100644
--- a/modules-available/usblockoff/lang/en/template-tags.json
+++ b/modules-available/usblockoff/lang/en/template-tags.json
@@ -47,5 +47,6 @@
"lang_assignMenu": "Assign menu",
"lang_serverName": "Server name",
"lang_configuration": "Configuration",
- "lang_usb-lock-off": "USB lock off"
+ "lang_usb-lock-off": "USB lock off",
+ "lang_disabledButtons_helptext": "You must first save the configuration to add rules."
}
diff --git a/modules-available/usblockoff/page.inc.php b/modules-available/usblockoff/page.inc.php
index 8c32a699..4a8e4a80 100644
--- a/modules-available/usblockoff/page.inc.php
+++ b/modules-available/usblockoff/page.inc.php
@@ -340,9 +340,17 @@ class Page_usblockoff extends Page
$rulesArray[] = $rule;
}
}
+
+ if ($configid == "new-default") {
+ $newConfig = true;
+ } else {
+ $newConfig = false;
+ }
+
return Render::parse('usb-rules-config', array(
'rules' => (array)$rulesArray,
- 'configid' => $configid
+ 'configid' => $configid,
+ 'newConfig' => $newConfig
));
}
diff --git a/modules-available/usblockoff/templates/usb-rules-config.html b/modules-available/usblockoff/templates/usb-rules-config.html
index 15c7a2f7..60f786c0 100644
--- a/modules-available/usblockoff/templates/usb-rules-config.html
+++ b/modules-available/usblockoff/templates/usb-rules-config.html
@@ -48,14 +48,16 @@
</tbody>
</table>
<div class="pull-right">
- <a class="btn btn-success" href="?do=usblockoff&show=add-generic-rule&configid={{configid}}"
- style="margin-right: 3px; float: right;">
- <span style="margin-right: 5px;" class="glyphicon glyphicon-plus"></span>
+ <a class="btn btn-success {{#newConfig}}disabled{{/newConfig}}"
+ {{^newConfig}}href="?do=usblockoff&show=add-generic-rule&configid={{configid}}"{{/newConfig}}
+ {{#newConfig}}title="{{lang_disabledButtons_helptext}}" style="pointer-events: auto;"{{/newConfig}}>
+ <span class="glyphicon glyphicon-plus"></span>
<span>{{lang_genericRule}}</span>
</a>
- <a class="btn btn-success" href="?do=usblockoff&show=add-devices&configid={{configid}}"
- style="margin-right: 3px;float: right;">
- <span style="margin-right: 5px;" class="glyphicon glyphicon-plus"></span>
+ <a class="btn btn-success {{#newConfig}}disabled{{/newConfig}}"
+ {{^newConfig}}href="?do=usblockoff&show=add-devices&configid={{configid}}"{{/newConfig}}
+ {{#newConfig}}title="{{lang_disabledButtons_helptext}}" style="pointer-events: auto;"{{/newConfig}}>
+ <span class="glyphicon glyphicon-plus"></span>
<span>{{lang_devices}}</span>
</a>
</div>