summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimotheus Pokorra <tp@tbits.net>2015-05-21 14:06:16 +0200
committerTimotheus Pokorra <tp@tbits.net>2015-05-21 14:06:16 +0200
commit8faf6e1e95d434e759c890232bdc81daf45da943 (patch)
tree4d33b655a01bd41d5d165e8d790a79539a856922
parentd8dc3e2f241d66fb36126416c44f8303df36ba41 (diff)
downloadwebadmin-8faf6e1e95d434e759c890232bdc81daf45da943.tar.gz
readonly checkbox should be displayed in disabled state (#5050)
-rw-r--r--lib/kolab_html.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/kolab_html.php b/lib/kolab_html.php
index 2317bd0..895647e 100644
--- a/lib/kolab_html.php
+++ b/lib/kolab_html.php
@@ -150,6 +150,11 @@ class kolab_html
$elem_attribs = array_merge(self::$input_attribs, self::$input_event_attribs,
self::$common_attribs, self::$event_attribs);
+ if ($attribs['type'] == 'checkbox' && $attribs['readonly']) {
+ // readonly checkbox should be disabled, otherwise the user could still check or uncheck the box
+ $attribs['disabled'] = 'disabled';
+ }
+
return sprintf('<input%s />', self::attrib_string($attribs, $elem_attribs));
}