ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.VideoPreviewGUI.php
Go to the documentation of this file.
1<?php
2
19namespace ILIAS\MediaCast\Video;
20
26{
27 protected \ILIAS\DI\UIServices $ui;
28 protected string $file = "";
29 protected string $onclick = "";
30 protected string $playing_time = "";
31 protected \ilLanguage $lng;
32
33 public function __construct(
34 string $file,
35 string $onclick,
36 string $playing_time
37 ) {
38 global $DIC;
39
40 $this->ui = $DIC->ui();
41 $this->file = $file;
42 $this->onclick = $onclick;
43 $this->playing_time = $playing_time;
44 $this->lng = $DIC->language();
45 $this->lng->loadLanguageModule("mcst");
46 }
47
51 public function render(): string
52 {
54
55 $tpl = new \ilTemplate("tpl.video_preview.html", true, true, "components/ILIAS/MediaCast/Video");
56 $im = $this->ui->factory()->image()->responsive($this->file, "");
57 $tpl->setVariable("IMAGE", $this->ui->renderer()->render($im));
58 $tpl->setVariable("ONCLICK", $this->onclick);
59 $tpl->setVariable("PLAYING_TIME", $this->playing_time);
60 $tpl->setVariable("WATCHED", $lng->txt("mcst_watched"));
61
62 return $tpl->get();
63 }
64}
__construct(string $file, string $onclick, string $playing_time)
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...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: shib_login.php:26