diff options
Diffstat (limited to 'program/include')
-rw-r--r-- | program/include/main.inc | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/program/include/main.inc b/program/include/main.inc index 672e00dbd..d1d9c781d 100644 --- a/program/include/main.inc +++ b/program/include/main.inc @@ -2122,3 +2122,29 @@ function rcube_upload_progress_init() } } } + +/** + * Initializes client-side autocompletion + */ +function rcube_autocomplete_init() +{ + global $RCMAIL; + static $init; + + if ($init) + return; + + $init = 1; + + if (($threads = (int)$RCMAIL->config->get('autocomplete_threads')) > 0) { + $book_types = (array) $RCMAIL->config->get('autocomplete_addressbooks', 'sql'); + if (count($book_types) > 1) { + $RCMAIL->output->set_env('autocomplete_threads', $threads); + $RCMAIL->output->set_env('autocomplete_sources', $book_types); + } + } + + $RCMAIL->output->set_env('autocomplete_max', (int)$RCMAIL->config->get('autocomplete_max', 15)); + $RCMAIL->output->set_env('autocomplete_min_length', $RCMAIL->config->get('autocomplete_min_length')); + $RCMAIL->output->add_label('autocompletechars'); +} |