Das Modul SL/MIME.pm zum Commit Revision 3987.
[kivitendo-erp.git] / SL / MIME.pm
1 package SL::MIME;
2
3 sub mime_type_from_ext {
4   $main::lxdebug->enter_sub();
5
6   my $self = shift;
7   my $ext  = shift;
8
9   # TODO: Mittels Standardmodulen implementieren.
10   my %mime_types = ('ods'  => 'application/vnd.oasis.opendocument.spreadsheet',
11                     'odt'  => 'application/vnd.oasis.opendocument.text',
12                     'pdf'  => 'application/pdf',
13                     'sql'  => 'text/plain',
14                     'txt'  => 'text/plain',
15                     'html' => 'text/html',
16     );
17
18   $ext =~ s/.*\.//;
19
20   $main::lxdebug->leave_sub();
21
22   return $mime_types{$ext};
23 }
24
25 1;