You are here

function addanother_access in Add Another 7.2

Same name and namespace in other branches
  1. 6 addanother.module \addanother_access()
  2. 7 addanother.module \addanother_access()

Check if we should display the Add another verbage on a node.

1 string reference to 'addanother_access'
addanother_menu in ./addanother.module
Implements hook_menu().

File

./addanother.module, line 84
The main file for the addanother module.

Code

function addanother_access($node) {
  if (!node_access('create', $node->type)) {
    return FALSE;
  }
  if (arg(2) == "edit" && !variable_get('addanother_tab_edit_' . $node->type, FALSE)) {
    return FALSE;
  }
  if ($node && variable_get('addanother_tab_' . $node->type, FALSE) && user_access('use add another')) {
    return TRUE;
  }
  return FALSE;
}