protected function ScheduledPublishWidget::buildRemoveForm in Scheduled Publish 8.3
Builds the entry remove form.
1 call to ScheduledPublishWidget::buildRemoveForm()
- ScheduledPublishWidget::addEntries in src/
Plugin/ Field/ FieldWidget/ ScheduledPublishWidget.php - Adds existing entries to the widget.
File
- src/
Plugin/ Field/ FieldWidget/ ScheduledPublishWidget.php, line 302
Class
- ScheduledPublishWidget
- Plugin implementation of the 'scheduled_publish_widget' widget.
Namespace
Drupal\scheduled_publish\Plugin\Field\FieldWidgetCode
protected function buildRemoveForm(&$form, $wrapper, $field_name, $entry) {
$form['message'] = [
'#theme_wrappers' => [
'container',
],
'#markup' => $this
->t('Are you sure you want to remove "%scheduling_option"?', [
'%scheduling_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-' . $field_name . '-remove-confirm-' . $entry['delta'],
'#limit_validation_errors' => [
$form['#parents'],
],
'#ajax' => [
'callback' => [
get_called_class(),
'getElement',
],
'wrapper' => $wrapper,
],
'#sp_id' => $field_name,
'#sp_row_delta' => $entry['delta'],
];
$form['actions']['sp_remove_cancel'] = [
'#type' => 'button',
'#value' => $this
->t('Cancel'),
'#name' => 'sp-' . $field_name . '-remove-cancel-' . $entry['delta'],
'#limit_validation_errors' => [],
'#ajax' => [
'callback' => [
get_called_class(),
'getElement',
],
'wrapper' => $wrapper,
],
'#sp_id' => $field_name,
'#sp_row_delta' => $entry['delta'],
];
}