diff options
Diffstat (limited to 'views/default/input/userpicker.php')
| -rw-r--r-- | views/default/input/userpicker.php | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/views/default/input/userpicker.php b/views/default/input/userpicker.php index 87cc6e24a..8b64d7df5 100644 --- a/views/default/input/userpicker.php +++ b/views/default/input/userpicker.php @@ -9,17 +9,18 @@ * * The name of the hidden fields is members[] * - * Defaults to lazy load user lists in paginated alphabetical order. User needs + * @warning Only a single input/userpicker is supported per web page. + * + * Defaults to lazy load user lists in alphabetical order. User needs * to type two characters before seeing the user popup list. * - * As users are checked they move down to a "users" box. + * As users are selected they move down to a "users" box. * When this happens, a hidden input is created with the * name of members[] and a value of the GUID. - * - * @warning: this is not stable */ elgg_load_js('elgg.userpicker'); +elgg_load_js('jquery.ui.autocomplete.html'); function user_picker_add_user($user_id) { $user = get_entity($user_id); @@ -27,8 +28,9 @@ function user_picker_add_user($user_id) { return false; } - $icon = elgg_view_entity_icon($user, 'tiny', array('hover' => false)); + $icon = elgg_view_entity_icon($user, 'tiny', array('use_hover' => false)); + // this html must be synced with the userpicker.js library $code = '<li><div class="elgg-image-block">'; $code .= "<div class='elgg-image'>$icon</div>"; $code .= "<div class='elgg-image-alt'><a href='#' class='elgg-userpicker-remove'>X</a></div>"; @@ -61,10 +63,13 @@ foreach ($vars['value'] as $user_id) { ?> <div class="elgg-user-picker"> <input type="text" class="elgg-input-user-picker" size="30"/> - <input type="checkbox" name="match_on" value="true" /> - <label><?php echo elgg_echo('userpicker:only_friends'); ?></label> + <label> + <input type="checkbox" name="match_on" value="true" /> + <?php echo elgg_echo('userpicker:only_friends'); ?> + </label> <ul class="elgg-user-picker-list"><?php echo $user_list; ?></ul> </div> <script type="text/javascript"> + // @todo grab the values in the init function rather than using inline JS elgg.userpicker.userList = <?php echo $json_values ?>; -</script>
\ No newline at end of file +</script> |
