| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
=head1 NAME |
|
2
|
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
HTML::FormEngine::Skin - FormEngines basic skin package |
|
4
|
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
=head1 THE TEMPLATE SYSTEM |
|
6
|
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
The parsing of the templates is done from left to right and from top |
|
8
|
|
|
|
|
|
|
to bottom! |
|
9
|
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
=head2 Variables |
|
11
|
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
Variables must have the following format: |
|
13
|
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
<&[A-Z_]+&> |
|
15
|
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
When the template is processed these directives are replaced by the |
|
17
|
|
|
|
|
|
|
variables value. If no value was defined, the default value is used, |
|
18
|
|
|
|
|
|
|
if even this is missing, they're just removed. |
|
19
|
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
Variables, defined for a certain template, are valid for all |
|
21
|
|
|
|
|
|
|
subtemplates too! |
|
22
|
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=head2 Handler calls |
|
24
|
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
You can call a handler out of a template and so replace the call |
|
26
|
|
|
|
|
|
|
directive with the handlers return value. |
|
27
|
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
A handler name must match the follwing regular expression: |
|
29
|
|
|
|
|
|
|
I<#?[a-z_]+[a-z_0-9]+>. |
|
30
|
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
Optionally one can pass arguments to a handler. E.g. C<<&error |
|
32
|
|
|
|
|
|
|
ERROR_IN&>> calls the error handler and passes to it ERROR_IN as |
|
33
|
|
|
|
|
|
|
argument. Mostly handlers are called without any arguments, |
|
34
|
|
|
|
|
|
|
e.g. C<<&value&>>, which calls the value handler. |
|
35
|
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
Handler calls can also be nested, e.g. like this: C<< <&<&arg 1&> |
|
37
|
|
|
|
|
|
|
ERROR_IN&> >>. In that example first C<< <&arg 1&> >> is called, the result |
|
38
|
|
|
|
|
|
|
is expected to be the name of a handler which is then called with |
|
39
|
|
|
|
|
|
|
I as argument. |
|
40
|
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
The handlers are normally defined in Handler.pm, but you can also |
|
42
|
|
|
|
|
|
|
define them directly in the skin or wherever you think it fits |
|
43
|
|
|
|
|
|
|
best. Important is that they're registered correctly by the skin. Read |
|
44
|
|
|
|
|
|
|
L, L and |
|
45
|
|
|
|
|
|
|
L for more information. |
|
46
|
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
The default handler is used for processing templates. So if you want |
|
48
|
|
|
|
|
|
|
to nest templates, you might use the templates name as a handler name |
|
49
|
|
|
|
|
|
|
and so call the default handler which will return the processed |
|
50
|
|
|
|
|
|
|
template code. |
|
51
|
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
To distinguish handler calls from template calls a I<#> is added |
|
53
|
|
|
|
|
|
|
infront of the name if a existing handler and not the default handler |
|
54
|
|
|
|
|
|
|
is to be called. This is only a convention and not necessary from the |
|
55
|
|
|
|
|
|
|
technical point of view. |
|
56
|
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
For more information about handlers, see the |
|
58
|
|
|
|
|
|
|
L. |
|
59
|
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=head2 Loops |
|
61
|
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
If you want to repeat a certain template fragment several times, you |
|
63
|
|
|
|
|
|
|
can use the following notation: |
|
64
|
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
<~some lines of code~LOOPVARIABLES SEPERATED BY SPACE~> |
|
66
|
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
If one or more loop variables are array references, the loop is |
|
68
|
|
|
|
|
|
|
repeated until the last loop variable as no element left. If all loop |
|
69
|
|
|
|
|
|
|
variables are scalars, the code is only printed once. If one ore more, |
|
70
|
|
|
|
|
|
|
but not all loop variables are scalars, these scalar variables have in |
|
71
|
|
|
|
|
|
|
every repetition the same value. If a loop variable is an array |
|
72
|
|
|
|
|
|
|
reference, but has no elements left, it has the NULL value in the |
|
73
|
|
|
|
|
|
|
following repetitions. |
|
74
|
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
You can nest loops. For example the ClassicSkin uses this feature: If |
|
76
|
|
|
|
|
|
|
you use one dimensional arrays, the text fields are printed each on a |
|
77
|
|
|
|
|
|
|
single line, if you use two dimensional arrays, you can print several |
|
78
|
|
|
|
|
|
|
text fields on the same line. |
|
79
|
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
Since FormEngine 1.0 you can also define loops without specifying loop |
|
81
|
|
|
|
|
|
|
variables. These loops are called global loops and they iterate over |
|
82
|
|
|
|
|
|
|
all used variables. That means as long as one of the variables used in |
|
83
|
|
|
|
|
|
|
the loops content has another element the loop is repeated. For |
|
84
|
|
|
|
|
|
|
example the I template of the ComplexSkin uses this feature. |
|
85
|
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=head2 Blocks |
|
87
|
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
Code that is enclosed in '', is only printed |
|
89
|
|
|
|
|
|
|
when all variables which are mentioned in VARIABLENAMES are defined |
|
90
|
|
|
|
|
|
|
(that means not empty). If you seperate the variable names by '|' |
|
91
|
|
|
|
|
|
|
instead of ' ', only one of these variables must be defined. |
|
92
|
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
=cut |
|
94
|
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
###################################################################### |
|
96
|
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
package HTML::FormEngine::Skin; |
|
98
|
|
|
|
|
|
|
|
|
99
|
1
|
|
|
1
|
|
705
|
use Locale::gettext; |
|
|
1
|
|
|
|
|
16748
|
|
|
|
1
|
|
|
|
|
120
|
|
|
100
|
1
|
|
|
1
|
|
10
|
use Digest::MD5 qw(md5_hex); |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
43
|
|
|
101
|
1
|
|
|
1
|
|
6
|
use Hash::Merge qw(merge); |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
1865
|
|
|
102
|
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
###################################################################### |
|
104
|
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
=head1 HTML::FormEngine::Skin |
|
106
|
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
This class is abstract and not a complete skin class but its the basis |
|
108
|
|
|
|
|
|
|
of all skins. That means all methods defined here are available in all |
|
109
|
|
|
|
|
|
|
skins. In case you write your own skin you should also base it on |
|
110
|
|
|
|
|
|
|
this class if it makes sense. if not you should at least support the |
|
111
|
|
|
|
|
|
|
same methods. |
|
112
|
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
=head2 Methods |
|
114
|
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
=head3 new ([ $textdomain ]) |
|
116
|
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
This method is the constructor. It returns the skin object. |
|
118
|
|
|
|
|
|
|
Optionally you can pass it the path to your locale directory. By |
|
119
|
|
|
|
|
|
|
default this is C. It is needed for C |
|
120
|
|
|
|
|
|
|
which translates the error messages and other stuff. |
|
121
|
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
=cut |
|
123
|
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
###################################################################### |
|
125
|
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
sub new { |
|
127
|
1
|
|
|
1
|
1
|
2
|
my ($class,$textdomain) = @_; |
|
128
|
1
|
|
33
|
|
|
8
|
my $self = bless({}, ref($class) || $class); |
|
129
|
1
|
|
|
|
|
8
|
$self->_textdomain($textdomain); |
|
130
|
1
|
|
|
|
|
9
|
$self->_init(); |
|
131
|
0
|
|
|
|
|
0
|
return $self; |
|
132
|
|
|
|
|
|
|
} |
|
133
|
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
###################################################################### |
|
135
|
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
=head3 set_textdomain ( $textdomain ) |
|
137
|
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
Use this method to set the textdomain. Default is C. |
|
139
|
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
=cut |
|
141
|
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
###################################################################### |
|
143
|
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
sub set_textdomain { |
|
145
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
|
146
|
0
|
|
|
|
|
0
|
$self->_textdomain(shift); |
|
147
|
|
|
|
|
|
|
} |
|
148
|
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
###################################################################### |
|
150
|
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
=head3 get_templ ([ $name ]) |
|
152
|
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
Returns the definition of the template with the given name. |
|
154
|
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
If no name is given a hash reference containing all templates is |
|
156
|
|
|
|
|
|
|
returned. |
|
157
|
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
=cut |
|
159
|
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
###################################################################### |
|
161
|
|
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
sub get_templ { |
|
163
|
0
|
|
|
0
|
1
|
0
|
my($self, $name) = @_; |
|
164
|
0
|
0
|
|
|
|
0
|
return $self->{templ}->{$name} if($name); |
|
165
|
0
|
|
|
|
|
0
|
return $self->{templ}; |
|
166
|
|
|
|
|
|
|
} |
|
167
|
|
|
|
|
|
|
|
|
168
|
|
|
|
|
|
|
###################################################################### |
|
169
|
|
|
|
|
|
|
|
|
170
|
|
|
|
|
|
|
=head3 set_templ ( HASHREF ) |
|
171
|
|
|
|
|
|
|
|
|
172
|
|
|
|
|
|
|
Overwrites all template definitions. Not recommended. |
|
173
|
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
=cut |
|
175
|
|
|
|
|
|
|
|
|
176
|
|
|
|
|
|
|
###################################################################### |
|
177
|
|
|
|
|
|
|
|
|
178
|
|
|
|
|
|
|
sub set_templ { |
|
179
|
0
|
|
|
0
|
1
|
0
|
my($self, $templ) = @_; |
|
180
|
0
|
0
|
0
|
|
|
0
|
$self->{templ} = $templ and return 1 if(ref($templ) eq 'HASH'); |
|
181
|
0
|
|
|
|
|
0
|
return 0; |
|
182
|
|
|
|
|
|
|
} |
|
183
|
|
|
|
|
|
|
|
|
184
|
|
|
|
|
|
|
###################################################################### |
|
185
|
|
|
|
|
|
|
|
|
186
|
|
|
|
|
|
|
=head3 alter_templ ( HASHREF ) |
|
187
|
|
|
|
|
|
|
|
|
188
|
|
|
|
|
|
|
If you only want to add or overwrite some templates, call this method. |
|
189
|
|
|
|
|
|
|
You have to pass a reference to the hash which stores these templates. |
|
190
|
|
|
|
|
|
|
|
|
191
|
|
|
|
|
|
|
=cut |
|
192
|
|
|
|
|
|
|
|
|
193
|
|
|
|
|
|
|
###################################################################### |
|
194
|
|
|
|
|
|
|
|
|
195
|
|
|
|
|
|
|
sub alter_templ { |
|
196
|
0
|
|
|
0
|
1
|
0
|
my ($self,$alter) = @_; |
|
197
|
0
|
0
|
0
|
|
|
0
|
$self->{templ} = merge($alter, $self->{templ}) and return 1 if(ref($alter) eq 'HASH'); |
|
198
|
0
|
|
|
|
|
0
|
return 0; |
|
199
|
|
|
|
|
|
|
} |
|
200
|
|
|
|
|
|
|
|
|
201
|
|
|
|
|
|
|
###################################################################### |
|
202
|
|
|
|
|
|
|
|
|
203
|
|
|
|
|
|
|
=head3 get_default ( [$templ, $var] ) |
|
204
|
|
|
|
|
|
|
|
|
205
|
|
|
|
|
|
|
If no arguments specified it just returns all default settings in a |
|
206
|
|
|
|
|
|
|
hash reference. |
|
207
|
|
|
|
|
|
|
|
|
208
|
|
|
|
|
|
|
If $templ is given it returns the default settings for template $templ. |
|
209
|
|
|
|
|
|
|
|
|
210
|
|
|
|
|
|
|
If $var is also given it returns the default setting of the variable |
|
211
|
|
|
|
|
|
|
$var in template $templ. |
|
212
|
|
|
|
|
|
|
|
|
213
|
|
|
|
|
|
|
=cut |
|
214
|
|
|
|
|
|
|
|
|
215
|
|
|
|
|
|
|
###################################################################### |
|
216
|
|
|
|
|
|
|
|
|
217
|
|
|
|
|
|
|
sub get_default { |
|
218
|
0
|
|
|
0
|
1
|
0
|
my($self, $templ, $var) = @_; |
|
219
|
0
|
0
|
|
|
|
0
|
if(defined($templ)) { |
|
220
|
0
|
0
|
|
|
|
0
|
if(defined($var)) { |
|
221
|
0
|
0
|
|
|
|
0
|
return $self->{default}->{$templ}->{$var} if(defined($self->{default}->{$templ}->{$var})); |
|
222
|
0
|
0
|
|
|
|
0
|
return $self->{default}->{main}->{$var} if(defined($self->{default}->{main}->{$var})); |
|
223
|
0
|
|
|
|
|
0
|
return $self->{default}->{default}->{$var}; |
|
224
|
|
|
|
|
|
|
} |
|
225
|
0
|
|
|
|
|
0
|
return $self->{default}->{$templ}; |
|
226
|
|
|
|
|
|
|
} |
|
227
|
0
|
|
|
|
|
0
|
return $self->{default}; |
|
228
|
|
|
|
|
|
|
} |
|
229
|
|
|
|
|
|
|
|
|
230
|
|
|
|
|
|
|
###################################################################### |
|
231
|
|
|
|
|
|
|
|
|
232
|
|
|
|
|
|
|
=head3 set_default ( HASHREF ) |
|
233
|
|
|
|
|
|
|
|
|
234
|
|
|
|
|
|
|
By using this method, you completly reset the default values of the |
|
235
|
|
|
|
|
|
|
template variables. You have to pass a reference to the hash which |
|
236
|
|
|
|
|
|
|
stores the new settings. In most cases you better call |
|
237
|
|
|
|
|
|
|
L. |
|
238
|
|
|
|
|
|
|
|
|
239
|
|
|
|
|
|
|
=cut |
|
240
|
|
|
|
|
|
|
|
|
241
|
|
|
|
|
|
|
###################################################################### |
|
242
|
|
|
|
|
|
|
|
|
243
|
|
|
|
|
|
|
sub set_default { |
|
244
|
0
|
|
|
0
|
1
|
0
|
my($self, $default) = @_; |
|
245
|
0
|
0
|
0
|
|
|
0
|
$self->{default} = $default and return 1 if(ref($default) eq 'HASH'); |
|
246
|
0
|
|
|
|
|
0
|
return 0; |
|
247
|
|
|
|
|
|
|
} |
|
248
|
|
|
|
|
|
|
|
|
249
|
|
|
|
|
|
|
###################################################################### |
|
250
|
|
|
|
|
|
|
|
|
251
|
|
|
|
|
|
|
=head3 alter_default ( HASHREF ) |
|
252
|
|
|
|
|
|
|
|
|
253
|
|
|
|
|
|
|
Pass a hash reference to this method for adding or overwriting default |
|
254
|
|
|
|
|
|
|
values. |
|
255
|
|
|
|
|
|
|
|
|
256
|
|
|
|
|
|
|
=cut |
|
257
|
|
|
|
|
|
|
|
|
258
|
|
|
|
|
|
|
###################################################################### |
|
259
|
|
|
|
|
|
|
|
|
260
|
|
|
|
|
|
|
sub alter_default { |
|
261
|
0
|
|
|
0
|
1
|
0
|
my ($self,$alter) = @_; |
|
262
|
0
|
0
|
0
|
|
|
0
|
$self->{default} = merge($alter, $self->{default}) and return 1 if(ref($alter) eq 'HASH'); |
|
263
|
0
|
|
|
|
|
0
|
return 0; |
|
264
|
|
|
|
|
|
|
} |
|
265
|
|
|
|
|
|
|
|
|
266
|
|
|
|
|
|
|
###################################################################### |
|
267
|
|
|
|
|
|
|
|
|
268
|
|
|
|
|
|
|
=head3 get_handler ([ $name ]) |
|
269
|
|
|
|
|
|
|
|
|
270
|
|
|
|
|
|
|
If $name is given it returns a reference to the handler having the |
|
271
|
|
|
|
|
|
|
given name. |
|
272
|
|
|
|
|
|
|
|
|
273
|
|
|
|
|
|
|
If not it returns a hash reference containing all handlers. |
|
274
|
|
|
|
|
|
|
|
|
275
|
|
|
|
|
|
|
=cut |
|
276
|
|
|
|
|
|
|
|
|
277
|
|
|
|
|
|
|
###################################################################### |
|
278
|
|
|
|
|
|
|
|
|
279
|
|
|
|
|
|
|
sub get_handler { |
|
280
|
0
|
|
|
0
|
1
|
0
|
my($self, $name) = @_; |
|
281
|
0
|
0
|
|
|
|
0
|
return $self->{handler}->{$name} if($name); |
|
282
|
0
|
|
|
|
|
0
|
return $self->{handler}; |
|
283
|
|
|
|
|
|
|
} |
|
284
|
|
|
|
|
|
|
|
|
285
|
|
|
|
|
|
|
###################################################################### |
|
286
|
|
|
|
|
|
|
|
|
287
|
|
|
|
|
|
|
=head3 set_handler ( HASHREF ) |
|
288
|
|
|
|
|
|
|
|
|
289
|
|
|
|
|
|
|
This method resets the handler settings. If you just want to add or |
|
290
|
|
|
|
|
|
|
overwrite a handler setting, use L. |
|
291
|
|
|
|
|
|
|
|
|
292
|
|
|
|
|
|
|
=cut |
|
293
|
|
|
|
|
|
|
|
|
294
|
|
|
|
|
|
|
###################################################################### |
|
295
|
|
|
|
|
|
|
|
|
296
|
|
|
|
|
|
|
sub set_handler { |
|
297
|
0
|
|
|
0
|
1
|
0
|
my($self, $handler) = @_; |
|
298
|
0
|
0
|
0
|
|
|
0
|
$self->{handler} = $handler and return 1 if(ref($handler) eq 'HASH'); |
|
299
|
0
|
|
|
|
|
0
|
return 0; |
|
300
|
|
|
|
|
|
|
} |
|
301
|
|
|
|
|
|
|
|
|
302
|
|
|
|
|
|
|
###################################################################### |
|
303
|
|
|
|
|
|
|
|
|
304
|
|
|
|
|
|
|
=head3 alter_handler ( HASHREF ) |
|
305
|
|
|
|
|
|
|
|
|
306
|
|
|
|
|
|
|
This method adds or overwrites template handlers. Have a look at |
|
307
|
|
|
|
|
|
|
Handler.pm for more information. |
|
308
|
|
|
|
|
|
|
|
|
309
|
|
|
|
|
|
|
=cut |
|
310
|
|
|
|
|
|
|
|
|
311
|
|
|
|
|
|
|
###################################################################### |
|
312
|
|
|
|
|
|
|
|
|
313
|
|
|
|
|
|
|
sub alter_handler { |
|
314
|
0
|
|
|
0
|
1
|
0
|
my ($self,$alter) = @_; |
|
315
|
0
|
0
|
0
|
|
|
0
|
$self->{handler} = merge($alter, $self->{handler}) and return 1 if(ref($alter) eq 'HASH'); |
|
316
|
0
|
|
|
|
|
0
|
return 0; |
|
317
|
|
|
|
|
|
|
} |
|
318
|
|
|
|
|
|
|
|
|
319
|
|
|
|
|
|
|
###################################################################### |
|
320
|
|
|
|
|
|
|
|
|
321
|
|
|
|
|
|
|
=head3 get_check ([ $name ]) |
|
322
|
|
|
|
|
|
|
|
|
323
|
|
|
|
|
|
|
If $name is given it returns a reference to the check function |
|
324
|
|
|
|
|
|
|
registered by the skin as $name. |
|
325
|
|
|
|
|
|
|
|
|
326
|
|
|
|
|
|
|
If $name is not given it returns a hash reference containing all check |
|
327
|
|
|
|
|
|
|
functions. |
|
328
|
|
|
|
|
|
|
|
|
329
|
|
|
|
|
|
|
=cut |
|
330
|
|
|
|
|
|
|
|
|
331
|
|
|
|
|
|
|
###################################################################### |
|
332
|
|
|
|
|
|
|
|
|
333
|
|
|
|
|
|
|
sub get_check { |
|
334
|
0
|
|
|
0
|
1
|
0
|
my($self, $name) = @_; |
|
335
|
0
|
0
|
|
|
|
0
|
return $self->{check}->{$name} if($name); |
|
336
|
0
|
|
|
|
|
0
|
return $self->{check}; |
|
337
|
|
|
|
|
|
|
} |
|
338
|
|
|
|
|
|
|
|
|
339
|
|
|
|
|
|
|
###################################################################### |
|
340
|
|
|
|
|
|
|
|
|
341
|
|
|
|
|
|
|
=head3 set_check ( HASHREF ) |
|
342
|
|
|
|
|
|
|
|
|
343
|
|
|
|
|
|
|
This method resets the check settings. If you just want to add or |
|
344
|
|
|
|
|
|
|
overwrite a check function, use L. |
|
345
|
|
|
|
|
|
|
|
|
346
|
|
|
|
|
|
|
=cut |
|
347
|
|
|
|
|
|
|
|
|
348
|
|
|
|
|
|
|
###################################################################### |
|
349
|
|
|
|
|
|
|
|
|
350
|
|
|
|
|
|
|
sub set_check { |
|
351
|
0
|
|
|
0
|
1
|
0
|
my($self, $check) = @_; |
|
352
|
0
|
0
|
0
|
|
|
0
|
$self->{check} = $check and return 1 if(ref($check) eq 'HASH'); |
|
353
|
0
|
|
|
|
|
0
|
return 0; |
|
354
|
|
|
|
|
|
|
} |
|
355
|
|
|
|
|
|
|
|
|
356
|
|
|
|
|
|
|
###################################################################### |
|
357
|
|
|
|
|
|
|
|
|
358
|
|
|
|
|
|
|
=head3 alter_check ( HASHREF ) |
|
359
|
|
|
|
|
|
|
|
|
360
|
|
|
|
|
|
|
This method adds or overwrites check routines. Have a look at |
|
361
|
|
|
|
|
|
|
Checks.pm for more information. |
|
362
|
|
|
|
|
|
|
|
|
363
|
|
|
|
|
|
|
=cut |
|
364
|
|
|
|
|
|
|
|
|
365
|
|
|
|
|
|
|
###################################################################### |
|
366
|
|
|
|
|
|
|
|
|
367
|
|
|
|
|
|
|
sub alter_check { |
|
368
|
0
|
|
|
0
|
1
|
0
|
my ($self,$alter) = @_; |
|
369
|
0
|
0
|
0
|
|
|
0
|
$self->{check} = merge($alter, $self->{check}) and return 1 if(ref($alter) eq 'HASH'); |
|
370
|
0
|
|
|
|
|
0
|
return 0; |
|
371
|
|
|
|
|
|
|
} |
|
372
|
|
|
|
|
|
|
|
|
373
|
|
|
|
|
|
|
###################################################################### |
|
374
|
|
|
|
|
|
|
|
|
375
|
|
|
|
|
|
|
=head3 is_hidden ( $templ ) |
|
376
|
|
|
|
|
|
|
|
|
377
|
|
|
|
|
|
|
Returns 1 (true) if the template with the given name is registered as |
|
378
|
|
|
|
|
|
|
I. Also see L |
|
379
|
|
|
|
|
|
|
|
|
380
|
|
|
|
|
|
|
=cut |
|
381
|
|
|
|
|
|
|
|
|
382
|
|
|
|
|
|
|
###################################################################### |
|
383
|
|
|
|
|
|
|
|
|
384
|
|
|
|
|
|
|
sub is_hidden { |
|
385
|
0
|
|
|
0
|
1
|
0
|
my ($self,$templ) = @_; |
|
386
|
0
|
0
|
|
|
|
0
|
return $self->{hidden}->{$templ} if($templ); |
|
387
|
0
|
|
|
|
|
0
|
return 0; |
|
388
|
|
|
|
|
|
|
} |
|
389
|
|
|
|
|
|
|
|
|
390
|
|
|
|
|
|
|
###################################################################### |
|
391
|
|
|
|
|
|
|
|
|
392
|
|
|
|
|
|
|
=head3 get_hidden |
|
393
|
|
|
|
|
|
|
|
|
394
|
|
|
|
|
|
|
Returns an array containing the names of all templates which are |
|
395
|
|
|
|
|
|
|
registered as I. Also see L. |
|
396
|
|
|
|
|
|
|
|
|
397
|
|
|
|
|
|
|
=cut |
|
398
|
|
|
|
|
|
|
|
|
399
|
|
|
|
|
|
|
###################################################################### |
|
400
|
|
|
|
|
|
|
|
|
401
|
|
|
|
|
|
|
sub get_hidden { |
|
402
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
|
403
|
0
|
|
|
|
|
0
|
return keys(%{$self->{hidden}}); |
|
|
0
|
|
|
|
|
0
|
|
|
404
|
|
|
|
|
|
|
} |
|
405
|
|
|
|
|
|
|
|
|
406
|
|
|
|
|
|
|
###################################################################### |
|
407
|
|
|
|
|
|
|
|
|
408
|
|
|
|
|
|
|
=head3 set_hidden ( ARRAY ) |
|
409
|
|
|
|
|
|
|
|
|
410
|
|
|
|
|
|
|
With this method you can reset the list of templates which are handled |
|
411
|
|
|
|
|
|
|
as hidden-templates, that means which shouldn't use any visible space |
|
412
|
|
|
|
|
|
|
and for which it doesn't matter where they're placed in the form. By |
|
413
|
|
|
|
|
|
|
default this list only contains I as reference to the template |
|
414
|
|
|
|
|
|
|
called I. |
|
415
|
|
|
|
|
|
|
|
|
416
|
|
|
|
|
|
|
Normally you'll prefer to only complete or redruce that list and |
|
417
|
|
|
|
|
|
|
therefore you'll call L or L
|
|
418
|
|
|
|
|
|
|
)>. |
|
419
|
|
|
|
|
|
|
|
|
420
|
|
|
|
|
|
|
=cut |
|
421
|
|
|
|
|
|
|
|
|
422
|
|
|
|
|
|
|
###################################################################### |
|
423
|
|
|
|
|
|
|
|
|
424
|
|
|
|
|
|
|
sub set_hidden { |
|
425
|
0
|
|
|
0
|
1
|
0
|
my($self, @hidden) = @_; |
|
426
|
0
|
|
|
|
|
0
|
$self->{hidden} = {}; |
|
427
|
0
|
|
|
|
|
0
|
return $self->alter_hidden(@hidden); |
|
428
|
|
|
|
|
|
|
} |
|
429
|
|
|
|
|
|
|
|
|
430
|
|
|
|
|
|
|
###################################################################### |
|
431
|
|
|
|
|
|
|
|
|
432
|
|
|
|
|
|
|
=head3 alter_hidden ( ARRAY ) |
|
433
|
|
|
|
|
|
|
|
|
434
|
|
|
|
|
|
|
See C. |
|
435
|
|
|
|
|
|
|
|
|
436
|
|
|
|
|
|
|
=cut |
|
437
|
|
|
|
|
|
|
|
|
438
|
|
|
|
|
|
|
###################################################################### |
|
439
|
|
|
|
|
|
|
|
|
440
|
|
|
|
|
|
|
sub alter_hidden { |
|
441
|
0
|
|
|
0
|
1
|
0
|
my ($self,@hidden) = @_; |
|
442
|
0
|
|
|
|
|
0
|
local $_; |
|
443
|
0
|
|
|
|
|
0
|
foreach $_ (@hidden) { |
|
444
|
0
|
|
|
|
|
0
|
$self->{hidden}->{$_} = 1; |
|
445
|
|
|
|
|
|
|
} |
|
446
|
0
|
|
|
|
|
0
|
return 1; |
|
447
|
|
|
|
|
|
|
} |
|
448
|
|
|
|
|
|
|
|
|
449
|
|
|
|
|
|
|
###################################################################### |
|
450
|
|
|
|
|
|
|
|
|
451
|
|
|
|
|
|
|
=head3 rm_hidden ( ARRAY ) |
|
452
|
|
|
|
|
|
|
|
|
453
|
|
|
|
|
|
|
See L. |
|
454
|
|
|
|
|
|
|
|
|
455
|
|
|
|
|
|
|
=cut |
|
456
|
|
|
|
|
|
|
|
|
457
|
|
|
|
|
|
|
###################################################################### |
|
458
|
|
|
|
|
|
|
|
|
459
|
|
|
|
|
|
|
sub rm_hidden { |
|
460
|
0
|
|
|
0
|
1
|
0
|
my($self,@hidden) = @_; |
|
461
|
0
|
|
|
|
|
0
|
local $_; |
|
462
|
0
|
|
|
|
|
0
|
foreach $_ (@hidden) { |
|
463
|
0
|
|
|
|
|
0
|
delete $self->{hidden}->{$_}; |
|
464
|
|
|
|
|
|
|
} |
|
465
|
0
|
|
|
|
|
0
|
return 1; |
|
466
|
|
|
|
|
|
|
} |
|
467
|
|
|
|
|
|
|
|
|
468
|
|
|
|
|
|
|
###################################################################### |
|
469
|
|
|
|
|
|
|
|
|
470
|
|
|
|
|
|
|
=head3 get_confirm_skin |
|
471
|
|
|
|
|
|
|
|
|
472
|
|
|
|
|
|
|
Returns the skin object which is used instead of this skin when the |
|
473
|
|
|
|
|
|
|
confirm form is created. |
|
474
|
|
|
|
|
|
|
|
|
475
|
|
|
|
|
|
|
See L, function C for more |
|
476
|
|
|
|
|
|
|
information. |
|
477
|
|
|
|
|
|
|
|
|
478
|
|
|
|
|
|
|
=cut |
|
479
|
|
|
|
|
|
|
|
|
480
|
|
|
|
|
|
|
###################################################################### |
|
481
|
|
|
|
|
|
|
|
|
482
|
|
|
|
|
|
|
sub get_confirm_skin { |
|
483
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
|
484
|
0
|
|
|
|
|
0
|
return $self->{confirm_skin}; |
|
485
|
|
|
|
|
|
|
} |
|
486
|
|
|
|
|
|
|
|
|
487
|
|
|
|
|
|
|
###################################################################### |
|
488
|
|
|
|
|
|
|
|
|
489
|
|
|
|
|
|
|
=head3 set_confirm_skin ( OBJECT ) |
|
490
|
|
|
|
|
|
|
|
|
491
|
|
|
|
|
|
|
Sets the confirm skin to the given skin object. |
|
492
|
|
|
|
|
|
|
|
|
493
|
|
|
|
|
|
|
See L, function C for more |
|
494
|
|
|
|
|
|
|
information. |
|
495
|
|
|
|
|
|
|
|
|
496
|
|
|
|
|
|
|
=cut |
|
497
|
|
|
|
|
|
|
|
|
498
|
|
|
|
|
|
|
###################################################################### |
|
499
|
|
|
|
|
|
|
|
|
500
|
|
|
|
|
|
|
sub set_confirm_skin { |
|
501
|
0
|
|
|
0
|
1
|
0
|
my($self, $skin) = @_; |
|
502
|
0
|
0
|
0
|
|
|
0
|
$self->{confirm_skin} = $skin and return 1 if(ref($skin)); |
|
503
|
0
|
|
|
|
|
0
|
return 0; |
|
504
|
|
|
|
|
|
|
} |
|
505
|
|
|
|
|
|
|
|
|
506
|
|
|
|
|
|
|
###################################################################### |
|
507
|
|
|
|
|
|
|
|
|
508
|
|
|
|
|
|
|
###################################################################### |
|
509
|
|
|
|
|
|
|
|
|
510
|
|
|
|
|
|
|
#sub get_text_skin { |
|
511
|
|
|
|
|
|
|
# my $self = shift; |
|
512
|
|
|
|
|
|
|
# return $self->{text_skin}; |
|
513
|
|
|
|
|
|
|
#} |
|
514
|
|
|
|
|
|
|
|
|
515
|
|
|
|
|
|
|
###################################################################### |
|
516
|
|
|
|
|
|
|
|
|
517
|
|
|
|
|
|
|
###################################################################### |
|
518
|
|
|
|
|
|
|
|
|
519
|
|
|
|
|
|
|
#sub set_text_skin { |
|
520
|
|
|
|
|
|
|
# my($self, $skin) = @_; |
|
521
|
|
|
|
|
|
|
# $self->{text_skin} = $skin and return 1 if(ref($skin)); |
|
522
|
|
|
|
|
|
|
# return 0; |
|
523
|
|
|
|
|
|
|
#} |
|
524
|
|
|
|
|
|
|
|
|
525
|
|
|
|
|
|
|
###################################################################### |
|
526
|
|
|
|
|
|
|
|
|
527
|
|
|
|
|
|
|
=head3 get_not_null_string |
|
528
|
|
|
|
|
|
|
|
|
529
|
|
|
|
|
|
|
Returns the string which is returned by the I handler in |
|
530
|
|
|
|
|
|
|
case a certain field must be filled out. By default that's the empty |
|
531
|
|
|
|
|
|
|
string (no mark). A good value is e.g. I<*>. Use L
|
|
532
|
|
|
|
|
|
|
( $string )> to modify it. |
|
533
|
|
|
|
|
|
|
|
|
534
|
|
|
|
|
|
|
=cut |
|
535
|
|
|
|
|
|
|
|
|
536
|
|
|
|
|
|
|
###################################################################### |
|
537
|
|
|
|
|
|
|
|
|
538
|
|
|
|
|
|
|
sub get_not_null_string { |
|
539
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
|
540
|
0
|
|
|
|
|
0
|
return $self->{not_null_string}; |
|
541
|
|
|
|
|
|
|
} |
|
542
|
|
|
|
|
|
|
|
|
543
|
|
|
|
|
|
|
###################################################################### |
|
544
|
|
|
|
|
|
|
|
|
545
|
|
|
|
|
|
|
=head3 set_not_null_string ( $string ) |
|
546
|
|
|
|
|
|
|
|
|
547
|
|
|
|
|
|
|
See L. |
|
548
|
|
|
|
|
|
|
|
|
549
|
|
|
|
|
|
|
=cut |
|
550
|
|
|
|
|
|
|
|
|
551
|
|
|
|
|
|
|
###################################################################### |
|
552
|
|
|
|
|
|
|
|
|
553
|
|
|
|
|
|
|
sub set_not_null_string { |
|
554
|
0
|
|
|
0
|
1
|
0
|
my ($self, $string) = @_; |
|
555
|
0
|
|
|
|
|
0
|
$self->{not_null_string} = $string; |
|
556
|
|
|
|
|
|
|
} |
|
557
|
|
|
|
|
|
|
|
|
558
|
|
|
|
|
|
|
###################################################################### |
|
559
|
|
|
|
|
|
|
|
|
560
|
|
|
|
|
|
|
=head2 SEE ALSO |
|
561
|
|
|
|
|
|
|
|
|
562
|
|
|
|
|
|
|
L, L, |
|
563
|
|
|
|
|
|
|
L, |
|
564
|
|
|
|
|
|
|
L |
|
565
|
|
|
|
|
|
|
|
|
566
|
|
|
|
|
|
|
And read the source code, especially the template definitions. |
|
567
|
|
|
|
|
|
|
|
|
568
|
|
|
|
|
|
|
=cut |
|
569
|
|
|
|
|
|
|
|
|
570
|
|
|
|
|
|
|
#--------- INTERNAL SUBROUTINES -------# |
|
571
|
|
|
|
|
|
|
|
|
572
|
|
|
|
|
|
|
sub _init { |
|
573
|
1
|
|
|
1
|
|
3
|
my $self = shift; |
|
574
|
1
|
|
|
|
|
6
|
$self->{templ} = $self->_get_templ; |
|
575
|
1
|
|
|
|
|
8
|
$self->{handler} = $self->_get_handler; |
|
576
|
1
|
|
|
|
|
12
|
$self->{default} = $self->_get_default; |
|
577
|
|
|
|
|
|
|
|
|
578
|
|
|
|
|
|
|
#templates which represent hidden fields should be handled special so that they don't use any visible space |
|
579
|
|
|
|
|
|
|
#all templates referenced from $self->{hidden} are handled like that |
|
580
|
1
|
|
|
|
|
10
|
$self->{hidden} = $self->_get_hidden; |
|
581
|
|
|
|
|
|
|
|
|
582
|
1
|
|
|
|
|
9
|
$self->{check} = $self->_get_check; |
|
583
|
|
|
|
|
|
|
##$self->{text_skin} = $self->_get_text_skin; |
|
584
|
0
|
|
|
|
|
0
|
$self->{confirm_skin} = $self->_get_confirm_skin; |
|
585
|
|
|
|
|
|
|
|
|
586
|
0
|
|
|
|
|
0
|
$self->{not_null_string} = $self->_get_not_null_string; |
|
587
|
0
|
|
|
|
|
0
|
$self->_init_child(); |
|
588
|
|
|
|
|
|
|
} |
|
589
|
|
|
|
|
|
|
|
|
590
|
0
|
|
|
0
|
|
0
|
sub _init_child { |
|
591
|
|
|
|
|
|
|
} |
|
592
|
|
|
|
|
|
|
|
|
593
|
|
|
|
|
|
|
sub _textdomain { |
|
594
|
1
|
|
|
1
|
|
2
|
my($self, $textdomain) = @_; |
|
595
|
1
|
|
50
|
|
|
24
|
bindtextdomain("HTML-FormEngine", $textdomain||'/usr/share/locale'); |
|
596
|
1
|
|
|
|
|
11
|
textdomain("HTML-FormEngine"); |
|
597
|
|
|
|
|
|
|
} |
|
598
|
|
|
|
|
|
|
|
|
599
|
|
|
|
|
|
|
sub _get_templ { |
|
600
|
1
|
|
|
1
|
|
2
|
my %templ; |
|
601
|
1
|
|
|
|
|
3
|
$templ{_text} = ' <&TEXT_XP&>/>'; |
|
602
|
1
|
|
|
|
|
2
|
$templ{_button} = ' |
|
603
|
1
|
|
|
|
|
3
|
$templ{_radio} = ' <&RADIO_XP&>/><&OPTION&>'; |
|
604
|
1
|
|
|
|
|
2
|
$templ{_select} = ' |
|
605
|
|
|
|
|
|
|
|
|
606
|
|
|
|
|
|
|
'; |
|
607
|
1
|
|
|
|
|
1
|
$templ{_select_optgroup} = ' |
|
608
|
|
|
|
|
|
|
|
|
609
|
|
|
|
|
|
|
'; |
|
610
|
1
|
|
|
|
|
3
|
$templ{_select_flexible} = ' |
|
611
|
|
|
|
|
|
|
|
|
612
|
|
|
|
|
|
|
'; |
|
613
|
1
|
|
|
|
|
8
|
$templ{_optgroup} = '<~ |
|
614
|
|
|
|
|
|
|
|
|
615
|
|
|
|
|
|
|
~OPTGROUP OPTION OPT_VAL~>'; |
|
616
|
1
|
|
|
|
|
3
|
$templ{optgroup} = '<&_optgroup&>'; |
|
617
|
1
|
|
|
|
|
3
|
$templ{optgroup_flexible} = ' |
|
618
|
|
|
|
|
|
|
|
|
619
|
|
|
|
|
|
|
'; |
|
620
|
1
|
|
|
|
|
2
|
$templ{_option} = '<~ |
|
621
|
|
|
|
|
|
|
~OPTION OPT_VAL~>'; |
|
622
|
1
|
|
|
|
|
2
|
$templ{option} = '<&_option&>'; |
|
623
|
1
|
|
|
|
|
2
|
$templ{_check} = ' <&CHECKBOX_XP&>/><&OPTION&>'; |
|
624
|
1
|
|
|
|
|
2
|
$templ{_textarea} = ''; |
|
625
|
1
|
|
|
|
|
2
|
$templ{_hidden} = '/>'; |
|
626
|
1
|
|
|
|
|
2
|
$templ{hidden} = '<&_hidden&>'; |
|
627
|
1
|
|
|
|
|
3
|
$templ{_fieldset} = ' |
|
628
|
|
|
|
|
|
|
|
|
629
|
|
|
|
|
|
|
|
|
630
|
|
|
|
|
|
|
|
|
633
|
|
|
|
|
|
|
'; |
|
634
|
1
|
|
|
|
|
2
|
$templ{_templ} = '<~<&TEMPL&>~TEMPL~>'; |
|
635
|
1
|
|
|
|
|
3
|
$templ{_print} = '<value -,1&>'; |
|
636
|
1
|
|
|
|
|
1
|
$templ{_print_option} = '<~ |
|
637
|
|
|
|
|
|
|
<&OPTION&>" name="<&NAME&>" />!OPT_VAL NAME!> ~OPTION OPT_VAL~>'; |
|
638
|
1
|
|
|
|
|
20
|
return \%templ; |
|
639
|
|
|
|
|
|
|
} |
|
640
|
|
|
|
|
|
|
|
|
641
|
|
|
|
|
|
|
sub _get_default { |
|
642
|
1
|
|
|
1
|
|
2
|
my %default; |
|
643
|
1
|
|
|
|
|
61
|
$default{_text} = {TYPE => 'text', SIZE => 20}; |
|
644
|
1
|
|
|
|
|
4
|
$default{_radio} = {}; |
|
645
|
1
|
|
|
|
|
2
|
$default{_select} = {}; |
|
646
|
1
|
|
|
|
|
4
|
$default{_check} = {}; |
|
647
|
1
|
|
|
|
|
3
|
$default{optgroup} = {}; |
|
648
|
1
|
|
|
|
|
2
|
$default{option} = {}; |
|
649
|
1
|
|
|
|
|
2
|
$default{_select_optgroup} = {}; |
|
650
|
1
|
|
|
|
|
5
|
$default{_textarea} = {COLS => 27, ROWS => 10}; |
|
651
|
1
|
|
|
|
|
5
|
$default{_button} = {TYPE => 'button'}; |
|
652
|
1
|
|
|
|
|
23
|
$default{main} = { |
|
653
|
|
|
|
|
|
|
ACTION => $ENV{REQUEST_URI}, |
|
654
|
|
|
|
|
|
|
METHOD => 'post', |
|
655
|
|
|
|
|
|
|
ACCEPT => '*', |
|
656
|
|
|
|
|
|
|
ENCTYPE => 'application/x-www-form-urlencoded', |
|
657
|
|
|
|
|
|
|
TARGET => '_self', |
|
658
|
|
|
|
|
|
|
CONFIRMSG => 'Are you really sure, that you want to submit the following data?', |
|
659
|
|
|
|
|
|
|
CONFMSG_ALIGN => 'center', |
|
660
|
|
|
|
|
|
|
CANCEL => 'Cancel', |
|
661
|
|
|
|
|
|
|
CONFIRMED => 'confirmed', |
|
662
|
|
|
|
|
|
|
CONFIRM_CANCEL => 'confirm_cancel', |
|
663
|
|
|
|
|
|
|
SEPVAL => md5_hex('F02r23m234E345n42g6i46ne%$'), |
|
664
|
|
|
|
|
|
|
FORM_ALIGN => 'center', |
|
665
|
|
|
|
|
|
|
SUBMIT_ALIGN => 'right', |
|
666
|
|
|
|
|
|
|
CANCEL_ALIGN => 'left', |
|
667
|
|
|
|
|
|
|
FORM_TABLE_BORDER => 0, |
|
668
|
|
|
|
|
|
|
FORM_TABLE_CELLSP => 1, |
|
669
|
|
|
|
|
|
|
FORM_TABLE_CELLPAD => 1, |
|
670
|
|
|
|
|
|
|
}; |
|
671
|
1
|
|
|
|
|
20
|
$default{default} = { |
|
672
|
|
|
|
|
|
|
templ => 'text', |
|
673
|
|
|
|
|
|
|
TITLE => '<&NAME&>', |
|
674
|
|
|
|
|
|
|
#NAME => '<&TITLE&>', |
|
675
|
|
|
|
|
|
|
ID => '<&NAME&>', |
|
676
|
|
|
|
|
|
|
NAME => '<&ID&>', |
|
677
|
|
|
|
|
|
|
OPT_VAL => '<&OPTION&>', |
|
678
|
|
|
|
|
|
|
OPTION => '<&OPT_VAL&>', |
|
679
|
|
|
|
|
|
|
SUBMIT => 'Ok', |
|
680
|
|
|
|
|
|
|
FORMNAME => 'FormEngine', |
|
681
|
|
|
|
|
|
|
TITLE_ALIGN => 'left', |
|
682
|
|
|
|
|
|
|
TITLE_VALIGN => 'top', |
|
683
|
|
|
|
|
|
|
TABLE_BORDER => 0, |
|
684
|
|
|
|
|
|
|
TABLE_CELLSP => 0, |
|
685
|
|
|
|
|
|
|
TABLE_CELLPAD => 0, |
|
686
|
|
|
|
|
|
|
TD_VALIGN => 'top', |
|
687
|
|
|
|
|
|
|
TABLE_BORDER_IN => 0, |
|
688
|
|
|
|
|
|
|
TABLE_CELLSP_IN => 0, |
|
689
|
|
|
|
|
|
|
TABLE_CELLPAD_IN => 0, |
|
690
|
|
|
|
|
|
|
TD_EXTRA_ERROR => 'style="color:#FF0000"', |
|
691
|
|
|
|
|
|
|
TD_EXTRA_ERROR_IN => 'style="color:#FF0000"', |
|
692
|
|
|
|
|
|
|
SPAN_EXTRA_ERROR => 'style="color:#FF0000"', |
|
693
|
|
|
|
|
|
|
ERROR_VALIGN => 'bottom', |
|
694
|
|
|
|
|
|
|
ERROR_ALIGN => 'left', |
|
695
|
|
|
|
|
|
|
TABLE_WIDTH => '100%', |
|
696
|
|
|
|
|
|
|
SP_NOTNULL => '', |
|
697
|
|
|
|
|
|
|
SP_NOTNULL_IN => '', |
|
698
|
|
|
|
|
|
|
}; |
|
699
|
1
|
|
|
|
|
19
|
return \%default; |
|
700
|
|
|
|
|
|
|
} |
|
701
|
|
|
|
|
|
|
|
|
702
|
|
|
|
|
|
|
sub _get_handler { |
|
703
|
1
|
|
|
1
|
|
750
|
require HTML::FormEngine::Handler; |
|
704
|
1
|
|
|
|
|
3
|
my %handler; |
|
705
|
1
|
|
|
|
|
4
|
$handler{default} = \&HTML::FormEngine::Handler::_handle_default; |
|
706
|
1
|
|
|
|
|
3
|
$handler{'#checked'} = \&HTML::FormEngine::Handler::_handle_checked; |
|
707
|
1
|
|
|
|
|
4
|
$handler{'#value'} = \&HTML::FormEngine::Handler::_handle_value; |
|
708
|
1
|
|
|
|
|
2
|
$handler{'#error'} = \&HTML::FormEngine::Handler::_handle_error; |
|
709
|
1
|
|
|
|
|
2
|
$handler{'#error_check'} = \&HTML::FormEngine::Handler::_handle_error; |
|
710
|
1
|
|
|
|
|
5
|
$handler{'#error_in'} = \&HTML::FormEngine::Handler::_handle_error; |
|
711
|
1
|
|
|
|
|
3
|
$handler{'#gettext'} = \&HTML::FormEngine::Handler::_handle_gettext; |
|
712
|
1
|
|
|
|
|
4
|
$handler{'#gettext_var'} = \&HTML::FormEngine::Handler::_handle_gettext_var; |
|
713
|
1
|
|
|
|
|
4
|
$handler{'#label'} = \&HTML::FormEngine::Handler::_handle_label; |
|
714
|
1
|
|
|
|
|
3
|
$handler{'#decide'} = \&HTML::FormEngine::Handler::_handle_decide; |
|
715
|
1
|
|
|
|
|
2
|
$handler{'#readonly'} = \&HTML::FormEngine::Handler::_handle_readonly; |
|
716
|
1
|
|
|
|
|
3
|
$handler{'#multiple'} = \&HTML::FormEngine::Handler::_handle_multiple; |
|
717
|
1
|
|
|
|
|
3
|
$handler{'#confirm_check_prepare'} = \&HTML::FormEngine::Handler::_handle_confirm_check_prepare; |
|
718
|
1
|
|
|
|
|
3
|
$handler{'#seperate'} = \&HTML::FormEngine::Handler::_handle_seperate; |
|
719
|
1
|
|
|
|
|
2
|
$handler{'#seperate_conly'} = \&HTML::FormEngine::Handler::_handle_seperate; |
|
720
|
1
|
|
|
|
|
3
|
$handler{'#encentities'} = \&HTML::FormEngine::Handler::_handle_encentities; |
|
721
|
1
|
|
|
|
|
3
|
$handler{'#save_to_global'} = \&HTML::FormEngine::Handler::_handle_save_to_global; |
|
722
|
1
|
|
|
|
|
3
|
$handler{'#not_null'} = \&HTML::FormEngine::Handler::_handle_not_null; |
|
723
|
1
|
|
|
|
|
2
|
$handler{'#htmltotext'} = \&HTML::FormEngine::Handler::_handle_html2text; |
|
724
|
1
|
|
|
|
|
2
|
$handler{'#arg'} = \&HTML::FormEngine::Handler::_handle_arg; |
|
725
|
1
|
|
|
|
|
4
|
return \%handler; |
|
726
|
|
|
|
|
|
|
} |
|
727
|
|
|
|
|
|
|
|
|
728
|
|
|
|
|
|
|
sub _get_check { |
|
729
|
1
|
|
|
1
|
|
603
|
require HTML::FormEngine::Checks; |
|
730
|
0
|
|
|
|
|
0
|
my %check; |
|
731
|
0
|
|
|
|
|
0
|
$check{not_null} = \&HTML::FormEngine::Checks::_check_not_null; |
|
732
|
0
|
|
|
|
|
0
|
$check{email} = \&HTML::FormEngine::Checks::_check_email; |
|
733
|
0
|
|
|
|
|
0
|
$check{rfc822} = \&HTML::FormEngine::Checks::_check_rfc822; |
|
734
|
0
|
|
|
|
|
0
|
$check{date} = \&HTML::FormEngine::Checks::_check_date; |
|
735
|
0
|
|
|
|
|
0
|
$check{digitonly} = \&HTML::FormEngine::Checks::_check_digitonly; |
|
736
|
0
|
|
|
|
|
0
|
$check{fmatch} = \&HTML::FormEngine::Checks::_check_match; |
|
737
|
0
|
|
|
|
|
0
|
$check{match} = \&HTML::FormEngine::Checks::_check_match; |
|
738
|
0
|
|
|
|
|
0
|
$check{regex} = \&HTML::FormEngine::Checks::_check_regex; |
|
739
|
0
|
|
|
|
|
0
|
$check{unique} = \&HTML::FormEngine::Checks::_check_unique; |
|
740
|
0
|
|
|
|
|
0
|
return \%check; |
|
741
|
|
|
|
|
|
|
} |
|
742
|
|
|
|
|
|
|
|
|
743
|
|
|
|
|
|
|
sub _get_hidden { |
|
744
|
1
|
|
|
1
|
|
4
|
my %hidden=('hidden' => 1); |
|
745
|
1
|
|
|
|
|
3
|
return \%hidden; |
|
746
|
|
|
|
|
|
|
} |
|
747
|
|
|
|
|
|
|
|
|
748
|
|
|
|
|
|
|
sub _get_confirm_skin() { |
|
749
|
0
|
|
|
0
|
|
|
require HTML::FormEngine::SkinConfirm; |
|
750
|
0
|
|
|
|
|
|
return new HTML::FormEngine::SkinConfirm; |
|
751
|
|
|
|
|
|
|
#return undef; |
|
752
|
|
|
|
|
|
|
} |
|
753
|
|
|
|
|
|
|
|
|
754
|
|
|
|
|
|
|
#sub _get_text_skin() { |
|
755
|
|
|
|
|
|
|
# require HTML::FormEngine::SkinText; |
|
756
|
|
|
|
|
|
|
# return new HTML::FormEngine::SkinText; |
|
757
|
|
|
|
|
|
|
#} |
|
758
|
|
|
|
|
|
|
|
|
759
|
|
|
|
|
|
|
sub _get_not_null_string() { |
|
760
|
0
|
|
|
0
|
|
|
return ''; #* |
|
761
|
|
|
|
|
|
|
} |
|
762
|
|
|
|
|
|
|
|
|
763
|
|
|
|
|
|
|
1; |
|
764
|
|
|
|
|
|
|
|
|
765
|
|
|
|
|
|
|
__END__ |