function webform_share_export in Webform share 6
Same name and namespace in other branches
- 7 webform_share.module \webform_share_export()
Menu callback to generate the webform dump.
1 string reference to 'webform_share_export'
- webform_share_menu in ./
webform_share.module - Implements hook_menu().
File
- ./
webform_share.module, line 124 - Module to handle importing and exporting of webforms, as well as adding the ability to set content type defaults.
Code
function webform_share_export($node) {
$webform = '$webform = ' . var_export($node->webform, true) . ";\n\n";
if (ob_get_level()) {
ob_end_clean();
}
drupal_set_header('Content-Type: text/plain');
drupal_set_header('Content-Disposition: attachment; filename="webform-' . $node->type . '-' . $node->nid . '.txt";');
drupal_set_header('Content-Length: ' . sprintf('%u', strlen($webform)));
print $webform;
exit;
}