Capitalizing printer.php's filename
[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 /**
72 * Constructor (private)
73 */
74 private function __construct() {}
75
76 // ###################################################################
77 /**
78 * Returns the singleton instance
79 *
80 * @return BSPrinter Singleton instance
81 */
82 public static function _Instance()
83 {
84 if (is_null(self::$instance))
85 {
86 self::$instance = new BSPrinter();
87 }
88 return self::$instance;
89 }
90
91 // ###################################################################
92 /**
93 * Returns the language array
94 *
95 * @return array Language array
96 */
97 public static function GetLanguageInformation()
98 {
99 return self::_Instance()->language;
100 }
101
102 // ###################################################################
103 /**
104 * Sets the language array information
105 *
106 * @param array Language array
107 */
108 public static function SetLanguageInformation($lang)
109 {
110 self::_Instance()->language = $lang;
111 }
112
113 // ###################################################################
114 /**
115 * Returns the stylesheet URL
116 *
117 * @return string Stylesheet link
118 */
119 public static function GetStylesheet()
120 {
121 return self::_Instance()->stylesheet;
122 }
123
124 // ###################################################################
125 /**
126 * Sets the path to the CSS style sheet
127 *
128 * @param string Path
129 */
130 public static function SetStylesheet($stylesheet)
131 {
132 self::_Instance()->stylesheet = $stylesheet;
133 }
134 }
135
136 /*=====================================================================*\
137 || ###################################################################
138 || # $HeadURL$
139 || # $Id$
140 || ###################################################################
141 \*=====================================================================*/
142 ?>