| 1 |
3 |
ahitrov@rambler.ru |
<!-- ���� �������� --> |
| 2 |
121 |
ahitrov |
<table cellpadding="0" cellspacing="2" border="0" width="100%"> |
| 3 |
3 |
ahitrov@rambler.ru |
<tr><td><b><% $rusname %></b> / <font size="-1" color="#888888">name="<% $attr %>"</font> </td></tr> |
| 4 |
121 |
ahitrov |
<tr><td> |
| 5 |
|
|
<div><a href="javascript:void(0)" class="mm_act" id="<% $attr %>_file_prompt" style="padding:0 6px;" |
| 6 |
|
|
onclick="$('#<% $attr %>_url_loader').hide(); $('#<% $attr %>_file_loader').show(); $('#<% $attr %>_file_prompt').addClass('mm_act'); $('#<% $attr %>_url_prompt').removeClass('mm_act'); return false;">file</a> |
| 7 |
|
|
<a href="javascript:void(0)" class="mm_inact" id="<% $attr %>_url_prompt" style="padding:0 6px;" |
| 8 |
|
|
onclick="$('#<% $attr %>_file_loader').hide(); $('#<% $attr %>_url_loader').show(); $('#<% $attr %>_url_prompt').addClass('mm_act'); $('#<% $attr %>_file_prompt').removeClass('mm_act'); $('#<% $attr %>_ext_url')[0].focus(); return false;">url</a></div> |
| 9 |
|
|
<div id="<% $attr %>_file_loader" style="background:#d0d0d0; padding:2px;"> |
| 10 |
|
|
<input type="file" name="<% $attr %>" style="width:95%;font-family:arial;font-size:9pt;"></div> |
| 11 |
|
|
<div id="<% $attr %>_url_loader" style="display:none; background:#d0d0d0; padding:2px;"> URL: <input |
| 12 |
|
|
id="<% $attr %>_ext_url" type="text" name="<% $attr %>.ext_url" style="width:81%;font-family:arial;font-size:9pt;"></div> |
| 13 |
|
|
</td></tr> |
| 14 |
3 |
ahitrov@rambler.ru |
% if ( exists($IMAGE->{width}) && exists($IMAGE->{height}) && exists($IMAGE->{filename}) ) |
| 15 |
|
|
% { |
| 16 |
|
|
<tr><td style="font-size:95%;"><% $IMAGE->{filename} %></td></tr> |
| 17 |
|
|
% my $max_show_width = 200; |
| 18 |
|
|
% my $show_w = ( $IMAGE->{width} > $max_show_width ? $max_show_width : $IMAGE->{width} ); |
| 19 |
|
|
% my $show_h = ( $IMAGE->{width} > $max_show_width ? ($max_show_width*$IMAGE->{height}/$IMAGE->{width}) : $IMAGE->{height} ); |
| 20 |
|
|
% my $img_path = $state->{images_dir}.'/'.$IMAGE->{filename}; |
| 21 |
|
|
<tr><td> |
| 22 |
|
|
% $img_path =~ s|^/{2,}|/|; |
| 23 |
|
|
% my $u1 = URI->new($img_path); |
| 24 |
|
|
% my $path = $u1->path; |
| 25 |
|
|
% $path =~ s|/{2,}|/|g; |
| 26 |
|
|
% $u1->path($path); |
| 27 |
|
|
% $img_path = $u1->canonical; |
| 28 |
121 |
ahitrov |
<font size="-1" color="#888888">��� x ���: <% $IMAGE->{width} %>x<% $IMAGE->{height} %></font> |
| 29 |
3 |
ahitrov@rambler.ru |
<img src="<% $img_path %>" alt="<% html_escape($IMAGE->{alt}) %>" width="<% $show_w %>" height="<% $show_h %>"><br> |
| 30 |
|
|
</td></tr> |
| 31 |
|
|
% } |
| 32 |
|
|
% |
| 33 |
|
|
|
| 34 |
|
|
% foreach my $iattr (@{ $iattrs }) |
| 35 |
|
|
% { |
| 36 |
|
|
% next if ( ($iattr eq 'filename') || ($iattr eq 'width') || ($iattr eq 'height') ); |
| 37 |
|
|
% if($iattr eq 'mini') { |
| 38 |
|
|
<tr><td><font size="-1" color="#888888">name="<% $attr %>_mini"</font> </td></tr> |
| 39 |
|
|
<tr><td><input type="file" name="<% $attr %>_mini" style="width:95%;font-family:arial;font-size:9pt;"></td></tr> |
| 40 |
|
|
% if (exists($IMAGE->{mini}->{filename}) ) |
| 41 |
|
|
% { |
| 42 |
|
|
<tr><td style="font-size:95%;"><% $IMAGE->{mini}->{filename} %></td></tr> |
| 43 |
|
|
% my $max_show_width = 200; |
| 44 |
|
|
% my $show_w = ( $IMAGE->{mini}->{width} > $max_show_width ? $max_show_width : $IMAGE->{mini}->{width} ); |
| 45 |
|
|
% my $show_h = ( $IMAGE->{mini}->{width} > $max_show_width ? ($max_show_width*$IMAGE->{mini}->{height}/$IMAGE->{mini}->{width}) : $IMAGE->{mini}->{height} ); |
| 46 |
|
|
<tr><td> |
| 47 |
|
|
<font size="-1" color="#888888">��� x ���: <% $IMAGE->{mini}->{width} %>x<% $IMAGE->{mini}->{height} %></font> |
| 48 |
|
|
<img src="<% $state->{images_dir}.'/'.$IMAGE->{mini}->{filename} %>" alt="<% html_escape($IMAGE->{mini}->{alt}) %>" width="<% $show_w %>" height="<% $show_h %>"><br> |
| 49 |
|
|
</td></tr> |
| 50 |
|
|
% } |
| 51 |
|
|
% } else { |
| 52 |
|
|
<tr><td><font size="-1" color="#888888"><% $ATTRNAMES->{$iattr} %> (<% $iattr %>):</font></td></tr> |
| 53 |
|
|
<tr><td><input type="text" name="<% $attr %>.<% $iattr %>" size="60" value="<% html_escape($IMAGE->{$iattr}) %>" style="width:95%;font-family:arial;font-size:9pt;"></td></tr> |
| 54 |
|
|
% } } |
| 55 |
|
|
|
| 56 |
|
|
<tr><td><input type="checkbox" name="_delete_image.<% $attr %>" value="1">�������<br><br></td></tr> |
| 57 |
|
|
</table> |
| 58 |
|
|
|
| 59 |
|
|
<%ARGS> |
| 60 |
|
|
|
| 61 |
|
|
$IMAGE => undef |
| 62 |
|
|
$rusname => undef |
| 63 |
|
|
$attr => undef |
| 64 |
|
|
$prop => {} |
| 65 |
|
|
|
| 66 |
|
|
</%ARGS> |
| 67 |
|
|
<%DOC> |
| 68 |
|
|
|
| 69 |
|
|
���������� ���������� ���� ��������... |
| 70 |
|
|
|
| 71 |
|
|
</%DOC> |
| 72 |
|
|
<%INIT> |
| 73 |
|
|
|
| 74 |
|
|
my $iattrs = $prop->{iattrs}; |
| 75 |
|
|
$iattrs ||= ['alt']; |
| 76 |
|
|
|
| 77 |
|
|
my $ATTRNAMES = { |
| 78 |
|
|
'alt' => '�������', |
| 79 |
|
|
'btext' => '����� �� ��������', |
| 80 |
|
|
'atext' => '����� ����� ��������', |
| 81 |
|
|
'url' => '������ � ��������', |
| 82 |
|
|
'copyright' => '��������', |
| 83 |
|
|
}; |
| 84 |
|
|
|
| 85 |
|
|
</%INIT> |