Defines the translation controller class for terms.
Expanded class hierarchy of ProfileTranslationController
class ProfileTranslationController extends EntityTranslationController {
/**
* Overrides EntityTranslationController::entityFormAlter().
*/
public function entityFormAlter(array &$form, array &$form_state, EntityInterface $entity) {
parent::entityFormAlter($form, $form_state, $entity);
$form['actions']['submit']['#submit'][] = array(
$this,
'entityFormSave',
);
}
/**
* Form submission handler for ProfileTranslationController::entityFormAlter().
*
* This handles the save action.
*
* @see \Drupal\Core\Entity\EntityFormController::build().
*/
function entityFormSave(array $form, array &$form_state) {
if ($this
->getSourceLangcode($form_state)) {
$entity = translation_entity_form_controller($form_state)
->getEntity();
// We need a redirect here, otherwise we would get an access denied page
// since the current URL would be preserved and we would try to add a
// translation for a language that already has a translation.
$form_state['redirect'] = $this
->getViewPath($entity);
}
}
}
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
EntityTranslationController:: |
protected | property | The entity info of the entity being translated. | |
EntityTranslationController:: |
protected | property | The type of the entity being translated. | |
EntityTranslationController:: |
protected | function | Adds a clue about the form element translatability. | |
EntityTranslationController:: |
function | Form submission handler for EntityTranslationController::entityFormAlter(). | ||
EntityTranslationController:: |
function | Form submission handler for EntityTranslationController::entityFormAlter(). | ||
EntityTranslationController:: |
public | function | Entity builder method. | 1 |
EntityTranslationController:: |
public | function | Process callback: determines which elements get clue in the form. | |
EntityTranslationController:: |
public | function | Form submission handler for EntityTranslationController::entityFormAlter(). | |
EntityTranslationController:: |
protected | function | Returns the title to be used for the entity form page. | 3 |
EntityTranslationController:: |
function | Form validation handler for EntityTranslationController::entityFormAlter(). | ||
EntityTranslationController:: |
public | function |
Implements EntityTranslationControllerInterface::getAccess(). Overrides EntityTranslationControllerInterface:: |
2 |
EntityTranslationController:: |
public | function |
Implements EntityTranslationControllerInterface::getBasePath(). Overrides EntityTranslationControllerInterface:: |
|
EntityTranslationController:: |
public | function |
Implements EntityTranslationControllerInterface::getEditPath(). Overrides EntityTranslationControllerInterface:: |
|
EntityTranslationController:: |
protected | function | Returns an instance of the given path. | |
EntityTranslationController:: |
public | function |
Implements EntityTranslationControllerInterface::getSourceLanguage(). Overrides EntityTranslationControllerInterface:: |
|
EntityTranslationController:: |
public | function |
Implements EntityTranslationControllerInterface::getTranslationAccess(). Overrides EntityTranslationControllerInterface:: |
|
EntityTranslationController:: |
public | function |
Implements EntityTranslationControllerInterface::getViewPath(). Overrides EntityTranslationControllerInterface:: |
|
EntityTranslationController:: |
public | function |
Implements EntityTranslationControllerInterface::removeTranslation(). Overrides EntityTranslationControllerInterface:: |
1 |
EntityTranslationController:: |
public | function |
Implements EntityTranslationControllerInterface::retranslate(). Overrides EntityTranslationControllerInterface:: |
|
EntityTranslationController:: |
public | function | Initializes an instance of the entity translation controller. | |
ProfileTranslationController:: |
public | function |
Overrides EntityTranslationController::entityFormAlter(). Overrides EntityTranslationController:: |
|
ProfileTranslationController:: |
function | Form submission handler for ProfileTranslationController::entityFormAlter(). |