1 |
3 |
ahitrov@rambler.ru |
<%args> |
2 |
|
|
|
3 |
|
|
$name => undef |
4 |
|
|
$check => undef |
5 |
|
|
|
6 |
|
|
</%args> |
7 |
|
|
<%init> |
8 |
|
|
|
9 |
|
|
my $VALUES = eval ('use vars qw($VAR1); '.$check); |
10 |
|
|
|
11 |
|
|
my $LAST = 0; |
12 |
|
|
$m->out('<table border="0" cellpadding="5" cellspacing="0" width="60%">'); |
13 |
|
|
$m->out('<tr><th valign="top">�������������</th><th>������������� ��� ����<br><font color="gray">(��, ��� ����� ����� ������������ ����� � checkbox)</font></th></tr>'); |
14 |
|
|
|
15 |
|
|
if ((defined $VALUES) && (ref($VALUES) eq 'HASH')) |
16 |
|
|
{ |
17 |
|
|
for my $key (sort (keys(%{ $VALUES }))) |
18 |
|
|
{ |
19 |
|
|
my $attr = $key; |
20 |
|
|
my $rusname = $VALUES->{$attr}->{rusname}; |
21 |
|
|
next if (! defined($rusname) || !$rusname); |
22 |
|
|
|
23 |
|
|
if ($attr =~ /^${name}_(\d+)$/) |
24 |
|
|
{ |
25 |
|
|
$LAST = $1; |
26 |
|
|
} |
27 |
|
|
$m->out( $m->scomp( '.one_field.msn', attr => $attr, rusname => $rusname ) ); |
28 |
|
|
} |
29 |
|
|
} |
30 |
|
|
for (($LAST+1)..($LAST+5)) |
31 |
|
|
{ |
32 |
|
|
my $attr = $name.'_'.$_; |
33 |
|
|
$m->out( $m->scomp( '.one_field.msn', attr => $attr ) ); |
34 |
|
|
} |
35 |
|
|
|
36 |
|
|
$m->out('</table>'); |
37 |
|
|
|
38 |
|
|
</%init> |
39 |
|
|
<%def .one_field.msn> |
40 |
|
|
<!-- ���� ���� --> |
41 |
|
|
|
42 |
|
|
<tr> |
43 |
|
|
<td width="40%" valign="top" style="font-size:80%; font-family:Tahoma;"> |
44 |
|
|
<% $attr %> |
45 |
|
|
</td> |
46 |
|
|
|
47 |
|
|
<td width="60%" valign="top" style="font-size:80%; font-family:Tahoma;"> |
48 |
|
|
<input name="<% $attr %>.checkboxrusname" type="text" value="<% $rusname %>" size="40"> |
49 |
|
|
</td> |
50 |
|
|
</tr> |
51 |
|
|
|
52 |
|
|
<%args> |
53 |
|
|
|
54 |
|
|
$attr => undef |
55 |
|
|
$rusname => undef |
56 |
|
|
|
57 |
|
|
</%args> |
58 |
|
|
<%init> |
59 |
|
|
|
60 |
|
|
return undef if (! defined($attr)); |
61 |
|
|
|
62 |
|
|
</%init> |
63 |
|
|
</%def> |
64 |
|
|
<%doc> |
65 |
|
|
|
66 |
|
|
�������������� ���� � ���� checkbox'�. ������ ���� ��������������� ���������� �������: |
67 |
|
|
attr - ���������� ���� |
68 |
|
|
rusname - ������� �������� |
69 |
|
|
|
70 |
|
|
��� ��� �������� � ����... |
71 |
|
|
|
72 |
|
|
</%doc> |