aboutsummaryrefslogtreecommitdiff
path: root/views/default/input/autocomplete.php
diff options
context:
space:
mode:
authorCash Costello <cash.costello@gmail.com>2011-07-02 09:21:30 -0400
committerCash Costello <cash.costello@gmail.com>2011-07-02 09:21:30 -0400
commitf5f3f205e97c2a3219897dd14de7d57659ce1181 (patch)
treee89da8c8aa003826b1815cabaf01d1fbcfbb351f /views/default/input/autocomplete.php
parent9e9b28479b6ecfd8685b2bba7f9ae5856ece9b2e (diff)
downloadelgg-f5f3f205e97c2a3219897dd14de7d57659ce1181.tar.gz
elgg-f5f3f205e97c2a3219897dd14de7d57659ce1181.tar.bz2
Fixes #3624 input views use class extending rather than overriding
Diffstat (limited to 'views/default/input/autocomplete.php')
-rw-r--r--views/default/input/autocomplete.php16
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); ?> />
-