X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;f=web%2Fmodules%2Fcontrib%2Ffontyourface%2Fmodules%2Flocal_fonts%2Fsrc%2FForm%2FLocalFontConfigEntityDeleteForm.php;fp=web%2Fmodules%2Fcontrib%2Ffontyourface%2Fmodules%2Flocal_fonts%2Fsrc%2FForm%2FLocalFontConfigEntityDeleteForm.php;h=2823fe80fada27c9968847e5b271ca59c922799b;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hp=0000000000000000000000000000000000000000;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad;p=yaffs-website diff --git a/web/modules/contrib/fontyourface/modules/local_fonts/src/Form/LocalFontConfigEntityDeleteForm.php b/web/modules/contrib/fontyourface/modules/local_fonts/src/Form/LocalFontConfigEntityDeleteForm.php new file mode 100644 index 000000000..2823fe80f --- /dev/null +++ b/web/modules/contrib/fontyourface/modules/local_fonts/src/Form/LocalFontConfigEntityDeleteForm.php @@ -0,0 +1,53 @@ +t('Are you sure you want to delete %name?', ['%name' => $this->entity->label()]); + } + + /** + * {@inheritdoc} + */ + public function getCancelUrl() { + return new Url('entity.local_font_config_entity.collection'); + } + + /** + * {@inheritdoc} + */ + public function getConfirmText() { + return $this->t('Delete'); + } + + /** + * {@inheritdoc} + */ + public function submitForm(array &$form, FormStateInterface $form_state) { + $this->entity->delete(); + + drupal_set_message( + $this->t('content @type: deleted @label.', + [ + '@type' => $this->entity->bundle(), + '@label' => $this->entity->label(), + ] + ) + ); + + $form_state->setRedirectUrl($this->getCancelUrl()); + } + +}