aboutsummaryrefslogtreecommitdiff
path: root/mod/file/views/default
diff options
context:
space:
mode:
Diffstat (limited to 'mod/file/views/default')
-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