MDL-63958 course: Return raw mimetype apart from description

This commit is contained in:
Juan Leyva 2018-11-15 14:37:07 +01:00
parent 08c51ff080
commit 34ad1a017e
2 changed files with 22 additions and 0 deletions

View file

@ -305,6 +305,7 @@ function resource_get_file_details($resource, $cm) {
if (!empty($options['showtype'])) {
if ($mainfile) {
$filedetails['type'] = get_mimetype_description($mainfile);
$filedetails['mimetype'] = $mainfile->get_mimetype();
// Only show type if it is not unknown.
if ($filedetails['type'] === get_mimetype_description('document/unknown')) {
$filedetails['type'] = '';