3 namespace Drupal\filter\Form;
5 use Drupal\Core\Entity\EntityConfirmFormBase;
6 use Drupal\Core\Form\FormStateInterface;
10 * Provides the filter format disable form.
14 class FilterDisableForm extends EntityConfirmFormBase {
19 public function getQuestion() {
20 return $this->t('Are you sure you want to disable the text format %format?', ['%format' => $this->entity->label()]);
26 public function getCancelUrl() {
27 return new Url('filter.admin_overview');
33 public function getConfirmText() {
34 return $this->t('Disable');
40 public function getDescription() {
41 return $this->t('Disabled text formats are completely removed from the administrative interface, and any content stored with that format will not be displayed. This action cannot be undone.');
47 public function submitForm(array &$form, FormStateInterface $form_state) {
48 $this->entity->disable()->save();
49 $this->messenger()->addStatus($this->t('Disabled text format %format.', ['%format' => $this->entity->label()]));
51 $form_state->setRedirectUrl($this->getCancelUrl());