function webform_share_export in Webform share 7
Same name and namespace in other branches
- 6 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 255 - 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) {
drupal_alter('webform_share_export', $node);
$webform = '$webform = ' . var_export($node->webform, TRUE) . ";\n\n";
if (ob_get_level()) {
ob_end_clean();
}
drupal_add_http_header('Content-Type', 'text/plain; charset=utf-8');
drupal_add_http_header('Content-Disposition', 'attachment; filename="webform-' . $node->type . '-' . $node->nid . '.txt";');
drupal_add_http_header('Content-Length', sprintf('%u', strlen($webform)));
print $webform;
exit;
}