You are here

function panelizer_save_node_panelizer in Panelizer 7

Same name and namespace in other branches
  1. 6 includes/node.inc \panelizer_save_node_panelizer()

Write a panelizer node panel to the database.

6 calls to panelizer_save_node_panelizer()
panelizer_edit_node_content_page in includes/node.inc
Page to edit basic settings on a panelized node.
panelizer_edit_node_context_page in includes/node.inc
Page to edit basic settings on a panelized node.
panelizer_edit_node_layout_page in includes/node.inc
Page to edit basic settings on a panelized node.
panelizer_edit_node_settings_page in includes/node.inc
Page to edit basic settings on a panelized node.
panelizer_node_insert in ./panelizer.module
Implements hook_node_insert().

... See full list

File

includes/node.inc, line 85
Contains routines specific to handling nodes that are panelized.

Code

function panelizer_save_node_panelizer($panelizer) {
  if (!empty($panelizer->display)) {

    // First write the display
    panels_save_display($panelizer->display);

    // Make sure we have the did.
    // @todo -- this should never spontaneously change on us, but we aren't
    // checking that, either. We possibly should enforce a safety condition
    // here.
    $panelizer->did = $panelizer->display->did;
  }

  // Then write the default
  if (empty($panelizer->new)) {

    // Existing record.
    $update = array(
      'nid',
    );
  }
  else {

    // New record.
    $update = array();
  }
  return drupal_write_record('panelizer_node', $panelizer, $update);
}