1 layout_access.inc LayoutAccess::form(&$form, &$form_state)

Settings form for configuring this access item.

File

core/modules/layout/plugins/access/layout_access.inc, line 63
Class for loading, modifying, and saving a layout access rule (condition).

Class

LayoutAccess
@file Class for loading, modifying, and saving a layout access rule (condition).

Code

function form(&$form, &$form_state) {
  /* @var Layout|LayoutMenuItem $item */
  if ($form_state['menu_item']) {
    $item = $form_state['menu_item'];
  }
  else {
    $item = $form_state['layout'];
  }
  $access_info = layout_get_access_info($this->plugin);
  $contexts = $item->getContexts();
  $current_context_settings = isset($this->settings['contexts']) ? $this->settings['contexts'] : array();
  $form['contexts'] = layout_contexts_form_element($contexts, $current_context_settings, $access_info);
}