2 /*=====================================================================*
3 || ###################################################################
4 || # Blue Static ISSO Framework [#]issoversion[#]
5 || # Copyright ©2002-[#]year[#] Blue Static
7 || # This program is free software; you can redistribute it and/or modify
8 || # it under the terms of the GNU General Public License as published by
9 || # the Free Software Foundation; version [#]gpl[#] of the License.
11 || # This program is distributed in the hope that it will be useful, but
12 || # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 || # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
16 || # You should have received a copy of the GNU General Public License along
17 || # with this program; if not, write to the Free Software Foundation, Inc.,
18 || # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
19 || ###################################################################
20 \*=====================================================================*/
23 * Printer Root Element: Page (PrinterRootElementPage.php)
28 require_once('ISSO/PrinterRootElement.php');
31 * Printer Root Element: Page
33 * This root element represents the entire page and is usually used for all
34 * printer applications
37 * @copyright Copyright (c)2002 - [#]year[#], Blue Static
42 class BSPrinterRootElementPage
extends BSPrinterRootElement
51 * Language information array: ('langcode' =>, 'direction' =>, 'charset' =>)
54 private $language = array('langcode' => 'en_US', 'direction' => 'ltr', 'charset' => 'utf-8');
65 * @param BSPrinter Printer object
66 * @param string Page title
68 function __construct($printer, $title)
70 $this->title
= $title;
71 parent
::__construct($printer);
74 // ###################################################################
76 * Sets the language array information
78 * @param array Language array
80 public function setLanguageInformation($lang)
82 $this->language
= $lang;
85 // ###################################################################
87 * Sets the path to the CSS style sheet
91 public function setStylesheet($stylesheet)
93 $this->stylesheet
= $stylesheet;
96 // ###################################################################
98 * Sets the parent element
100 public function setParent(BSPrinterElement
$parent)
102 trigger_error('Cannot set the parent element on a BSPrinterRootElement');
105 // ###################################################################
107 * Gets the parent element (none exist as this is the root element)
109 public function getParent()
114 // ###################################################################
116 * Returns the HTML for all printed children elements
118 * @return string Printed HTML
120 protected function _paintChildren()
124 foreach ($this->children
AS $child)
126 $this->builder
.= "\n" . $child->paint() . "\n";
129 return $this->builder
;
132 // ###################################################################
134 * Tells the element to paint itself (and any children)
136 public function paint()
138 $this->printer
->paint("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n");
139 $this->printer
->paint("<html xml:lang=\"" . $this->language
['langcode'] . "\" lang=\"" . $this->language
['langcode'] . "\" dir=\"" . $this->language
['direction'] . "\">\n<head>");
140 $this->printer
->paint("\n\t<title>" . sprintf(_('%1$s - %2$s'), BSRegister
::GetApplication(), $this->title
) . "</title>");
141 $this->printer
->paint("\n\t<meta http-equiv=\"Content-Type\" content=\"text/html; charset=" . $this->language
['charset'] . "\" />");
142 $this->printer
->paint("\n\t<link rel=\"stylesheet\" href=\"" . $this->stylesheet
. "\" />");
144 $this->printer
->paint("\n</head>\n<body>\n");
146 if (BSRegister
::GetType('PrinterNavigation') AND (!defined('ISSO_PRINTER_NO_NAVIGATION') OR (defined('ISSO_PRINTER_NO_NAVIGATION') AND constant('ISSO_PRINTER_NO_NAVIGATION') != true
)))
148 echo BSRegister
::GetType('PrinterNavigation')->generate_header_html();
151 $this->printer
->paint($this->_paintChildren());
153 if (BSRegister
::GetDebug() AND isset($_GET['query']))
158 if (is_array($this->registry
->modules
[ISSO_DB_LAYER
]->history
))
160 foreach ($this->registry
->modules
[ISSO_DB_LAYER
]->history
AS $query)
162 echo $this->registry
->modules
[ISSO_DB_LAYER
]->construct_query_debug($query);
168 if (BSRegister
::GetType('PrinterNavigation') AND (!defined('ISSO_PRINTER_NO_NAVIGATION') OR (defined('ISSO_PRINTER_NO_NAVIGATION') AND constant('ISSO_PRINTER_NO_NAVIGATION') != true
)))
170 echo BSRegister
::GetType('PrinterNavigation')->generate_footer_html();
173 $copyright = "\n<br />\n<p align=\"center\" class=\"copyright\">\n\t<a href=\"http://www.bluestatic.org\" target=\"_blank\">" . BSRegister
::GetApplication() . ' ' . BSRegister
::GetAppVersion() . ", ©2002 - " . gmdate('Y') . " Blue Static</a>\n</p>";
175 if (!defined('ISSO_PRINTER_HIDE_SETUP'))
177 $this->printer
->paint("\n$copyright");
178 //echo $this->registry->construct_debug_block(false);
181 $this->printer
->paint("\n\n</body>\n</html>");
187 /*=====================================================================*
188 || ###################################################################
191 || ###################################################################
192 \*=====================================================================*/