1 layout.pages.inc _layout_page_access()

Access callback; Check access for Layout-provided pages.

This private function is called from layout_page_access() in layout.module.

File

core/modules/layout/layout.pages.inc, line 38
Page callbacks for non-administrative pages of Layout module.

Code

function _layout_page_access() {
  $args = func_get_args();
  $menu_item_name = array_shift($args);
  $menu_item = layout_menu_item_load($menu_item_name);

  if ($menu_item) {
    // Populate the contexts from the menu system.
    $contexts = $menu_item->getContexts();
    foreach ($contexts as $context) {
      if (isset($context->position) && isset($args[$context->position])) {
        $context->setData($args[$context->position]);
      }
    }
    return $menu_item->checkAccess();
  }

  return FALSE;
}