From f4adea3198f441663835ea4e45f622483adb444e Mon Sep 17 00:00:00 2001 From: icewing Date: Thu, 1 May 2008 12:13:20 +0000 Subject: Marcus Povey * Using mime types git-svn-id: https://code.elgg.org/elgg/trunk@591 36083f99-b078-4883-b0ff-0f9b5a30f544 --- mod/file/actions/upload.php | 1 + mod/file/index.php | 3 +++ mod/file/start.php | 5 +++-- mod/file/views/default/file/file.php | 3 +++ mod/file/views/default/file/icon.php | 23 +++++++++++++++++++++++ 5 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 mod/file/views/default/file/icon.php (limited to 'mod') diff --git a/mod/file/actions/upload.php b/mod/file/actions/upload.php index 881470bc7..05b0150f6 100644 --- a/mod/file/actions/upload.php +++ b/mod/file/actions/upload.php @@ -19,6 +19,7 @@ $prefix = "/file/"; $file = new ElggFile(); $file->setFilename($_FILES['upload']['name']); + $file->setMimeType($_FILES['upload']['type']); $file->open("write"); $file->write(get_uploaded_file('upload')); diff --git a/mod/file/index.php b/mod/file/index.php index 577233276..896eb9e94 100644 --- a/mod/file/index.php +++ b/mod/file/index.php @@ -6,6 +6,9 @@ * @author Marcus Povey * @copyright Curverider Ltd 2008 * @link http://elgg.com/ + * + * + * TODO: File icons, download & mime types */ require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php"); diff --git a/mod/file/start.php b/mod/file/start.php index 98ee4ff46..3c5fbb80d 100644 --- a/mod/file/start.php +++ b/mod/file/start.php @@ -87,12 +87,13 @@ $tags = $file->getMetaData("tag"); if (!is_array($tags)) $tags = array($tags); - + // Draw file return elgg_view("file/file", array( "tags" => $tags, "title" => $file->title, - "description" => $file->description + "description" => $file->description, + "mime" => $file->getMimeType() )); } diff --git a/mod/file/views/default/file/file.php b/mod/file/views/default/file/file.php index 1b2beae53..cbb3034b6 100644 --- a/mod/file/views/default/file/file.php +++ b/mod/file/views/default/file/file.php @@ -15,12 +15,15 @@ $title = $vars['title']; $desc = $vars['description']; + $mime = $vars['mimetype']; + ?>
+ $mime)); ?>
diff --git a/mod/file/views/default/file/icon.php b/mod/file/views/default/file/icon.php new file mode 100644 index 000000000..266a60a47 --- /dev/null +++ b/mod/file/views/default/file/icon.php @@ -0,0 +1,23 @@ + \ No newline at end of file -- cgit v1.2.3