You are here

protected function MultipleUpdatesForm::buildStateRemoveForm in Scheduled Publish 8.3

Builds the state entry remove form.

1 call to MultipleUpdatesForm::buildStateRemoveForm()
MultipleUpdatesForm::addStates in src/Form/MultipleUpdatesForm.php
Adds existing state entries to the form.

File

src/Form/MultipleUpdatesForm.php, line 339
Contains \Drupal\scheduled_publish\Form\MultipleUpdatesForm.

Class

MultipleUpdatesForm

Namespace

Drupal\scheduled_publish\Form

Code

protected function buildStateRemoveForm(&$form, $wrapper, $entry) {
  $form['message'] = [
    '#theme_wrappers' => [
      'container',
    ],
    '#markup' => $this
      ->t('Are you sure you want to remove "%shceduling_option"?', [
      '%shceduling_option' => $entry['date_display'] . ' ' . $entry['state_display'],
    ]),
  ];
  $form['actions'] = [
    '#type' => 'container',
    '#weight' => 10,
  ];
  $form['actions']['sp_remove_confirm'] = [
    '#type' => 'button',
    '#value' => $this
      ->t('Remove'),
    '#name' => 'sp-state-remove-confirm-' . $entry['delta'],
    '#limit_validation_errors' => [
      $form['#parents'],
    ],
    '#ajax' => [
      'callback' => [
        get_called_class(),
        'getForm',
      ],
      'wrapper' => $wrapper,
    ],
    '#sp_row_delta' => $entry['delta'],
  ];
  $form['actions']['sp_remove_cancel'] = [
    '#type' => 'button',
    '#value' => $this
      ->t('Cancel'),
    '#name' => 'sp-state-remove-cancel-' . $entry['delta'],
    '#limit_validation_errors' => [],
    '#ajax' => [
      'callback' => [
        get_called_class(),
        'getForm',
      ],
      'wrapper' => $wrapper,
    ],
    '#sp_row_delta' => $entry['delta'],
  ];
}