From 5041c6c48153453ed597206d08eeff37cf20e676 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Sat, 15 Mar 2014 14:46:48 -0300 Subject: Squashed 'mod/cool_theme/' content from commit a26f7df git-subtree-dir: mod/cool_theme git-subtree-split: a26f7df43a266f7d1ff04847da330d15f6041e9b --- views/default/input/userpicker.php | 73 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 views/default/input/userpicker.php (limited to 'views/default/input/userpicker.php') diff --git a/views/default/input/userpicker.php b/views/default/input/userpicker.php new file mode 100644 index 000000000..91a397e37 --- /dev/null +++ b/views/default/input/userpicker.php @@ -0,0 +1,73 @@ + false)); + + // this html must be synced with the userpicker.js library + $code = '
  • '; + $code .= "
    $icon
    "; + $code .= ""; + $code .= "
    " . $user->name . "
    "; + $code .= "
    "; + $code .= ""; + $code .= '
  • '; + + return $code; +} + +// loop over all values and prepare them so that "in" will work in javascript +$values = array(); +if (!is_array($vars['value'])) { + $vars['value'] = array($vars['value']); +} +foreach ($vars['value'] as $value) { + $values[$value] = TRUE; +} + +// convert the values to a json-encoded list +$json_values = json_encode($values); + +// create an HTML list of users +$user_list = ''; +foreach ($vars['value'] as $user_id) { + $user_list .= user_picker_add_user($user_id); +} + +?> +
    + + + + +
    + \ No newline at end of file -- cgit v1.2.3