Revision 533aa5ba
Von Werner Hahn vor mehr als 8 Jahren hinzugefügt
SL/Controller/FileUploader.pm | ||
---|---|---|
29 | 29 |
|
30 | 30 |
sub action_show_files { |
31 | 31 |
my ($self) = @_; |
32 |
$main::lxdebug->dump(0, 'WH: Show_Files',\$::form); |
|
33 |
my $images = SL::DB::Manager::File->get_all( query => [ trans_id => $::form->{id}, modul => $::form->{modul} ] ); |
|
34 |
$main::lxdebug->dump(0, 'WH: ',\$images); |
|
32 | 35 |
|
33 | 36 |
|
34 | 37 |
} |
SL/Controller/ShopPart.pm | ||
---|---|---|
52 | 52 |
|
53 | 53 |
}; |
54 | 54 |
|
55 |
sub action_show_files { |
|
56 |
my ($self) = @_; |
|
57 |
$main::lxdebug->dump(0, 'WH: Show_Files',\$::form); |
|
58 |
require SL::DB::File; |
|
59 |
my $images = SL::DB::Manager::File->get_all( where => [ trans_id => $::form->{id}, modul => $::form->{modul}, file_content_type => { like => 'image/%' } ] ); |
|
60 |
$main::lxdebug->dump(0, 'WH: ',\$images); |
|
61 |
#my $html = $self->render('shop_part/_list_images', { output => 0 }, IMAGES => $images); |
|
62 |
$self->render('shop_part/_list_images', { header => 0 }, IMAGES => $images); |
|
63 |
#$main::lxdebug->dump(0, 'WH: ',\$html); |
|
64 |
|
|
65 |
#$self->js->html('#shop_images', $html); |
|
66 |
#$self->js->render; |
|
67 |
|
|
68 |
# $self->render('customer_vendor_turnover/count_open_items_by_year', { layout => 0 }); |
|
69 |
|
|
70 |
|
|
71 |
} |
|
72 |
|
|
55 | 73 |
|
56 | 74 |
|
57 | 75 |
# old: |
58 | 76 |
# sub action_edit { |
59 | 77 |
# my ($self) = @_; |
60 |
#
|
|
78 |
# |
|
61 | 79 |
# $self->render('shop_part/edit'); #, { output => 0 }); #, price_source => $price_source) |
62 | 80 |
# } |
63 | 81 |
# |
templates/webpages/ic/tabs/_shop.html | ||
---|---|---|
1 | 1 |
[%- USE HTML %][%- USE L -%][%- USE P -%][%- USE LxERP -%] |
2 | 2 |
[%- USE Dumper %] |
3 |
[%- USE JavaScript -%] |
|
3 | 4 |
<div id="shop_variables"> |
4 | 5 |
[% LxERP.t8("Active shops:") %] |
5 | 6 |
<table> |
... | ... | |
56 | 57 |
</p> |
57 | 58 |
</div> |
58 | 59 |
[%- END %] |
59 |
<div id="shop_images"> |
|
60 |
<script type="text/javascript"> |
|
61 |
function show_images() { |
|
62 |
var url = 'controller.pl?action=ShopPart/show_files&modul=shop_part&id=[% shop_part.part_id %]'; |
|
63 |
$('#shop_images').load(url); |
|
64 |
} |
|
65 |
|
|
66 |
$(window).load(function() { |
|
67 |
show_images(); |
|
68 |
}); |
|
69 |
</script> |
|
70 |
<div id="shop_images" border=1 > |
|
60 | 71 |
</div> |
61 | 72 |
</div> |
62 | 73 |
|
templates/webpages/shop_part/_list_images.html | ||
---|---|---|
1 |
[%- USE HTML %][%- USE L -%][%- USE P -%][%- USE LxERP -%] |
|
2 |
[%- USE T8 %][% USE Base64 %] |
|
3 |
[%- USE Dumper %] |
|
4 |
<table width="100%" id="images_list"> |
|
5 |
<thead> |
|
6 |
<tr class="listheading"> |
|
7 |
<th width="70px"></th> |
|
8 |
<th>[% 'Title' | $T8 %]</th> |
|
9 |
<th>[% 'Description' | $T8 %]</th> |
|
10 |
<th>[% 'Filename' | $T8 %]</th> |
|
11 |
<th>[% 'Orig. Size w/h' | $T8 %]</th> |
|
12 |
</tr> |
|
13 |
</thead> |
|
14 |
<tbody> |
|
15 |
[%- FOREACH img = IMAGES %] |
|
16 |
<tr class="listrow" id="image_id_[% img.id %]"> |
|
17 |
<td><img src="data:[% img.thumbnail_img_content_type %];base64,[% img.thumbnail_img_content.encode_base64 %]" alt="[% img.title %]"></td> |
|
18 |
<td>[% HTML.escape(img.title) %]</td> |
|
19 |
<td>[% HTML.escape(img.description) %]</td> |
|
20 |
<td>[% HTML.escape(img.filename) %]</td> |
|
21 |
<td>[% HTML.escape(img.thumbnail_img_width) _ ' x ' _ HTML.escape(img.thumbnail_img_height) %]</td> |
|
22 |
</tr> |
|
23 |
[% END %] |
|
24 |
</tbody> |
|
25 |
</table> |
|
26 |
|
Auch abrufbar als: Unified diff
Bilder werden als Tabelle angezeigt