- Updated printer_navigation.php to get BSPrinterNavigation, however this will be...
[isso.git] / Printer.php
1 <?php
2 /*=====================================================================*\
3 || ###################################################################
4 || # Blue Static ISSO Framework
5 || # Copyright ©2002-[#]year[#] Blue Static
6 || #
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.
10 || #
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
14 || # more details.
15 || #
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 \*=====================================================================*/
21
22 /**
23 * Printer System (printer.php)
24 *
25 * @package ISSO
26 */
27
28 require_once('ISSO/PrinterElement.php');
29 require_once('ISSO/PrinterBaseElement.php');
30 require_once('ISSO/PrinterLabelElement.php');
31 require_once('ISSO/PrinterRootElement.php');
32 require_once('ISSO/PrinterRootElementPage.php');
33 require_once('ISSO/PrinterRootElementTable.php');
34 require_once('ISSO/PrinterRootElementForm.php');
35 require_once('ISSO/PrinterTableElement.php');
36
37 /**
38 * Printer System
39 *
40 * This is the root static framework module for the HTML printer system that
41 * works without templates. Here, you simply set the language and stylesheet
42 * information and use the other classes to generate the code.
43 *
44 * @author Blue Static
45 * @copyright Copyright (c)2002 - [#]year[#], Blue Static
46 * @version $Revision$
47 * @package ISSO
48 *
49 */
50 class BSPrinter
51 {
52 /**
53 * Singleton instance
54 * @var BSPrinter
55 */
56 private static $instance;
57
58 /**
59 * Language information for all printer elements with format array(langcode: en_US, direction: ltr/rtl, charset: utf-8)
60 * @var string
61 */
62 private $language = array('langcode' => 'en_US', 'direction' => 'ltr', 'charset' => 'utf-8');
63
64 /**
65 * CSS stylesheet to link to
66 * @var string
67 */
68 private $stylesheet;
69
70 /**
71 * Realm; the extra bit added to the title
72 * @var string
73 */
74 private $realm = 'BSPrinterOutput';
75
76 // ###################################################################
77 /**
78 * Constructor (private)
79 */
80 private function __construct() {}
81
82 // ###################################################################
83 /**
84 * Returns the singleton instance
85 *
86 * @return BSPrinter Singleton instance
87 */
88 public static function _Instance()
89 {
90 if (!self::$instance)
91 {
92 self::$instance = new BSPrinter();
93 }
94 return self::$instance;
95 }
96
97 // ###################################################################
98 /**
99 * Returns the realm
100 *
101 * @return string Realm
102 */
103 public static function GetRealm()
104 {
105 return self::_Instance()->realm;
106 }
107
108 // ###################################################################
109 /**
110 * Sets the realm
111 *
112 * @param string Realm
113 */
114 public static function SetRealm($realm)
115 {
116 self::_Instance()->realm = $realm;
117 }
118
119 // ###################################################################
120 /**
121 * Returns the language array
122 *
123 * @return array Language array
124 */
125 public static function GetLanguageInformation()
126 {
127 return self::_Instance()->language;
128 }
129
130 // ###################################################################
131 /**
132 * Sets the language array information
133 *
134 * @param array Language array
135 */
136 public static function SetLanguageInformation($lang)
137 {
138 self::_Instance()->language = $lang;
139 }
140
141 // ###################################################################
142 /**
143 * Returns the stylesheet URL
144 *
145 * @return string Stylesheet link
146 */
147 public static function GetStylesheet()
148 {
149 return self::_Instance()->stylesheet;
150 }
151
152 // ###################################################################
153 /**
154 * Sets the path to the CSS style sheet
155 *
156 * @param string Path
157 */
158 public static function SetStylesheet($stylesheet)
159 {
160 self::_Instance()->stylesheet = $stylesheet;
161 }
162 }
163
164 /*=====================================================================*\
165 || ###################################################################
166 || # $HeadURL$
167 || # $Id$
168 || ###################################################################
169 \*=====================================================================*/
170 ?>