diff options
Diffstat (limited to 'mod/file/start.php')
| -rw-r--r-- | mod/file/start.php | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/mod/file/start.php b/mod/file/start.php index e15a9ad61..7c0c216b2 100644 --- a/mod/file/start.php +++ b/mod/file/start.php @@ -121,6 +121,10 @@ function file_page_handler($page) { file_register_toggle(); include "$file_dir/friends.php"; break; + case 'read': // Elgg 1.7 compatibility + register_error(elgg_echo("changebookmark")); + forward("file/view/{$page[1]}"); + break; case 'view': set_input('guid', $page[1]); include "$file_dir/view.php"; @@ -232,14 +236,22 @@ function file_owner_block_menu($hook, $type, $return, $params) { * @return string The overall type */ function file_get_simple_type($mimetype) { + + if ($simpletype = elgg_trigger_plugin_hook('file:simpletype', $mimetype, null, null)) { + return $simpletype; + } switch ($mimetype) { case "application/msword": + case "application/vnd.openxmlformats-officedocument.wordprocessingml.document": return "document"; break; case "application/pdf": return "document"; break; + case "application/ogg": + return "audio"; + break; } if (substr_count($mimetype, 'text/')) { @@ -345,17 +357,22 @@ function file_icon_url_override($hook, $type, $returnvalue, $params) { // thumbnails get first priority if ($file->thumbnail) { - return "mod/file/thumbnail.php?file_guid=$file->guid&size=$size"; + $ts = (int)$file->icontime; + return "mod/file/thumbnail.php?file_guid=$file->guid&size=$size&icontime=$ts"; } $mapping = array( 'application/excel' => 'excel', 'application/msword' => 'word', + 'application/ogg' => 'music', 'application/pdf' => 'pdf', 'application/powerpoint' => 'ppt', 'application/vnd.ms-excel' => 'excel', 'application/vnd.ms-powerpoint' => 'ppt', 'application/vnd.oasis.opendocument.text' => 'openoffice', + 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' => 'word', + 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' => 'excel', + 'application/vnd.openxmlformats-officedocument.presentationml.presentation' => 'ppt', 'application/x-gzip' => 'archive', 'application/x-rar-compressed' => 'archive', 'application/x-stuffit' => 'archive', @@ -396,4 +413,4 @@ function file_icon_url_override($hook, $type, $returnvalue, $params) { $url = elgg_trigger_plugin_hook('file:icon:url', 'override', $params, $url); return $url; } -}
\ No newline at end of file +} |
