function node_export_gui in Node export 6.3
Same name and namespace in other branches
- 7.3 node_export.pages.inc \node_export_gui()
Export GUI function.
Parameters
$nodes: A node, an array of nodes, or an array of nids. @param $format The node export format. @param $delivery The code delivery format, if NULL will use settings.
1 call to node_export_gui()
- node_export_bulk_operation in ./
node_export.module - Callback for use with hook_node_operations().
1 string reference to 'node_export_gui'
- node_export_menu in ./
node_export.module - Implementation of hook_menu().
File
- ./
node_export.pages.inc, line 220 - The Node export pages file.
Code
function node_export_gui($nodes = NULL, $format = NULL, $delivery = NULL) {
// Get the $code_string.
if ($nodes) {
// $nodes passed in, get the code_string.
$result = node_export($nodes, $format);
if ($result['success']) {
$code_string = $result['output'];
}
else {
foreach ($result['output'] as $output) {
drupal_set_message($output, 'error');
}
return;
}
$nids = node_export_nodes_to_nids($nodes);
$format = $result['format'];
}
elseif (!empty($_SESSION['node_export'])) {
// Nids and code string supplied from session.
$session_data = array_shift($_SESSION['node_export']);
$code_string = $session_data['code_string'];
$nids = $session_data['nids'];
$format = $session_data['format'];
}
$delivery = $delivery ? $delivery : variable_get('node_export_code', 'all');
if ($delivery != 'file') {
if (is_object($nodes)) {
// Single node, output straight away.
drupal_set_title(t('Node export of !title', array(
'!title' => check_plain($nodes->title),
)));
return drupal_get_form('node_export_form', $nids, $code_string, $format);
}
elseif ($nodes) {
// Node operation, add to session and redirect.
$_SESSION['node_export'][] = array(
'code_string' => $code_string,
'nids' => $nids,
);
drupal_goto('admin/content/node_export');
}
elseif (!$nodes) {
// No $nodes passed, but $code_string came from session.
return drupal_get_form('node_export_form', $nids, $code_string, $format);
}
}
else {
// Get file.
node_export_get_file($nids, $code_string, $format);
}
}