2b780c9e029adc42c77d6155d5c15e5b4c20d2b4
[yaffs-website] / web / core / modules / menu_link_content / src / Form / MenuLinkContentDeleteForm.php
1 <?php
2
3 namespace Drupal\menu_link_content\Form;
4
5 use Drupal\Core\Entity\ContentEntityDeleteForm;
6 use Drupal\Core\Url;
7
8 /**
9  * Provides a delete form for content menu links.
10  */
11 class MenuLinkContentDeleteForm extends ContentEntityDeleteForm {
12
13   /**
14    * {@inheritdoc}
15    */
16   public function getCancelUrl() {
17     if ($this->moduleHandler->moduleExists('menu_ui')) {
18       return new Url('entity.menu.edit_form', ['menu' => $this->entity->getMenuName()]);
19     }
20     return $this->entity->urlInfo();
21   }
22
23   /**
24    * {@inheritdoc}
25    */
26   protected function getRedirectUrl() {
27     return $this->getCancelUrl();
28   }
29
30   /**
31    * {@inheritdoc}
32    */
33   protected function getDeletionMessage() {
34     return $this->t('The menu link %title has been deleted.', ['%title' => $this->entity->label()]);
35   }
36
37 }