class BlockContentTranslationHandler in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/block_content/src/BlockContentTranslationHandler.php \Drupal\block_content\BlockContentTranslationHandler
Defines the translation handler for custom blocks.
Hierarchy
- class \Drupal\content_translation\ContentTranslationHandler implements ContentTranslationHandlerInterface, EntityHandlerInterface uses DependencySerializationTrait
- class \Drupal\block_content\BlockContentTranslationHandler
Expanded class hierarchy of BlockContentTranslationHandler
File
- core/
modules/ block_content/ src/ BlockContentTranslationHandler.php, line 18 - Contains \Drupal\block_content\BlockContentTranslationHandler.
Namespace
Drupal\block_contentView source
class BlockContentTranslationHandler extends ContentTranslationHandler {
/**
* {@inheritdoc}
*/
public function entityFormAlter(array &$form, FormStateInterface $form_state, EntityInterface $entity) {
parent::entityFormAlter($form, $form_state, $entity);
// Move the translation fieldset to a vertical tab.
if (isset($form['translation'])) {
$form['translation'] += array(
'#group' => 'additional_settings',
'#weight' => 100,
'#attributes' => array(
'class' => array(
'block-content-translation-options',
),
),
);
}
}
/**
* {@inheritdoc}
*/
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(),
));
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
BlockContentTranslationHandler:: |
public | function |
Performs the needed alterations to the entity form. Overrides ContentTranslationHandler:: |
|
BlockContentTranslationHandler:: |
protected | function |
Returns the title to be used for the entity form page. Overrides ContentTranslationHandler:: |
|
ContentTranslationHandler:: |
protected | property | The current user. | |
ContentTranslationHandler:: |
protected | property | Information about the entity type. | |
ContentTranslationHandler:: |
protected | property | The type of the entity being translated. | |
ContentTranslationHandler:: |
protected | property | The array of installed field storage definitions for the entity type, keyed by field name. | |
ContentTranslationHandler:: |
protected | property | The language manager. | |
ContentTranslationHandler:: |
protected | property | The content translation manager. | |
ContentTranslationHandler:: |
protected | function | Adds a clue about the form element translatability. | |
ContentTranslationHandler:: |
protected | function | Checks the field storage definition for translatability support. | |
ContentTranslationHandler:: |
public static | function |
Instantiates a new instance of this entity handler. Overrides EntityHandlerInterface:: |
|
ContentTranslationHandler:: |
function | Form submission handler for ContentTranslationHandler::entityFormAlter(). | ||
ContentTranslationHandler:: |
function | Form submission handler for ContentTranslationHandler::entityFormAlter(). | ||
ContentTranslationHandler:: |
public | function | Entity builder method. | 2 |
ContentTranslationHandler:: |
public | function | Process callback: determines which elements get clue in the form. | |
ContentTranslationHandler:: |
public | function | Form submission handler for ContentTranslationHandler::entityFormAlter(). | |
ContentTranslationHandler:: |
function | Form submission handler for ContentTranslationHandler::entityFormAlter(). | ||
ContentTranslationHandler:: |
function | Form validation handler for ContentTranslationHandler::entityFormAlter(). | ||
ContentTranslationHandler:: |
public static | function | Default value callback for the owner base field definition. | |
ContentTranslationHandler:: |
public | function |
Returns a set of field definitions to be used to store metadata items. Overrides ContentTranslationHandlerInterface:: |
|
ContentTranslationHandler:: |
public | function |
Retrieves the source language for the translation being created. Overrides ContentTranslationHandlerInterface:: |
|
ContentTranslationHandler:: |
public | function |
Checks if the user can perform the given operation on translations of the
wrapped entity. Overrides ContentTranslationHandlerInterface:: |
|
ContentTranslationHandler:: |
protected | function | Checks whether the entity type supports author natively. | |
ContentTranslationHandler:: |
protected | function | Checks whether the entity type supports modification time natively. | |
ContentTranslationHandler:: |
protected | function | Checks whether the entity type supports creation time natively. | 1 |
ContentTranslationHandler:: |
protected | function | Checks whether the entity type supports published status natively. | 1 |
ContentTranslationHandler:: |
public | function |
Marks translations as outdated. Overrides ContentTranslationHandlerInterface:: |
|
ContentTranslationHandler:: |
public | function | Initializes an instance of the content translation controller. | |
DependencySerializationTrait:: |
protected | property | An array of service IDs keyed by property name used for serialization. | |
DependencySerializationTrait:: |
public | function | 1 | |
DependencySerializationTrait:: |
public | function | 2 |