You are here

function views_ui_edit_display_form in Views (for Drupal 7) 7.3

Same name and namespace in other branches
  1. 8.3 views_ui/admin.inc \views_ui_edit_display_form()
  2. 6.3 includes/admin.inc \views_ui_edit_display_form()
  3. 6.2 includes/admin.inc \views_ui_edit_display_form()

Form constructor callback to edit display of a view.

1 string reference to 'views_ui_edit_display_form'
views_ui_ajax_forms in includes/admin.inc

File

includes/admin.inc, line 3414
Provides the Views' administrative interface.

Code

function views_ui_edit_display_form($form, &$form_state) {
  $view =& $form_state['view'];
  $display_id = $form_state['display_id'];
  $section = $form_state['section'];
  if (!$view
    ->set_display($display_id)) {
    views_ajax_error(t('Invalid display id @display', array(
      '@display' => $display_id,
    )));
  }
  $display =& $view->display[$display_id];

  // Get form from the handler.
  $form['options'] = array(
    '#theme_wrappers' => array(
      'container',
    ),
    '#attributes' => array(
      'class' => array(
        'scroll',
      ),
    ),
  );
  $display->handler
    ->options_form($form['options'], $form_state);

  // The handler options form sets $form['#title'], which we need on the entire
  // $form instead of just the ['options'] section.
  $form['#title'] = $form['options']['#title'];
  unset($form['options']['#title']);

  // Move the override dropdown out of the scrollable section of the form.
  if (isset($form['options']['override'])) {
    $form['override'] = $form['options']['override'];
    unset($form['options']['override']);
  }
  $name = NULL;
  if (isset($form_state['update_name'])) {
    $name = $form_state['update_name'];
  }
  views_ui_standard_form_buttons($form, $form_state, 'views_ui_edit_display_form', $name);
  return $form;
}