You are here

function addanother_access in Add Another 7

Same name and namespace in other branches
  1. 6 addanother.module \addanother_access()
  2. 7.2 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
Implement hook_menu().

File

./addanother.module, line 71
Presents users with an option to create another node of the same type after a node is added.

Code

function addanother_access($nid) {
  $allowed_nodetypes = variable_get('addanother_nodetypes', array());
  $node = node_load($nid);
  if (arg(2) == "edit" && !variable_get('addanother_tab_edit', FALSE)) {
    return FALSE;
  }
  if ($node && isset($allowed_nodetypes[$node->type]) && $allowed_nodetypes[$node->type] && user_access('use add another') && node_access('create', $node->type)) {
    return TRUE;
  }
  return FALSE;
}