Commit 3b3ba275 authored by alexpott's avatar alexpott

Issue #2227973 by pfrenssen, Berdir: Rename ContentTranslationController to...

Issue #2227973 by pfrenssen, Berdir: Rename ContentTranslationController to ContentTranslationHandler.
parent afd8aee5
......@@ -2,21 +2,21 @@
/**
* @file
* Contains \Drupal\custom_block\CustomBlockTranslationController.
* Contains \Drupal\custom_block\CustomBlockTranslationHandler.
*/
namespace Drupal\custom_block;
use Drupal\Core\Entity\EntityInterface;
use Drupal\content_translation\ContentTranslationController;
use Drupal\content_translation\ContentTranslationHandler;
/**
* Defines the translation controller class for custom blocks.
* Defines the translation handler for custom blocks.
*/
class CustomBlockTranslationController extends ContentTranslationController {
class CustomBlockTranslationHandler extends ContentTranslationHandler {
/**
* Overrides ContentTranslationController::entityFormAlter().
* {@inheritdoc}
*/
public function entityFormAlter(array &$form, array &$form_state, EntityInterface $entity) {
parent::entityFormAlter($form, $form_state, $entity);
......@@ -33,7 +33,7 @@ public function entityFormAlter(array &$form, array &$form_state, EntityInterfac
}
/**
* Overrides ContentTranslationController::entityFormTitle().
* {@inheritdoc}
*/
protected function entityFormTitle(EntityInterface $entity) {
$block_type = entity_load('custom_block_type', $entity->bundle());
......
......@@ -30,7 +30,7 @@
* "delete" = "Drupal\custom_block\Form\CustomBlockDeleteForm",
* "default" = "Drupal\custom_block\CustomBlockFormController"
* },
* "translation" = "Drupal\custom_block\CustomBlockTranslationController"
* "translation" = "Drupal\custom_block\CustomBlockTranslationHandler"
* },
* admin_permission = "administer blocks",
* base_table = "custom_block",
......
<?php
/**
* @file
* Definition of Drupal\comment\CommentTranslationController.
* Contains \Drupal\comment\CommentTranslationHandler.
*/
namespace Drupal\comment;
use Drupal\Core\Entity\EntityInterface;
use Drupal\content_translation\ContentTranslationController;
use Drupal\content_translation\ContentTranslationHandler;
/**
* Defines the translation controller class for comments.
* Defines the translation handler for comments.
*/
class CommentTranslationController extends ContentTranslationController {
class CommentTranslationHandler extends ContentTranslationHandler {
/**
* Overrides ContentTranslationController::entityFormTitle().
* {@inheritdoc}
*/
protected function entityFormTitle(EntityInterface $entity) {
return t('Edit comment @subject', array('@subject' => $entity->label()));
......
......@@ -2,7 +2,7 @@
/**
* @file
* Definition of Drupal\comment\Entity\Comment.
* Contains \Drupal\comment\Entity\Comment.
*/
namespace Drupal\comment\Entity;
......@@ -32,7 +32,7 @@
* "default" = "Drupal\comment\CommentFormController",
* "delete" = "Drupal\comment\Form\DeleteForm"
* },
* "translation" = "Drupal\comment\CommentTranslationController"
* "translation" = "Drupal\comment\CommentTranslationHandler"
* },
* base_table = "comment",
* uri_callback = "comment_uri",
......
......@@ -90,9 +90,9 @@ function content_translation_language_types_info_alter(array &$language_types) {
* Every entity type needs a translation controller to be translated. This can
* be specified through the 'translation' key in the 'controllers' entity info
* property. If an entity type is translatable and no translation controller is
* defined, \Drupal\content_translation\ContentTranslationController will be
* defined, \Drupal\content_translation\ContentTranslationHandler will be
* assumed. Every translation controller class must implement
* \Drupal\content_translation\ContentTranslationControllerInterface.
* \Drupal\content_translation\ContentTranslationHandlerInterface.
*
* If the entity paths match the default pattern above and there is no need for
* an entity-specific translation controller class, Content Translation will
......@@ -107,7 +107,7 @@ function content_translation_entity_type_alter(array &$entity_types) {
foreach ($entity_types as $entity_type) {
if ($entity_type->isTranslatable()) {
if (!$entity_type->hasControllerClass('translation')) {
$entity_type->setControllerClass('translation', 'Drupal\content_translation\ContentTranslationController');
$entity_type->setControllerClass('translation', 'Drupal\content_translation\ContentTranslationHandler');
}
$translation = $entity_type->get('translation');
......@@ -347,7 +347,7 @@ function content_translation_enabled($entity_type, $bundle = NULL) {
* @param string $entity_type_id
* The type of the entity being translated.
*
* @return \Drupal\content_translation\ContentTranslationControllerInterface
* @return \Drupal\content_translation\ContentTranslationHandlerInterface
* An instance of the content translation controller interface.
*
* @todo Move to \Drupal\content_translation\ContentTranslationManager.
......
......@@ -2,7 +2,7 @@
/**
* @file
* Definition of Drupal\content_translation\ContentTranslationController.
* Contains \Drupal\content_translation\ContentTranslationHandler.
*/
namespace Drupal\content_translation;
......@@ -13,9 +13,9 @@
use Drupal\Core\Render\Element;
/**
* Base class for content translation controllers.
* Base class for content translation handlers.
*/
class ContentTranslationController implements ContentTranslationControllerInterface {
class ContentTranslationHandler implements ContentTranslationHandlerInterface {
/**
* The type of the entity being translated.
......@@ -43,7 +43,7 @@ public function __construct(EntityTypeInterface $entity_type) {
}
/**
* Implements ContentTranslationControllerInterface::retranslate().
* {@inheritdoc}
*/
public function retranslate(EntityInterface $entity, $langcode = NULL) {
$updated_langcode = !empty($langcode) ? $langcode : $entity->language()->id;
......@@ -54,7 +54,7 @@ public function retranslate(EntityInterface $entity, $langcode = NULL) {
}
/**
* Implements ContentTranslationControllerInterface::getTranslationAccess().
* {@inheritdoc}
*/
public function getTranslationAccess(EntityInterface $entity, $op) {
// @todo Move this logic into a translation access controller checking also
......@@ -70,14 +70,14 @@ public function getTranslationAccess(EntityInterface $entity, $op) {
}
/**
* Implements ContentTranslationControllerInterface::getSourceLanguage().
* {@inheritdoc}
*/
public function getSourceLangcode(array $form_state) {
return isset($form_state['content_translation']['source']) ? $form_state['content_translation']['source']->id : FALSE;
}
/**
* Implements ContentTranslationControllerInterface::entityFormAlter().
* {@inheritdoc}
*/
public function entityFormAlter(array &$form, array &$form_state, EntityInterface $entity) {
$form_controller = content_translation_form_controller($form_state);
......@@ -282,7 +282,7 @@ public function entityFormAlter(array &$form, array &$form_state, EntityInterfac
/**
* Process callback: determines which elements get clue in the form.
*
* @see \Drupal\content_translation\ContentTranslationController::entityFormAlter()
* @see \Drupal\content_translation\ContentTranslationHandler::entityFormAlter()
*/
public function entityFormSharedElements($element, $form_state, $form) {
static $ignored_types;
......@@ -366,7 +366,7 @@ protected function addTranslatabilityClue(&$element) {
* @param \Drupal\Core\Entity\EntityInterface $entity
* The entity whose form is being built.
*
* @see \Drupal\content_translation\ContentTranslationController::entityFormAlter()
* @see \Drupal\content_translation\ContentTranslationHandler::entityFormAlter()
*/
public function entityFormEntityBuild($entity_type, EntityInterface $entity, array $form, array &$form_state) {
$form_controller = content_translation_form_controller($form_state);
......@@ -403,7 +403,7 @@ public function entityFormEntityBuild($entity_type, EntityInterface $entity, arr
}
/**
* Form validation handler for ContentTranslationController::entityFormAlter().
* Form validation handler for ContentTranslationHandler::entityFormAlter().
*
* Validates the submitted content translation metadata.
*/
......@@ -422,7 +422,7 @@ function entityFormValidate($form, &$form_state) {
}
/**
* Form submission handler for ContentTranslationController::entityFormAlter().
* Form submission handler for ContentTranslationHandler::entityFormAlter().
*
* Takes care of the source language change.
*/
......@@ -438,7 +438,7 @@ public function entityFormSourceChange($form, &$form_state) {
}
/**
* Form submission handler for ContentTranslationController::entityFormAlter().
* Form submission handler for ContentTranslationHandler::entityFormAlter().
*
* Takes care of entity deletion.
*/
......@@ -451,7 +451,7 @@ function entityFormDelete($form, &$form_state) {
}
/**
* Form submission handler for ContentTranslationController::entityFormAlter().
* Form submission handler for ContentTranslationHandler::entityFormAlter().
*
* Takes care of content translation deletion.
*/
......
......@@ -2,7 +2,7 @@
/**
* @file
* Definition of Drupal\content_translation\ContentTranslationControllerInterface.
* Contains \Drupal\content_translation\ContentTranslationHandlerInterface.
*/
namespace Drupal\content_translation;
......@@ -15,7 +15,7 @@
* Defines a set of methods to allow any entity to be processed by the entity
* translation UI.
*/
interface ContentTranslationControllerInterface {
interface ContentTranslationHandlerInterface {
/**
* Checks if the user can perform the given operation on translations of the
......
......@@ -75,7 +75,7 @@ abstract class ContentTranslationTestBase extends WebTestBase {
/**
* The translation controller for the current entity type.
*
* @var \Drupal\content_translation\ContentTranslationControllerInterface
* @var \Drupal\content_translation\ContentTranslationHandlerInterface
*/
protected $controller;
......
......@@ -2,7 +2,7 @@
/**
* @file
* Definition of Drupal\node\Entity\Node.
* Contains \Drupal\node\Entity\Node.
*/
namespace Drupal\node\Entity;
......@@ -32,7 +32,7 @@
* "edit" = "Drupal\node\NodeFormController"
* },
* "list_builder" = "Drupal\node\NodeListBuilder",
* "translation" = "Drupal\node\NodeTranslationController"
* "translation" = "Drupal\node\NodeTranslationHandler"
* },
* base_table = "node",
* data_table = "node_field_data",
......
......@@ -2,21 +2,21 @@
/**
* @file
* Definition of Drupal\node\NodeTranslationController.
* Contains \Drupal\node\NodeTranslationHandler.
*/
namespace Drupal\node;
use Drupal\Core\Entity\EntityInterface;
use Drupal\content_translation\ContentTranslationController;
use Drupal\content_translation\ContentTranslationHandler;
/**
* Defines the translation controller class for nodes.
* Defines the translation handler for nodes.
*/
class NodeTranslationController extends ContentTranslationController {
class NodeTranslationHandler extends ContentTranslationHandler {
/**
* Overrides ContentTranslationController::entityFormAlter().
* {@inheritdoc}
*/
public function entityFormAlter(array &$form, array &$form_state, EntityInterface $entity) {
parent::entityFormAlter($form, $form_state, $entity);
......@@ -63,7 +63,7 @@ public function entityFormAlter(array &$form, array &$form_state, EntityInterfac
}
/**
* Overrides ContentTranslationController::entityFormTitle().
* {@inheritdoc}
*/
protected function entityFormTitle(EntityInterface $entity) {
$type_name = node_get_type_label($entity);
......@@ -71,7 +71,7 @@ protected function entityFormTitle(EntityInterface $entity) {
}
/**
* Overrides ContentTranslationController::entityFormEntityBuild().
* {@inheritdoc}
*/
public function entityFormEntityBuild($entity_type, EntityInterface $entity, array $form, array &$form_state) {
if (isset($form_state['values']['content_translation'])) {
......
......@@ -27,7 +27,7 @@
* "add" = "Drupal\shortcut\ShortcutFormController",
* "delete" = "Drupal\shortcut\Form\ShortcutDeleteForm"
* },
* "translation" = "Drupal\content_translation\ContentTranslationController"
* "translation" = "Drupal\content_translation\ContentTranslationHandler"
* },
* base_table = "shortcut",
* data_table = "shortcut_field_data",
......
......@@ -2,7 +2,7 @@
/**
* @file
* Definition of Drupal\entity_test\Entity\EntityTest.
* Contains \Drupal\entity_test\Entity\EntityTest.
*/
namespace Drupal\entity_test\Entity;
......@@ -28,7 +28,7 @@
* "form" = {
* "default" = "Drupal\entity_test\EntityTestFormController"
* },
* "translation" = "Drupal\content_translation\ContentTranslationController"
* "translation" = "Drupal\content_translation\ContentTranslationHandler"
* },
* base_table = "entity_test",
* fieldable = TRUE,
......
......@@ -2,7 +2,7 @@
/**
* @file
* Definition of Drupal\entity_test\Entity\EntityTestBaseFieldDisplay.
* Contains \Drupal\entity_test\Entity\EntityTestBaseFieldDisplay.
*/
namespace Drupal\entity_test\Entity;
......@@ -21,7 +21,7 @@
* "form" = {
* "default" = "Drupal\entity_test\EntityTestFormController"
* },
* "translation" = "Drupal\content_translation\ContentTranslationController"
* "translation" = "Drupal\content_translation\ContentTranslationHandler"
* },
* base_table = "entity_test",
* fieldable = TRUE,
......
......@@ -20,7 +20,7 @@
* "form" = {
* "default" = "Drupal\entity_test\EntityTestFormController"
* },
* "translation" = "Drupal\content_translation\ContentTranslationController"
* "translation" = "Drupal\content_translation\ContentTranslationHandler"
* },
* base_table = "entity_test",
* fieldable = TRUE,
......
......@@ -2,7 +2,7 @@
/**
* @file
* Definition of Drupal\entity_test\Entity\EntityTestMul.
* Contains \Drupal\entity_test\Entity\EntityTestMul.
*/
namespace Drupal\entity_test\Entity;
......@@ -23,7 +23,7 @@
* "form" = {
* "default" = "Drupal\entity_test\EntityTestFormController"
* },
* "translation" = "Drupal\content_translation\ContentTranslationController"
* "translation" = "Drupal\content_translation\ContentTranslationHandler"
* },
* base_table = "entity_test_mul",
* data_table = "entity_test_mul_property_data",
......
......@@ -2,7 +2,7 @@
/**
* @file
* Definition of Drupal\entity_test\Entity\EntityTestMulRev.
* Contains \Drupal\entity_test\Entity\EntityTestMulRev.
*/
namespace Drupal\entity_test\Entity;
......@@ -22,7 +22,7 @@
* "form" = {
* "default" = "Drupal\entity_test\EntityTestFormController"
* },
* "translation" = "Drupal\content_translation\ContentTranslationController"
* "translation" = "Drupal\content_translation\ContentTranslationHandler"
* },
* base_table = "entity_test_mulrev",
* data_table = "entity_test_mulrev_property_data",
......
......@@ -2,7 +2,7 @@
/**
* @file
* Definition of Drupal\entity_test\Entity\EntityTestRev.
* Contains \Drupal\entity_test\Entity\EntityTestRev.
*/
namespace Drupal\entity_test\Entity;
......@@ -22,7 +22,7 @@
* "form" = {
* "default" = "Drupal\entity_test\EntityTestFormController"
* },
* "translation" = "Drupal\content_translation\ContentTranslationController"
* "translation" = "Drupal\content_translation\ContentTranslationHandler"
* },
* base_table = "entity_test_rev",
* revision_table = "entity_test_rev_revision",
......
......@@ -2,7 +2,7 @@
/**
* @file
* Definition of Drupal\taxonomy\Entity\Term.
* Contains \Drupal\taxonomy\Entity\Term.
*/
namespace Drupal\taxonomy\Entity;
......@@ -30,7 +30,7 @@
* "default" = "Drupal\taxonomy\TermFormController",
* "delete" = "Drupal\taxonomy\Form\TermDeleteForm"
* },
* "translation" = "Drupal\taxonomy\TermTranslationController"
* "translation" = "Drupal\taxonomy\TermTranslationHandler"
* },
* base_table = "taxonomy_term_data",
* uri_callback = "taxonomy_term_uri",
......
......@@ -2,21 +2,21 @@
/**
* @file
* Definition of Drupal\taxonomy\TermTranslationController.
* Contains \Drupal\taxonomy\TermTranslationHandler.
*/
namespace Drupal\taxonomy;
use Drupal\Core\Entity\EntityInterface;
use Drupal\content_translation\ContentTranslationController;
use Drupal\content_translation\ContentTranslationHandler;
/**
* Defines the translation controller class for terms.
* Defines the translation handler for terms.
*/
class TermTranslationController extends ContentTranslationController {
class TermTranslationHandler extends ContentTranslationHandler {
/**
* Overrides ContentTranslationController::entityFormAlter().
* {@inheritdoc}
*/
public function entityFormAlter(array &$form, array &$form_state, EntityInterface $entity) {
parent::entityFormAlter($form, $form_state, $entity);
......@@ -24,7 +24,7 @@ public function entityFormAlter(array &$form, array &$form_state, EntityInterfac
}
/**
* Form submission handler for TermTranslationController::entityFormAlter().
* Form submission handler for TermTranslationHandler::entityFormAlter().
*
* This handles the save action.
*
......
......@@ -2,7 +2,7 @@
/**
* @file
* Definition of Drupal\user\Entity\User.
* Contains \Drupal\user\Entity\User.
*/
namespace Drupal\user\Entity;
......@@ -31,7 +31,7 @@
* "cancel" = "Drupal\user\Form\UserCancelForm",
* "register" = "Drupal\user\RegisterFormController"
* },
* "translation" = "Drupal\user\ProfileTranslationController"
* "translation" = "Drupal\user\ProfileTranslationHandler"
* },
* admin_permission = "administer user",
* base_table = "users",
......
......@@ -2,21 +2,21 @@
/**
* @file
* Definition of Drupal\user\ProfileTranslationController.
* Contains \Drupal\user\ProfileTranslationHandler.
*/
namespace Drupal\user;
use Drupal\Core\Entity\EntityInterface;
use Drupal\content_translation\ContentTranslationController;
use Drupal\content_translation\ContentTranslationHandler;
/**
* Defines the translation controller class for users.
* Defines the translation handler for users.
*/
class ProfileTranslationController extends ContentTranslationController {
class ProfileTranslationHandler extends ContentTranslationHandler {
/**
* Overrides ContentTranslationController::entityFormAlter().
* {@inheritdoc}
*/
public function entityFormAlter(array &$form, array &$form_state, EntityInterface $entity) {
parent::entityFormAlter($form, $form_state, $entity);
......@@ -24,7 +24,7 @@ public function entityFormAlter(array &$form, array &$form_state, EntityInterfac
}
/**
* Form submission handler for ProfileTranslationController::entityFormAlter().
* Form submission handler for ProfileTranslationHandler::entityFormAlter().
*
* This handles the save action.
*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment