You are here

function panels_node_insert in Panels 5.2

Same name and namespace in other branches
  1. 6.3 panels_node/panels_node.module \panels_node_insert()
  2. 6.2 panels_node/panels_node.module \panels_node_insert()

Implementation of hook_insert().

File

panels_node/panels_node.module, line 269
panels_node.module

Code

function panels_node_insert(&$node) {

  // Create a new display and record that.
  $display = panels_new_display();
  $display->layout = $node->panels_node['layout'];
  panels_save_display($display);
  $css_id = $node->panels_node['css_id'];
  db_query("INSERT INTO {panels_node} (nid, did, css_id) VALUES (%d, %d, '%s')", $node->nid, $display->did, $node->panels_node['css_id']);
  $node->panels_node['did'] = $display->did;
}