Same filename and directory in other branches
- 10 core/modules/filter/src/Form/FilterDisableForm.php
- 9 core/modules/filter/src/Form/FilterDisableForm.php
Namespace
Drupal\filter\Form
File
core/modules/filter/src/Form/FilterDisableForm.php
View source
<?php
namespace Drupal\filter\Form;
use Drupal\Core\Entity\EntityConfirmFormBase;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Url;
class FilterDisableForm extends EntityConfirmFormBase {
public function getQuestion() {
return $this
->t('Are you sure you want to disable the text format %format?', [
'%format' => $this->entity
->label(),
]);
}
public function getCancelUrl() {
return new Url('filter.admin_overview');
}
public function getConfirmText() {
return $this
->t('Disable');
}
public function getDescription() {
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.');
}
public function submitForm(array &$form, FormStateInterface $form_state) {
$this->entity
->disable()
->save();
$this
->messenger()
->addStatus($this
->t('Disabled text format %format.', [
'%format' => $this->entity
->label(),
]));
$form_state
->setRedirectUrl($this
->getCancelUrl());
}
}
Classes