summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2013-11-07 11:41:01 (GMT)
committerAleksander Machniak <alec@alec.pl>2013-11-07 11:43:57 (GMT)
commitc74fa4d2b0b106b007b31e8a3d5e052f9b8fad64 (patch)
tree538d7ae761ac04e965a5105c0248ebf26e425e2c
parent83036257cf3a5731fcc687ba6b41f6be9c42e53a (diff)
downloadkolab-wap-c74fa4d2b0b106b007b31e8a3d5e052f9b8fad64.tar.gz
Finally fix readonly quota input (Bug #2414)
-rw-r--r--lib/kolab_html.php19
1 files changed, 13 insertions, 6 deletions
diff --git a/lib/kolab_html.php b/lib/kolab_html.php
index 8567bb0..1107d4b 100644
--- a/lib/kolab_html.php
+++ b/lib/kolab_html.php
@@ -173,10 +173,21 @@ class kolab_html
}
}
+ if (empty($attribs['size'])) {
+ $attribs['size'] = 10;
+ }
+
+ // show no select dropdown box if value is readonly
+ if (!empty($attribs['readonly'])) {
+ if ($unit) {
+ $attribs['value'] .= ' ' . strtoupper($unit);
+ }
+
+ return self::input($attribs);
+ }
+
$select = array(
'name' => $attribs['name'] . '-unit',
- 'readonly' => !empty($attribs['readonly']),
- 'disabled' => !empty($attribs['readonly']),
'options' => array(),
);
@@ -190,10 +201,6 @@ class kolab_html
$attribs['data-type'] = 'quota';
- if (empty($attribs['size'])) {
- $attribs['size'] = 10;
- }
-
return self::input($attribs) . self::select($select);
}