From 7a50500239c19c5dd9f7552acb442b359a7b8ab4 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Mon, 17 Mar 2008 21:56:26 -0400 Subject: [PATCH] Add a method for injecting code into the element of the page * PrinterRootPage.php: Add a headerCode ivar (BSPrinterRootPage::setHeaderCode): New method (BSPrinterRootPage::paint): Paint the header code --- CHANGES | 4 +++- PrinterRootPage.php | 17 +++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 5e66e52..be3b505 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,5 @@ 3.1.0 =================== -- Change: BSPrinterElementTable:__construct() can now take straight strings and convert them into BSPrinterElementLabel's \ No newline at end of file +- Change: BSPrinterElementTable:__construct() can now take straight strings and convert them into BSPrinterElementLabel's +- New: BSPrinterRootPage::setHeaderCode() allows injecting in between the tag of the root page element (creates BSPrinterRootPage::$headerCode) + diff --git a/PrinterRootPage.php b/PrinterRootPage.php index 2724239..75ed20c 100644 --- a/PrinterRootPage.php +++ b/PrinterRootPage.php @@ -52,6 +52,12 @@ class BSPrinterRootPage extends BSPrinterRootAbstract */ private $navigator; + /** + * The header code for the page + * @var string + */ + private $headerCode; + /** * Constructor * @@ -97,6 +103,16 @@ class BSPrinterRootPage extends BSPrinterRootAbstract return $this->navigatior; } + /** + * Sets the code to inject into the element of the page + * + * @param string Code + */ + public function setHeaderCode($code) + { + $this->headerCode = $code; + } + /** * Creates a redirect to another page; constructs the header and footer * (therefore execution stops) @@ -283,6 +299,7 @@ class BSPrinterRootPage extends BSPrinterRootAbstract echo "\n\t" . BSPrinter::get_realm() . " - " . $this->title . ""; echo "\n\t"; echo "\n\t"; + echo "\n" . $this->headerCode; echo "\n\n\n"; if ($this->navigator && (!defined('ISSO_PRINTER_NO_NAVIGATION') || !constant('ISSO_PRINTER_NO_NAVIGATION'))) -- 2.43.5