function _fillpdf_transform_field_value in FillPDF 7.2
Same name and namespace in other branches
- 6 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()
File
- ./
fillpdf.module, line 1069 - 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;
}
}