Updated to Drupal 8.5. Core Media not yet in use.
[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  * @internal
12  */
13 class BlockDeleteForm extends EntityDeleteForm {
14
15   /**
16    * {@inheritdoc}
17    */
18   public function getCancelUrl() {
19     return new Url('block.admin_display');
20   }
21
22   /**
23    * {@inheritdoc}
24    */
25   public function getConfirmText() {
26     return $this->t('Remove');
27   }
28
29   /**
30    * {@inheritdoc}
31    */
32   public function getQuestion() {
33     return $this->t('Are you sure you want to remove the @entity-type %label?', [
34       '@entity-type' => $this->getEntity()->getEntityType()->getLowercaseLabel(),
35       '%label' => $this->getEntity()->label(),
36     ]);
37   }
38
39   /**
40    * {@inheritdoc}
41    */
42   protected function getDeletionMessage() {
43     $entity = $this->getEntity();
44     return $this->t('The @entity-type %label has been removed.', [
45       '@entity-type' => $entity->getEntityType()->getLowercaseLabel(),
46       '%label' => $entity->label(),
47     ]);
48   }
49
50 }