3 namespace Drupal\pathauto\Form;
5 use Drupal\Core\Entity\EntityConfirmFormBase;
6 use Drupal\Core\Form\FormStateInterface;
10 * Provides the pathauto pattern disable disable form.
12 class PatternDisableForm extends EntityConfirmFormBase {
17 public function getQuestion() {
18 return $this->t('Are you sure you want to disable the pattern %label?', array('%label' => $this->entity->label()));
24 public function getCancelUrl() {
25 return new Url('entity.pathauto_pattern.collection');
31 public function getConfirmText() {
32 return $this->t('Disable');
38 public function getDescription() {
39 return $this->t('Disabled patterns are ignored when generating aliases.');
45 public function submitForm(array &$form, FormStateInterface $form_state) {
46 $this->entity->disable()->save();
47 drupal_set_message($this->t('Disabled pattern %label.', array('%label' => $this->entity->label())));
49 $form_state->setRedirectUrl($this->getCancelUrl());