class FilterDisableForm in Drupal 10
Same name and namespace in other branches
- 8 core/modules/filter/src/Form/FilterDisableForm.php \Drupal\filter\Form\FilterDisableForm
- 9 core/modules/filter/src/Form/FilterDisableForm.php \Drupal\filter\Form\FilterDisableForm
Provides the filter format disable form.
@internal
Hierarchy
- class \Drupal\Core\Form\FormBase implements ContainerInjectionInterface, FormInterface uses DependencySerializationTrait, LoggerChannelTrait, MessengerTrait, RedirectDestinationTrait, StringTranslationTrait
- class \Drupal\Core\Entity\EntityForm implements EntityFormInterface
- class \Drupal\Core\Entity\EntityConfirmFormBase implements ConfirmFormInterface
- class \Drupal\filter\Form\FilterDisableForm
- class \Drupal\Core\Entity\EntityConfirmFormBase implements ConfirmFormInterface
- class \Drupal\Core\Entity\EntityForm implements EntityFormInterface
Expanded class hierarchy of FilterDisableForm
File
- core/
modules/ filter/ src/ Form/ FilterDisableForm.php, line 14
Namespace
Drupal\filter\FormView source
class FilterDisableForm extends EntityConfirmFormBase {
/**
* {@inheritdoc}
*/
public function getQuestion() {
return $this
->t('Are you sure you want to disable the text format %format?', [
'%format' => $this->entity
->label(),
]);
}
/**
* {@inheritdoc}
*/
public function getCancelUrl() {
return new Url('filter.admin_overview');
}
/**
* {@inheritdoc}
*/
public function getConfirmText() {
return $this
->t('Disable');
}
/**
* {@inheritdoc}
*/
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.');
}
/**
* {@inheritdoc}
*/
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());
}
}