public function EditDetails::submitForm

Overrides \Drupal\views_ui\Form\Ajax\ViewsFormBase::submitForm().

Overrides ViewsFormBase::submitForm

File

drupal/core/modules/views_ui/lib/Drupal/views_ui/Form/Ajax/EditDetails.php, line 78
Contains \Drupal\views_ui\Form\Ajax\EditDetails.

Class

EditDetails
Provides a form for editing the details of a View.

Namespace

Drupal\views_ui\Form\Ajax

Code

public function submitForm(array &$form, array &$form_state) {
  $view = $form_state['view'];
  foreach ($form_state['values'] as $key => $value) {

    // Only save values onto the view if they're actual view properties
    // (as opposed to 'op' or 'form_build_id').
    if (isset($form['details'][$key])) {
      $view
        ->set($key, $value);
    }
  }
  $bases = Views::viewsData()
    ->fetchBaseTables();
  $form_state['#page_title'] = $view
    ->label();
  if (isset($bases[$view
    ->get('base_table')])) {
    $form_state['#page_title'] .= ' (' . $bases[$view
      ->get('base_table')]['title'] . ')';
  }
  $view
    ->cacheSet();
}