1 admin_bar.inc | admin_bar_links_users() |
Builds user counter.
See also
File
- core/
modules/ admin_bar/ admin_bar.inc, line 640 - Menu builder functions for Administration bar.
Code
function admin_bar_links_users() {
// Add link to show current authenticated/anonymous users.
$links['user-counter'] = array(
// This span is used by JavaScript to update the value while preserving the
// overall admin bar cache.
'#title' => '<span class="user-counter-value">' . admin_bar_get_user_count() . '</span>',
'#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'),
'#options' => array(
'icon' => 'user-list-fill',
'html' => TRUE,
),
);
return $links;
}