5209b329bf14b8def37a45c91145e714a5b47e21
[yaffs-website] / web / core / modules / block / src / Form / BlockDeleteForm.php
1 <?php
2
3 namespace Drupal\block\Form;
4
5 use Drupal\Core\Entity\EntityDeleteForm;
6 use Drupal\Core\Url;
7
8 /**
9  * Provides a deletion confirmation form for the block instance deletion form.
10  */
11 class BlockDeleteForm extends EntityDeleteForm {
12
13   /**
14    * {@inheritdoc}
15    */
16   public function getCancelUrl() {
17     return new Url('block.admin_display');
18   }
19
20   /**
21    * {@inheritdoc}
22    */
23   public function getConfirmText() {
24     return $this->t('Remove');
25   }
26
27   /**
28    * {@inheritdoc}
29    */
30   public function getQuestion() {
31     return $this->t('Are you sure you want to remove the @entity-type %label?', [
32       '@entity-type' => $this->getEntity()->getEntityType()->getLowercaseLabel(),
33       '%label' => $this->getEntity()->label(),
34     ]);
35   }
36
37   /**
38    * {@inheritdoc}
39    */
40   protected function getDeletionMessage() {
41     $entity = $this->getEntity();
42     return $this->t('The @entity-type %label has been removed.', [
43       '@entity-type' => $entity->getEntityType()->getLowercaseLabel(),
44       '%label' => $entity->label(),
45     ]);
46   }
47
48 }