No regular expressions were active.
|
|
1 |
|
<?php
|
|
|
2 |
|
|
|
|
3 |
|
class BxBa
seFormView
{
|
|
|
4 |
|
var $s
Code; // c
ode of thi
s form
|
|
|
5 |
|
var $s
Name; // f
orm name
|
|
|
6 |
|
var $i
ColsNum =
1; // numb
er of colu
mns of for
m (ex., fo
r couple j
oin and ed
it)
|
|
|
7 |
|
var $b
SecondEnab
led = fals
e; // defi
nes if sec
ond profil
e column i
s enabled
(in case p
rofile typ
e is singl
e)
|
|
|
8 |
|
|
|
|
9 |
|
functi
on BxBaseF
ormView( $
sName ) {
|
|
|
10 |
|
$t
his -> sNa
me = $sNam
e;
|
|
|
11 |
|
|
|
|
12 |
|
}
|
|
|
13 |
|
|
|
|
14 |
|
functi
on begin(
$aFormAttr
s = null,
$aTableAtt
rs = null,
$aFormPar
ams = null
, $aTableP
arams = nu
ll ) {
|
|
|
15 |
|
|
|
|
16 |
|
if
( $aFormAt
trs == n
ull ) $aFo
rmParams
= array();
|
|
|
17 |
|
if
( $aTableA
ttrs == n
ull ) $aFo
rmParams
= array();
|
|
|
18 |
|
if
( $aFormPa
rams == n
ull ) $aFo
rmParams
= array();
|
|
|
19 |
|
if
( $aTableP
arams == n
ull ) $aTa
bleParams
= array();
|
|
|
20 |
|
|
|
|
21 |
|
//
detect co
lumns numb
er
|
|
|
22 |
|
if
( isset( $
aTablePara
ms['double
'] ) and $
aTablePara
ms['double
'] )
|
|
|
23 |
|
$this ->
iColsNum
= 2;
|
|
|
24 |
|
|
|
|
25 |
|
//
detect if
second co
lumn enabl
ed
|
|
|
26 |
|
if
( $this ->
iColsNum
== 2 and i
sset( $aTa
bleParams[
'second_en
abled'] )
and $aTabl
eParams['s
econd_enab
led'] )
|
|
|
27 |
|
$this ->
bSecondEn
abled = tr
ue;
|
|
|
28 |
|
|
|
|
29 |
|
$s
FormAttrs
= $this -
> processF
ormAttrs(
$aFormAttr
s );
|
|
|
30 |
|
$s
TableAttrs
= $this -
> processF
ormTableAt
trs( $aTab
leAttrs );
|
|
|
31 |
|
|
|
|
32 |
|
$t
his -> gen
FormBegin(
$sFormAtt
rs, $aForm
Params );
|
|
|
33 |
|
if
( isset( $
aFormParam
s['hidden'
] ) and is
_array( $a
FormParams
['hidden']
) )
|
|
|
34 |
|
$this ->
insertHid
denFields(
$aFormPar
ams['hidde
n'] );
|
|
|
35 |
|
|
|
|
36 |
|
$t
his -> gen
FormTableB
egin( $sTa
bleAttrs,
$aTablePar
ams );
|
|
|
37 |
|
|
|
|
38 |
|
if
( isset( $
aTablePara
ms['header
s'] ) and
is_array(
$aTablePar
ams['heade
rs'] ) )
|
|
|
39 |
|
$this ->
insertTab
leHeaders(
$aTablePa
rams['head
ers'], $aT
ableParams
['headers_
add'] );
|
|
|
40 |
|
}
|
|
|
41 |
|
|
|
|
42 |
|
functi
on insertH
iddenField
s( $aField
s ) {
|
|
|
43 |
|
fo
reach( $aF
ields as $
sKey => $s
Value )
|
|
|
44 |
|
$this ->
sCode .=
'<input ty
pe="hidden
" name="'
. $sKey .
'" value="
' . $this
-> value2h
tml( $sVal
ue ) . '"
/>';
|
|
|
45 |
|
}
|
|
|
46 |
|
|
|
|
47 |
|
functi
on insertT
ableHeader
s( $aHeade
rs, $sAdd
) {
|
|
|
48 |
|
$t
his -> sCo
de .= '<tr
class="he
aders">';
|
|
|
49 |
|
|
|
|
50 |
|
fo
r( $iInd =
0; $iInd
<= $this -
> iColsNum
; $iInd ++
) {
|
|
|
51 |
|
$this ->
sCode .=
|
|
|
52 |
|
"<th $
sAdd>" .
|
|
|
53 |
|
$thi
s -> value
2html( $aH
eaders[$iI
nd], true
) .
|
|
|
54 |
|
'</th>
';
|
|
|
55 |
|
}
|
|
|
56 |
|
|
|
|
57 |
|
$t
his -> sCo
de .= '</t
r>';
|
|
|
58 |
|
}
|
|
|
59 |
|
|
|
|
60 |
|
functi
on process
FormAttrs(
$aFormAtt
rs ) {
|
|
|
61 |
|
$s
FormAttrs
= '';
|
|
|
62 |
|
|
|
|
63 |
|
//
set defau
lt form at
tributes
|
|
|
64 |
|
if
( !isset(
$aFormAttr
s['method'
] ) )
|
|
|
65 |
|
$aFormAt
trs['metho
d'] = 'pos
t';
|
|
|
66 |
|
|
|
|
67 |
|
if
( !isset(
$aFormAttr
s['action'
] ) )
|
|
|
68 |
|
$aFormAt
trs['actio
n'] = $_SE
RVER['PHP_
SELF'];
|
|
|
69 |
|
|
|
|
70 |
|
if
( !isset(
$aFormAttr
s['enctype
'] ) )
|
|
|
71 |
|
$aFormAt
trs['encty
pe'] = 'mu
ltipart/fo
rm-data';
|
|
|
72 |
|
|
|
|
73 |
|
//
add name
|
|
|
74 |
|
$a
FormAttrs[
'name'] =
$this -> s
Name;
|
|
|
75 |
|
|
|
|
76 |
|
//
process fo
rm attribu
tes
|
|
|
77 |
|
fo
reach( $aF
ormAttrs a
s $sKey =>
$sValue )
|
|
|
78 |
|
$sFormAt
trs .= ' '
. $sKey .
'="' . $t
his -> val
ue2html( $
sValue ) .
'"'; // '
method="p
ost"'
|
|
|
79 |
|
|
|
|
80 |
|
re
turn $sFor
mAttrs;
|
|
|
81 |
|
}
|
|
|
82 |
|
|
|
|
83 |
|
functi
on process
FormTableA
ttrs( $aTa
bleAttrs )
{
|
|
|
84 |
|
$s
TableAttrs
= '';
|
|
|
85 |
|
|
|
|
86 |
|
//
set defau
lt table a
ttributes
|
|
|
87 |
|
if
( !isset(
$aTableAtt
rs['cellsp
acing'] )
)
|
|
|
88 |
|
$aTableA
ttrs['cell
spacing']
= '0';
|
|
|
89 |
|
|
|
|
90 |
|
if
( !isset(
$aTableAtt
rs['cellpa
dding'] )
)
|
|
|
91 |
|
$aTableA
ttrs['cell
padding']
= '0';
|
|
|
92 |
|
|
|
|
93 |
|
if
( !isset(
$aTableAtt
rs['border
'] ) )
|
|
|
94 |
|
$aTableA
ttrs['bord
er'] = '0'
;
|
|
|
95 |
|
|
|
|
96 |
|
//
process ta
ble attrib
utes
|
|
|
97 |
|
fo
reach( $aT
ableAttrs
as $sKey =
> $sValue
)
|
|
|
98 |
|
$sTableA
ttrs .= '
' . $sKey
. '="' . $
this -> va
lue2html(
$sValue )
. '"'; //
' method="
post"'
|
|
|
99 |
|
|
|
|
100 |
|
re
turn $sTab
leAttrs;
|
|
|
101 |
|
}
|
|
|
102 |
|
|
|
|
103 |
|
functi
on value2h
tml( $sTex
t, $bNoEmp
ty = false
) {
|
|
|
104 |
|
$s
Ret = html
specialcha
rs( $sText
);
|
|
|
105 |
|
|
|
|
106 |
|
/*
if( $sText
&& !$sRet
) {
|
|
|
107 |
|
$aDbg =
debug_back
trace();
|
|
|
108 |
|
foreach(
$aDbg as
$sKey => $
aValue ) {
|
|
|
109 |
|
unse
t( $aDbg[$
sKey]['obj
ect'] );
|
|
|
110 |
|
}
|
|
|
111 |
|
echoDbg(
$aDbg );
|
|
|
112 |
|
}*
/
|
|
|
113 |
|
|
|
|
114 |
|
if
( $sRet ==
= '' and $
bNoEmpty )
|
|
|
115 |
|
$sRet =
' ';
|
|
|
116 |
|
re
turn $sRet
;
|
|
|
117 |
|
}
|
|
|
118 |
|
|
|
|
119 |
|
functi
on end( $a
Buttons )
{
|
|
|
120 |
|
$t
his -> gen
FormTableE
nd( $aButt
ons );
|
|
|
121 |
|
$t
his -> gen
FormEnd();
|
|
|
122 |
|
}
|
|
|
123 |
|
|
|
|
124 |
|
functi
on getCode
() {
|
|
|
125 |
|
re
turn $this
-> sCode;
|
|
|
126 |
|
}
|
|
|
127 |
|
|
|
|
128 |
|
functi
on genForm
Begin( $sF
ormAttrs )
{
|
|
|
129 |
|
$t
his -> sCo
de .= "<fo
rm $sFormA
ttrs>";
|
|
|
130 |
|
ob
_start();
|
|
|
131 |
|
?>
|
|
|
132 |
|
<s
cript type
="text/jav
ascript" l
anguage="j
avascript"
>
|
|
|
133 |
|
$(docume
nt).ready(
function(
){ //onloa
d
|
|
|
134 |
|
|
|
|
135 |
|
//ap
ply counte
rs to text
areas
|
|
|
136 |
|
$( '
textarea.i
nput_area'
).each( f
unction()
{
|
|
|
137 |
|
function s
etCounter(
) {
|
|
|
138 |
|
if( $a
rea.val()
)
|
|
|
139 |
|
$c
ounter.sho
w( 300 );
|
|
|
140 |
|
else
|
|
|
141 |
|
$c
ounter.hid
e( 300 );
|
|
|
142 |
|
|
|
|
143 |
|
$count
erCont.htm
l( $area.v
al().lengt
h );
|
|
|
144 |
|
}
|
|
|
145 |
|
|
|
|
146 |
|
var $area
= $(this);
|
|
|
147 |
|
$area.afte
r(
|
|
|
148 |
|
'<div
class="cou
nter" styl
e="display
:none;"><?
=_t( '_Cou
nter' )?>:
<b></b></
div>'
|
|
|
149 |
|
);
|
|
|
150 |
|
|
|
|
151 |
|
var $count
er = $area
.siblings(
'div.count
er')
|
|
|
152 |
|
var $count
erCont = $
counter.ch
ildren('b'
);
|
|
|
153 |
|
|
|
|
154 |
|
setCounter
();
|
|
|
155 |
|
$area.chan
ge( setCou
nter ).key
up( setCou
nter );
|
|
|
156 |
|
} );
|
|
|
157 |
|
} );
|
|
|
158 |
|
</
script>
|
|
|
159 |
|
<?
|
|
|
160 |
|
$t
his -> sCo
de .= ob_g
et_clean()
;
|
|
|
161 |
|
}
|
|
|
162 |
|
|
|
|
163 |
|
functi
on genForm
End() {
|
|
|
164 |
|
$t
his -> sCo
de .= "</f
orm>";
|
|
|
165 |
|
}
|
|
|
166 |
|
|
|
|
167 |
|
functi
on genForm
TableBegin
( $sTableA
ttrs ) {
|
|
|
168 |
|
$t
his -> sCo
de .= "<ta
ble $sTabl
eAttrs>";
|
|
|
169 |
|
}
|
|
|
170 |
|
|
|
|
171 |
|
functi
on genForm
TableEnd(
$aButtons
) {
|
|
|
172 |
|
$t
his -> sCo
de .= '<tr
><th class
="bottom_c
ontrols" c
olspan="'
. ( $this
-> iColsNu
m + 1 ) .
'">';
|
|
|
173 |
|
$t
his -> ins
ertBottomB
uttons( $a
Buttons );
|
|
|
174 |
|
$t
his -> sCo
de .= '</t
h></tr>';
|
|
|
175 |
|
$t
his -> sCo
de .= "</t
able>";
|
|
|
176 |
|
}
|
|
|
177 |
|
|
|
|
178 |
|
functi
on insertB
ottomButto
ns( $aButt
ons ) {
|
|
|
179 |
|
fo
reach ($aB
uttons as
$sInd => $
aButton) {
|
|
|
180 |
|
$sAttrs
= '';
|
|
|
181 |
|
foreach
($aButton
as $sKey =
> $sValue)
|
|
|
182 |
|
$sAt
trs .= ' '
. $sKey .
'="' . $t
his -> val
ue2html( $
sValue ) .
'"';
|
|
|
183 |
|
|
|
|
184 |
|
$this ->
sCode .=
"<input $s
Attrs />";
|
|
|
185 |
|
}
|
|
|
186 |
|
}
|
|
|
187 |
|
|
|
|
188 |
|
functi
on addRow(
$aCol0, $
aCol1 = nu
ll, $bCycl
ed = false
) {
|
|
|
189 |
|
$t
his -> sCo
de .= "<tr
>\n";
|
|
|
190 |
|
|
|
|
191 |
|
if
( $aCol0['
Type'] ==
'system' a
nd $aCol0[
'Name'] ==
'TermsOfU
se' ) {
|
|
|
192 |
|
$this ->
insertInp
utCol( $aC
ol0, 5 );
//special
|
|
|
193 |
|
}
else {
|
|
|
194 |
|
$this ->
insertRow
Caption( $
aCol0['Cap
tion'], $a
Col0['Desc
'], $aCol0
['Mandator
y'] );
|
|
|
195 |
|
|
|
|
196 |
|
if( $thi
s -> iCols
Num == 1 )
{
|
|
|
197 |
|
// s
ingle
|
|
|
198 |
|
$thi
s -> inser
tInputCol(
$aCol0, 0
);
|
|
|
199 |
|
$aCo
l1 = null;
|
|
|
200 |
|
} else {
|
|
|
201 |
|
if(
!is_array(
$aCol1 )
)
|
|
|
202 |
|
// mutual
|
|
|
203 |
|
$this -> i
nsertInput
Col( $aCol
0, 1 );
|
|
|
204 |
|
else
{
|
|
|
205 |
|
// double
|
|
|
206 |
|
$this -> i
nsertInput
Col( $aCol
0, 2 );
|
|
|
207 |
|
// second
|
|
|
208 |
|
$this -> i
nsertInput
Col( $aCol
1, 3 );
|
|
|
209 |
|
}
|
|
|
210 |
|
}
|
|
|
211 |
|
}
|
|
|
212 |
|
|
|
|
213 |
|
$t
his -> sCo
de .= "</t
r>\n";
|
|
|
214 |
|
|
|
|
215 |
|
|
|
|
216 |
|
|
|
|
217 |
|
if
( $aCol0['
Type'] ==
'pass' and
!$bCycled
) { //ins
ert confir
m password
field
|
|
|
218 |
|
|
|
|
219 |
|
$aColCon
f0 = $aCol
0;
|
|
|
220 |
|
$aColCon
f1 = $aCol
1;
|
|
|
221 |
|
|
|
|
222 |
|
$aColCon
f0['Name']
= str_rep
lace( '[0]
', '_confi
rm[0]', $a
ColConf0['
Name'] );
|
|
|
223 |
|
$aColCon
f0['Captio
n'] = _t(
'_Confirm
password'
);
|
|
|
224 |
|
$aColCon
f0['Desc']
= _t( '_C
onfirm pas
sword desc
r' );
|
|
|
225 |
|
|
|
|
226 |
|
if( is_a
rray( $aCo
lConf1 ) )
{
|
|
|
227 |
|
$aCo
lConf1['Na
me'] = str
_replace(
'[1]', '_c
onfirm[1]'
, $aColCon
f1['Name']
);
|
|
|
228 |
|
}
|
|
|
229 |
|
|
|
|
230 |
|
$this ->
addRow( $
aColConf0,
$aColConf
1, true );
|
|
|
231 |
|
}
|
|
|
232 |
|
}
|
|
|
233 |
|
|
|
|
234 |
|
functi
on insertR
owCaption(
$sCaption
, $sDesc,
$bMandator
y ) {
|
|
|
235 |
|
$t
his -> sCo
de .=
|
|
|
236 |
|
'<th cla
ss="label"
>' .
|
|
|
237 |
|
$sCa
ption . ':
' .
|
|
|
238 |
|
( $b
Mandatory
? '<span c
lass="form
_mandatory
">*</span>
' : '' ) .
|
|
|
239 |
|
$thi
s -> inser
tDescripti
on( $sDesc
) .
|
|
|
240 |
|
"</th>\n
";
|
|
|
241 |
|
}
|
|
|
242 |
|
|
|
|
243 |
|
functi
on insertD
escription
( $sDesc )
{
|
|
|
244 |
|
if
( empty( $
sDesc ) )
|
|
|
245 |
|
return '
';
|
|
|
246 |
|
|
|
|
247 |
|
$s
Desc = str
_replace(
"'", "\\'
", $sDesc
);
|
|
|
248 |
|
$s
Desc = str
_replace(
"\n", "\\n
", $sDesc
);
|
|
|
249 |
|
$s
Desc = str
_replace(
"\r", "",
$sDesc
);
|
|
|
250 |
|
|
|
|
251 |
|
re
turn '
|
|
|
252 |
|
<img cla
ss="form_i
nfo_icon"
src="' . g
etTemplate
Icon( 'inf
o.gif' ) .
'"
|
|
|
253 |
|
onmous
eover="sho
wFloatDesc
(\'' . $th
is -> valu
e2html( $s
Desc ) . '
\');"
|
|
|
254 |
|
onmous
emove="mov
eFloatDesc
( event )"
onmouseou
t="hideFlo
atDesc()"
/>';
|
|
|
255 |
|
}
|
|
|
256 |
|
|
|
|
257 |
|
functi
on beginBl
ock( $sCap
tion ) {
|
|
|
258 |
|
$t
his -> sCo
de .= '<tr
><th class
="block" c
olspan="'
. ( $this
-> iColsNu
m + 1 ) .
'">' . $th
is -> valu
e2html( $s
Caption )
. '</th></
tr>';
|
|
|
259 |
|
}
|
|
|
260 |
|
|
|
|
261 |
|
functi
on endBloc
k() {
|
|
|
262 |
|
|
|
|
263 |
|
}
|
|
|
264 |
|
|
|
|
265 |
|
functi
on insertI
nputCol( $
aInput, $i
Type = 0 )
{
|
|
|
266 |
|
sw
itch( $iTy
pe ) {
|
|
|
267 |
|
case 0:
//simple s
ingle colu
mn
|
|
|
268 |
|
case 2:
//first of
double
|
|
|
269 |
|
$thi
s -> sCode
.= '<td>'
;
|
|
|
270 |
|
break;
|
|
|
271 |
|
|
|
|
272 |
|
case 1:
//mutual c
olumn
|
|
|
273 |
|
$thi
s -> sCode
.= '<td c
olspan="2"
>';
|
|
|
274 |
|
break;
|
|
|
275 |
|
|
|
|
276 |
|
case 3:
//second o
f double
|
|
|
277 |
|
$thi
s -> sCode
.= '<td c
lass="form
_second_co
l"' . ( $t
his -> bSe
condEnable
d ? '' : '
style="di
splay: non
e;"' ) . '
>';
|
|
|
278 |
|
break;
|
|
|
279 |
|
|
|
|
280 |
|
case 5:
//special
- full row
|
|
|
281 |
|
$thi
s -> sCode
.= '<td c
olspan="3"
class="fo
rm_row_spe
cial">';
|
|
|
282 |
|
break;
|
|
|
283 |
|
}
|
|
|
284 |
|
|
|
|
285 |
|
$t
his -> ins
ertInput(
$aInput );
|
|
|
286 |
|
|
|
|
287 |
|
$t
his -> ins
ertFieldEr
rorIcon( $
aInput['Er
ror'] );
|
|
|
288 |
|
|
|
|
289 |
|
$t
his -> sCo
de .= '</t
d>';
|
|
|
290 |
|
}
|
|
|
291 |
|
|
|
|
292 |
|
functi
on insertF
ieldErrorI
con( $sErr
or = '' )
{
|
|
|
293 |
|
|
|
|
294 |
|
$t
his -> sCo
de .= '<im
g src="' .
getTempla
teIcon( 'w
arn.gif' )
. '" clas
s="form_wa
rn_icon"';
|
|
|
295 |
|
|
|
|
296 |
|
if
( $sError
) {
|
|
|
297 |
|
$sError
= str_repl
ace( "'",
"\\'", $s
Error );
|
|
|
298 |
|
$sError
= str_repl
ace( "\n",
"\\n", $s
Error );
|
|
|
299 |
|
$sError
= str_repl
ace( "\r",
"", $s
Error );
|
|
|
300 |
|
|
|
|
301 |
|
$this ->
sCode .=
' onmouseo
ver="showF
loatDesc(\
'' . $this
-> value2
html( $sEr
ror ) . '\
')"';
|
|
|
302 |
|
}
else {
|
|
|
303 |
|
$this ->
sCode .=
' style="d
isplay: no
ne;"';
|
|
|
304 |
|
}
|
|
|
305 |
|
|
|
|
306 |
|
$t
his -> sCo
de .= ' on
mousemove=
"moveFloat
Desc(event
)" onmouse
out="hideF
loatDesc()
" />';
|
|
|
307 |
|
}
|
|
|
308 |
|
|
|
|
309 |
|
functi
on insertI
nput( $aIn
put ) {
|
|
|
310 |
|
gl
obal $site
;
|
|
|
311 |
|
|
|
|
312 |
|
$s
Code = '';
|
|
|
313 |
|
sw
itch( $aIn
put['Type'
] ) {
|
|
|
314 |
|
case 'te
xt':
|
|
|
315 |
|
$sCo
de = '<inp
ut type="t
ext" class
="input_te
xt" name="
' . $aInpu
t['Name']
. '" value
="' . $thi
s ->value2
html( $aIn
put['Value
'] ) . '"
/>';
|
|
|
316 |
|
break;
|
|
|
317 |
|
|
|
|
318 |
|
case 'ar
ea':
|
|
|
319 |
|
$sCo
de = '
|
|
|
320 |
|
<textarea
class="inp
ut_area" n
ame="' . $
aInput['Na
me'] . '">
' .
|
|
|
321 |
|
$this
-> value2h
tml( $aInp
ut['Value'
] ) .
|
|
|
322 |
|
'</textare
a>';
|
|
|
323 |
|
break;
|
|
|
324 |
|
|
|
|
325 |
|
case 'pa
ss':
|
|
|
326 |
|
$sCo
de = '<inp
ut type="p
assword" c
lass="inpu
t_pass" na
me="' . $a
Input['Nam
e'] . '" /
>';
|
|
|
327 |
|
break;
|
|
|
328 |
|
|
|
|
329 |
|
case 'da
te':
|
|
|
330 |
|
$sCo
de = '<inp
ut type="t
ext" class
="input_da
te" name="
' . $aInpu
t['Name']
. '" value
="' . $thi
s ->value2
html( $aIn
put['Value
'] ) . '"
/>';
|
|
|
331 |
|
break;
|
|
|
332 |
|
|
|
|
333 |
|
case 'se
lect_one':
|
|
|
334 |
|
$thi
s -> inser
tSelectOne
( $aInput
);
|
|
|
335 |
|
break;
|
|
|
336 |
|
|
|
|
337 |
|
case 'se
lect_set':
|
|
|
338 |
|
$thi
s -> inser
tSelectSet
( $aInput
);
|
|
|
339 |
|
break;
|
|
|
340 |
|
|
|
|
341 |
|
case 'nu
m':
|
|
|
342 |
|
$sCo
de = '<inp
ut type="t
ext" class
="input_nu
m" name="'
. $aInput
['Name'] .
'" value=
"' . $this
->value2h
tml( $aInp
ut['Value'
] ) . '" /
>';
|
|
|
343 |
|
break;
|
|
|
344 |
|
|
|
|
345 |
|
case 'ra
nge':
|
|
|
346 |
|
$sCo
de = '<in
put type="
text" clas
s="input_r
ange_0" na
me="' . $a
Input['Nam
e'] . '[0]
" value="'
. $this -
>value2htm
l( $aInput
['Value'][
0] ) . '"
/>';
|
|
|
347 |
|
$sCo
de .= ' -
';
|
|
|
348 |
|
$sCo
de .= '<in
put type="
text" clas
s="input_r
ange_1" na
me="' . $a
Input['Nam
e'] . '[1]
" value="'
. $this -
>value2htm
l( $aInput
['Value'][
1] ) . '"
/>';
|
|
|
349 |
|
break;
|
|
|
350 |
|
|
|
|
351 |
|
case 'bo
ol':
|
|
|
352 |
|
$sCo
de = '
|
|
|
353 |
|
<input typ
e="checkbo
x" name="'
. $aInput
['Name'] .
'" value="
yes"' .
|
|
|
354 |
|
( $aInpu
t['Value']
? ' check
ed="checke
d"' : '' )
. ' />';
|
|
|
355 |
|
break;
|
|
|
356 |
|
|
|
|
357 |
|
case 'sy
stem':
|
|
|
358 |
|
swit
ch( $aInpu
t['Name']
) {
|
|
|
359 |
|
case 'Coup
le':
|
|
|
360 |
|
$sCode
=
|
|
|
361 |
|
'<
select nam
e="Couple"
class="in
put_select
_couple" o
nchange="d
oShowHideS
econdProfi
le( this.v
alue, this
.form )">'
.
|
|
|
362 |
|
'<option
value="no
"' . ( $a
Input['Val
ue'] ? ''
: ' select
ed="select
ed"' ) . '
>' . _t( '
_Single' )
. '</opti
on>' .
|
|
|
363 |
|
'<option
value="ye
s"' . ( $a
Input['Val
ue'] ? ' s
elected="s
elected"'
: '' ) . '
>' . _t( '
_Couple' )
. '</opti
on>' .
|
|
|
364 |
|
'<
/select>';
|
|
|
365 |
|
break;
|
|
|
366 |
|
|
|
|
367 |
|
case 'Capt
cha':
|
|
|
368 |
|
$sCode
=
|
|
|
369 |
|
'<
img src="'
. $site['
url'] . 's
img/simg.p
hp" class=
"form_capt
cha" /><br
/><br />
|
|
|
370 |
|
<i
nput type=
"text" cla
ss="input_
text" maxl
ength="6"
name="Capt
cha" />';
|
|
|
371 |
|
break;
|
|
|
372 |
|
|
|
|
373 |
|
case 'Stat
us':
|
|
|
374 |
|
$this
-> insertS
electOne(
$aInput, f
alse );
|
|
|
375 |
|
break;
|
|
|
376 |
|
|
|
|
377 |
|
case 'Feat
ured':
|
|
|
378 |
|
$aInpu
t['Type']
= 'bool';
|
|
|
379 |
|
$this
-> insertI
nput( $aIn
put );
|
|
|
380 |
|
break;
|
|
|
381 |
|
|
|
|
382 |
|
case 'Term
sOfUse':
|
|
|
383 |
|
$sCode
= '
|
|
|
384 |
|
|
|
|
385 |
|
<i
nput type=
"checkbox"
name="Ter
msOfUse" v
alue="yes"
id="Terms
OfUse_agre
e" />
|
|
|
386 |
|
<l
abel for="
TermsOfUse
_agree">
|
|
|
387 |
|
' . $aIn
put['Capti
on'] . '
|
|
|
388 |
|
</
label>';
|
|
|
389 |
|
break;
|
|
|
390 |
|
|
|
|
391 |
|
default:
|
|
|
392 |
|
$sCode
= 'rr';
|
|
|
393 |
|
}
|
|
|
394 |
|
break;
|
|
|
395 |
|
default:
|
|
|
396 |
|
$sCo
de = 'You
fucking my
brain?';
|
|
|
397 |
|
}
|
|
|
398 |
|
|
|
|
399 |
|
$t
his -> sCo
de .= $sCo
de;
|
|
|
400 |
|
}
|
|
|
401 |
|
|
|
|
402 |
|
functi
on insertS
electOne(
$aInput, $
bAddFirst
= true ) {
|
|
|
403 |
|
if
( $bAddFir
st )
|
|
|
404 |
|
$aValues
= array(
'' => '_Se
lect it' )
;
|
|
|
405 |
|
|
|
|
406 |
|
if
( is_array
( $aInput[
'Values']
) ) {
|
|
|
407 |
|
foreach(
$aInput['
Values'] a
s $sKey )
|
|
|
408 |
|
$aVa
lues[$sKey
] = "_$sKe
y";
|
|
|
409 |
|
}
else {
|
|
|
410 |
|
$aValues
+= $this
-> getPred
efList( $a
Input['Val
ues'], $aI
nput['UseL
Key'] );
|
|
|
411 |
|
}
|
|
|
412 |
|
|
|
|
413 |
|
sw
itch( $aIn
put['Contr
ol'] ) {
|
|
|
414 |
|
case 'se
lect':
|
|
|
415 |
|
$sCo
de = '<sel
ect class=
"input_sel
ect" name=
"' . $aInp
ut['Name']
. '">';
|
|
|
416 |
|
foreach( $
aValues as
$sKey =>
$sValue )
{
|
|
|
417 |
|
$sSele
cted = ( $
aInput['Va
lue'] == $
sKey ) ? '
selected=
"selected"
' : '';
|
|
|
418 |
|
$sCode
.= '
|
|
|
419 |
|
<o
ption valu
e="' . $th
is -> valu
e2html( $s
Key ) . '"
' . $sSele
cted . '>'
.
|
|
|
420 |
|
$this ->
value2htm
l( _t( $sV
alue ) ) .
|
|
|
421 |
|
'<
/option>';
|
|
|
422 |
|
}
|
|
|
423 |
|
$sCo
de .= '</s
elect>';
|
|
|
424 |
|
break;
|
|
|
425 |
|
|
|
|
426 |
|
case 'ra
dio':
|
|
|
427 |
|
$sCo
de = '';
|
|
|
428 |
|
fore
ach( $aVal
ues as $sK
ey => $sVa
lue ) {
|
|
|
429 |
|
if( $sKey
=== '' )
|
|
|
430 |
|
contin
ue;
|
|
|
431 |
|
|
|
|
432 |
|
$sSelected
= ( $aInp
ut['Value'
] == $sKey
) ? ' che
cked="chec
ked"' : ''
;
|
|
|
433 |
|
$sID = $aI
nput['Name
'] . '_' .
$sKey;
|
|
|
434 |
|
$sCode .=
'
|
|
|
435 |
|
<input
type="rad
io" class=
"input_rad
io"
|
|
|
436 |
|
valu
e="' . $th
is -> valu
e2html( $s
Key ) . '"
|
|
|
437 |
|
' .
$sSelected
. '
|
|
|
438 |
|
id="
' . $sID .
'"
|
|
|
439 |
|
name
="' . $aIn
put['Name'
] . '" />
|
|
|
440 |
|
<label
class="in
put_radio_
label" for
="' . $sID
. '">' .
_t( $sValu
e ) . '</l
abel>';
|
|
|
441 |
|
}
|
|
|
442 |
|
break;
|
|
|
443 |
|
}
|
|
|
444 |
|
|
|
|
445 |
|
$t
his -> sCo
de .= $sCo
de;
|
|
|
446 |
|
}
|
|
|
447 |
|
|
|
|
448 |
|
functi
on insertS
electSet(
$aInput )
{
|
|
|
449 |
|
if
( is_array
( $aInput[
'Values']
) ) {
|
|
|
450 |
|
foreach(
$aInput['
Values'] a
s $sKey )
|
|
|
451 |
|
$aVa
lues[$sKey
] = "_$sKe
y";
|
|
|
452 |
|
}
else {
|
|
|
453 |
|
$aValues
= $this -
> getPrede
fList( $aI
nput['Valu
es'], $aIn
put['UseLK
ey'] );
|
|
|
454 |
|
}
|
|
|
455 |
|
|
|
|
456 |
|
if
( !is_arra
y($aInput[
'Value'])
)
|
|
|
457 |
|
$aInput[
'Value'] =
array();
|
|
|
458 |
|
|
|
|
459 |
|
sw
itch( $aIn
put['Contr
ol'] ) {
|
|
|
460 |
|
case 'se
lect':
|
|
|
461 |
|
$sCo
de = '<sel
ect class=
"input_sel
ect_multi"
multiple=
"multiple"
name="' .
$aInput['
Name'] . '
[]">';
|
|
|
462 |
|
foreach( $
aValues as
$sKey =>
$sValue )
{
|
|
|
463 |
|
$sSele
cted = in_
array( $sK
ey, $aInpu
t['Value']
) ? ' sel
ected="sel
ected"' :
'';
|
|
|
464 |
|
$sCode
.= '
|
|
|
465 |
|
<o
ption valu
e="' . $th
is -> valu
e2html( $s
Key ) . '"
' . $sSele
cted . '>'
.
|
|
|
466 |
|
$this ->
value2htm
l( _t( $sV
alue ) ) .
|
|
|
467 |
|
'<
/option>';
|
|
|
468 |
|
}
|
|
|
469 |
|
$sCo
de .= '</s
elect>';
|
|
|
470 |
|
break;
|
|
|
471 |
|
|
|
|
472 |
|
case 'ch
eckbox':
|
|
|
473 |
|
$sCo
de = '';
|
|
|
474 |
|
fore
ach( $aVal
ues as $sK
ey => $sVa
lue ) {
|
|
|
475 |
|
$sSelected
= in_arra
y( $sKey,
$aInput['V
alue'] ) ?
' checked
="checked"
' : '';
|
|
|
476 |
|
$sID = $aI
nput['Name
'] . '_' .
$sKey;
|
|
|
477 |
|
$sCode .=
'
|
|
|
478 |
|
<input
type="che
ckbox" cla
ss="input_
checkbox"
|
|
|
479 |
|
valu
e="' . $th
is -> valu
e2html( $s
Key ) . '"
|
|
|
480 |
|
' .
$sSelected
. '
|
|
|
481 |
|
id="
' . $sID .
'"
|
|
|
482 |
|
name
="' . $aIn
put['Name'
] . '[]" /
>
|
|
|
483 |
|
<label
class="in
put_radio_
label" for
="' . $sID
. '">' .
_t( $sValu
e ) . '</l
abel>';
|
|
|
484 |
|
}
|
|
|
485 |
|
break;
|
|
|
486 |
|
}
|
|
|
487 |
|
|
|
|
488 |
|
$t
his -> sCo
de .= $sCo
de;
|
|
|
489 |
|
}
|
|
|
490 |
|
|
|
|
491 |
|
functi
on getPred
efList( $s
Key, $sUse
LKey = 'LK
ey' ) {
|
|
|
492 |
|
gl
obal $aPre
Values;
|
|
|
493 |
|
|
|
|
494 |
|
if
( substr(
$sKey, 0,
2 ) == '#!
' )
|
|
|
495 |
|
$sKey =
substr( $s
Key, 2 );
|
|
|
496 |
|
|
|
|
497 |
|
$a
List = arr
ay();
|
|
|
498 |
|
|
|
|
499 |
|
if
( !isset(
$aPreValue
s[$sKey] )
)
|
|
|
500 |
|
return $
aList;
|
|
|
501 |
|
|
|
|
502 |
|
fo
reach( $aP
reValues[$
sKey] as $
sVal => $a
Val ) {
|
|
|
503 |
|
if( !iss
et( $aVal[
$sUseLKey]
) )
|
|
|
504 |
|
$sUs
eLKey = 'L
Key';
|
|
|
505 |
|
|
|
|
506 |
|
$aList[
$sVal ] =
$aVal[ $sU
seLKey ];
|
|
|
507 |
|
}
|
|
|
508 |
|
|
|
|
509 |
|
re
turn $aLis
t;
|
|
|
510 |
|
}
|
|
|
511 |
|
}
|