diff options
author | alecpl <alec@alec.pl> | 2011-07-25 10:49:39 +0000 |
---|---|---|
committer | alecpl <alec@alec.pl> | 2011-07-25 10:49:39 +0000 |
commit | 0213f8d4dddf88b1a3eec91ff0f95832ebac3008 (patch) | |
tree | d221b163d8097347d666edfc5ef393e6020dda3b /program/include | |
parent | 18371736346a2f71f37f68e6fd13de8b230a8baf (diff) |
- Added optional "multithreading" autocomplete feature
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'); +} |