Revision 0861998a
Von Tamino Steinert vor etwa 1 Jahr hinzugefügt
SL/Presenter/EmailJournal.pm | ||
---|---|---|
6 | 6 |
use SL::Presenter::Tag qw(link_tag img_tag html_tag); |
7 | 7 |
use SL::Locale::String qw(t8); |
8 | 8 |
use SL::SessionFile::Random; |
9 |
use SL::DB::EmailJournalAttachment; |
|
9 | 10 |
|
10 | 11 |
use Exporter qw(import); |
11 | 12 |
our @EXPORT_OK = qw(email_journal entry_status attachment_preview); |
... | ... | |
46 | 47 |
} |
47 | 48 |
|
48 | 49 |
sub attachment_preview { |
49 |
my ($attachment, %params) = @_; |
|
50 |
my ($attachment_or_id, %params) = @_;
|
|
50 | 51 |
|
51 |
if (! $attachment) { |
|
52 |
if (! $attachment_or_id) {
|
|
52 | 53 |
return is_escaped(html_tag('div', '', id => 'attachment_preview')); |
53 | 54 |
} |
55 |
my $attachment = ref $attachment_or_id ? $attachment_or_id |
|
56 |
: SL::DB::EmailJournalAttachment->new(id => $attachment_or_id)->load; |
|
54 | 57 |
|
55 | 58 |
# clean up mime_type |
56 | 59 |
my $mime_type = $attachment->mime_type; |
Auch abrufbar als: Unified diff
Presenter::EmailJournal: Anhang-Vorschaufunktion mit ID oder Objekt