1 |
cvsjoko |
1.1 |
<? |
2 |
|
|
|
3 |
|
|
class HTMLGUI { |
4 |
|
|
|
5 |
|
|
function getFormObject($args) { |
6 |
|
|
$hf = new HTMLForm($args); |
7 |
|
|
return $hf; |
8 |
|
|
} |
9 |
|
|
|
10 |
|
|
// -------------------------------------------------------- |
11 |
|
|
function includeJsLib_Wddx($libbase) { ?> |
12 |
|
|
|
13 |
|
|
<!-- js_lib_wddx start --> |
14 |
|
|
<SCRIPT LANGUAGE="javascript" SRC="<?= $libbase ?>wddx/wddx.js"></SCRIPT> |
15 |
|
|
<SCRIPT LANGUAGE="javascript" SRC="<?= $libbase ?>wddx/wddxDes.js"></SCRIPT> |
16 |
|
|
<SCRIPT LANGUAGE="javascript" SRC="<?= $libbase ?>wddx/wddxRsEx.js"></SCRIPT> |
17 |
|
|
<SCRIPT LANGUAGE="javascript" SRC="<?= $libbase ?>wddx/wddxMenu.js"></SCRIPT> |
18 |
|
|
<SCRIPT LANGUAGE="javascript"> |
19 |
|
|
var Deserializer = new WddxDeserializer(); |
20 |
|
|
function wddx_unserialize (wddxpacket) |
21 |
|
|
{ |
22 |
|
|
Obj = Deserializer.deserialize(wddxpacket); |
23 |
|
|
return Obj; |
24 |
|
|
} |
25 |
|
|
</SCRIPT> |
26 |
|
|
<!-- js_lib_wddx end --> |
27 |
|
|
|
28 |
|
|
<? } |
29 |
|
|
|
30 |
|
|
// -------------------------------------------------------- |
31 |
|
|
function includeJsLib_JoustMenu($libbase) { ?> |
32 |
|
|
|
33 |
|
|
<SCRIPT LANGUAGE="javascript" SRC="<?= $libbase ?>joust/menu.js"></SCRIPT> |
34 |
|
|
|
35 |
|
|
<? } |
36 |
|
|
|
37 |
|
|
|
38 |
|
|
} |
39 |
|
|
|
40 |
|
|
class HTMLForm { |
41 |
|
|
|
42 |
|
|
var $HTMLWidgets; |
43 |
|
|
var $name_formvar; |
44 |
|
|
var $persistency; |
45 |
|
|
|
46 |
|
|
function HTMLForm($args) { |
47 |
|
|
$ic = $args['RelatedInformationCluster']; |
48 |
|
|
$ic_attribs = $ic->getAttributes(); |
49 |
|
|
|
50 |
|
|
$this->name_formvar = $ic_attribs['name']; |
51 |
|
|
|
52 |
|
|
if ( is_object($ic_attribs['persistency_handler']) ) { |
53 |
|
|
|
54 |
|
|
/* |
55 |
|
|
switch ( $ic_attribs['persistency_handler']->type ) { |
56 |
|
|
|
57 |
|
|
case 'session': |
58 |
|
|
// patch values from "POST" to session (directly, as *one* hash) and ... |
59 |
|
|
$tmp_form = getValueByVarname($this->name_formvar); |
60 |
|
|
$ic_attribs['persistency_handler']->save( $tmp_form ); |
61 |
|
|
break; |
62 |
|
|
|
63 |
|
|
case 'db': |
64 |
|
|
// patch values from "POST" directly into InformationCluster's MetaItem's Value-Attribute |
65 |
|
|
$tmp_form = getValueByVarname($this->name_formvar); |
66 |
|
|
$ic->setValuesFromHash( $tmp_form ); |
67 |
|
|
// patch values from InformationCluster's MetaItem's Value-Attribute to database |
68 |
|
|
$ic_attribs['persistency_handler']->save( $ic->getValuesToHash() ); |
69 |
|
|
break; |
70 |
|
|
|
71 |
|
|
} |
72 |
|
|
*/ |
73 |
|
|
|
74 |
|
|
// copy (not logically validated) values from "POST" to Persistant Storage |
75 |
|
|
$tmp_form = getValueByVarname($this->name_formvar); |
76 |
|
|
$ic_attribs['persistency_handler']->save( $tmp_form ); |
77 |
|
|
|
78 |
|
|
// prepare values from Persistant Storage |
79 |
|
|
$currentData = $ic_attribs['persistency_handler']->load(); |
80 |
|
|
|
81 |
|
|
} else { |
82 |
|
|
|
83 |
|
|
// prepare values just from "POST" |
84 |
|
|
$currentData = getValueByVarname($this->name_formvar); |
85 |
|
|
|
86 |
|
|
} |
87 |
|
|
|
88 |
|
|
// patch prepared values into InformationCluster's MetaItem's Value-Attribute |
89 |
|
|
$ic->setValuesFromHash( $currentData ); |
90 |
|
|
|
91 |
|
|
|
92 |
|
|
$this->HTMLWidgets = new HTMLWidgets($this->name_formvar); |
93 |
|
|
} |
94 |
|
|
|
95 |
|
|
function HTMLWidgets() { |
96 |
|
|
return $this->HTMLWidgets; |
97 |
|
|
} |
98 |
|
|
|
99 |
|
|
} |
100 |
|
|
|
101 |
|
|
// ------------------------------------------------------------------------------------ |
102 |
|
|
class HTMLFrameset { |
103 |
|
|
|
104 |
|
|
var $bool_jailed; |
105 |
|
|
var $attribs; |
106 |
|
|
|
107 |
|
|
function HTMLFrameset($args) { |
108 |
|
|
$this->attribs = $args; |
109 |
|
|
} |
110 |
|
|
|
111 |
|
|
function getJailTop() { |
112 |
|
|
if(!$this->attribs['jailed']) { return; } |
113 |
|
|
return ' |
114 |
|
|
<frameset rows="*,' . $this->attribs['height'] . ',*" border="0" frameborder="0" framespacing="0"> |
115 |
|
|
<frame src="pages/frameset/blank.html" scrolling="no" marginwidth="0" marginheight="0"> |
116 |
|
|
|
117 |
|
|
<frameset cols="*,' . $this->attribs['width'] . ',*" border="0" frameborder="0" framespacing="0"> |
118 |
|
|
<frame src="pages/frameset/blank.html" scrolling="no" marginwidth="0" marginheight="0"> |
119 |
|
|
'; |
120 |
|
|
} |
121 |
|
|
|
122 |
|
|
function getJailBottom() { |
123 |
|
|
if(!$this->attribs['jailed']) { return; } |
124 |
|
|
return ' |
125 |
|
|
<frame src="pages/frameset/blank.html" scrolling=no> |
126 |
|
|
</frameset> |
127 |
|
|
|
128 |
|
|
<frame src="pages/frameset/blank.html" scrolling=no> |
129 |
|
|
</frameset> |
130 |
|
|
'; |
131 |
|
|
} |
132 |
|
|
|
133 |
|
|
} |
134 |
|
|
|
135 |
|
|
?> |