aboutsummaryrefslogtreecommitdiff
path: root/mod/file/views
diff options
context:
space:
mode:
authoricewing <icewing@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-05-01 12:13:20 +0000
committericewing <icewing@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-05-01 12:13:20 +0000
commitf4adea3198f441663835ea4e45f622483adb444e (patch)
treeef61bc9b6cde3e60083fea9c6dd6a17ceb2aebe9 /mod/file/views
parent01693c67dbb7ed686b6fa03faba875eb11fea160 (diff)
downloadelgg-f4adea3198f441663835ea4e45f622483adb444e.tar.gz
elgg-f4adea3198f441663835ea4e45f622483adb444e.tar.bz2
Marcus Povey <marcus@dushka.co.uk>
* Using mime types git-svn-id: https://code.elgg.org/elgg/trunk@591 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/file/views')
-rw-r--r--mod/file/views/default/file/file.php3
-rw-r--r--mod/file/views/default/file/icon.php23
2 files changed, 26 insertions, 0 deletions
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'];
+
?>
<div class="file">
<table width="100%">
<tr>
<td valign="top">
<div class="file_icon">
+ <?php echo elgg_view("file/icon", array("mime" => $mime)); ?>
</div>
</td>
<td valign="top">
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 @@
+<?php
+ /**
+ * Elgg file icons.
+ * Displays an icon, depending on its mime type, for a file.
+ * Optionally you can specify a size.
+ *
+ * @package ElggFile
+ * @author Marcus Povey
+ * @copyright Curverider Ltd 2008
+ * @link http://elgg.com/
+ */
+
+
+ $mime = $vars['mimetype'];
+
+ $width = $vars['width'];
+ $height = $vars['height'];
+
+ if (!$width) $width = 100;
+ if (!$height) $height = 100;
+
+ echo $mime;
+?> \ No newline at end of file