80 $f = $this->
ui->factory();
81 $renderer = $this->
ui->renderer();
88 if ($this->media_cast->getDownloadable()) {
92 if ($this->rss_link !==
"") {
93 $b =
$f->link()->standard(
96 )->withOpenInNewViewport(
true);
106 $lp_collection_mode = $this->domain->learningProgress($this->media_cast)->isCollectionMode();
109 foreach ($this->media_cast->getSortedItemsArray() as $item) {
110 $mob = new \ilObjMediaObject($item[
"mob_id"]);
111 $med = $mob->getMediaItem(
"Standard");
112 if (!in_array($med->getFormat(), iterator_to_array($this->media_types->getAllowedImageMimeTypes()),
true)) {
116 if (strcasecmp(
"Reference", $med->getLocationType()) == 0) {
117 $resource = $med->getLocation();
123 $image =
$f->image()->responsive(
128 $pages[] =
$f->modal()->lightboxImagePage($image, $mob->getTitle());
129 if ($lp_collection_mode) {
130 $mob_modals[$mob->getId()] =
$f->modal()->lightbox($pages);
135 if (!$lp_collection_mode) {
136 $main_modal =
$f->modal()->lightbox($pages);
140 foreach ($this->media_cast->getSortedItemsArray() as $item) {
141 $mob = new \ilObjMediaObject($item[
"mob_id"]);
142 $med = $mob->getMediaItem(
"Standard");
144 if (!in_array($med->getFormat(), iterator_to_array($this->media_types->getAllowedImageMimeTypes()),
true)) {
148 if (strcasecmp(
"Reference", $med->getLocationType()) == 0) {
149 $resource = $med->getLocation();
154 $preview_resource = $resource;
155 if ($mob->getVideoPreviewPic() !=
"") {
160 $preview_image =
$f->image()->responsive(
165 $image =
$f->image()->responsive(
170 if (!$lp_collection_mode) {
171 $modal = $main_modal;
173 $modal = $mob_modals[$mob->getId()];
176 $card_image = $preview_image->withAction($modal->getShowSignal());
179 if (!$lp_collection_mode) {
180 $slide_to =
"document.querySelector('.modal-body .carousel [data-slide-to=\"" . $cnt .
"\"]').click();";
182 $completed_cb = $this->completed_callback .
'&mob_id=' . $mob->getId();
183 $completed_cb =
"$.ajax({type:'GET', url: '$completed_cb'});";
186 $card_image = $card_image->withAdditionalOnLoadCode(
function (
$id) use ($slide_to, $completed_cb) {
187 return "$('#$id').click(function(e) { $slide_to $completed_cb });";
189 if (!$lp_collection_mode) {
193 $sections = ($mob->getDescription())
194 ? [
$f->legacy($mob->getDescription())]
197 if ($this->media_cast->getDownloadable()) {
201 $sections[] =
$f->button()->standard(
$lng->
txt(
"download"), $download);
205 if ($this->mc_manager->commentsActive()) {
206 $comments_gui = $this->gui->comments()->commentGUI(
207 $this->media_cast->getRefId(),
210 $sections[] =
$f->legacy($comments_gui->getGlyph());
214 $title = $mob->getTitle();
216 $card =
$f->card()->standard(
221 )->withTitleAction($modal->getShowSignal());
227 $deck =
$f->deck($cards);
229 if (count($pages) === 0 && count($mob_modals) === 0) {
232 if (!$lp_collection_mode) {
233 $modals = [$main_modal];
235 $modals = $mob_modals;
237 return "<div id='il-mcst-img-gallery'>" . $renderer->render(array_merge([$deck], $modals)) .
"</div>";
getLinkTargetByClass( $a_class, string $a_cmd=null, string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
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...
setParameterByClass(string $a_class, string $a_parameter, $a_value)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
static signFile(string $path_to_file)
getFormAction(object $a_gui_obj, string $a_fallback_cmd=null, string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)