MDL-72830 repository_contentbank: Use content specific icons

This commit is contained in:
Daniel Thies 2021-10-16 09:57:55 -05:00
parent 35b993b694
commit 3aa3b664ab

View File

@ -96,6 +96,7 @@ class helper {
'filename' => $file->get_filename()
];
$contenttype = $content->get_content_type_instance();
$encodedpath = base64_encode(json_encode($params));
$node = [
@ -108,8 +109,8 @@ class helper {
'isref' => $file->is_external_file(),
'size' => $file->get_filesize(),
'source' => $encodedpath,
'icon' => $OUTPUT->image_url(file_file_icon($file, 24))->out(false),
'thumbnail' => $OUTPUT->image_url(file_file_icon($file, 90))->out(false)
'icon' => $contenttype->get_icon($content),
'thumbnail' => $contenttype->get_icon($content)
];
if ($file->get_status() == 666) {
@ -131,4 +132,4 @@ class helper {
'name' => $context->get_context_name(false)
];
}
}
}