Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/nextcloudpi.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornachoparker <nacho@ownyourbits.com>2017-08-10 19:45:40 +0300
committernachoparker <nacho@ownyourbits.com>2017-08-11 00:17:56 +0300
commitb1c307335f85173d30795c4cd57dffcda24c18ce (patch)
tree6fc8e704f5bdbeeb9fd0e36ecfdb9f9425b7051e /ncp-web/ncp-launcher.php
parent6f7465844ca3fae38fa84234d8de97f39fe9576c (diff)
ncp-web: use checkboxes for yes/no fieldsv0.19.5
Diffstat (limited to 'ncp-web/ncp-launcher.php')
-rw-r--r--ncp-web/ncp-launcher.php11
1 files changed, 10 insertions, 1 deletions
diff --git a/ncp-web/ncp-launcher.php b/ncp-web/ncp-launcher.php
index 03672c78..ce3e88a5 100644
--- a/ncp-web/ncp-launcher.php
+++ b/ncp-web/ncp-launcher.php
@@ -35,7 +35,16 @@ if ( $_POST['action'] == "cfgreq" )
while ( $line = fgets($fh) )
{
- if ( preg_match('/^(\w+)_=(.*)$/', $line, $matches) )
+ if ( preg_match('/^(\w+)_=(yes|no)$/', $line, $matches) )
+ {
+ if ( $matches[2] == "yes" )
+ $checked = "checked";
+ $output = $output . "<tr>";
+ $output = $output . "<td><label for=\"$matches[1]\">$matches[1]</label></td>";
+ $output = $output . "<td><input type=\"checkbox\" id=\"$matches[1]\" name=\"$matches[1]\" value=\"$matches[2]\" $checked></td>";
+ $output = $output . "</tr>";
+ }
+ else if ( preg_match('/^(\w+)_=(.*)$/', $line, $matches) )
{
$output = $output . "<tr>";
$output = $output . "<td><label for=\"$matches[1]\">$matches[1]</label></td>";