You are here

public function AckMenuMap::realmMenu in Access Control Kit 7

Implements AckMenuHandlerInterface::realmMenu().

Overrides AckMenuHandlerInterface::realmMenu

File

ack_menu/handlers/ack_menu_map.inc, line 295
Contains the handler class for mapping menu links to access realms.

Class

AckMenuMap
Controls access to menu links based on realm mapping.

Code

public function realmMenu($realm) {

  // If the realm is mapped, use the menu from the first mapped link we find.
  // Otherwise, use the first menu we find in the handler's menu list.
  $mapped_links = $this
    ->mappedLinks($realm);
  do {
    $mlid = array_pop($mapped_links);
    $link = empty($mlid) ? NULL : menu_link_load($mlid);
  } while (isset($mlid) && empty($link));
  return empty($link) ? reset($this->menus) : $link['menu_name'];
}