function views_plugin_display_attachment::options_form

3.x views_plugin_display_attachment.inc views_plugin_display_attachment::options_form(&$form, &$form_state)
2.x views_plugin_display_attachment.inc views_plugin_display_attachment::options_form(&$form, &$form_state)

Provide the default form for setting options.

Overrides views_plugin_display::options_form

File

plugins/views_plugin_display_attachment.inc, line 116
Contains the attachment display plugin.

Class

views_plugin_display_attachment
The plugin that handles an attachment display.

Code

function options_form(&$form, &$form_state) {
  // It is very important to call the parent function here:
  parent::options_form($form, $form_state);

  switch ($form_state['section']) {
    case 'inherit_arguments':
      $form['#title'] .= t('Inherit arguments');
      $form['inherit_arguments'] = array(
        '#type' => 'checkbox',
        '#title' => t('Inherit'),
        '#description' => t('Should this display inherit its arguments from the parent display to which it is attached?'),
        '#default_value' => $this->get_option('inherit_arguments'),
      );
      break;
    case 'inherit_exposed_filters':
      $form['#title'] .= t('Inherit exposed filters');
      $form['inherit_exposed_filters'] = array(
        '#type' => 'checkbox',
        '#title' => t('Inherit'),
        '#description' => t('Should this display inherit its exposed filter values from the parent display to which it is attached?'),
        '#default_value' => $this->get_option('inherit_exposed_filters'),
      );
      break;
    case 'inherit_pager':
      $form['#title'] .= t('Inherit pager');
      $form['inherit_pager'] = array(
        '#type' => 'checkbox',
        '#title' => t('Inherit'),
        '#description' => t('Should this display inherit its paging values from the parent display to which it is attached? Note that this will provide unexpected results if the number of items to display do not match.'),
        '#default_value' => $this->get_option('inherit_pager'),
      );
      break;
    case 'render_pager':
      $form['#title'] .= t('Render pager');
      $form['render_pager'] = array(
        '#type' => 'checkbox',
        '#title' => t('Render'),
        '#description' => t('Should this display render the pager values? If not it can inherit from the parent...'),
        '#default_value' => $this->get_option('render_pager'),
      );
      break;
    case 'attachment_position':
      $form['#title'] .= t('Position');
      $form['attachment_position'] = array(
        '#type' => 'radios',
        '#description' => t('Attach before or after the parent display?'),
        '#options' => $this->attachment_positions(),
        '#default_value' => $this->get_option('attachment_position'),
      );
      break;
    case 'displays':
      $form['#title'] .= t('Attach to');
      $displays = array();
      foreach ($this->view->display as $display_id => $display) {
        if (!empty($display->handler) && $display->handler->accept_attachments()) {
          $displays[$display_id] = $display->display_title;
        }
      }
      $form['displays'] = array(
        '#type' => 'checkboxes',
        '#description' => t('Select which display or displays this should attach to.'),
        '#options' => $displays,
        '#default_value' => $this->get_option('displays'),
      );
      break;
  }
}