function _translation_tab_access

Access callback: Checks that the user has permission to 'translate all content' or to 'translate own content' and has created the node being translated.

Only displays the translation tab for nodes that are not language-neutral of types that have translation enabled.

Parameters

$node: A node entity.

Return value

TRUE if the translation tab should be displayed, FALSE otherwise.

See also

translation_menu()

1 string reference to '_translation_tab_access'
translation_menu in drupal/core/modules/translation/translation.module
Implements hook_menu().

File

drupal/core/modules/translation/translation.module, line 86
Manages content translations.

Code

function _translation_tab_access($node) {
  if ($node->langcode != LANGUAGE_NOT_SPECIFIED && translation_supported_type($node->type) && node_access('view', $node)) {
    return translation_user_can_translate_node($node);
  }
  return FALSE;
}