summaryrefslogtreecommitdiffstats
path: root/lib/kolab_client_task.php
diff options
context:
space:
mode:
authorAleksander Machniak <machniak@kolabsys.com>2014-12-22 07:10:39 -0500
committerAleksander Machniak <machniak@kolabsys.com>2014-12-22 07:10:39 -0500
commit47b1217a1c494dc428f4ff16e026f44abd3f3ed3 (patch)
tree63e50a0756e70beaff0e4fdc2c14817a2ae0c704 /lib/kolab_client_task.php
parentd1f86621d0ffdbdb536fb352d9b3a74397aa04c2 (diff)
downloadwebadmin-47b1217a1c494dc428f4ff16e026f44abd3f3ed3.tar.gz
Add support for autocompletion on text fields (#3885)
- to enable that define field as 'text-autocompletion' in settings or just add 'autocomplete' = true to the form_field params.
Diffstat (limited to 'lib/kolab_client_task.php')
-rw-r--r--lib/kolab_client_task.php16
1 files changed, 12 insertions, 4 deletions
diff --git a/lib/kolab_client_task.php b/lib/kolab_client_task.php
index b784856..5dce5bb 100644
--- a/lib/kolab_client_task.php
+++ b/lib/kolab_client_task.php
@@ -921,10 +921,14 @@ class kolab_client_task
break;
default:
- $result['type'] = kolab_form::INPUT_TEXT;
-
- if (isset($field['maxlength'])) {
- $result['maxlength'] = $field['maxlength'];
+ if (!empty($field['autocomplete'])) {
+ $result['type'] = kolab_form::INPUT_TEXTAREA;
+ $result['data-type'] = 'list';
+ $result['data-maxcount'] = 1;
+ $result['data-autocomplete'] = true;
+ }
+ else {
+ $result['type'] = kolab_form::INPUT_TEXT;
}
if ($field['type'] && $field['type'] != 'text') {
@@ -940,6 +944,10 @@ class kolab_client_task
else {
$result['default'] = $field['default'];
}
+
+ if (isset($field['maxlength'])) {
+ $result['maxlength'] = $field['maxlength'];
+ }
}
$result['required'] = empty($field['optional']);