function _fillpdf_process_destination_path in FillPDF 6
Same name and namespace in other branches
- 7.2 fillpdf.module \_fillpdf_process_destination_path()
- 7 fillpdf.module \_fillpdf_process_destination_path()
1 call to _fillpdf_process_destination_path()
- fillpdf_merge_pdf in ./fillpdf.module
- Constructs a page from scratch (pdf content-type) and sends it to the
browser or saves it, depending on if a custom path is configured or not.
File
- ./fillpdf.module, line 691
- Allows mappings of PDFs to site content
Code
function _fillpdf_process_destination_path($destination_path, $token_objects) {
$orig_path = $destination_path;
$destination_path = trim($orig_path);
$types = array();
if (isset($token_objects['node'])) {
$types[] = 'node';
}
elseif (isset($token_objects['webform'])) {
$types[] = 'webform';
}
if (substr($destination_path, 0, 1) == '/') {
}
else {
$destination_path = file_directory_path() . "/{$destination_path}";
}
foreach ($types as $type) {
$destination_path = token_replace($destination_path, $type, $token_objects[$type]);
}
return $destination_path;
}