You are here

function panelizer_node_insert in Panelizer 6

Same name and namespace in other branches
  1. 7 panelizer.module \panelizer_node_insert()

Implements hook_nodeapi() for insert (D7's hook_node_insert()).

1 call to panelizer_node_insert()
panelizer_nodeapi in ./panelizer.module
Implements hook_nodeapi().

File

./panelizer.module, line 303
panelizer.module

Code

function panelizer_node_insert($node) {
  if (!empty($node->clone_from_original_nid)) {
    $original_node = node_load($node->clone_from_original_nid);
    ctools_include('node', 'panelizer');
    $original_panelizer = panelizer_load_node_panelizer($original_node);
    if (!empty($original_panelizer)) {
      $cloned_panelizer = panelizer_clone_node_panelizer($original_panelizer, $node->nid);
      panelizer_save_node_panelizer($cloned_panelizer);
    }
  }
}