aboutsummaryrefslogtreecommitdiff
path: root/views/default/input
diff options
context:
space:
mode:
authorcash <cash.costello@gmail.com>2011-10-13 22:05:49 -0400
committercash <cash.costello@gmail.com>2011-10-13 22:05:49 -0400
commit34c968355231216624c2beae59ea9ad17f7ef2c0 (patch)
tree097668c73ea473d7536d4b2e1f0f9716f4bc2ef5 /views/default/input
parente230036354269ac638521fed90cba3f6e77aff1c (diff)
downloadelgg-34c968355231216624c2beae59ea9ad17f7ef2c0.tar.gz
elgg-34c968355231216624c2beae59ea9ad17f7ef2c0.tar.bz2
added documentation for the userpicker
Diffstat (limited to 'views/default/input')
-rw-r--r--views/default/input/userpicker.php10
1 files changed, 6 insertions, 4 deletions
diff --git a/views/default/input/userpicker.php b/views/default/input/userpicker.php
index 87cc6e24a..5c4b297b1 100644
--- a/views/default/input/userpicker.php
+++ b/views/default/input/userpicker.php
@@ -9,14 +9,14 @@
*
* 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');
@@ -29,6 +29,7 @@ function user_picker_add_user($user_id) {
$icon = elgg_view_entity_icon($user, 'tiny', array('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>";
@@ -66,5 +67,6 @@ foreach ($vars['value'] as $user_id) {
<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