287 : void {
291 if (count($files) > 0) {
293
295
296
297 $cnt = 0;
298 foreach ($files as $file) {
299 $cnt++;
300
302
303 $ui_factory =
$DIC->ui()->factory();
304 $ui_renderer =
$DIC->ui()->renderer();
305
306 $output_filename = htmlspecialchars($file['name']);
307
308 if ($this->media_type->isImage($mime)) {
309 $item_id =
"il-ex-modal-img-" . $a_ass->
getId() .
"-" . $cnt;
310
311
312 $image = $ui_renderer->render($ui_factory->image()->responsive($file['fullpath'], $output_filename));
314
316 $modal->setId($item_id);
318 $modal->setBody($image);
319 $modal->setHeading($output_filename);
320 $modal = $modal->getHTML();
321
322 $img_tpl =
new ilTemplate(
"tpl.image_file.html",
true,
true,
"Modules/Exercise");
323 $img_tpl->setCurrentBlock("image_content");
324 $img_tpl->setVariable("MODAL", $modal);
325 $img_tpl->setVariable("ITEM_ID", $item_id);
326 $img_tpl->setVariable("IMAGE", $image);
327 $img_tpl->setvariable("IMAGE_LENS", $image_lens);
328 $img_tpl->setvariable(
"ALT_LENS",
$lng->
txt(
"exc_fullscreen"));
329 $img_tpl->parseCurrentBlock();
330
331 $a_info->
addProperty($output_filename, $img_tpl->get());
332 } elseif ($this->media_type->isAudio($mime) || $this->media_type->isVideo($mime)) {
333 $media_tpl =
new ilTemplate(
"tpl.media_file.html",
true,
true,
"Modules/Exercise");
334
335 if ($this->media_type->isAudio($mime)) {
336 $p = $ui_factory->player()->audio($file['fullpath']);
337 } else {
338 $p = $ui_factory->player()->video($file['fullpath']);
339 }
340 $media_tpl->setVariable("MEDIA", $ui_renderer->render($p));
341
342 $but = $ui_factory->button()->shy(
344 $this->getSubmissionLink("downloadFile", array("file" => urlencode($file["name"])))
345 );
346 $media_tpl->setVariable("DOWNLOAD_BUTTON", $ui_renderer->render($but));
347 $a_info->
addProperty($output_filename, $media_tpl->get());
348 } else {
349 $a_info->
addProperty($output_filename,
$lng->
txt(
"download"), $this->getSubmissionLink(
"downloadFile", array(
"file" => urlencode($file[
"name"]))));
350 }
351 }
352 }
353 }
addSection(string $a_title)
addProperty(string $a_name, string $a_value, string $a_link="")
add a property to current section
loadLanguageModule(string $a_module)
Load language module.
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
special template class to simplify handling of ITX/PEAR
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)