You are here

function oa_clone_node_check in Open Atrium Clone 7.2

Page callback that prompts the user to confirm the operation.

This code was copied from clone_node_check() and simple changed to call our oa_clone_node_prepopulate() rather than clone_node_prepopulate().

Parameters

object $node: A node object representing the node we are cloning.

See also

clone_node_check()

1 string reference to 'oa_clone_node_check'
oa_clone_menu_alter in ./oa_clone.module
Implements hook_menu_alter().

File

./oa_clone.module, line 88

Code

function oa_clone_node_check($node) {
  $method = variable_get('clone_method', 'prepopulate');
  switch ($method) {
    case 'save-edit':
      if (variable_get('clone_nodes_without_confirm', FALSE)) {
        $new_nid = clone_node_save($node->nid);
        $options = array();
        if (!empty($_GET['node-clone-destination'])) {
          $options['query']['destination'] = $_GET['node-clone-destination'];
        }
        drupal_goto('node/' . $new_nid . '/edit', $options);
      }
      else {
        return drupal_get_form('clone_node_confirm', $node);
      }
      break;
    case 'prepopulate':
    default:

      // Open Atrium: Here is our one change.
      return oa_clone_node_prepopulate($node);
      break;
  }
}