You are here

function entity_translation_edit_page in Entity Translation 7

Page callback.

1 string reference to 'entity_translation_edit_page'
entity_translation_menu_alter in ./entity_translation.module
Implements hook_menu_alter().

File

./entity_translation.module, line 553

Code

function entity_translation_edit_page() {
  $args = func_get_args();
  $entity_type = array_shift($args);
  $entity = array_shift($args);
  $langcode = array_shift($args);
  $edit_form_item = array_shift($args);

  // Set the current form language.
  $handler = entity_translation_get_handler($entity_type, $entity);
  $handler
    ->initPathScheme();
  $langcode = entity_translation_get_existing_language($entity_type, $entity, $langcode);
  $handler
    ->setActiveLanguage($langcode);

  // Display the entity edit form.
  return _entity_translation_callback($edit_form_item['page callback'], $args, $edit_form_item);
}