7 /image/display_image.mas - a mason component to display an image, initially written for the image detail page
17 a CXGN::Image object for the image to be displayed.
21 the user who is currently logged in.
25 The size of the image to display initially
31 Lukas Mueller <lam87@cornell.edu>
43 $display_order => undef
46 <& /util/import_javascript.mas, classes => [ 'CXGN.Image', 'jquery', 'jqueryui' ] &>
54 use CXGN::Phenome::Individual;
56 my $thumbnail_img = $image->get_img_src_tag("thumbnail");
57 my $small_img = $image->get_img_src_tag("small");
58 my $medium_img = $image->get_img_src_tag("medium");
59 my $large_img = $image->get_img_src_tag("large");
60 my $original_img = $image->get_img_src_tag("original");
62 my $object_id = $image->get_image_id();
64 if ($size!~/thumbnail|small|medium|large|original/i ) { $size="medium"; }
67 if ($size eq "small") { $active = 1;}
68 if ($size eq "medium") { $active = 2;}
69 if ($size eq "large") { $active = 3; }
70 if ($size eq "original") { $active = 4; }
88 <li><a href="#tabs-1">thumbnail</a></li>
89 <li><a href="#tabs-2">small</a></li>
90 <li><a href="#tabs-3">medium</a></li>
91 <li><a href="#tabs-4">large</a></li>
92 <li><a href="#tabs-5">original</a></li>
95 <p><center><% $thumbnail_img %></center></p>
98 <p><center><% $small_img %></center></p>
101 <p><center><% $medium_img %></center></p>
104 <p><center><% $large_img %></center></p>
107 <p><center><% $original_img %></center></p>
115 <center><table><tr><td class="boxbgcolor5"><b>Note:</b> The above image may be subject to copyright. Please contact the submitter about permissions to use the image.</td></tr></table></center><br />
118 % my $tag_count = scalar($image->get_tags());
120 <&| /page/info_section.mas, title=>"Associated tags" &>
121 <br><b>Associated tags</b> [<a href="/tag/index.pl?image_id=<% $object_id %>&action=new">add/remove</a>]: <% $tag_count %>
124 % foreach my $tag ($image->get_tags()) {
125 % print $tag->get_name()." ";
131 <&| /page/info_section.mas, title=>"Associated objects" &>
133 % print $image->get_associated_object_links();
137 <&| /page/info_section.mas, title=>"Display properties", collapsible => 1, collapsed => 1 &>
139 <div id="display_properties_div">
151 jQuery(window).ready( function() {
152 jQuery('#image_tabs').tabs({ active: <% $active %> });
154 // fetch display order data
156 url: '/ajax/image/<% $object_id %>',
157 error: function(r,x,error) { alert('An error occurred retrieving the image display order data.'+r.status+' '+error); },
158 success: function(r) {
159 if (r.error) { alert('Error: '+r.error); return; }
161 for (var i=0; i<r.display_order.length; i++) {
162 html += r.display_order[i]['name']+' <b>'+r.display_order[i]['display_order']+'</b> <a href="/image/display_order?image_id='+r.display_order[i].image_id+'&type='+r.display_order[i].type+'&id='+r.display_order[i].id+'&display_order='+r.display_order[i].display_order+'">change</button></a><br />';
165 jQuery('#display_properties_div').html(html);