Version 1
[yaffs-website] / web / core / modules / shortcut / src / Form / ShortcutDeleteForm.php
diff --git a/web/core/modules/shortcut/src/Form/ShortcutDeleteForm.php b/web/core/modules/shortcut/src/Form/ShortcutDeleteForm.php
new file mode 100644 (file)
index 0000000..fcabeec
--- /dev/null
@@ -0,0 +1,36 @@
+<?php
+
+namespace Drupal\shortcut\Form;
+
+use Drupal\Core\Entity\ContentEntityDeleteForm;
+use Drupal\Core\Url;
+
+/**
+ * Builds the shortcut link deletion form.
+ */
+class ShortcutDeleteForm extends ContentEntityDeleteForm {
+
+  /**
+   * {@inheritdoc}
+   */
+  public function getFormId() {
+    return 'shortcut_confirm_delete';
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function getCancelUrl() {
+    return new Url('entity.shortcut_set.customize_form', [
+      'shortcut_set' => $this->entity->bundle(),
+    ]);
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function getRedirectUrl() {
+    return $this->getCancelUrl();
+  }
+
+}