Documentation is available at basic_context.php
1 <?php
2 class basic_context_normal {
3 var $_clear = false;
4 var $_header = '';
5 var $_onload = '';
6 var $_onunload = '';
7 var $name = 'normal';
8 var $_loosedtd = true;
9 var $_footer = '';
10
11 function basic_context_normal() {
12 }
13
14 function setloosedtd($value) {
15 $this->_loosedtd = $value;
16 }
17
18 function clearall() {
19 $this->_clear = true;
20 }
21
22 function addheader($str) {
23 $this->_header .= $str;
24 }
25
26 function addfooter($str) {
27 $this->_footer .= $str;
28 }
29
30 function addonload($str) {
31 $this->_onload .= $str;
32 }
33
34 function addonunload($str) {
35 $this->_onunload .= $str;
36 }
37
38 function header_start() {
39 if ($this->_clear) return '';
40 /*
41 Triedit doesnt like the usual doctype, so leave it out in documentsection editor
42 */
43 if ($this->_loosedtd) $result .= '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">';
44 else $result .= '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">';
45 $result .= '<html><head>'.$this->header_content();
46 return $result;
47 }
48
49 function header_content() {
50 global $system_url
51 $result = '
52 <meta http-equiv="Content-Language" content="da">
53 <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
54 <link rel="stylesheet" type="text/css" href="'.$system_url.'css/gui.css">
55 <script type="text/javascript" src="'.$system_url.'js/mozilla_compat.js"></script>';
56
57 $result .= $this->_header;
58 return $result;
59 }
60
61 function footer_content() {
62 return $this->_footer;
63 }
64
65 function header_end() {
66 if ($this->_clear) return '';
67 return '</head>';
68 }
69
70 function body() {
71 if ($this->_clear) return '';
72 return '<body onload="'.$this->_onload.'" onunload="'.$this->_onunload.'">';
73 }
74
75 function footer() {
76 if ($this->_clear) return '';
77 $result = $this->footer_content();
78 $result .= "</body></html>";
79 return $result;
80 }
81
82 }
83
84
85
86 class basic_context_dialog {
87 var $_clear = false;
88 var $_header = '';
89 var $_onload = '';
90 var $name = 'dialog';
91
92 function basic_context_normal() {
93 }
94
95 function clearall() {
96 $this->_clear = true;
97 }
98
99 function addheader($str) {
100 $this->_header .= $str;
101 }
102
103 function addonload($str) {
104 $this->_onload .= $str;
105 }
106
107 function addonunload($str) {
108 $this->_onunload .= $str;
109 }
110
111 function header_start() {
112 if ($this->_clear) return '';
113 $result .= '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
114 <html>
115 <head>
116 <style type="text/css">
117 body { background-color: buttonface; font-family: Tahoma; font-size: 8pt; }
118 select { font-family: Tahoma; font-size: 8pt; }
119 input { font-family: Tahoma; font-size: 8pt; }
120 td { font-family: Tahoma; font-size: 8pt; }
121 </style>
122 <meta http-equiv="Content-Language" content="da">
123 <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">';
124 $result .= $this->_header;
125 return $result;
126 }
127
128 function header_end() {
129 if ($this->_clear) return '';
130 return '</head>';
131 }
132
133 function body() {
134 if ($this->_clear) return '';
135 return '<body onload="'.$this->_onload.'" onunload="'.$this->_onunload.'">';
136 }
137
138 function footer() {
139 if ($this->_clear) return '';
140 return '</body></html>';
141 }
142
143 }
144
145
146 class basic_context_largedialog extends basic_context_normal {
147
148 function header_content() {
149 $result = parent::header_content();
150 $result .= '
151 <style type="text/css">
152 <!--
153 body {
154 margin: 0px;
155 background: ThreeDFace;
156 }
157 -->
158 </style>
159 ';
160 return $result;
161 }
162
163 }
164
165
166 function getcontext($otype,$context='normal') {
167 if (file_exists($otype."_context_".$context.".php")) {
168 @require_once($otype."_context_".$context.".php");
169 }
170 if (class_exists($otype.'_context_'.$context)) {
171 $s = $otype.'_context_'.$context;
172 } else {
173 $s = 'basic_context_'.$context;
174 }
175 return new $s;
176 }
177
178 ?>
Documentation generated on Thu, 9 Jun 2005 06:51:02 +0200 by phpDocumentor 1.2.3