Mercurial > hg > isophonics-drupal-site
diff core/modules/block_content/src/BlockContentTranslationHandler.php @ 0:4c8ae668cc8c
Initial import (non-working)
author | Chris Cannam |
---|---|
date | Wed, 29 Nov 2017 16:09:58 +0000 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/modules/block_content/src/BlockContentTranslationHandler.php Wed Nov 29 16:09:58 2017 +0000 @@ -0,0 +1,22 @@ +<?php + +namespace Drupal\block_content; + +use Drupal\block_content\Entity\BlockContentType; +use Drupal\Core\Entity\EntityInterface; +use Drupal\content_translation\ContentTranslationHandler; + +/** + * Defines the translation handler for custom blocks. + */ +class BlockContentTranslationHandler extends ContentTranslationHandler { + + /** + * {@inheritdoc} + */ + protected function entityFormTitle(EntityInterface $entity) { + $block_type = BlockContentType::load($entity->bundle()); + return t('<em>Edit @type</em> @title', ['@type' => $block_type->label(), '@title' => $entity->label()]); + } + +}