Add a method for injecting code into the <head> element of the page
authorRobert Sesek <rsesek@bluestatic.org>
Tue, 18 Mar 2008 01:56:26 +0000 (21:56 -0400)
committerRobert Sesek <rsesek@bluestatic.org>
Tue, 18 Mar 2008 01:56:26 +0000 (21:56 -0400)
* PrinterRootPage.php: Add a headerCode ivar
(BSPrinterRootPage::setHeaderCode): New method
(BSPrinterRootPage::paint): Paint the header code

CHANGES
PrinterRootPage.php

diff --git a/CHANGES b/CHANGES
index 5e66e521586d5bfd3cd918e7fa80f743587902e2..be3b50574cbe9f17c10b72400c318f4bad133d7e 100644 (file)
--- 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 <head> tag of the root page element (creates BSPrinterRootPage::$headerCode)
+
index 2724239f9e0a10d1fd052b1e60551b48950fcf2f..75ed20c1366c11a0cb74bed9365d24e734091ec1 100644 (file)
@@ -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 <head> 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<title>" . BSPrinter::get_realm() . " - " . $this->title . "</title>";
                echo "\n\t<meta http-equiv=\"Content-Type\" content=\"text/html; charset=" . $language['charset'] . "\" />";
                echo "\n\t<link rel=\"stylesheet\" href=\"" . BSPrinter::get_stylesheet() . "\" />";
+               echo "\n" . $this->headerCode;
                echo "\n</head>\n<body>\n";
                
                if ($this->navigator && (!defined('ISSO_PRINTER_NO_NAVIGATION') || !constant('ISSO_PRINTER_NO_NAVIGATION')))