You are here

function ds_field_ui_change_layout_submit in Display Suite 8.3

Same name and namespace in other branches
  1. 8.4 includes/field_ui.inc \ds_field_ui_change_layout_submit()
  2. 8.2 includes/field_ui.inc \ds_field_ui_change_layout_submit()
  3. 7.2 includes/ds.field_ui.inc \ds_field_ui_change_layout_submit()

Form submission handler for _ds_field_ui_table_layouts_preview().

2 string references to 'ds_field_ui_change_layout_submit'
ds_field_ui_layouts_save in includes/field_ui.inc
Save the layout settings from the 'Manage display' screen.
_ds_field_ui_table_layouts_preview in includes/field_ui.inc
Add the layout previews to the Field UI screen.

File

includes/field_ui.inc, line 1109
Field UI functions for Display Suite.

Code

function ds_field_ui_change_layout_submit($form, FormStateInterface $form_state) {

  // Remove original destination.
  \Drupal::request()->query
    ->remove('destination');
  $destination = $form_state
    ->getValue('layout_changed_url');
  $redirectUrl = new Url($destination['route_name'], $destination['route_parameters'], $destination['options']);
  if (!empty($destination['destination_url'])) {
    $redirectUrl
      ->setOption('query', [
      'destination' => $destination['destination_url'],
    ]);
  }
  $form_state
    ->setRedirectUrl($redirectUrl);
}