X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Fnode%2Fsrc%2FForm%2FNodeDeleteForm.php;fp=web%2Fcore%2Fmodules%2Fnode%2Fsrc%2FForm%2FNodeDeleteForm.php;h=da8c2025c11c7186815dc192b9f992ad1c1bba63;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hp=0000000000000000000000000000000000000000;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad;p=yaffs-website diff --git a/web/core/modules/node/src/Form/NodeDeleteForm.php b/web/core/modules/node/src/Form/NodeDeleteForm.php new file mode 100644 index 000000000..da8c2025c --- /dev/null +++ b/web/core/modules/node/src/Form/NodeDeleteForm.php @@ -0,0 +1,45 @@ +getEntity(); + + $node_type_storage = $this->entityManager->getStorage('node_type'); + $node_type = $node_type_storage->load($entity->bundle())->label(); + + if (!$entity->isDefaultTranslation()) { + return $this->t('@language translation of the @type %label has been deleted.', [ + '@language' => $entity->language()->getName(), + '@type' => $node_type, + '%label' => $entity->label(), + ]); + } + + return $this->t('The @type %title has been deleted.', [ + '@type' => $node_type, + '%title' => $this->getEntity()->label(), + ]); + } + + /** + * {@inheritdoc} + */ + protected function logDeletionMessage() { + /** @var \Drupal\node\NodeInterface $entity */ + $entity = $this->getEntity(); + $this->logger('content')->notice('@type: deleted %title.', ['@type' => $entity->getType(), '%title' => $entity->label()]); + } + +}