ClearReplicationQueueForm.php in Workspace 8
File
src/Form/ClearReplicationQueueForm.php
View source
<?php
namespace Drupal\workspace\Form;
use Drupal\Core\Form\FormBase;
use Drupal\Core\Form\FormStateInterface;
class ClearReplicationQueueForm extends FormBase {
public function getFormId() {
return 'clear_replication_queue_form';
}
public function buildForm(array $form, FormStateInterface $form_state) {
$form['clear_queue'] = array(
'#type' => 'fieldset',
'#title' => $this
->t('Clear replication queue'),
);
$form['clear_queue']['submit'] = [
'#type' => 'submit',
'#value' => $this
->t('Clear queue'),
];
$form['clear_queue']['description'] = [
'#type' => 'markup',
'#markup' => '<div class="description">' . $this
->t('All replications will be marked as failed and removed from the cron queue, except those that are in progress.') . '</div>',
];
return $form;
}
public function submitForm(array &$form, FormStateInterface $form_state) {
$form_state
->setRedirect('workspace.confirm_clear_replication_queue');
}
}