/[cvs]/nfo/php/libs/org.netfrag.elib/html/lib_htmlgui.php.inc_old_2
ViewVC logotype

Annotation of /nfo/php/libs/org.netfrag.elib/html/lib_htmlgui.php.inc_old_2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations)
Wed Jan 23 17:40:35 2002 UTC (22 years, 5 months ago) by cvsjoko
Branch point for: nfo, MAIN
Initial revision

1 cvsjoko 1.1 <?
2    
3     // =================================================================
4     // some helper-functions
5    
6     // ------------------------------------------------------------------------------------------------------
7     function getHtmlTag($tagname, $args = array(), $bool_endtag = 0) {
8     $retval = "";
9     if ($bool_endtag) {
10     $retval = "</$tagname>";
11     } else {
12     $attribstring = getHtmlTag_Attributes($args);
13     $retval = "<$tagname $attribstring>\n";
14     }
15     return $retval;
16     }
17    
18     // ------------------------------------------------------------------------------------------------------
19     function getHtmlTag_Attributes($args) {
20     return getAttribStringFromHash($args, ' ', '=', '"');
21     }
22    
23     // =================================================================
24     class HTMLGUI {
25    
26     function getFormObject($args) {
27     $hf = new HTMLForm($args);
28     return $hf;
29     }
30    
31     // --------------------------------------------------------
32     function includeJsLib_Wddx($libbase) { ?>
33    
34     <!-- js_lib_wddx start -->
35     <SCRIPT LANGUAGE="javascript" SRC="<?= $libbase ?>wddx/wddx.js"></SCRIPT>
36     <SCRIPT LANGUAGE="javascript" SRC="<?= $libbase ?>wddx/wddxDes.js"></SCRIPT>
37     <SCRIPT LANGUAGE="javascript" SRC="<?= $libbase ?>wddx/wddxRsEx.js"></SCRIPT>
38     <SCRIPT LANGUAGE="javascript" SRC="<?= $libbase ?>wddx/wddxMenu.js"></SCRIPT>
39     <SCRIPT LANGUAGE="javascript">
40     var Deserializer = new WddxDeserializer();
41     function wddx_unserialize (wddxpacket)
42     {
43     Obj = Deserializer.deserialize(wddxpacket);
44     return Obj;
45     }
46     </SCRIPT>
47     <!-- js_lib_wddx end -->
48    
49     <? }
50    
51     // --------------------------------------------------------
52     function includeJsLib_JoustMenu($libbase) { ?>
53    
54     <SCRIPT LANGUAGE="javascript" SRC="<?= $libbase ?>joust/menu.js"></SCRIPT>
55    
56     <? }
57    
58     }
59    
60    
61     // =================================================================
62     class HTMLFrameset {
63    
64     var $bool_jailed;
65     var $attribs;
66    
67     function HTMLFrameset($args) {
68     $this->attribs = $args;
69     }
70    
71     function getJailTop() {
72     if(!$this->attribs['jailed']) { return; }
73     return '
74     <frameset rows="*,' . $this->attribs['height'] . ',*" border="0" frameborder="0" framespacing="0">
75     <frame src="pages/frameset/blank.html" scrolling="no" marginwidth="0" marginheight="0">
76    
77     <frameset cols="*,' . $this->attribs['width'] . ',*" border="0" frameborder="0" framespacing="0">
78     <frame src="pages/frameset/blank.html" scrolling="no" marginwidth="0" marginheight="0">
79     ';
80     }
81    
82     function getJailBottom() {
83     if(!$this->attribs['jailed']) { return; }
84     return '
85     <frame src="pages/frameset/blank.html" scrolling=no>
86     </frameset>
87    
88     <frame src="pages/frameset/blank.html" scrolling=no>
89     </frameset>
90     ';
91     }
92    
93     }
94    
95    
96     // =================================================================
97     class HtmlGui_PageBox {
98    
99     var $header;
100     var $footer;
101    
102     function HtmlGui_PageBox($args) {
103    
104     $this->header['htmlattribs_default'] = array();
105     if (isset($args['htmlattribs_header_default'])) {
106     $this->header['htmlattribs_default'] = $args['htmlattribs_header_default'];
107     }
108    
109     $this->footer['htmlattribs_default'] = array();
110     if (isset($args['htmlattribs_footer_default'])) {
111     $this->footer['htmlattribs_default'] = $args['htmlattribs_footer_default'];
112     }
113    
114     if (isset($args['caption'])) {
115     $this->addHeaderArea($args['caption']);
116     }
117    
118     }
119    
120     function addHeaderArea( $content = '', $htmlargs_container = array() ) {
121     $htmlattribs = array_merge($this->header['htmlattribs_default'], $htmlargs_container);
122     $args = array( 'content' => $content, 'htmlargs_container' => $htmlattribs );
123     $this->header['areas'][] = $args;
124     }
125    
126     function addFooterArea( $content = '', $htmlargs_container = array() ) {
127     $htmlattribs = array_merge($this->footer['htmlattribs_default'], $htmlargs_container);
128     $args = array( 'content' => $content, 'htmlargs_container' => $htmlattribs );
129     $this->footer['areas'][] = $args;
130     }
131    
132     function gen($contentType) {
133     switch($contentType) {
134     case 'begin';
135     $this->_gen_Begin();
136     break;
137     case 'end';
138     $this->_gen_End();
139     break;
140     }
141     }
142    
143    
144     function _gen_Begin() {
145     ?>
146    
147     <table border="0" width="602" cellspacing="0" cellpadding="1" style="border-width:0px; border-style:solid; borderlight-color:#474890;">
148    
149     <tr><td bgcolor="#474890" style="padding-bottom:0px;">
150     <? $this->_gen_ContentHeader(); ?>
151     </td></tr>
152    
153     <tr><td bgcolor="#474890" style="padding-bottom:0px;">
154    
155     <table border="0" width="600" cellspacing="0" cellpadding="1">
156    
157     <tr>
158     <td class="txtMainn" bgcolor="#FAFAFA" height="8"></td>
159     </tr>
160    
161     <tr>
162     <td class="txtMainn" bgcolor="#FAFAFA">
163    
164     <?
165     }
166    
167    
168     function _gen_End() {
169     ?>
170    
171     </td>
172     </tr>
173    
174     <!--
175     <tr>
176     <td class="txtMainn" bgcolor="#FAFAFA" height="100"></td>
177     </tr>
178     -->
179    
180     <tr>
181     <td bgcolor="#FAFAFA" >&nbsp;</td>
182     </tr>
183    
184     </table>
185    
186     </td></tr>
187    
188    
189     <tr><td bgcolor="#474890">
190     <? $this->_gen_ContentFooter(); ?>
191     </td></tr>
192    
193     </table>
194    
195     <?
196     }
197    
198     function _gen_ContentHeader() {
199     ?>
200     <table border="0" width="100%" cellspacing="0" cellpadding="3">
201     <tr>
202     <?
203     // print "right-arrow"
204     $htmlattribs = $this->header['htmlattribs_default'];
205     $htmlattribs['width'] = 10;
206     $content = '<img src="../img/icons/arrowc.gif" width="9" height="18" border="0">';
207     print getHtmlTag('td', $htmlattribs) . $content . getHtmlTag('td', Null, 1) . "\n";
208    
209     // print all areas
210     if (!isset($this->header['areas'])) { $this->addHeaderArea(); }
211     reset($this->header['areas']);
212     while($item = current($this->header['areas'])) {
213     // print one item (value)
214     print getHtmlTag('td', $item['htmlargs_container']) . $item['content'] . getHtmlTag('td', Null, 1) . "\n";
215     next($this->header['areas']);
216     }
217     ?>
218     </tr>
219     </table>
220     <?
221     }
222    
223    
224     function _gen_ContentFooter() {
225     ?>
226     <table border="0" width="100%" cellspacing="0" cellpadding="1">
227     <tr height="18"><td bgcolor="#fafafa">
228     <table border="0" width="99.97%" cellspacing="0" cellpadding="1">
229     <tr>
230     <?
231     // print all areas
232     if (!isset($this->footer['areas'])) { $this->addFooterArea(); }
233     reset($this->footer['areas']);
234     while($item = current($this->footer['areas'])) {
235     // print one item ("right-arrow")
236     $htmlattribs = $this->footer['htmlattribs_default'];
237     $htmlattribs['width'] = 10;
238     $content = '<img src="../img/icons/arroww.gif" width="9" height="18" border="0">';
239     print getHtmlTag('td', $htmlattribs) . $content . getHtmlTag('td', Null, 1) . "\n";
240    
241     // print one item (value)
242     print getHtmlTag('td', $item['htmlargs_container']) . $item['content'] . getHtmlTag('td', Null, 1) . "\n";
243     next($this->footer['areas']);
244     }
245     ?>
246     </tr>
247     </table>
248     </td></tr>
249     </table>
250     <?
251     }
252    
253     }
254    
255     ?>

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed