You are here

function _fillpdf_replacements_to_array in FillPDF 6

Same name and namespace in other branches
  1. 7.2 fillpdf.module \_fillpdf_replacements_to_array()
  2. 7 fillpdf.module \_fillpdf_replacements_to_array()
1 call to _fillpdf_replacements_to_array()
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 719
Allows mappings of PDFs to site content

Code

function _fillpdf_replacements_to_array($replacements) {
  $standardized_replacements = str_replace(array(
    "\r\n",
    "\r",
  ), "\n", $replacements);
  $lines = explode("\n", $standardized_replacements);
  $return = array();
  foreach ($lines as $replacement) {
    if (!empty($replacement)) {
      $split = explode('|', $replacement);
      $return[$split[0]] = preg_replace('|<br />|', '
', $split[1]);
    }
  }
  return $return;
}