From 56d5847d30bcb516aa6ac8e1e9e891d631051a0b Mon Sep 17 00:00:00 2001 From: eileen Date: Sun, 17 Feb 2019 20:57:06 +1300 Subject: [PATCH] Remove unused parameter --- CRM/Utils/PDF/Utils.php | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/CRM/Utils/PDF/Utils.php b/CRM/Utils/PDF/Utils.php index 1a7d449621..d7f72f6f20 100644 --- a/CRM/Utils/PDF/Utils.php +++ b/CRM/Utils/PDF/Utils.php @@ -48,7 +48,7 @@ class CRM_Utils_PDF_Utils { * * @return string|void */ - public static function html2pdf(&$text, $fileName = 'civicrm.pdf', $output = FALSE, $pdfFormat = NULL) { + public static function html2pdf($text, $fileName = 'civicrm.pdf', $output = FALSE, $pdfFormat = NULL) { if (is_array($text)) { $pages = &$text; } @@ -77,18 +77,8 @@ class CRM_Utils_PDF_Utils { $b = CRM_Core_BAO_PdfFormat::getValue('margin_bottom', $format); $l = CRM_Core_BAO_PdfFormat::getValue('margin_left', $format); - $stationery_path_partial = CRM_Core_BAO_PdfFormat::getValue('stationery', $format); - - $stationery_path = NULL; - if (strlen($stationery_path_partial)) { - $doc_root = $_SERVER['DOCUMENT_ROOT']; - $stationery_path = $doc_root . "/" . $stationery_path_partial; - } - $margins = array($metric, $t, $r, $b, $l); - $config = CRM_Core_Config::singleton(); - // Add a special region for the HTML header of PDF files: $pdfHeaderRegion = CRM_Core_Region::instance('export-document-header', FALSE); $htmlHeader = ($pdfHeaderRegion) ? $pdfHeaderRegion->render('', FALSE) : ''; @@ -98,14 +88,14 @@ class CRM_Utils_PDF_Utils { - + {$htmlHeader}
\n"; // Strip ,
, and tags from each page - $htmlElementstoStrip = array( + $htmlElementstoStrip = [ '@]*?>.*?@siu', '@]*?>.*?@siu', '@@siu', @@ -113,8 +103,8 @@ class CRM_Utils_PDF_Utils { '@]*?>@siu', '@@siu', '@]*?>@siu', - ); - $htmlElementsInstead = array('', '', '', '', '', ''); + ]; + $htmlElementsInstead = ['', '', '', '', '', '']; foreach ($pages as & $page) { $page = preg_replace($htmlElementstoStrip, $htmlElementsInstead, @@ -127,12 +117,11 @@ class CRM_Utils_PDF_Utils {
"; - if ($config->wkhtmltopdfPath) { + if (CRM_Core_Config::singleton()->wkhtmltopdfPath) { return self::_html2pdf_wkhtmltopdf($paper_size, $orientation, $margins, $html, $output, $fileName); } else { return self::_html2pdf_dompdf($paper_size, $orientation, $html, $output, $fileName); - //return self::_html2pdf_tcpdf($paper_size, $orientation, $margins, $html, $output, $fileName, $stationery_path); } } -- 2.25.1