function panelizer_export_save_callback in Panelizer 6
Same name and namespace in other branches
- 7.3 panelizer.module \panelizer_export_save_callback()
- 7 panelizer.module \panelizer_export_save_callback()
- 7.2 panelizer.module \panelizer_export_save_callback()
export.inc callback to properly save a panelizer default.
1 string reference to 'panelizer_export_save_callback'
- panelizer_schema_1 in ./
panelizer.install - Schema version 1 for Panels in D6.
File
- ./
panelizer.module, line 460 - panelizer.module
Code
function panelizer_export_save_callback(&$object) {
if (!empty($object->display)) {
// First write the display
panels_save_display($object->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.
$object->did = $object->display->did;
}
// Then write the default
if ($object->export_type & EXPORT_IN_DATABASE) {
// Existing record.
$update = array(
'pnid',
);
}
else {
// New record.
$update = array();
$object->export_type = EXPORT_IN_DATABASE;
}
return drupal_write_record('panelizer_defaults', $object, $update);
}