Revision 296 (by ahitrov, 2013/03/26 17:59:01) |
Promosite (anthill) project source
|
% #<pre><% Dumper($photos) %></pre>
<div class="photo">\
% for ( 1 .. ($max || $photos->{maxnumber})) {
% my $img = $photos->{"image_$_"};
% my $mini = $img->{mini}->{'100x100'};
% if ( exists $mini->{filename} && $mini->{filename} ) {
% my $display = $show eq 'all' ? 'inline' : $_ > $visual ? 'none' : 'inline';
% my $alt = $img->{alt};
% $alt =~ s/<[^>]+>//g;
<span id="photo_<% $doc->id %>_<% $_ %>" style="display:<% $display %>; padding:0px 10px;"><a
href="slide_show.html?id=<% $doc->id %>&num=<% $_ %>&class=<% $doc->class %>"
onclick="openWin('Photo','slide_show.html?id=<% $doc->id %>&num=<% $_ %>&class=<% $doc->class %>',550,590); return false;"><img
hspace="<% int((100 - $mini->{width})/2) %>" vspace="<% int((100 - $mini->{height})/2) %>"
src="<% $mini->{filename} %>" width="<% $mini->{width} %>" height="<% $mini->{height} %>" border="0" title="<% $alt |h %>" alt="<% $alt |h %>" align="absmiddle"></a></span>\
% }
% }
</div>
<%args>
$doc => undef
$show => 'all'
$max => undef
$visual => 7
</%args>
<%init>
return unless ref $doc;
my $prj = $request->{project};
my $profile = $request->{project_profile};
my $root = $request->{project_section};
my $photos = $doc->get_image ('pictures');
return unless ref $photos && $photos->{maxnumber};
</%init>