You are here

function admin_menu_links_users in Administration menu 8.3

Same name and namespace in other branches
  1. 7.3 admin_menu.inc \admin_menu_links_users()

Builds user counter.

See also

theme_admin_menu_links()

1 call to admin_menu_links_users()
admin_menu_output in ./admin_menu.module
Build the administration menu output.

File

./admin_menu.inc, line 571
Menu builder functions for Administration menu.

Code

function admin_menu_links_users() {
  $links = [
    '#theme' => 'admin_menu_links',
    '#wrapper_attributes' => [
      'id' => 'admin-menu-users',
    ],
    '#weight' => 150,
  ];

  // Add link to show current authenticated/anonymous users.
  $links['user-counter'] = [
    '#title' => admin_menu_get_user_count(),
    '#description' => t('Current anonymous / authenticated users'),
    '#weight' => -90,
    '#attributes' => [
      'class' => [
        'admin-menu-action',
        'admin-menu-users',
      ],
    ],
    '#href' => user_access('administer users') ? 'admin/people/people' : 'user',
  ];
  return $links;
}