You are here

public function PagererPresetEditForm::processStyleChange in Pagerer 8.2

Same name and namespace in other branches
  1. 8 src/Form/PagererPresetEditForm.php \Drupal\pagerer\Form\PagererPresetEditForm::processStyleChange()

Refreshes the form after a change of a style.

File

src/Form/PagererPresetEditForm.php, line 126

Class

PagererPresetEditForm
Base form handler for Pagerer Presets.

Namespace

Drupal\pagerer\Form

Code

public function processStyleChange($form, FormStateInterface $form_state) {
  $this->messenger
    ->addMessage($this
    ->t('Click on the <em>Save</em> button to confirm the selection.'), 'warning');
  $response = new AjaxResponse();
  $status_messages = [
    '#type' => 'status_messages',
  ];
  $response
    ->addCommand(new HtmlCommand('#pagerer-ajax-messages', $status_messages));
  $response
    ->addCommand(new ReplaceCommand('#pagerer-pager-preview', $form['preview']));
  return $response;
}