diff options
-rw-r--r-- | ncp-web/ncp-launcher.php | 11 | ||||
-rw-r--r-- | ncp-web/ncp.css | 2 | ||||
-rw-r--r-- | ncp-web/ncp.js | 2 |
3 files changed, 13 insertions, 2 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>"; diff --git a/ncp-web/ncp.css b/ncp-web/ncp.css index 1abbe2f8..40829a1f 100644 --- a/ncp-web/ncp.css +++ b/ncp-web/ncp.css @@ -1013,7 +1013,7 @@ select { width: 100%; } -#config-box-wrapper input { +#config-box-wrapper input[type='text'] { width: 100%; } diff --git a/ncp-web/ncp.js b/ncp-web/ncp.js index a643212f..8fdd5e0a 100644 --- a/ncp-web/ncp.js +++ b/ncp-web/ncp.js @@ -56,6 +56,8 @@ $(function() // create configuration object var cfg = {}; $( 'input' , '#config-box' ).each( function(item){ + if( item.getAttribute('type') == 'checkbox' ) + item.value = item.checked ? 'yes' : 'no'; cfg[item.name] = item.value; } ); |