Skip to content
Snippets Groups Projects
Commit bf0eb567 authored by Astor Bizard's avatar Astor Bizard :dog2:
Browse files

Merge branch 'MOODLE_3X_STABLE' into MOODLE_41_STABLE

parents 8a53b507 a840f49a
No related branches found
No related tags found
No related merge requests found
......@@ -163,12 +163,24 @@ class renderer {
$item->modtext = self::replace_image_with_string($item->modtext);
}
try {
// Create a download button for .mbz file.
$storage = new storage();
$file = $storage->get($item->filename);
$downloadurl = \moodle_url::make_pluginfile_url($file->get_contextid(), $file->get_component(), $file->get_filearea(),
null, $file->get_filepath(), $file->get_filename(), true);
$downloadbutton = html_writer::link($downloadurl, '<i class="fa fa-download" alt="' . get_string('download') . '"></i>',
[ 'title' => get_string('downloadfile') ]);
} catch (\block_sharing_cart\exceptions\cannot_find_file_exception $e) {
$downloadbutton = '';
}
return '
<li class="activity ' . $class . '" id="block_sharing_cart-item-' . $item->id . '" data-disable-copy="'. ($item->uninstalled_plugin ?? 0) .'">
<div class="sc-indent-' . $depth . '" title="' . $title . '">
' . self::render_modicon($item) . '
<span class="instancename">' . format_string($item->modtext) . '</span>
<span class="commands"></span>
<span class="commands">' . $downloadbutton . '</span>
</div>
</li>';
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment