You are here

function lingotek_access in Lingotek Translation 7.4

Same name and namespace in other branches
  1. 7.7 lingotek.util.inc \lingotek_access()
  2. 7.2 lingotek.util.inc \lingotek_access()
  3. 7.3 lingotek.util.inc \lingotek_access()
  4. 7.5 lingotek.util.inc \lingotek_access()
  5. 7.6 lingotek.util.inc \lingotek_access()

Menu access callback.

Only display Lingotek tab for node types, which have translation enabled and where the current node is not language neutral (which should span all languages).

1 call to lingotek_access()
lingotek_node_view in ./lingotek.module
Implements hook_node_view().
1 string reference to 'lingotek_access'
lingotek_menu in ./lingotek.module
Implements hook_menu().

File

./lingotek.util.inc, line 419
Utility functions.

Code

function lingotek_access($node, $permission) {
  if (Lingotek::isSupportedLanguage($node->language) && node_access('update', $node) && $node->lingotek['profile'] != LingotekSync::PROFILE_DISABLED) {
    return user_access($permission);
  }
  return FALSE;
}