Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 533aa5ba

Von Werner Hahn vor fast 9 Jahren hinzugefügt

  • ID 533aa5ba6a70585177108646c282cbbace319be1
  • Vorgänger de78c073
  • Nachfolger 237d9e65

Bilder werden als Tabelle angezeigt

Unterschiede anzeigen:

SL/Controller/FileUploader.pm
sub action_show_files {
my ($self) = @_;
$main::lxdebug->dump(0, 'WH: Show_Files',\$::form);
my $images = SL::DB::Manager::File->get_all( query => [ trans_id => $::form->{id}, modul => $::form->{modul} ] );
$main::lxdebug->dump(0, 'WH: ',\$images);
}
SL/Controller/ShopPart.pm
};
sub action_show_files {
my ($self) = @_;
$main::lxdebug->dump(0, 'WH: Show_Files',\$::form);
require SL::DB::File;
my $images = SL::DB::Manager::File->get_all( where => [ trans_id => $::form->{id}, modul => $::form->{modul}, file_content_type => { like => 'image/%' } ] );
$main::lxdebug->dump(0, 'WH: ',\$images);
#my $html = $self->render('shop_part/_list_images', { output => 0 }, IMAGES => $images);
$self->render('shop_part/_list_images', { header => 0 }, IMAGES => $images);
#$main::lxdebug->dump(0, 'WH: ',\$html);
#$self->js->html('#shop_images', $html);
#$self->js->render;
# $self->render('customer_vendor_turnover/count_open_items_by_year', { layout => 0 });
}
# old:
# sub action_edit {
# my ($self) = @_;
#
#
# $self->render('shop_part/edit'); #, { output => 0 }); #, price_source => $price_source)
# }
#
templates/webpages/ic/tabs/_shop.html
[%- USE HTML %][%- USE L -%][%- USE P -%][%- USE LxERP -%]
[%- USE Dumper %]
[%- USE JavaScript -%]
<div id="shop_variables">
[% LxERP.t8("Active shops:") %]
<table>
......
</p>
</div>
[%- END %]
<div id="shop_images">
<script type="text/javascript">
function show_images() {
var url = 'controller.pl?action=ShopPart/show_files&modul=shop_part&id=[% shop_part.part_id %]';
$('#shop_images').load(url);
}
$(window).load(function() {
show_images();
});
</script>
<div id="shop_images" border=1 >
</div>
</div>
templates/webpages/shop_part/_list_images.html
[%- USE HTML %][%- USE L -%][%- USE P -%][%- USE LxERP -%]
[%- USE T8 %][% USE Base64 %]
[%- USE Dumper %]
<table width="100%" id="images_list">
<thead>
<tr class="listheading">
<th width="70px"></th>
<th>[% 'Title' | $T8 %]</th>
<th>[% 'Description' | $T8 %]</th>
<th>[% 'Filename' | $T8 %]</th>
<th>[% 'Orig. Size w/h' | $T8 %]</th>
</tr>
</thead>
<tbody>
[%- FOREACH img = IMAGES %]
<tr class="listrow" id="image_id_[% img.id %]">
<td><img src="data:[% img.thumbnail_img_content_type %];base64,[% img.thumbnail_img_content.encode_base64 %]" alt="[% img.title %]"></td>
<td>[% HTML.escape(img.title) %]</td>
<td>[% HTML.escape(img.description) %]</td>
<td>[% HTML.escape(img.filename) %]</td>
<td>[% HTML.escape(img.thumbnail_img_width) _ ' x ' _ HTML.escape(img.thumbnail_img_height) %]</td>
</tr>
[% END %]
</tbody>
</table>

Auch abrufbar als: Unified diff