BlockContentTranslationHandler::entityFormAlter

public BlockContentTranslationHandler::entityFormAlter(array &$form, FormStateInterface $form_state, EntityInterface $entity)

Performs the needed alterations to the entity form.

Parameters

array $form: The entity form to be altered to provide the translation workflow.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

\Drupal\Core\Entity\EntityInterface $entity: The entity being created or edited.

Overrides ContentTranslationHandler::entityFormAlter

File

core/modules/block_content/src/BlockContentTranslationHandler.php, line 18

Class

BlockContentTranslationHandler
Defines the translation handler for custom blocks.

Namespace

Drupal\block_content

Code

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'),
      ),
    );
  }
}
doc_Drupal
2016-10-29 08:47:03
Comments
Leave a Comment

Please login to continue.