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 19:43:19 +0000 (14:43 -0500)
CRM/Report/Form/Instance.php

index 040de0f27a9b32a0160b20c32b9a4e0fcaf3d0d9..69c6efa0de7e30f5c8424ebfbbb320479874a55a 100644 (file)
@@ -227,11 +227,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\">";