1.12.x admin_bar.inc admin_bar_links_users()
1.10.x admin_bar.inc admin_bar_links_users()
1.11.x admin_bar.inc admin_bar_links_users()
1.7.x admin_bar.inc admin_bar_links_users()

Builds user counter.

See also

theme_admin_bar_links()

File

modules/admin_bar/admin_bar.inc, line 623
Menu builder functions for Administration bar.

Code

function admin_bar_links_users() {
  // Add link to show current authenticated/anonymous users.
  $links['user-counter'] = array(
    '#title' => admin_bar_get_user_count(),
    '#description' => t('Current anonymous / authenticated users'),
    '#weight' => 20,
    '#attributes' => array('class' => array('admin-bar-action', 'admin-bar-users')),
    '#href' => (user_access('administer users') ? 'admin/people/list' : 'user'),
  );
  return $links;
}