Revision 296 (by ahitrov, 2013/03/26 17:59:01) |
Promosite (anthill) project source
|
<style>
.input {width:97%;font-family:arial;font-size:8pt;border:1px solid #aaa}
.textarea {width:97%; height:100px;font-family:arial;font-size:8pt;border:1px solid #aaa}
</style>
<%args>
$name => undef
$rusname => undef
$check => undef
</%args>
<%init>
my $fields;
eval { $fields = eval('use vars qw($VAR1); '.$check) };
$fields = [] unless $fields;
$m->out('<h5 style="margin:0; padding:4px; color:blue; background:silver;">Список полей:</h5>');
$m->out('<div style="padding:4px; background:#d0e0f0; text-align:center;">');
my $i = 1;
foreach my $field (@$fields) {
my $rusname = "$rusname N$i";
$m->comp('.field',
name => $name,
fname => $field->{name},
url => $field->{url},
alias => $field->{alias},
image => $field->{image},
amage => $field->{amage},
delete => 1,
number => $i);
$i++;
}
$rusname = "$rusname N$i";
$m->comp('.field', name => $name, fname => '', url => '', alias => '', delete => 0, number => $i);
$m->out('</div>');
</%init>
<%def .field>
<%args>
$name => undef
$fname => undef
$url => undef
$alias => undef
$image => undef
$amage => undef
$delete => 0
$number => undef
</%args>
<%init>
</%init>
<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;">
<tr><td width="5%">#</td><td width="95%"><% $number %></td></tr>
<tr><td width="1%"><b>Название:</b></td><td width="99%"><input class="input" type="text" name="<% $name.'_name_'.$number %>" value="<% $fname %>"></td></tr>
<tr><td><b>Ссылка:</b></td><td><input class="input" type="text" name="<% $name.'_url_'.$number %>" value="<% $url %>"></td></tr>
<tr><td><b>Алиас:</b></td><td><input class="input" type="text" name="<% $name.'_alias_'.$number %>" value="<% $alias %>"></td></tr>
<tr><td><b>Картинка:</b>(норм)</td><td><input class="input" type="text" name="<% $name.'_image_'.$number %>" value="<% $image %>"></td></tr>
<tr><td><b>Картинка:</b>(актив)</td><td><input class="input" type="text" name="<% $name.'_amage_'.$number %>" value="<% $amage %>"></td></tr>
% if ( $delete ) {
<tr><td></td><td style="color:red;"><input type="checkbox" name="<% $name.'_delete_'.$number %>">Удалить</td></tr>
% }
</table>
</%def>