diff --git a/web/ajax/modals/settings.php b/web/ajax/modals/settings.php
index 59d19ddbb..d2e27a3b4 100644
--- a/web/ajax/modals/settings.php
+++ b/web/ajax/modals/settings.php
@@ -1,11 +1,11 @@
$_REQUEST['mid']));
$zmuCommand = getZmuCommand(' -m '.escapeshellarg($_REQUEST['mid']).' -B -C -H -O');
$zmuOutput = exec( $zmuCommand );
-if ( $zmuOutput ) {
+if ($zmuOutput) {
list($brightness, $contrast, $hue, $colour) = explode(' ', $zmuOutput);
$monitor->Brightness($brightness);
@@ -13,7 +13,6 @@ if ( $zmuOutput ) {
$monitor->Hue($hue);
$monitor->Colour($colour);
}
-
?>
@@ -35,22 +34,79 @@ if ( $zmuOutput ) {
+Device().' --list-ctrls');
+$ctls = trim($ctls);
+$ctls = explode("\n", $ctls);
+
+foreach ($ctls as $line) {
+ $ctl = explode(':', $line);
+ $type_info = explode(' ', trim($ctl[0]));
+
+ $setting = trim($type_info[0]);
+ if ($setting == 'saturation')
+ $setting = 'colour';
+ $setting_uc = ucwords($setting);
+ $type = $type[2];
+
+ $min = '';
+ $max = '';
+ $step = '';
+ $value = '';
+ $default = '';
+
+ # The purpose is security
+ foreach (explode(' ', trim($ctl[1])) as $index=>$prop) {
+ list($key,$val) = explode('=', $prop);
+
+ // get current value
+ if ($key == 'value') {
+ $value = validInt($val);
+ } else if ($key == 'default') {
+ $default = validInt($val);
+ } else if ($key == 'min') {
+ $min = validInt($val);
+ } else if ($key == 'max') {
+ $max = validInt($val);
+ } else if ($key == 'step') {
+ $step = validInt($val);
+ }
+ }
+
+ if ($setting == 'brightness' or $setting == 'colour' or $setting == 'contrast' or $setting == 'hue') {
+ echo '
- |
- disabled="disabled" /> |
+ '.translate($setting_uc).' |
+ '.$min.' | | '.$max.' |
+';
+ } else {
+ if ($type == '(bool)') {
+ echo '
- |
- /> |
+ '.translate($setting_uc).' |
+ | '.html_radio('new'.$setting_uc, array('0'=>translate('True'), '1', translate('False')), $value, array('disabled'=>'disabled')).'
+ | |
+';
+ } else if ($type == '(int)') {
+ echo '
- |
- /> |
+ '.translate($setting_uc).' |
+ | | |
+';
+ } else {
+ echo '
- |
- /> |
+ '.translate($setting_uc).' |
+ | '.$value.' | |
+';
+ }
+ }
+} # end foreach ctrl
+?>