Commit 4a7abb95 authored by Dries's avatar Dries

- Patch #45312 by Robin and Zen: made theme_user_list() more like...

- Patch #45312 by Robin and Zen: made theme_user_list() more like theme_item_list(), made it robust for empty lists.
parent 56d0d76f
......@@ -584,9 +584,7 @@ function user_block($op = 'list', $delta = 0, $edit = array()) {
$items[] = $account;
}
if ($items) {
$output .= theme('user_list', $items, t('Online users'));
}
$output .= theme('user_list', $items, t('Online users'));
$block['subject'] = t('Who\'s online');
$block['content'] = $output;
......@@ -646,8 +644,10 @@ function theme_user_profile($account, $fields) {
* @ingroup themeable
*/
function theme_user_list($users, $title = NULL) {
foreach ($users as $user) {
$items[] = theme('username', $user);
if (!empty($users)) {
foreach ($users as $user) {
$items[] = theme('username', $user);
}
}
return theme('item_list', $items, $title);
}
......
......@@ -584,9 +584,7 @@ function user_block($op = 'list', $delta = 0, $edit = array()) {
$items[] = $account;
}
if ($items) {
$output .= theme('user_list', $items, t('Online users'));
}
$output .= theme('user_list', $items, t('Online users'));
$block['subject'] = t('Who\'s online');
$block['content'] = $output;
......@@ -646,8 +644,10 @@ function theme_user_profile($account, $fields) {
* @ingroup themeable
*/
function theme_user_list($users, $title = NULL) {
foreach ($users as $user) {
$items[] = theme('username', $user);
if (!empty($users)) {
foreach ($users as $user) {
$items[] = theme('username', $user);
}
}
return theme('item_list', $items, $title);
}
......
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