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">'); |
13 |
|
|
$m->out('<tr><th valign="top">�������������</th><th>������������� ��� ����<br><font color="gray">(��, ��� ����� ����� ������������ ����� � select)</font></th>'); |
14 |
|
|
$m->out('<th valign="top">�������� � ���������� ������</th></tr>'); |
15 |
|
|
|
16 |
|
|
if ((defined $VALUES) && (ref($VALUES) eq 'HASH')) |
17 |
|
|
{ |
18 |
|
|
for my $key (sort (keys(%{ $VALUES }))) |
19 |
|
|
{ |
20 |
|
|
my $attr = $key; |
21 |
|
|
my $rusname = $VALUES->{$attr}->{rusname}; |
22 |
|
|
my $values = $VALUES->{$attr}->{values}; |
23 |
|
|
|
24 |
|
|
next if (!defined($rusname) || !$rusname); |
25 |
|
|
if ($attr =~ /^${name}_(\d+)$/) |
26 |
|
|
{ |
27 |
|
|
$LAST = $1; |
28 |
|
|
} |
29 |
|
|
$m->out( $m->scomp( '.one_field.msn', attr => $attr, rusname => $rusname, values => $values ) ); |
30 |
|
|
} |
31 |
|
|
} |
32 |
|
|
for (($LAST+1)..($LAST+5)) |
33 |
|
|
{ |
34 |
|
|
my $attr = $name.'_'.$_; |
35 |
|
|
$m->out( $m->scomp( '.one_field.msn', attr => $attr ) ); |
36 |
|
|
} |
37 |
|
|
|
38 |
|
|
$m->out('</table>'); |
39 |
|
|
|
40 |
|
|
</%init> |
41 |
|
|
<%def .one_field.msn> |
42 |
|
|
<!-- ���� ���� --> |
43 |
|
|
|
44 |
|
|
<tr> |
45 |
|
|
|
46 |
|
|
<td width="20%" valign="top" style="font-size:80%; font-family:Tahoma;"> |
47 |
|
|
<% $attr %> |
48 |
|
|
</td> |
49 |
|
|
|
50 |
|
|
<td width="30%" valign="top" style="font-size:80%; font-family:Tahoma;"> |
51 |
|
|
<input name="<% $attr %>.selectrusname" type="text" value="<% $rusname %>" size="30"> |
52 |
|
|
</td> |
53 |
|
|
|
54 |
|
|
<td> |
55 |
|
|
<textarea style="font-size:8pt;font-family:Tahoma;" rows=4 cols=60 name="<% $attr %>.selectdata" nowrap>\ |
56 |
|
|
% if ($values && (ref($values) eq 'ARRAY')) { |
57 |
|
|
<% join("\n", @{ $values } ) %>\ |
58 |
|
|
% } |
59 |
|
|
</textarea> |
60 |
|
|
</td> |
61 |
|
|
|
62 |
|
|
</tr> |
63 |
|
|
|
64 |
|
|
<%args> |
65 |
|
|
|
66 |
|
|
$attr => undef |
67 |
|
|
$rusname => undef |
68 |
|
|
$values => [] |
69 |
|
|
|
70 |
|
|
</%args> |
71 |
|
|
<%init> |
72 |
|
|
|
73 |
|
|
return undef if (! defined($attr)); |
74 |
|
|
|
75 |
|
|
</%init> |
76 |
|
|
</%def> |
77 |
|
|
<%doc> |
78 |
|
|
|
79 |
|
|
�������������� ���� � ���� select'�. ������ ���� ��������������� ���������� �������: |
80 |
|
|
attr - ���������� ���� |
81 |
|
|
rusname - ������� �������� |
82 |
|
|
values - �������� (�������� � ������� textbox) |
83 |
|
|
|
84 |
|
|
��� ��� �������� � ����... |
85 |
|
|
|
86 |
|
|
</%doc> |