Commit 7a75734f authored by Martyn Smith's avatar Martyn Smith Committed by Martyn Smith
Browse files

Add array support to display_name()

parent 86b84712
......@@ -51,7 +51,7 @@ $data = search_user($query, $limit, $offset);
foreach ($data['results'] as &$result) {
// @todo should call magical display user function
$result['name'] = $result['firstname'];
$result['name'] = display_name($result);
unset($result['email']);
unset($result['institution']);
......
......@@ -50,8 +50,7 @@ function form_render_userlist($element, Form $form) {
$members = get_records_select('usr','id IN (' . join(',',$value) . ')', null, '', 'id,firstname,lastname,prefname');
foreach($members as &$member) {
// @todo should be using the pref/full name function here
$member = $member->firstname;
$member = display_name($member);
}
$smarty->assign('options',$members);
......
......@@ -1015,6 +1015,9 @@ function email_user($userto, $userfrom, $subject, $messagetext, $messagehtml='')
}
function display_name($user) {
if (is_array($user)) {
$user = (object)$user;
}
return $user->firstname . ' ' . $user->lastname;
// @todo
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment