function export_node_export in Node export 6
Same name and namespace in other branches
- 5.2 export.pages.inc \export_node_export()
- 5 export.module \export_node_export()
exports a node - prepopulate a node editing form set $return_code to TRUE to not return form but the code instead.
1 call to export_node_export()
- export_node_bulk in ./
export.module - Callback for 'export' node operation.
1 string reference to 'export_node_export'
- export_menu in ./
export.module - Implementation of hook_menu().
File
- ./
export.pages.inc, line 53
Code
function export_node_export($original_node, $return_code = FALSE, $iteration = 0) {
if (isset($original_node->nid)) {
global $user;
if (export_is_permitted($original_node->type)) {
$node = drupal_clone($original_node);
$node->nid = NULL;
$node->vid = NULL;
$node->name = $user->name;
$node->uid = $user->uid;
$node->created = NULL;
$node->menu = NULL;
if (isset($node->book['mlid'])) {
$node->book['mlid'] = NULL;
}
$node->path = NULL;
$node->files = array();
drupal_set_title(t('Export of !title', array(
'!title' => check_plain($node->title),
)));
if (variable_get('export_reset_' . $node->type, FALSE)) {
$node_options = variable_get('node_options_' . $node->type, array(
'status',
'promote',
));
// Fill in the default values.
foreach (array(
'status',
'moderate',
'promote',
'sticky',
'revision',
) as $key) {
$node->{$key} = in_array($key, $node_options);
}
}
// Let other modules do special fixing up.
// The function signature is: hook_export_node_alter(&$node, $original_node, $method)
// Where $method is 'export'
drupal_alter("export_node", $node, $original_node, "export");
$node_code = export_node_encode($node, $iteration);
return $return_code ? $node_code : drupal_get_form('export_form', $node_code);
}
}
}