diff options
Diffstat (limited to 'views/default/input/autocomplete.php')
-rw-r--r-- | views/default/input/autocomplete.php | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/views/default/input/autocomplete.php b/views/default/input/autocomplete.php index 0a4057ddf..421541e24 100644 --- a/views/default/input/autocomplete.php +++ b/views/default/input/autocomplete.php @@ -7,20 +7,25 @@ * * @todo This currently only works for ONE AUTOCOMPLETE TEXT FIELD on a page. * - * @uses $vars['match_on'] Array | str What to match on. all|array(groups|users|friends|subtype) + * @uses $vars['value'] Current value for the text input + * @uses $vars['match_on'] Array | str What to match on. all|array(groups|users|friends|subtype) * @uses $vars['match_owner'] Bool. Match only entities that are owned by logged in user. - * + * @uses $vars['class'] Additional CSS class */ +if (isset($vars['class'])) { + $vars['class'] = "elgg-input-autocomplete {$vars['class']}"; +} else { + $vars['class'] = "elgg-input-autocomplete"; +} + $defaults = array( - 'class' => '', 'value' => '', + 'disabled' => false, ); $vars = array_merge($defaults, $vars); -$vars['class'] = trim("elgg-input-autocomplete {$vars['class']}"); - $ac_url_params = http_build_query(array( 'match_on' => $vars['match_on'], 'match_owner' => $vars['match_owner'], @@ -38,4 +43,3 @@ elgg.provide('elgg.autocomplete'); elgg.autocomplete.url = "<?php echo elgg_get_site_url() . 'livesearch?' . $ac_url_params; ?>"; </script> <input type="text" <?php echo elgg_format_attributes($vars); ?> /> - |