class NodeTranslationController

Defines the translation controller class for nodes.

Hierarchy

Expanded class hierarchy of NodeTranslationController

File

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

Namespace

Drupal\node
View source
class NodeTranslationController extends EntityTranslationController {

  /**
   * Overrides EntityTranslationController::getAccess().
   */
  public function getAccess(EntityInterface $entity, $op) {
    return node_access($op, $entity);
  }

  /**
   * Overrides EntityTranslationController::entityFormAlter().
   */
  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'])) {
      $form['translation'] += array(
        '#group' => 'additional_settings',
        '#weight' => 100,
        '#attributes' => array(
          'class' => array(
            'node-translation-options',
          ),
        ),
      );
    }
  }

  /**
   * Overrides EntityTranslationController::entityFormTitle().
   */
  protected function entityFormTitle(EntityInterface $entity) {
    $type_name = node_get_type_label($entity);
    return t('<em>Edit @type</em> @title', array(
      '@type' => $type_name,
      '@title' => $entity
        ->label(),
    ));
  }

}

Members

Namesort descending Modifiers Type Description Overrides
EntityTranslationController::$entityInfo protected property The entity info of the entity being translated.
EntityTranslationController::$entityType protected property The type of the entity being translated.
EntityTranslationController::addTranslatabilityClue protected function Adds a clue about the form element translatability.
EntityTranslationController::entityFormDelete function Form submission handler for EntityTranslationController::entityFormAlter().
EntityTranslationController::entityFormDeleteTranslation function Form submission handler for EntityTranslationController::entityFormAlter().
EntityTranslationController::entityFormEntityBuild public function Entity builder method.
EntityTranslationController::entityFormSharedElements public function Process callback: Determines which elements get clue in the form.
EntityTranslationController::entityFormSourceChange public function Form submission handler for EntityTranslationController::entityFormAlter().
EntityTranslationController::getBasePath public function Implements EntityTranslationControllerInterface::getBasePath(). Overrides EntityTranslationControllerInterface::getBasePath
EntityTranslationController::getEditPath public function Implements EntityTranslationControllerInterface::getEditPath(). Overrides EntityTranslationControllerInterface::getEditPath
EntityTranslationController::getPathInstance protected function Returns an instance of the given path.
EntityTranslationController::getSourceLangcode public function Implements EntityTranslationControllerInterface::getSourceLanguage(). Overrides EntityTranslationControllerInterface::getSourceLangcode
EntityTranslationController::getTranslationAccess public function Implements EntityTranslationControllerInterface::getTranslationAccess(). Overrides EntityTranslationControllerInterface::getTranslationAccess
EntityTranslationController::getViewPath public function Implements EntityTranslationControllerInterface::getViewPath(). Overrides EntityTranslationControllerInterface::getViewPath
EntityTranslationController::removeTranslation public function Implements EntityTranslationControllerInterface::removeTranslation(). Overrides EntityTranslationControllerInterface::removeTranslation 1
EntityTranslationController::retranslate public function Implements EntityTranslationControllerInterface::retranslate(). Overrides EntityTranslationControllerInterface::retranslate
EntityTranslationController::__construct public function Initializes an instance of the entity translation controller.
NodeTranslationController::entityFormAlter public function Overrides EntityTranslationController::entityFormAlter(). Overrides EntityTranslationController::entityFormAlter
NodeTranslationController::entityFormTitle protected function Overrides EntityTranslationController::entityFormTitle(). Overrides EntityTranslationController::entityFormTitle
NodeTranslationController::getAccess public function Overrides EntityTranslationController::getAccess(). Overrides EntityTranslationController::getAccess