summaryrefslogtreecommitdiff
path: root/lib/kolab_html.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/kolab_html.php')
-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);
}