You are here

function admin_menu_admin_menu_replacements in Administration menu 7.3

Same name and namespace in other branches
  1. 8.3 admin_menu.module \admin_menu_admin_menu_replacements()
  2. 5.3 admin_menu.module \admin_menu_admin_menu_replacements()
  3. 6.3 admin_menu.module \admin_menu_admin_menu_replacements()

Implements hook_admin_menu_replacements().

File

./admin_menu.module, line 537
Render an administrative menu as a dropdown menu at the top of the window.

Code

function admin_menu_admin_menu_replacements($complete) {
  $items = array();

  // If the complete menu is output, then it is uncached and will contain the
  // current counts already.
  if (!$complete) {

    // Check whether the users count component is enabled.
    $components = variable_get('admin_menu_components', array());
    if (!empty($components['admin_menu.users']) && ($user_count = admin_menu_get_user_count())) {

      // Replace the counters in the cached menu output with current counts.
      $items['.admin-menu-users a'] = $user_count;
    }
  }
  return $items;
}