3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
9 +--------------------------------------------------------------------+
12 use Civi\Report\OutputHandlerInterface
;
13 use Civi\Report\OutputHandlerBase
;
16 * CSV Report Output Handler
18 class CRM_Report_OutputHandler_Print
extends OutputHandlerBase
implements OutputHandlerInterface
{
21 * Are we a suitable output handler based on the given form?
23 * The class member $form isn't set yet at this point since we don't
24 * even know if we're in play yet, so the form is a parameter.
26 * @param CRM_Report_Form $form
30 public function isOutputHandlerFor(CRM_Report_Form
$form):bool {
31 return ($form->getOutputMode() === 'print');
35 * Return the download filename. This should be the "clean" name, not
36 * a munged temporary filename.
38 * For 'print' there is no attachment.
42 public function getFileName():string {
47 * Return the html body of the email.
51 public function getMailBody():string {
52 return $this->getOutputString();
56 * Return the report contents as a string.
60 public function getOutputString():string {
61 return $this->getForm()->compileContent();
65 * Set headers as appropriate and send the output to the browser.
66 * Here the headers are already text/html.
68 public function download() {
69 echo $this->getOutputString();
73 * Override so links displayed in the browser are relative.
77 public function isAbsoluteUrl():bool {