Das Modul SL/MIME.pm zum Commit Revision 3987.
authorMoritz Bunkus <m.bunkus@linet-services.de>
Mon, 4 May 2009 11:25:59 +0000 (11:25 +0000)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Mon, 4 May 2009 11:25:59 +0000 (11:25 +0000)
SL/MIME.pm [new file with mode: 0644]

diff --git a/SL/MIME.pm b/SL/MIME.pm
new file mode 100644 (file)
index 0000000..9edfe0d
--- /dev/null
@@ -0,0 +1,25 @@
+package SL::MIME;
+
+sub mime_type_from_ext {
+  $main::lxdebug->enter_sub();
+
+  my $self = shift;
+  my $ext  = shift;
+
+  # TODO: Mittels Standardmodulen implementieren.
+  my %mime_types = ('ods'  => 'application/vnd.oasis.opendocument.spreadsheet',
+                    'odt'  => 'application/vnd.oasis.opendocument.text',
+                    'pdf'  => 'application/pdf',
+                    'sql'  => 'text/plain',
+                    'txt'  => 'text/plain',
+                    'html' => 'text/html',
+    );
+
+  $ext =~ s/.*\.//;
+
+  $main::lxdebug->leave_sub();
+
+  return $mime_types{$ext};
+}
+
+1;