You are here

public function FlexiformDisplayPageBase::configForm in Flexiform 7

Get the configuration form.

Overrides FlexiformDisplayBase::configForm

3 calls to FlexiformDisplayPageBase::configForm()
FlexiformDisplayCreateModal::configForm in includes/display/add_modal.display.inc
Get config form.
FlexiformDisplayCreatePage::configForm in includes/display/add_page.display.inc
Get the configuration form.
FlexiformDisplayEditPage::configForm in includes/display/edit_page.display.inc
Get the configuration form.
3 methods override FlexiformDisplayPageBase::configForm()
FlexiformDisplayCreateModal::configForm in includes/display/add_modal.display.inc
Get config form.
FlexiformDisplayCreatePage::configForm in includes/display/add_page.display.inc
Get the configuration form.
FlexiformDisplayEditPage::configForm in includes/display/edit_page.display.inc
Get the configuration form.

File

includes/display/page.display.inc, line 90
Base definition for pages.

Class

FlexiformDisplayPageBase
Base class for page displays.

Code

public function configForm($form, &$form_state) {
  $form = parent::configForm($form, $form_state);
  $form['path'] = array(
    '#title' => t('Path'),
    '#type' => 'textfield',
    '#default_value' => isset($this->configuration['path']) ? $this->configuration['path'] : NULL,
  );
  $form['type'] = array(
    '#title' => t('Menu type'),
    '#type' => 'select',
    '#description' => t('Select the type of menu item to use.'),
    '#options' => array(
      MENU_CALLBACK => t('No menu item'),
      MENU_NORMAL_ITEM => t('Normal menu item'),
      MENU_LOCAL_ACTION => t('Local action'),
      MENU_LOCAL_TASK => t('Tab'),
      MENU_DEFAULT_LOCAL_TASK => t('Default tab'),
    ),
    '#default_value' => isset($this->configuration['type']) ? $this->configuration['type'] : MENU_CALLBACK,
  );
  $form['menu_name'] = array(
    '#title' => t('Menu'),
    '#type' => 'select',
    '#description' => t('Select the menu the item should be put in.'),
    '#options' => module_exists('menu') ? menu_get_menus() : menu_list_system_menus(),
    '#default_value' => isset($this->configuration['menu_name']) ? $this->configuration['menu_name'] : NULL,
    '#states' => array(
      'visible' => array(
        ':input[name="displays[flexiform_create_entity_page][type]"]' => array(
          '!value' => MENU_CALLBACK,
        ),
      ),
    ),
  );
  $form['weight'] = array(
    '#title' => t('Weight'),
    '#type' => 'weight',
    '#description' => t('Heavier items will sink and lighter items will be positioned near the top.'),
    '#default_value' => isset($this->configuration['weight']) ? $this->configuration['weight'] : 0,
    '#delta' => 30,
  );
  $form['access'] = array(
    '#type' => 'fieldset',
    '#title' => t('Access'),
    '#tree' => TRUE,
    '#description' => t('Alter settings for who can access this page. These settings will override the main flexiform access settings.'),
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
  );
  $form['access']['permission'] = array(
    '#type' => 'select',
    '#title' => t('Required Permission'),
    '#description' => t('Only users with the following permission will be able to access this form. <strong>N.B. It is recommended that you use the access controls below. This option should only be used if different permissions are required for different displays.</strong>'),
    '#options' => $this
      ->getPermissionOptions(),
    '#empty_option' => t(' - None - '),
    '#default_value' => isset($this->configuration['access']['permission']) ? $this->configuration['access']['permission'] : '',
  );
  return $form;
}