BlockContentTranslationHandler.php in Zircon Profile 8.0
File
core/modules/block_content/src/BlockContentTranslationHandler.php
View source
<?php
namespace Drupal\block_content;
use Drupal\block_content\Entity\BlockContentType;
use Drupal\Core\Entity\EntityInterface;
use Drupal\content_translation\ContentTranslationHandler;
use Drupal\Core\Form\FormStateInterface;
class BlockContentTranslationHandler extends ContentTranslationHandler {
public function entityFormAlter(array &$form, FormStateInterface $form_state, EntityInterface $entity) {
parent::entityFormAlter($form, $form_state, $entity);
if (isset($form['translation'])) {
$form['translation'] += array(
'#group' => 'additional_settings',
'#weight' => 100,
'#attributes' => array(
'class' => array(
'block-content-translation-options',
),
),
);
}
}
protected function entityFormTitle(EntityInterface $entity) {
$block_type = BlockContentType::load($entity
->bundle());
return t('<em>Edit @type</em> @title', array(
'@type' => $block_type
->label(),
'@title' => $entity
->label(),
));
}
}