public function NodeTranslationController::entityFormAlter

Overrides EntityTranslationController::entityFormAlter().

Overrides EntityTranslationController::entityFormAlter

File

drupal/core/modules/node/lib/Drupal/node/NodeTranslationController.php, line 28
Definition of Drupal\node\NodeTranslationController.

Class

NodeTranslationController
Defines the translation controller class for nodes.

Namespace

Drupal\node

Code

public function entityFormAlter(array &$form, array &$form_state, EntityInterface $entity) {
  parent::entityFormAlter($form, $form_state, $entity);

  // Move the translation fieldset to a vertical tab.
  if (isset($form['translation_entity'])) {
    $form['translation_entity'] += array(
      '#group' => 'additional_settings',
      '#weight' => 100,
      '#attributes' => array(
        'class' => array(
          'node-translation-options',
        ),
      ),
    );

    // We do not need to show these values on node forms: they inherit the
    // basic node property values.
    $form['translation_entity']['status']['#access'] = FALSE;
    $form['translation_entity']['name']['#access'] = FALSE;
    $form['translation_entity']['created']['#access'] = FALSE;
  }
}