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 +--------------------------------------------------------------------+
11 namespace Civi\Report
;
14 * Base Report Output Handler
16 class OutputHandlerBase
implements OutputHandlerInterface
{
19 * This is for convenience since otherwise several functions
20 * would take it as a parameter.
22 * @var \CRM_Report_Form
29 * @return \CRM_Report_Form
31 public function getForm():\CRM_Report_Form
{
38 * @param \CRM_Report_Form $form
40 public function setForm(\CRM_Report_Form
$form) {
45 * Are we a suitable output handler based on the given form?
47 * The class member $form isn't set yet at this point since we don't
48 * even know if we're in play yet, so the form is a parameter.
50 * @param \CRM_Report_Form $form
54 public function isOutputHandlerFor(\CRM_Report_Form
$form):bool {
59 * Return the download filename. This should be the "clean" name, not
60 * a munged temporary filename.
64 public function getFileName():string {
69 * Return the html body of the email.
73 public function getMailBody():string {
78 * Return the report contents as a string.
82 public function getOutputString():string {
87 * Set headers as appropriate and send the output to the browser.
89 public function download() {
93 * Mime type of the attachment.
97 public function getMimeType():string {
102 * Charset of the attachment.
104 * The default of '' means charset is not specified in the mimepart,
105 * which is normal for binary attachments, but for text attachments you
106 * should specify something like 'utf-8'.
110 public function getCharset():string {
115 * Hide/show various elements in the output, but generally for a handler
116 * this is always set to TRUE.
120 public function isPrintOnly():bool {
125 * Use a pager, but for a handler this would be FALSE since paging
130 public function isAddPaging():bool {
135 * Create absolute urls for links. Generally for a handler
136 * this is always set to TRUE, but for example for 'print' it's displayed
137 * on the site so it can be relative.
138 * @todo Couldn't it just always be absolute?
142 public function isAbsoluteUrl():bool {