39 protected \ILIAS\MediaObjects\MediaType\MediaTypeManager
$media_type;
40 protected \ILIAS\MediaCast\InternalGUIService
$gui;
58 bool $a_call_by_reference,
59 bool $a_prepare_output =
true
63 $this->
ctrl = $DIC->ctrl();
64 $this->
lng = $DIC->language();
65 $this->
user = $DIC->user();
66 $this->
tabs = $DIC->tabs();
67 $this->tpl =
$DIC[
"tpl"];
68 $this->
access = $DIC->access();
69 $this->
toolbar = $DIC->toolbar();
71 $this->log =
$DIC[
"ilLog"];
72 $this->
help = $DIC[
"ilHelp"];
73 $this->
locator = $DIC[
"ilLocator"];
74 $ilCtrl =
$DIC->ctrl();
76 $this->mc_request =
$DIC->mediaCast()
87 $ilCtrl->saveParameter($this,
"item_id");
92 $this->mc_manager =
$DIC->mediaCast()->internal()
93 ->domain()->mediaCast($this->
object);
95 $this->gui =
$DIC->mediaCast()->internal()->gui();
96 $this->media_type =
$DIC->mediaObjects()->internal()->domain()->mediaType();
97 $this->video_gui =
$DIC->mediaObjects()->internal()->gui()->video();
98 $this->mob_player_gui =
$DIC->mediaObjects()->internal()->gui()->player();
106 $next_class = $this->
ctrl->getNextClass($this);
107 $cmd = $this->
ctrl->getCmd();
110 switch ($next_class) {
111 case "ilmediacreationgui":
114 $this->
ctrl->setReturn($this,
"listItems");
115 $ilTabs->activateTab(
"content");
118 switch ($this->
object->getViewMode()) {
131 },
function ($mob_id, $long_desc) {
133 },
function ($mob_ids) {
135 },
function ($mob_id) {
137 },
function ($mob_id) {
140 $this->
ctrl->forwardCommand($creation);
143 case "ilinfoscreengui":
152 $ilTabs->activateTab(
"export");
154 $exp_gui->addFormat(
"xml");
155 $ret = $this->
ctrl->forwardCommand($exp_gui);
159 case 'ilpermissiongui':
160 $ilTabs->activateTab(
"id_permissions");
162 $ret = $this->
ctrl->forwardCommand($perm_gui);
165 case 'ilobjectcopygui':
167 $cp->setType(
'mcst');
168 $this->
ctrl->forwardCommand($cp);
171 case "ilcommonactiondispatchergui":
173 $this->
ctrl->forwardCommand($gui);
176 case "illearningprogressgui":
177 $ilTabs->activateTab(
'learning_progress');
180 $this->
object->getRefId(),
181 $this->mc_request->getUserId() ?: $ilUser->getId()
183 $this->
ctrl->forwardCommand($new_gui);
184 $this->tabs_gui->setTabActive(
'learning_progress');
187 case "mcstimagegallerygui":
188 $view = new \McstImageGalleryGUI($this->
object, $this->tpl, $this->
getFeedLink());
189 $this->
ctrl->forwardCommand($view);
192 case "mcstpodcastgui":
193 $view = new \McstPodcastGUI($this->
object, $this->tpl, $this->
getFeedLink());
194 $this->
ctrl->forwardCommand($view);
197 case strtolower(ilCommentGUI::class):
201 case strtolower(ilObjectMetaDataGUI::class):
203 $ilTabs->activateTab(
"meta_data");
205 $this->
ctrl->forwardCommand($gui);
208 case strtolower(SettingsGUI::class):
210 $ilTabs->activateTab(
"id_settings");
211 $gui = $this->gui->settings()->settingsGUI(
213 $this->object->getRefId()
215 $this->
ctrl->forwardCommand($gui);
223 if ($cmd !=
"infoScreenObject") {
238 $this->
error->raiseError($this->
lng->txt(
"msg_no_perm_write"), $this->error->MESSAGE);
241 $this->
ctrl->redirectByClass(SettingsGUI::class,
"");
248 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"object_added"),
true);
249 ilUtil::redirect(
"ilias.php?baseClass=ilMediaCastHandlerGUI&ref_id=" . $new_object->
getRefId() .
"&cmd=editSettings");
261 if ($a_presentation_mode) {
262 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
"mcst_view_abandoned"));
266 if ($a_presentation_mode) {
272 $med_items = $this->
object->getSortedItemsArray();
274 if ($a_presentation_mode) {
280 $table_gui->setData($med_items);
282 if ($ilAccess->checkAccess(
"write",
"", $this->requested_ref_id) && !$a_presentation_mode) {
283 if (in_array($this->
object->getViewMode(), [
288 $ilToolbar->addButton(
$lng->
txt(
"add"), $this->ctrl->getLinkTargetByClass(
"ilMediaCreationGUI",
""));
290 $ilToolbar->addButton(
$lng->
txt(
"add"), $this->ctrl->getLinkTarget($this,
"addCastItem"));
293 $table_gui->addMultiCommand(
"confirmDeletionItems",
$lng->
txt(
"delete"));
294 $table_gui->setSelectAllCheckbox(
"item_id");
301 window.addEventListener(
'load', (
event) => {
302 $(document).on(
'hidden.bs.modal', (e) => {
303 $(
'.modal-body').html(
'');
305 $(document).on(
'shown.bs.modal', (e) => {
306 window.dispatchEvent(
new Event(
'resize'));
311 $tpl->
setContent($this->gui->ui()->renderer()->render($new_table->get()) . $script);
317 $new_table->handleCommand();
322 return $this->gui->getMediaCastManageTableGUI($this,
"tableCommand");
337 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
338 if ($enable_internal_rss) {
360 $item_id = $this->mc_request->getItemId();
361 $this->
ctrl->setParameterByClass(self::class,
"item_id", $item_id);
370 $this->mc_request->getItemId()
374 $this->video_gui->addPreviewExtractionToToolbar(
375 $this->mcst_item->getMobId(),
386 foreach ($this->
object->getSortedItemsArray() as $item) {
387 if ($mob_id == $item[
"mob_id"]) {
388 $this->
ctrl->setParameter($this,
"item_id", $item[
"id"]);
389 $this->
ctrl->redirect($this,
"editCastItem");
392 $this->
ctrl->redirect($this,
"listItems");
397 foreach ($this->
object->getSortedItemsArray() as $item) {
398 if ($mob_id == $item[
"mob_id"]) {
401 $mc_item->setTitle($mob->getTitle());
402 $mc_item->setContent($mob->getLongDescription());
415 $ilTabs->activateTab(
"edit_content");
420 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
423 $this->form_gui->setMultipart(
true);
427 $text_input->setMaxLength(200);
428 $this->form_gui->addItem($text_input);
432 $text_area->setRequired(
false);
433 $this->form_gui->addItem($text_area);
436 if ($enable_internal_rss) {
439 $radio_group->addOption($radio_option);
441 $radio_group->addOption($radio_option);
442 $radio_group->setInfo(
$lng->
txt(
"mcst_visibility_info"));
443 $radio_group->setRequired(
true);
444 $radio_group->setValue($this->
object->getDefaultAccess() == 0 ?
"users" :
"public");
445 $this->form_gui->addItem($radio_group);
451 $dur->setInfo(
$lng->
txt(
"mcst_duration_info"));
452 $dur->setShowDays(
false);
453 $dur->setShowHours(
true);
454 $dur->setShowSeconds(
true);
455 $this->form_gui->addItem($dur);
459 if ($purpose ==
"VideoAlternative" &&
460 $a_mode ==
"create") {
465 $section->setTitle(
$lng->
txt(
"mcst_" . strtolower($purpose) .
"_title"));
466 $this->form_gui->addItem($section);
467 if ($a_mode !=
"create") {
470 $label->setPostVar(
"label_value_" . $purpose);
471 $label->setInfo(
$lng->
txt(
"mcst_current_value_info"));
472 $this->form_gui->addItem($label);
473 $this->form_gui->addItem($value);
476 $file->setSuffixes($this->mc_manager->getSuffixesForViewMode(
477 $this->object->getViewMode()
479 $this->form_gui->addItem($file);
481 $text_input->setPattern(
"/https?\:\/\/.+/i");
482 $text_input->setInfo(
$lng->
txt(
"mcst_reference_info"));
483 $this->form_gui->addItem($text_input);
484 if ($purpose !=
"Standard") {
486 $clearCheckBox->setPostVar(
"delete_" . $purpose);
487 $clearCheckBox->setTitle(
$lng->
txt(
"mcst_clear_purpose_title"));
488 $this->form_gui->addItem($clearCheckBox);
492 $this->form_gui->addItem($ne);
496 if ($a_mode !==
"create") {
500 $this->video_gui->addPreviewInput($this->form_gui, $mob_id);
505 if ($a_mode ==
"create") {
506 $this->form_gui->setTitle(
$lng->
txt(
"mcst_add_new_item"));
507 $this->form_gui->addCommandButton(
"saveCastItem",
$lng->
txt(
"save"));
509 $this->form_gui->setTitle(
$lng->
txt(
"mcst_edit_item"));
510 $this->form_gui->addCommandButton(
"updateCastItem",
$lng->
txt(
"save"));
512 $this->form_gui->addCommandButton(
"listItems",
$lng->
txt(
"cancel"));
513 $this->form_gui->setFormAction($ilCtrl->getFormAction($this,
"saveCastItem"));
531 $this->mc_request->getItemId()
533 if (count($mediaItems) > 0) {
534 foreach ($mediaItems as $med) {
535 if (!isset($values[
"title"])) {
537 $values[
"title"] = $this->mcst_item->getTitle();
538 $values[
"description"] = $this->mcst_item->getContent();
539 $values[
"visibility"] = $this->mcst_item->getVisibility();
540 $length = explode(
":", $this->mcst_item->getPlaytime());
541 $values[
"duration"] = array(
"hh" => $length[0],
"mm" => $length[1],
"ss" => $length[2]);
544 $values[
"value_" . $med->getPurpose()] = (strlen($med->getLocation()) > 100) ?
"..." . substr($med->getLocation(), strlen($med->getLocation()) - 100) : $med->getLocation();
545 $values[
"label_value_" . $med->getPurpose()] = (strlen($med->getLocation()) > 100) ?
"..." . substr($med->getLocation(), strlen($med->getLocation()) - 100) : $med->getLocation();
546 $values[
"mimetype_" . $med->getPurpose()] = $med->getFormat();
550 if (!isset($values[
"value_" . $purpose])) {
551 $values[
"label_value_" . $purpose] =
$lng->
txt(
"none");
552 $values[
"value_" . $purpose] =
$lng->
txt(
"none");
555 $this->form_gui->setValuesByArray($values);
568 $ilTabs->activateTab(
"edit_content");
572 if (!$this->form_gui->checkInput() ||
573 ($this->form_gui->getInput(
"url_Standard") ==
"" && !$_FILES[
'file_Standard'][
'tmp_name'])) {
574 $this->tpl->setOnScreenMessage(
'failure',
$lng->
txt(
"mcst_input_either_file_or_url"));
586 $title = $this->form_gui->getInput(
"title") !=
"" ? $this->form_gui->getInput(
"title") : basename($file);
587 $description = $this->form_gui->getInput(
"description");
588 $mob->setTitle($title);
589 $mob->setDescription($description);
592 $this->video_gui->savePreviewInput($this->form_gui, $mob->getId());
598 foreach ($this->additionalPurposes as $purpose) {
600 $file_gui = $this->form_gui->getInput(
"file_" . $purpose);
601 $url_gui = $this->form_gui->getInput(
"url_" . $purpose);
602 if ($url_gui || $file_gui[
"size"] > 0) {
609 if ($prevpic[
"size"] == 0) {
612 $mob->generatePreviewPic(320, 240);
620 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
624 $mc_item->setMobId($mob->getId());
626 $mc_item->setContextObjId($this->
object->getId());
627 $mc_item->setContextObjType($this->
object->getType());
628 $mc_item->setUserId($ilUser->getId());
630 $mc_item->setTitle($title);
631 $mc_item->setContent($description);
632 $mc_item->setLimitation(
false);
633 if ($enable_internal_rss) {
634 $mc_item->setVisibility($this->form_gui->getInput(
"visibility"));
636 $mc_item->setVisibility(
"users");
640 $ilCtrl->redirect($this,
"listItems");
647 ? $this->form_gui->getInput(
"duration")
648 : array(
"hh" => 0,
"mm" => 0,
"ss" => 0);
650 $duration_str = str_pad(
$duration[
"hh"], 2,
"0", STR_PAD_LEFT) .
":" .
651 str_pad(
$duration[
"mm"], 2,
"0", STR_PAD_LEFT) .
":" .
652 str_pad(
$duration[
"ss"], 2,
"0", STR_PAD_LEFT);
658 $duration_str = $this->
object->getPlaytimeForSeconds(
$d);
662 return $duration_str;
674 $mediaItem->setPurpose($purpose);
694 $url_gui = $this->form_gui->getInput(
"url_" . $purpose);
695 $file_gui = $this->form_gui->getInput(
"file_" . $purpose);
698 $file = $this->form_gui->getInput(
"url_" . $purpose);
699 $title = basename($file);
700 $location = $this->form_gui->getInput(
"url_" . $purpose);
701 $locationType =
"Reference";
702 } elseif ($file_gui[
"size"] > 0) {
706 if (!is_dir($mob_dir)) {
709 $dir = LegacyPathHelper::createRelativePath($mob_dir);
710 $old_files = $this->
filesystem->finder()->in([$dir])->exclude([$dir .
'/mob_vpreview.png'])->files();
711 foreach ($old_files as $file) {
717 $file_name = str_replace(
" ",
"_", $file_name);
719 $file = $mob_dir .
"/" . $file_name;
721 $locationType =
"LocalFile";
733 if ($format ===
"") {
742 $mediaItem->
setHeight(self::isAudio($format) ? 0 : 180);
743 $mob->generatePreviewPic(320, 240);
746 if (($purpose ===
"Standard") && isset($title)) {
758 $ilCtrl = $this->ctrl;
759 $ilUser = $this->user;
765 $this->checkPermission(
"write");
767 $this->initAddCastItemForm(
"edit");
769 if ($this->form_gui->checkInput()) {
772 $this->mc_request->getItemId()
774 $mob_id = $mc_item->getMobId();
781 if ($this->form_gui->getInput(
"delete_" . $purpose)) {
783 $ilLog->write(
"Mcst: deleting purpose $purpose");
787 $url_gui = $this->form_gui->getInput(
"url_" . $purpose);
788 $file_gui = $this->form_gui->getInput(
"file_" . $purpose);
790 if ($media_item ==
null) {
791 if ($purpose !=
"Standard" &&
792 ($url_gui || $file_gui[
"size"] > 0)) {
795 $file = $this->createMediaItemForPurpose($mob, $purpose);
798 $file = $this->updateMediaItem($mob, $media_item);
801 if ($purpose ==
"Standard") {
803 $duration = $this->getDuration($media_item);
805 $title = $this->form_gui->getInput(
"title") !=
"" ? $this->form_gui->getInput(
"title") : basename($file);
806 $description = $this->form_gui->getInput(
"description");
811 $this->video_gui->savePreviewInput($this->form_gui, $mob->
getId());
823 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
825 $mc_item->setUserId($ilUser->getId());
829 $seconds = ((
int) $dur_arr[0] * 60 * 60) + ((
int) $dur_arr[1] * 60) + ((
int) $dur_arr[2]);
831 $st_med->setDuration($seconds);
834 $mc_item->setTitle($title);
835 $mc_item->setContent($description);
836 if ($enable_internal_rss) {
837 $mc_item->setVisibility($this->form_gui->getInput(
"visibility"));
841 $ilCtrl->redirect($this,
"listItems");
843 $this->populateFormFromPost();
849 $f = $this->gui->ui()->factory();
850 $item_id = $this->mc_request->getItemId();
857 if ($this->media_type->isAudio($med->getFormat())) {
858 $comp =
$f->player()->audio($file,
"");
859 } elseif ($this->media_type->isVideo($med->getFormat())) {
860 $comp =
$f->player()->video($file);
861 } elseif ($this->media_type->isImage($med->getFormat())) {
862 $comp =
$f->image()->responsive($file, $mob->
getTitle());
866 if (is_null($comp)) {
867 $comp =
$f->messageBox()->info($this->
lng->txt(
"mcst_item_not_found"));
870 $this->
lng->txt(
"mcst_preview"),
871 $this->lng->txt(
"close")
872 )->content([$comp])->send();
878 $f = $this->gui->ui()->factory();
879 $r = $this->gui->ui()->renderer();
880 $ids = $this->mc_request->getItemIds();
881 if (current($ids) ===
'ALL_OBJECTS') {
882 $arr = $this->
object->getSortedItemsArray();
883 $ids = array_keys($arr);
886 foreach ($ids as
$id) {
888 $items[] =
$f->modal()->interruptiveItem()->keyValue(
$id,
"", $item->getTitle());
890 $this->gui->send($r->renderAsync([
891 $f->modal()->interruptive(
892 $this->lng->txt(
"mcst_confirm_deletion"),
893 $this->lng->txt(
"info_delete_sure"),
894 $this->ctrl->getFormAction($this,
"deleteItems")
895 )->withAffectedItems($items)
901 $ilCtrl = $this->ctrl;
904 $ilTabs = $this->tabs;
906 $this->checkPermission(
"write");
907 $ilTabs->activateTab(
"edit_content");
909 $ids = $this->mc_request->getItemIds();
910 if (count($ids) == 0) {
911 $this->listItemsObject();
918 $c_gui->setFormAction($ilCtrl->getFormAction($this,
"deleteItems"));
919 $c_gui->setHeaderText(
$lng->txt(
"info_delete_sure"));
920 $c_gui->setCancel(
$lng->txt(
"cancel"),
"listItems");
921 $c_gui->setConfirm(
$lng->txt(
"confirm"),
"deleteItems");
924 foreach ($ids as $item_id) {
934 $tpl->setContent($c_gui->getHTML());
939 $ilCtrl = $this->ctrl;
941 $this->checkPermission(
"write");
944 $ids = $this->mc_request->getItemIds();
945 foreach ($ids as $item_id) {
949 $this->
object->saveOrder(array_map(
function ($i) {
951 }, $this->
object->readItems()));
952 $ilCtrl->redirect($this,
"listItems");
960 $ilCtrl = $this->ctrl;
961 $ilUser = $this->user;
963 $this->checkPermission(
"read");
964 $news_item =
new ilNewsItem($this->mc_request->getItemId());
965 $this->
object->handleLPUpdate($ilUser->getId(), $news_item->getMobId());
966 if (!$news_item->deliverMobFile(
968 $this->mc_request->getPresentation()
970 $ilCtrl->redirect($this,
"showContent");
977 $ilCtrl = $this->ctrl;
980 $mc_item =
new ilNewsItem($this->mc_request->getItemId());
981 $mob = $mc_item->getMobId();
988 $m_item->determineDuration();
989 $dur = $m_item->getDuration();
991 $mc_item->setPlaytime($this->
object->getPlaytimeForSeconds($dur));
994 $this->tpl->setOnScreenMessage(
'success',
$lng->txt(
"mcst_set_playtime"),
true);
998 $this->tpl->setOnScreenMessage(
'failure',
$lng->txt(
"mcst_unable_to_determin_playtime"),
true);
1001 $ilCtrl->redirect($this,
"listItems");
1009 if (!$this->checkPermissionBool(
"read")) {
1010 $this->checkPermission(
"visible");
1012 $this->
ctrl->redirectByClass(ilInfoScreenGUI::class,
"showSummary");
1017 $ilTabs = $this->tabs;
1019 $ilTabs->activateTab(
"id_info");
1021 if (!$this->checkPermissionBool(
"read")) {
1022 $this->checkPermission(
"visible");
1027 $info->addMetaDataSections($this->
object->getId(), 0, $this->object->getType());
1028 $info->enablePrivateNotes();
1031 $this->
lng->loadLanguageModule(
"meta");
1032 $this->
lng->loadLanguageModule(
"mcst");
1033 $med_items = $this->
object->getItemsArray();
1034 $info->addSection($this->
lng->txt(
"meta_general"));
1036 $this->
lng->txt(
"mcst_nr_items"),
1040 if (count($med_items) > 0) {
1041 $cur = current($med_items);
1047 $info->addProperty($this->
lng->txt(
"mcst_last_submission"), $last);
1055 $ilAccess = $this->access;
1056 $ilTabs = $this->tabs;
1058 $ilHelp = $this->help;
1060 $ilHelp->setScreenIdComponent(
"mcst");
1063 if ($ilAccess->checkAccess(
'read',
"", $this->object->getRefId())) {
1066 $lng->txt(
"content"),
1067 $this->ctrl->getLinkTarget($this,
"showContent")
1072 if ($ilAccess->checkAccess(
'visible',
"", $this->object->getRefId()) ||
1073 $ilAccess->checkAccess(
'read',
"", $this->object->getRefId())) {
1076 $lng->txt(
"info_short"),
1077 $this->ctrl->getLinkTargetByClass(
"ilinfoscreengui",
"showSummary")
1082 if ($ilAccess->checkAccess(
'write',
"", $this->object->getRefId())) {
1085 $lng->txt(
"settings"),
1086 $this->ctrl->getLinkTargetByClass(SettingsGUI::class,
"")
1092 'learning_progress',
1093 $lng->txt(
'learning_progress'),
1094 $this->ctrl->getLinkTargetByClass(array(__CLASS__,
'illearningprogressgui'),
'')
1098 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
1100 $mdtab = $mdgui->getTab();
1102 $this->tabs_gui->addTab(
1104 $this->
lng->txt(
"meta_data"),
1111 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
1114 $lng->txt(
"export"),
1115 $this->ctrl->getLinkTargetByClass(
"ilexportgui",
"")
1120 if ($ilAccess->checkAccess(
'edit_permission',
"", $this->object->getRefId())) {
1123 $lng->txt(
"perm_settings"),
1124 $this->ctrl->getLinkTargetByClass(
"ilpermissiongui",
"perm")
1130 string $a_active =
"content"
1132 $ilTabs = $this->
tabs;
1133 $ilAccess = $this->access;
1139 $this->ctrl->getLinkTarget($this,
"showContent")
1142 if ($ilAccess->checkAccess(
"write",
"", $this->requested_ref_id)) {
1145 $lng->txt(
"mcst_manage"),
1146 $this->ctrl->getLinkTarget($this,
"listItems")
1152 $lng->txt(
"mcst_ordering"),
1153 $this->ctrl->getLinkTarget($this,
"editOrder")
1158 $ilTabs->activateSubTab($a_active);
1159 $ilTabs->activateTab(
"content");
1164 $this->editObject();
1169 $ilLocator = $this->locator;
1171 if (is_object($this->
object)) {
1172 $ilLocator->addItem($this->
object->getTitle(), $this->ctrl->getLinkTarget($this,
"showContent"),
"", $this->requested_ref_id);
1176 public static function _goto(
string $a_target): void
1179 $main_tpl =
$DIC->ui()->mainTemplate();
1181 $ilAccess =
$DIC->access();
1183 $ctrl =
$DIC->ctrl();
1185 if ($ilAccess->checkAccess(
"read",
"", $a_target)) {
1186 $ctrl->setParameterByClass(
"ilobjmediacastgui",
"ref_id", $a_target);
1188 $ctrl->redirectByClass([
"ilmediacasthandlergui",
"ilobjmediacastgui"],
"showContent");
1189 } elseif ($ilAccess->checkAccess(
"visible",
"", $a_target)) {
1192 $main_tpl->setOnScreenMessage(
'failure', sprintf(
1193 $lng->txt(
"msg_no_perm_read_item"),
1202 protected static function isAudio(
string $extension): bool
1204 return strpos($extension,
"audio") !==
false;
1229 $this->form_gui->setValuesByPost();
1236 if ($this->form_gui->getInput(
"value_" . $purpose)) {
1237 $input = $this->form_gui->getItemByPostVar(
"label_value_" . $purpose);
1238 $input->setValue($this->form_gui->getInput(
"value_" . $purpose));
1242 $this->form_gui->setValuesByPost();
1243 $tpl->setContent($this->form_gui->getHTML());
1248 $ilTabs = $this->tabs;
1252 $this->checkPermission(
"write");
1253 $ilTabs->activateTab(
"edit_content");
1255 $this->addContentSubTabs(
"sorting");
1258 switch ($this->
object->getOrder()) {
1262 $this->listItemsObject();
1272 $table_gui->setTitle(
$lng->txt(
"mcst_media_cast"));
1273 $table_gui->setData($this->
object->getSortedItemsArray());
1275 $table_gui->addCommandButton(
"saveOrder",
$lng->txt(
"mcst_save_order"));
1277 $tpl->setContent($table_gui->getHTML());
1284 $ids = $this->mc_request->getItemIds();
1288 foreach (array_keys($ids) as
$id) {
1291 $this->
object->saveOrder($items);
1293 $this->tpl->setOnScreenMessage(
'success',
$lng->txt(
"settings_saved"),
true);
1294 $this->
ctrl->redirect($this,
"editOrder");
1304 $ilUser = $this->user;
1305 $ilTabs = $this->tabs;
1310 $this->
object->getRefId(),
1311 $this->object->getId(),
1319 $this->showGallery();
1321 $view = new \McstImageGalleryGUI($this->
object, $this->tpl, $this->getFeedLink());
1322 $view->setCompletedCallback($this->
ctrl->getLinkTarget(
1324 "handlePlayerCompletedEvent",
1329 $this->
tabs->activateTab(
"content");
1330 $this->addContentSubTabs(
"content");
1331 $tpl->setContent($this->
ctrl->getHTML($view));
1333 $view = new \McstPodcastGUI($this->
object, $this->tpl, $this->getFeedLink());
1334 $this->
tabs->activateTab(
"content");
1335 $this->addContentSubTabs(
"content");
1336 $tpl->setContent($this->
ctrl->getHTML($view));
1338 $ilTabs->activateTab(
"content");
1339 $this->addContentSubTabs(
"content");
1340 $view = new \ILIAS\MediaCast\Presentation\VideoViewGUI($this->
object, $tpl, $this->getFeedLink());
1341 $view->setCompletedCallback($this->
ctrl->getLinkTarget(
1343 "handlePlayerCompletedEvent",
1348 $view->setAutoplayCallback($this->
ctrl->getLinkTarget(
1350 "handleAutoplayTrigger",
1357 $this->listItemsObject(
true);
1360 $tpl->setPermanentLink($this->
object->getType(), $this->object->getRefId());
1366 $ilTabs = $this->tabs;
1367 $ilCtrl = $this->ctrl;
1369 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
"mcst_view_abandoned"));
1374 $ilCtrl = $this->ctrl;
1375 $this->checkPermission(
"write");
1376 $this->mcst_item =
new ilNewsItem($this->mc_request->getItemId());
1377 $this->video_gui->handleExtractionRequest(
1378 $this->mcst_item->getMobId()
1380 $ilCtrl->redirect($this,
"editCastItem");
1385 if ($this->mc_request->getEvent() ===
"play") {
1386 $player = explode(
"_", $this->mc_request->getPlayer());
1387 $news_id = (
int) $player[1];
1389 $item->increasePlayCounter();
1391 $mob_id = $item->getMobId();
1393 $ilUser = $this->user;
1394 $this->
object->handleLPUpdate($ilUser->getId(), $mob_id);
1402 $mob_id = $this->mc_request->getMobId();
1404 $ilUser = $this->user;
1405 $this->
object->handleLPUpdate($ilUser->getId(), $mob_id);
1412 $this->addMobsToCast($mob_ids,
"",
false);
1417 $this->addMobsToCast([$mob_id], $long_desc);
1422 string $long_desc =
"",
1423 bool $redirect =
true,
1424 bool $extract =
false
1426 $ctrl = $this->
ctrl;
1427 $user = $this->user;
1430 foreach ($mob_ids as $mob_id) {
1431 $item_ids[] = $this->
object->addMobToCast($mob_id, $user->getId(), $long_desc, $extract);
1435 if (count($item_ids) === 1) {
1436 $ctrl->setParameter($this,
"item_id", $item_ids[0]);
1437 $ctrl->redirect($this,
"editCastItem");
1439 $ctrl->redirect($this,
"listItems");
1445 $this->addMobsToCast($mob_ids,
"",
true,
true);
1450 $this->
user->writePref(
1452 $this->mc_request->getAutoplay()
1459 return $this->gui->comments()->commentGUI(
1460 $this->
object->getRefId(),
1461 $this->mc_request->getItemId()
1467 echo $this->getCommentGUI()->getListHTML() .
"<script>ilNotes.init(null);</script>";
1473 $mob_id = $this->mc_request->getMobId();
1474 $html = $this->mob_player_gui->wrapper()->renderComponent(
new ilObjMediaObject($mob_id));
1475 $this->gui->httpUtil()->sendString($html);
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Indicates that a file is missing or not found.
Indicates general problems with the input or output operations.
The legacy path helper provides convenient functions for the integration of the filesystem service wi...
static _lookup(string $a_type, string $a_setting, int $a_user=0, int $a_block_id=0)
Lookup setting from database.
static _recordReadEvent(string $a_type, int $a_ref_id, int $obj_id, int $usr_id, bool $isCatchupWriteEvents=true, $a_ext_rc=null, $a_ext_time=null)
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
@classDescription Date and time handling
Export User Interface Class.
static getASCIIFilename(string $a_filename)
static renameExecutables(string $a_dir)
static moveUploadedFile(string $a_file, string $a_name, string $a_target, bool $a_raise_errors=true, string $a_mode="move_uploaded")
move uploaded file
static _updateStatus(int $a_obj_id, int $a_usr_id, ?object $a_obj=null, bool $a_percentage=false, bool $a_force_raise=false)
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...
static checkAccess(int $a_ref_id, bool $a_allow_only_read=true)
check access to learning progress
const LP_CONTEXT_REPOSITORY
Class ilObjUserTrackingGUI.
Component logger with individual log levels by component id.
A news item can be created by different sources.
This class represents a non editable value in a property form.
GUI class for the workflow of copying objects.
Class ilObjectGUI Basic methods of all Output classes.
ilGlobalTemplateInterface $tpl
static _gotoRepositoryRoot(bool $raise_error=false)
Goto repository root.
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
addHeaderAction()
Add header action menu.
static _gotoRepositoryNode(int $ref_id, string $cmd="")
prepareOutput(bool $show_sub_objects=true)
Class ilObject Basic functions for all objects.
static _lookupObjId(int $ref_id)
setDescription(string $description)
static _lookupTitle(int $obj_id)
This class represents an option in a radio group.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class represents a text area property in a property form.
This class represents a text property in a property form.
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
static redirect(string $a_script)
The filesystem interface provides the public interface for the Filesystem service API consumer.
setContent(string $a_html)
Sets content for standard template.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc