7 /phenome/print_images.mas - a component for printing images associated with your favorite objects (locus, accession etc.)
12 Requires the following javascript classes:
13 <& /util/import_javascript.mas, classes => ["jquery", "thickbox", "CXGN.Page.FormattingHelpers"] &>
25 dstabase handle (for instantiating new SGN::Image objects)
31 Naama Menda <nm249@cornell.edu>
46 use CXGN::Page::FormattingHelpers qw / html_optional_show /;
50 my $m_image_html = "";
54 if (@$images) { # don't display anything for empty list of images
55 $image_html .= qq|<table cellpadding="5">|;
56 foreach my $image_id (@$images) {
58 my $image = SGN::Image->new($dbh, $image_id);
59 my $image_name = $image->get_name();
60 my $image_description = $image->get_description();
61 my $image_img = $image->get_image_url("medium");
62 my $small_image = $image->get_image_url("thumbnail");
63 my $image_page = "/image/index.pl?image_id=$image_id";
66 qq|<a href="$image_img" title="<a href=$image_page>Go to image page ($image_name)</a>" class="thickbox" rel="gallery-figures"><img src="$small_image" alt="$image_description" /></a> |;
68 qq|<tr><td width=120>|
74 if ( $count < 3 ) { $image_html .= $fhtml; }
76 push @more_is, $fhtml;
77 } #more than 3 figures- show these in a hidden div
79 $image_html .= "</table>"; #close the table tag or the first 3 figures
82 "<table cellpadding=5>"; #open table tag for the hidden figures #4 and on
83 my $more = scalar(@more_is);
84 foreach (@more_is) { $m_image_html .= $_; }
86 $m_image_html .= "</table>"; #close tabletag for the hidden figures
88 if (@more_is) { #html_optional_show if there are more than 3 figures
89 $image_html .= html_optional_show(
91 "<b>See $more more images...</b>",
93 0, #< do not show by default
94 'abstract_optional_show', #< don't use the default button-like style