1 package SL::Presenter::FileObject;
5 use SL::Presenter::Tag qw(link_tag);
6 use SL::Presenter::EscapedText qw(escape is_escaped);
8 use Exporter qw(import);
9 our @EXPORT_OK = qw(file_object);
14 my ($file_object, %params) = @_;
17 my $text = escape($file_object->file_name);
18 if (! delete $params{no_link}) {
19 my $href = 'controller.pl?action=File/download&id=' . $file_object->id;
20 $href .= '&version=' . $file_object->version if $file_object->version;
21 $text = link_tag($href, $text, %params);
38 SL::Presenter::FileObject - Presenter module for SL::File::Object(s), the
39 file objects of the filemanagement. (Note, that this are not instances of
44 my $file_object = SL::File->get(id => 1);
45 my $html = SL::Presenter::FileObject::file_object($file_object, no_link => 1);
51 =item C<file_object $file_object, %params>
53 Returns a rendered version (actually an instance of
54 L<SL::Presenter::EscapedText>) of the file object
57 C<%params> can include:
63 If falsish (the default) then the file name of the object will be linked
64 to the "download action" for that file.
76 Bernd Bleßmann E<lt>bernd@kivitendo-premium.deE<gt>