You are here

function entity_translation_current_form_get_handler in Entity Translation 7

Returns the translation handler associated to the currently submitted form.

Return value

EntityTranslationHandlerInterface A translation handler instance if available, FALSE oterwise.

Deprecated

This is no longer used and will be removed in the first stable release.

File

./entity_translation.module, line 1928

Code

function entity_translation_current_form_get_handler() {
  $handler = FALSE;
  if (!empty($_POST['form_build_id'])) {
    $form_state = form_state_defaults();
    if ($form = form_get_cache($_POST['form_build_id'], $form_state)) {
      $handler = entity_translation_entity_form_get_handler($form, $form_state);
    }
  }
  return $handler;
}