X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FCore%2FPage.php;h=4194e9bda745fc8723da13dbe115797fd587c827;hb=ac7573eb6ff259c200720456ed85d0900c173f14;hp=e3aadfebcdac66342449496f6f7bcf03df0789ff;hpb=b53486458136e5ba1b17df44102d0ced3e4a5752;p=civicrm-core.git diff --git a/CRM/Core/Page.php b/CRM/Core/Page.php index e3aadfebcd..4194e9bda7 100644 --- a/CRM/Core/Page.php +++ b/CRM/Core/Page.php @@ -59,7 +59,9 @@ class CRM_Core_Page { * Are we in print mode? if so we need to modify the display * functionality to do a minimal display :) * - * @var bool + * @var int|string + * Should match a CRM_Core_Smarty::PRINT_* constant, + * or equal 0 if not in print mode */ protected $_print = FALSE; @@ -127,6 +129,9 @@ class CRM_Core_Page { // Required for footer.tpl, // See ExampleHookTest:testPageOutput. 'footer_status_severity', + // in 'body.tpl + 'suppressForm', + 'beginHookFormElements', ]; /** @@ -218,10 +223,10 @@ class CRM_Core_Page { //its time to call the hook. CRM_Utils_Hook::alterContent($content, 'page', $pageTemplateFile, $this); - if ($this->_print == CRM_Core_Smarty::PRINT_PDF) { + if ($this->_print === CRM_Core_Smarty::PRINT_PDF) { CRM_Utils_PDF_Utils::html2pdf($content, "{$this->_name}.pdf", FALSE); } - elseif ($this->_print == CRM_Core_Smarty::PRINT_JSON) { + elseif ($this->_print === CRM_Core_Smarty::PRINT_JSON) { $this->ajaxResponse['content'] = $content; CRM_Core_Page_AJAX::returnJsonResponse($this->ajaxResponse); } @@ -389,7 +394,11 @@ class CRM_Core_Page { /** * Setter for print. * - * @param bool $print + * @param int|string $print + * Should match a CRM_Core_Smarty::PRINT_* constant, + * or equal 0 if not in print mode + * + * @return void */ public function setPrint($print) { $this->_print = $print; @@ -398,8 +407,9 @@ class CRM_Core_Page { /** * Getter for print. * - * @return bool - * return the print value + * @return int|string + * Value matching a CRM_Core_Smarty::PRINT_* constant, + * or 0 if not in print mode */ public function getPrint() { return $this->_print;