You are here

public function AckMenuMap::__construct in Access Control Kit 7

Overrides AccessControlKitHandler::__construct().

Overrides AccessControlKitHandler::__construct

File

ack_menu/handlers/ack_menu_map.inc, line 71
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 __construct($scheme, array $settings = array()) {
  parent::__construct($scheme, $settings);
  $this->schemeMachineName = $scheme->machine_name;
  $this->schemeName = $scheme->name;
  $this->schemeRealms = isset($scheme->realms) ? $scheme->realms : array();

  // Make sure that the configured menus actually exist.
  $this->menus = array();
  if (isset($settings['menus'])) {
    $menus = menu_get_menus();
    foreach ($settings['menus'] as $menu_name) {
      if (isset($menus[$menu_name])) {
        $this->menus[] = $menu_name;
      }
    }
  }
}