You are here

function theme_user_list in Drupal 7

Same name and namespace in other branches
  1. 4 modules/user.module \theme_user_list()
  2. 5 modules/user/user.module \theme_user_list()
  3. 6 modules/user/user.module \theme_user_list()

Returns HTML for a list of users.

Parameters

$variables: An associative array containing:

  • users: An array with user objects. Should contain at least the name and uid.
  • title: (optional) Title to pass on to theme_item_list().

Related topics

1 theme call to theme_user_list()
user_block_view in modules/user/user.module
Implements hook_block_view().

File

modules/user/user.module, line 1545
Enables the user registration and login system.

Code

function theme_user_list($variables) {
  $users = $variables['users'];
  $title = $variables['title'];
  $items = array();
  if (!empty($users)) {
    foreach ($users as $user) {
      $items[] = theme('username', array(
        'account' => $user,
      ));
    }
  }
  return theme('item_list', array(
    'items' => $items,
    'title' => $title,
  ));
}