function lingotek_entity_translation_node_tab_access in Lingotek Translation 7.5
Same name and namespace in other branches
- 7.7 lingotek.module \lingotek_entity_translation_node_tab_access()
- 7.2 lingotek.module \lingotek_entity_translation_node_tab_access()
- 7.3 lingotek.module \lingotek_entity_translation_node_tab_access()
- 7.4 lingotek.module \lingotek_entity_translation_node_tab_access()
- 7.6 lingotek.module \lingotek_entity_translation_node_tab_access()
Entity Translation access callback when enabled with Lingotek Translation module.
Return value
bool TRUE if the user should be able to access the requested resource, FALSE otherwise.
See also
entity_translation_node_tab_access().
1 string reference to 'lingotek_entity_translation_node_tab_access'
- lingotek_menu_alter in ./
lingotek.module - Implements hook_menu_alter().
File
- ./
lingotek.module, line 546
Code
function lingotek_entity_translation_node_tab_access() {
$args = func_get_args();
$node = array_shift($args);
if ($node->language !== LANGUAGE_NONE) {
// if the user doesn't have rights, don't show it
$user_access = drupal_multilingual() && (user_access('translate any entity') || user_access("translate node entities"));
$node_disabled = isset($node->lingotek['profile']) && $node->lingotek['profile'] == LingotekSync::PROFILE_DISABLED;
if (!$user_access) {
return FALSE;
}
// if it's a Lingotek-supported type and the node itself is not specifically
// disabled then don't show it
if (lingotek_access($node, 'manage projects')) {
return FALSE;
}
if (module_exists('entity_translation') && entity_translation_node_supported_type($node->type)) {
// This is not a Lingotek-supported type, but is a type
// that is set up for Entity Translation.
// Fall back to the Entity Translation module's access callback.
if (entity_translation_node('node', $node)) {
$function = array_shift($args);
return call_user_func_array($function, $args);
}
return entity_translation_tab_access('node', $node);
}
if (module_exists('translation')) {
// This node is set up to use the Translation module's
// node translation (as opposed to Entity Translation).
return _translation_tab_access($node);
}
}
return FALSE;
}