1 |
296 |
ahitrov |
<style> |
2 |
|
|
.input {width:97%;font-family:arial;font-size:8pt;border:1px solid #aaa} |
3 |
|
|
.textarea {width:97%; height:100px;font-family:arial;font-size:8pt;border:1px solid #aaa} |
4 |
|
|
</style> |
5 |
|
|
<%args> |
6 |
|
|
|
7 |
|
|
$name => undef |
8 |
|
|
$rusname => undef |
9 |
|
|
$check => undef |
10 |
|
|
|
11 |
|
|
</%args> |
12 |
|
|
<%init> |
13 |
|
|
|
14 |
|
|
my $fields; |
15 |
|
|
eval { $fields = eval('use vars qw($VAR1); '.$check) }; |
16 |
|
|
$fields = [] unless $fields; |
17 |
|
|
$m->out('<h5 style="margin:0; padding:4px; color:blue; background:silver;">Список полей:</h5>'); |
18 |
|
|
$m->out('<div style="padding:4px; background:#d0e0f0; text-align:center;">'); |
19 |
|
|
my $i = 1; |
20 |
|
|
foreach my $field (@$fields) { |
21 |
|
|
my $rusname = "$rusname N$i"; |
22 |
|
|
$m->comp('.field', |
23 |
|
|
name => $name, |
24 |
|
|
fname => $field->{name}, |
25 |
|
|
url => $field->{url}, |
26 |
|
|
alias => $field->{alias}, |
27 |
|
|
image => $field->{image}, |
28 |
|
|
amage => $field->{amage}, |
29 |
|
|
delete => 1, |
30 |
|
|
number => $i); |
31 |
|
|
$i++; |
32 |
|
|
} |
33 |
|
|
$rusname = "$rusname N$i"; |
34 |
|
|
$m->comp('.field', name => $name, fname => '', url => '', alias => '', delete => 0, number => $i); |
35 |
|
|
$m->out('</div>'); |
36 |
|
|
|
37 |
|
|
</%init> |
38 |
|
|
<%def .field> |
39 |
|
|
<%args> |
40 |
|
|
$name => undef |
41 |
|
|
$fname => undef |
42 |
|
|
$url => undef |
43 |
|
|
$alias => undef |
44 |
|
|
$image => undef |
45 |
|
|
$amage => undef |
46 |
|
|
$delete => 0 |
47 |
|
|
$number => undef |
48 |
|
|
</%args> |
49 |
|
|
<%init> |
50 |
|
|
</%init> |
51 |
|
|
<table width="95%" style="margin:5px 0;padding:5 6 5 6;border:1px solid #ccc;font-size:70%;font-family:Tahoma;background-color:#f5f5f5;color:#000;"> |
52 |
|
|
<tr><td width="5%">#</td><td width="95%"><% $number %></td></tr> |
53 |
|
|
<tr><td width="1%"><b>Название:</b></td><td width="99%"><input class="input" type="text" name="<% $name.'_name_'.$number %>" value="<% $fname %>"></td></tr> |
54 |
|
|
<tr><td><b>Ссылка:</b></td><td><input class="input" type="text" name="<% $name.'_url_'.$number %>" value="<% $url %>"></td></tr> |
55 |
|
|
<tr><td><b>Алиас:</b></td><td><input class="input" type="text" name="<% $name.'_alias_'.$number %>" value="<% $alias %>"></td></tr> |
56 |
|
|
<tr><td><b>Картинка:</b>(норм)</td><td><input class="input" type="text" name="<% $name.'_image_'.$number %>" value="<% $image %>"></td></tr> |
57 |
|
|
<tr><td><b>Картинка:</b>(актив)</td><td><input class="input" type="text" name="<% $name.'_amage_'.$number %>" value="<% $amage %>"></td></tr> |
58 |
|
|
% if ( $delete ) { |
59 |
|
|
<tr><td></td><td style="color:red;"><input type="checkbox" name="<% $name.'_delete_'.$number %>">Удалить</td></tr> |
60 |
|
|
% } |
61 |
|
|
</table> |
62 |
|
|
</%def> |