3 namespace Drupal\filter\Form;
5 use Drupal\Core\Entity\EntityConfirmFormBase;
6 use Drupal\Core\Form\FormStateInterface;
10 * Provides the filter format disable form.
12 class FilterDisableForm extends EntityConfirmFormBase {
17 public function getQuestion() {
18 return $this->t('Are you sure you want to disable the text format %format?', ['%format' => $this->entity->label()]);
24 public function getCancelUrl() {
25 return new Url('filter.admin_overview');
31 public function getConfirmText() {
32 return $this->t('Disable');
38 public function getDescription() {
39 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.');
45 public function submitForm(array &$form, FormStateInterface $form_state) {
46 $this->entity->disable()->save();
47 drupal_set_message($this->t('Disabled text format %format.', ['%format' => $this->entity->label()]));
49 $form_state->setRedirectUrl($this->getCancelUrl());