summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/api/kolab_api_service_form_value.php2
-rw-r--r--lib/kolab_html.php21
2 files changed, 14 insertions, 9 deletions
diff --git a/lib/api/kolab_api_service_form_value.php b/lib/api/kolab_api_service_form_value.php
index cb7fa34..1bed5f0 100644
--- a/lib/api/kolab_api_service_form_value.php
+++ b/lib/api/kolab_api_service_form_value.php
@@ -1195,7 +1195,7 @@ class kolab_api_service_form_value extends kolab_api_service
}
}
- return (int) $value;
+ return (string) intval($value);
}
private function validate_mailalternateaddress($value, $postdata = array(), $validation_type = null)
diff --git a/lib/kolab_html.php b/lib/kolab_html.php
index 8b296f8..8567bb0 100644
--- a/lib/kolab_html.php
+++ b/lib/kolab_html.php
@@ -162,9 +162,6 @@ class kolab_html
*/
public static function inputquota($attribs = array())
{
- $elem_attribs = array_merge(self::$input_attribs, self::$input_event_attribs,
- self::$common_attribs, self::$event_attribs);
-
if ($attribs['value'] % 1024 == 0) {
if ($attribs['value'] >= 1024) {
$attribs['value'] /= 1024;
@@ -176,10 +173,19 @@ class kolab_html
}
}
- $options = array();
+ $select = array(
+ 'name' => $attribs['name'] . '-unit',
+ 'readonly' => !empty($attribs['readonly']),
+ 'disabled' => !empty($attribs['readonly']),
+ 'options' => array(),
+ );
+
foreach (array('kb', 'mb', 'gb') as $u) {
- $options[] = '<option value="' . $u . '"' . ($unit == $u ? ' selected' : '') . '>'
- . strtoupper($u) . '</option>';
+ $select['options'][] = array(
+ 'value' => $u,
+ 'content' => strtoupper($u),
+ 'selected' => $unit == $u,
+ );
}
$attribs['data-type'] = 'quota';
@@ -188,8 +194,7 @@ class kolab_html
$attribs['size'] = 10;
}
- return sprintf('<input%s /><select name="%s-unit">%s</select>',
- self::attrib_string($attribs, $elem_attribs), $attribs['name'], implode($options));
+ return self::input($attribs) . self::select($select);
}
/**