function _fillpdf_transform_field_value in FillPDF 6
Same name and namespace in other branches
- 7.2 fillpdf.module \_fillpdf_transform_field_value()
- 7 fillpdf.module \_fillpdf_transform_field_value()
Apply any field value transformations defined via the UI. Note that the replacement arguments need to already have been run through _fillpdf_replacements_to_array().
See also
_fillpdf_replacements_to_array().
1 call to _fillpdf_transform_field_value()
- 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 739 - Allows mappings of PDFs to site content
Code
function _fillpdf_transform_field_value($value, $pdf_replacements, $field_replacements) {
if (empty($pdf_replacements) && empty($field_replacements)) {
return $value;
}
elseif (!empty($field_replacements) && isset($field_replacements[$value])) {
return $field_replacements[$value];
}
elseif (!empty($pdf_replacements) && isset($pdf_replacements[$value])) {
return $pdf_replacements[$value];
}
else {
return $value;
}
}