1 entity_bundle_layout_access.inc EntityBundleLayoutAccess::form(&$form, &$form_state)

Settings form for configuring this access item.

Overrides LayoutAccess::form

File

core/modules/layout/plugins/access/entity_bundle_layout_access.inc, line 24
Plugin to provide access control based upon entity bundle.

Class

EntityBundleLayoutAccess
@file Plugin to provide access control based upon entity bundle.

Code

function form(&$form, &$form_state) {
  parent::form($form, $form_state);

  $options = array();
  $entity_info = entity_get_info($this->entity_type);
  foreach ($entity_info['bundles'] as $type => $info) {
    $options[$type] = check_plain($info['label']);
  }

  $form['bundles'] = array(
    '#title' => t('@entity @bundle', array('@entity' => $entity_info['label'], '@bundle' => $entity_info['bundle label'])),
    '#type' => 'checkboxes',
    '#options' => $options,
    '#default_value' => $this->settings['bundles'],
  );
}