You are here

function clone_get_token in Node clone 7

Get the token that needs to be added to the clone link.

Parameters

int $nid: The node ID of the node to be cloned

Return value

string Either 'confirm' or a CSRF token.

4 calls to clone_get_token()
clone_access_cloning in ./clone.module
clone_form_node_admin_content_alter in ./clone.module
Implements hook_form_FORM_ID_alter().
clone_token_to_arg in ./clone.module
Implements a to_arg function for the clone local action.
views_handler_field_node_link_clone::render_link in views/views_handler_field_node_link_clone.inc
Renders the link.

File

./clone.module, line 87
Allow users to make a copy of an item of content (a node) and then edit that copy.

Code

function clone_get_token($nid) {
  if (variable_get('clone_nodes_without_confirm', FALSE) && variable_get('clone_method', 'prepopulate') != 'prepopulate') {
    return drupal_get_token('clone_access_cloning-' . $nid);
  }
  return 'confirm';
}