CRM-17658 Reports: add new region for default report HTML header
authorAndrew Hunt <andrew@aghstrategies.com>
Thu, 3 Dec 2015 17:46:36 +0000 (12:46 -0500)
committerAndrew Hunt <andrew@aghstrategies.com>
Thu, 3 Dec 2015 17:47:46 +0000 (12:47 -0500)
CRM/Report/Form/Instance.php

index 04e4a1dd495bb6c94c1df1779b08b328f83eb6c4..b812e069b83b2f62c5fd5540c94db32e10600b7a 100644 (file)
@@ -222,11 +222,18 @@ class CRM_Report_Form_Instance {
     }
 
     $config = CRM_Core_Config::singleton();
+
+    // Add a special region for the default HTML header of printed reports.  It
+    // won't affect reports with customized headers, just ones with the default.
+    $printHeaderRegion = CRM_Core_Region::instance('default-report-header', FALSE);
+    $htmlHeader = ($printHeaderRegion) ? $printHeaderRegion->render('', FALSE) : '';
+
     $defaults['report_header'] = $report_header = "<html>
   <head>
     <title>CiviCRM Report</title>
     <meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
     <style type=\"text/css\">@import url({$config->userFrameworkResourceURL}css/print.css);</style>
+    {$htmlHeader}
   </head>
   <body><div id=\"crm-container\">";