1 package SL::Presenter::FileObject;
 
   5 use SL::Presenter::EscapedText qw(escape is_escaped);
 
   7 use Exporter qw(import);
 
   8 our @EXPORT_OK = qw(file_object);
 
  13   my ($file_object, %params) = @_;
 
  15   my $link_start  = '<a href="controller.pl?action=File/download&id=' . $file_object->id;
 
  16   $link_start    .= '&version=' . $file_object->version if $file_object->version;
 
  19   my $link_end    = '</a>';
 
  22     $params{no_link} ? '' : $link_start,
 
  23     escape($file_object->file_name),
 
  24     $params{no_link} ? '' : $link_end,
 
  41 SL::Presenter::FileObject - Presenter module for SL::File::Object(s), the
 
  42 file objects of the filemanagement. (Note, that this are not instances of
 
  47   my $file_object = SL::File->get(id => 1);
 
  48   my $html        = SL::Presenter::File::file_object($file_object, no_link => 1);
 
  54 =item C<file_object $file_object, %params>
 
  56 Returns a rendered version (actually an instance of
 
  57 L<SL::Presenter::EscapedText>) of the file object
 
  60 C<%params> can include:
 
  66 If falsish (the default) then the file name of the object will be linked
 
  67 to the "download action" for that file.
 
  79 Bernd Bleßmann E<lt>bernd@kivitendo-premium.deE<gt>