You are here

function lingotek_entity_translation_edit_access in Lingotek Translation 7.2

Same name and namespace in other branches
  1. 7.7 lingotek.module \lingotek_entity_translation_edit_access()
  2. 7.3 lingotek.module \lingotek_entity_translation_edit_access()
  3. 7.4 lingotek.module \lingotek_entity_translation_edit_access()
  4. 7.5 lingotek.module \lingotek_entity_translation_edit_access()
  5. 7.6 lingotek.module \lingotek_entity_translation_edit_access()

Entity Translation edit access callback when enabled with Lingotek module.

Return value

bool TRUE if the user should be able to access the requested resource, FALSE otherwise.

See also

entity_translation_edit_access()

1 string reference to 'lingotek_entity_translation_edit_access'
lingotek_menu_alter in ./lingotek.module
Implements hook_menu_alter().

File

./lingotek.module, line 457

Code

function lingotek_entity_translation_edit_access($entity_type, $entity, $langcode) {
  $translations = entity_translation_get_handler($entity_type, $entity)
    ->getTranslations();

  // If a translations for the given language does not exist we cannot edit it.
  if (!isset($translations->data[$langcode])) {
    return FALSE;
  }

  // Invoke the actual callback with its arguments.
  $args = func_get_args();
  return call_user_func_array($args[3], array_slice($args, 4));
}