40 protected \ILIAS\MediaObjects\MediaType\MediaTypeManager
$media_type;
41 protected \ILIAS\MediaCast\InternalGUIService
$gui;
42 protected \ILIAS\MediaObjects\Video\GUIService
$video_gui;
59 bool $a_call_by_reference,
60 bool $a_prepare_output =
true
64 $this->
ctrl = $DIC->ctrl();
65 $this->
lng = $DIC->language();
66 $this->
user = $DIC->user();
67 $this->
tabs = $DIC->tabs();
68 $this->tpl =
$DIC[
"tpl"];
69 $this->
access = $DIC->access();
70 $this->
toolbar = $DIC->toolbar();
72 $this->log =
$DIC[
"ilLog"];
73 $this->
help = $DIC[
"ilHelp"];
74 $this->
locator = $DIC[
"ilLocator"];
75 $ilCtrl =
$DIC->ctrl();
77 $this->mc_request =
$DIC->mediaCast()
88 $ilCtrl->saveParameter($this,
"item_id");
93 $this->mc_manager =
$DIC->mediaCast()->internal()
94 ->domain()->mediaCast($this->
object);
96 $this->gui =
$DIC->mediaCast()->internal()->gui();
97 $this->media_type =
$DIC->mediaObjects()->internal()->domain()->mediaType();
98 $this->video_gui =
$DIC->mediaObjects()->internal()->gui()->video();
99 $this->mob_player_gui =
$DIC->mediaObjects()->internal()->gui()->player();
100 $this->mob_manager =
$DIC->mediaObjects()->internal()->domain()->mediaObject();
108 $next_class = $this->
ctrl->getNextClass($this);
109 $cmd = $this->
ctrl->getCmd();
112 switch ($next_class) {
113 case "ilmediacreationgui":
116 $this->
ctrl->setReturn($this,
"listItems");
117 $ilTabs->activateTab(
"content");
120 switch ($this->
object->getViewMode()) {
133 },
function ($mob_id, $long_desc) {
135 },
function ($mob_ids) {
137 },
function ($mob_id) {
139 },
function ($mob_id) {
142 $this->
ctrl->forwardCommand($creation);
145 case "ilinfoscreengui":
154 $ilTabs->activateTab(
"export");
156 $exp_gui->addFormat(
"xml");
157 $ret = $this->
ctrl->forwardCommand($exp_gui);
161 case 'ilpermissiongui':
162 $ilTabs->activateTab(
"id_permissions");
164 $ret = $this->
ctrl->forwardCommand($perm_gui);
167 case 'ilobjectcopygui':
169 $cp->setType(
'mcst');
170 $this->
ctrl->forwardCommand($cp);
173 case "ilcommonactiondispatchergui":
175 $this->
ctrl->forwardCommand($gui);
178 case "illearningprogressgui":
179 $ilTabs->activateTab(
'learning_progress');
182 $this->
object->getRefId(),
183 $this->mc_request->getUserId() ?: $ilUser->getId()
185 $this->
ctrl->forwardCommand($new_gui);
186 $this->tabs_gui->setTabActive(
'learning_progress');
189 case "mcstimagegallerygui":
190 $view = new \McstImageGalleryGUI($this->
object, $this->tpl, $this->
getFeedLink());
191 $this->
ctrl->forwardCommand($view);
194 case "mcstpodcastgui":
195 $view = new \McstPodcastGUI($this->
object, $this->tpl, $this->
getFeedLink());
196 $this->
ctrl->forwardCommand($view);
199 case strtolower(ilCommentGUI::class):
203 case strtolower(ilObjectMetaDataGUI::class):
205 $ilTabs->activateTab(
"meta_data");
207 $this->
ctrl->forwardCommand($gui);
210 case strtolower(SettingsGUI::class):
212 $ilTabs->activateTab(
"id_settings");
213 $gui = $this->gui->settings()->settingsGUI(
215 $this->object->getRefId()
217 $this->
ctrl->forwardCommand($gui);
225 if ($cmd !=
"infoScreenObject") {
240 $this->
error->raiseError($this->
lng->txt(
"msg_no_perm_write"), $this->error->MESSAGE);
243 $this->
ctrl->redirectByClass(SettingsGUI::class,
"");
250 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"object_added"),
true);
251 ilUtil::redirect(
"ilias.php?baseClass=ilMediaCastHandlerGUI&ref_id=" . $new_object->
getRefId() .
"&cmd=editSettings");
263 if ($a_presentation_mode) {
264 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
"mcst_view_abandoned"));
268 if ($a_presentation_mode) {
274 $med_items = $this->
object->getSortedItemsArray();
276 if ($a_presentation_mode) {
282 $table_gui->setData($med_items);
284 if ($ilAccess->checkAccess(
"write",
"", $this->requested_ref_id) && !$a_presentation_mode) {
285 if (in_array($this->
object->getViewMode(), [
290 $ilToolbar->addButton(
$lng->
txt(
"add"), $this->ctrl->getLinkTargetByClass(
"ilMediaCreationGUI",
""));
292 $ilToolbar->addButton(
$lng->
txt(
"add"), $this->ctrl->getLinkTarget($this,
"addCastItem"));
295 $table_gui->addMultiCommand(
"confirmDeletionItems",
$lng->
txt(
"delete"));
296 $table_gui->setSelectAllCheckbox(
"item_id");
303 window.addEventListener(
'load', (
event) => {
304 $(document).on(
'hidden.bs.modal', (e) => {
305 $(
'.modal-body').html(
'');
307 $(document).on(
'shown.bs.modal', (e) => {
308 window.dispatchEvent(
new Event(
'resize'));
313 $tpl->
setContent($this->gui->ui()->renderer()->render($new_table->get()) . $script);
319 $new_table->handleCommand();
324 return $this->gui->getMediaCastManageTableGUI($this,
"tableCommand");
339 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
340 if ($enable_internal_rss) {
362 $item_id = $this->mc_request->getItemId();
363 $this->
ctrl->setParameterByClass(self::class,
"item_id", $item_id);
372 $this->mc_request->getItemId()
376 $this->video_gui->addPreviewExtractionToToolbar(
377 $this->mcst_item->getMobId(),
388 foreach ($this->
object->getSortedItemsArray() as $item) {
389 if ($mob_id == $item[
"mob_id"]) {
390 $this->
ctrl->setParameter($this,
"item_id", $item[
"id"]);
391 $this->
ctrl->redirect($this,
"editCastItem");
394 $this->
ctrl->redirect($this,
"listItems");
399 foreach ($this->
object->getSortedItemsArray() as $item) {
400 if ($mob_id == $item[
"mob_id"]) {
403 $mc_item->setTitle($mob->getTitle());
404 $mc_item->setContent($mob->getLongDescription());
417 $ilTabs->activateTab(
"edit_content");
422 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
425 $this->form_gui->setMultipart(
true);
429 $text_input->setMaxLength(200);
430 $this->form_gui->addItem($text_input);
434 $text_area->setRequired(
false);
435 $this->form_gui->addItem($text_area);
438 if ($enable_internal_rss) {
441 $radio_group->addOption($radio_option);
443 $radio_group->addOption($radio_option);
444 $radio_group->setInfo(
$lng->
txt(
"mcst_visibility_info"));
445 $radio_group->setRequired(
true);
446 $radio_group->setValue($this->
object->getDefaultAccess() == 0 ?
"users" :
"public");
447 $this->form_gui->addItem($radio_group);
453 $dur->setInfo(
$lng->
txt(
"mcst_duration_info"));
454 $dur->setShowDays(
false);
455 $dur->setShowHours(
true);
456 $dur->setShowSeconds(
true);
457 $this->form_gui->addItem($dur);
461 if ($purpose ==
"VideoAlternative" &&
462 $a_mode ==
"create") {
467 $section->setTitle(
$lng->
txt(
"mcst_" . strtolower($purpose) .
"_title"));
468 $this->form_gui->addItem($section);
469 if ($a_mode !=
"create") {
472 $label->setPostVar(
"label_value_" . $purpose);
473 $label->setInfo(
$lng->
txt(
"mcst_current_value_info"));
474 $this->form_gui->addItem($label);
475 $this->form_gui->addItem($value);
478 $file->setSuffixes($this->mc_manager->getSuffixesForViewMode(
479 $this->object->getViewMode()
481 $this->form_gui->addItem($file);
483 $text_input->setPattern(
"/https?\:\/\/.+/i");
484 $text_input->setInfo(
$lng->
txt(
"mcst_reference_info"));
485 $this->form_gui->addItem($text_input);
486 if ($purpose !=
"Standard") {
488 $clearCheckBox->setPostVar(
"delete_" . $purpose);
489 $clearCheckBox->setTitle(
$lng->
txt(
"mcst_clear_purpose_title"));
490 $this->form_gui->addItem($clearCheckBox);
494 $this->form_gui->addItem($ne);
498 if ($a_mode !==
"create") {
502 $this->video_gui->addPreviewInput($this->form_gui, $mob_id);
507 if ($a_mode ==
"create") {
508 $this->form_gui->setTitle(
$lng->
txt(
"mcst_add_new_item"));
509 $this->form_gui->addCommandButton(
"saveCastItem",
$lng->
txt(
"save"));
511 $this->form_gui->setTitle(
$lng->
txt(
"mcst_edit_item"));
512 $this->form_gui->addCommandButton(
"updateCastItem",
$lng->
txt(
"save"));
514 $this->form_gui->addCommandButton(
"listItems",
$lng->
txt(
"cancel"));
515 $this->form_gui->setFormAction($ilCtrl->getFormAction($this,
"saveCastItem"));
533 $this->mc_request->getItemId()
535 if (count($mediaItems) > 0) {
536 foreach ($mediaItems as $med) {
537 if (!isset($values[
"title"])) {
539 $values[
"title"] = $this->mcst_item->getTitle();
540 $values[
"description"] = $this->mcst_item->getContent();
541 $values[
"visibility"] = $this->mcst_item->getVisibility();
542 $length = explode(
":", $this->mcst_item->getPlaytime());
543 $values[
"duration"] = array(
"hh" => $length[0],
"mm" => $length[1],
"ss" => $length[2]);
546 $values[
"value_" . $med->getPurpose()] = (strlen($med->getLocation()) > 100) ?
"..." . substr($med->getLocation(), strlen($med->getLocation()) - 100) : $med->getLocation();
547 $values[
"label_value_" . $med->getPurpose()] = (strlen($med->getLocation()) > 100) ?
"..." . substr($med->getLocation(), strlen($med->getLocation()) - 100) : $med->getLocation();
548 $values[
"mimetype_" . $med->getPurpose()] = $med->getFormat();
552 if (!isset($values[
"value_" . $purpose])) {
553 $values[
"label_value_" . $purpose] =
$lng->
txt(
"none");
554 $values[
"value_" . $purpose] =
$lng->
txt(
"none");
557 $this->form_gui->setValuesByArray($values);
570 $ilTabs->activateTab(
"edit_content");
574 if (!$this->form_gui->checkInput() ||
575 ($this->form_gui->getInput(
"url_Standard") ==
"" && !$_FILES[
'file_Standard'][
'tmp_name'])) {
576 $this->tpl->setOnScreenMessage(
'failure',
$lng->
txt(
"mcst_input_either_file_or_url"));
588 $title = $this->form_gui->getInput(
"title") !=
"" ? $this->form_gui->getInput(
"title") : basename($file);
589 $description = $this->form_gui->getInput(
"description");
590 $mob->setTitle($title);
591 $mob->setDescription($description);
594 $this->video_gui->savePreviewInput($this->form_gui, $mob->getId());
600 foreach ($this->additionalPurposes as $purpose) {
602 $file_gui = $this->form_gui->getInput(
"file_" . $purpose);
603 $url_gui = $this->form_gui->getInput(
"url_" . $purpose);
604 if ($url_gui || $file_gui[
"size"] > 0) {
611 if ($prevpic[
"size"] == 0) {
614 $mob->generatePreviewPic(320, 240);
622 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
626 $mc_item->setMobId($mob->getId());
628 $mc_item->setContextObjId($this->
object->getId());
629 $mc_item->setContextObjType($this->
object->getType());
630 $mc_item->setUserId($ilUser->getId());
632 $mc_item->setTitle($title);
633 $mc_item->setContent($description);
634 $mc_item->setLimitation(
false);
635 if ($enable_internal_rss) {
636 $mc_item->setVisibility($this->form_gui->getInput(
"visibility"));
638 $mc_item->setVisibility(
"users");
642 $ilCtrl->redirect($this,
"listItems");
649 ? $this->form_gui->getInput(
"duration")
650 : array(
"hh" => 0,
"mm" => 0,
"ss" => 0);
652 $duration_str = str_pad(
$duration[
"hh"], 2,
"0", STR_PAD_LEFT) .
":" .
653 str_pad(
$duration[
"mm"], 2,
"0", STR_PAD_LEFT) .
":" .
654 str_pad(
$duration[
"ss"], 2,
"0", STR_PAD_LEFT);
660 $duration_str = $this->
object->getPlaytimeForSeconds(
$d);
664 return $duration_str;
676 $mediaItem->setPurpose($purpose);
696 $url_gui = $this->form_gui->getInput(
"url_" . $purpose);
697 $file_gui = $this->form_gui->getInput(
"file_" . $purpose);
700 $file = $this->form_gui->getInput(
"url_" . $purpose);
701 $title = basename($file);
702 $location = $this->form_gui->getInput(
"url_" . $purpose);
703 $locationType =
"Reference";
710 if ($format ===
"") {
717 $mediaItem->
setHeight(self::isAudio($format) ? 0 : 180);
718 $mob->generatePreviewPic(320, 240);
720 } elseif ($file_gui[
"size"] > 0) {
723 $file_name = str_replace(
" ",
"_", $file_name);
725 $this->mob_manager->addFileFromLegacyUpload($mob->
getId(), $_FILES[
'file_' . $purpose][
'tmp_name']);
728 $_FILES[
'file_' . $purpose][
'tmp_name'],
735 if (($purpose ===
"Standard") && isset($title)) {
747 $ilCtrl = $this->ctrl;
748 $ilUser = $this->user;
754 $this->checkPermission(
"write");
756 $this->initAddCastItemForm(
"edit");
758 if ($this->form_gui->checkInput()) {
761 $this->mc_request->getItemId()
763 $mob_id = $mc_item->getMobId();
770 if ($this->form_gui->getInput(
"delete_" . $purpose)) {
772 $ilLog->write(
"Mcst: deleting purpose $purpose");
776 $url_gui = $this->form_gui->getInput(
"url_" . $purpose);
777 $file_gui = $this->form_gui->getInput(
"file_" . $purpose);
779 if ($media_item ==
null) {
780 if ($purpose !=
"Standard" &&
781 ($url_gui || $file_gui[
"size"] > 0)) {
784 $file = $this->createMediaItemForPurpose($mob, $purpose);
787 $file = $this->updateMediaItem($mob, $media_item);
790 if ($purpose ==
"Standard") {
792 $duration = $this->getDuration($media_item);
794 $title = $this->form_gui->getInput(
"title") !=
"" ? $this->form_gui->getInput(
"title") : basename($file);
795 $description = $this->form_gui->getInput(
"description");
800 $this->video_gui->savePreviewInput($this->form_gui, $mob->
getId());
812 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
814 $mc_item->setUserId($ilUser->getId());
818 $seconds = ((
int) $dur_arr[0] * 60 * 60) + ((
int) $dur_arr[1] * 60) + ((
int) $dur_arr[2]);
820 $st_med->setDuration($seconds);
823 $mc_item->setTitle($title);
824 $mc_item->setContent($description);
825 if ($enable_internal_rss) {
826 $mc_item->setVisibility($this->form_gui->getInput(
"visibility"));
830 $ilCtrl->redirect($this,
"listItems");
832 $this->populateFormFromPost();
838 $f = $this->gui->ui()->factory();
839 $item_id = $this->mc_request->getItemId();
846 if ($this->media_type->isAudio($med->getFormat())) {
847 $comp =
$f->player()->audio($file,
"");
848 } elseif ($this->media_type->isVideo($med->getFormat())) {
849 $comp =
$f->player()->video($file);
850 } elseif ($this->media_type->isImage($med->getFormat())) {
851 $comp =
$f->image()->responsive($file, $mob->
getTitle());
855 if (is_null($comp)) {
856 $comp =
$f->messageBox()->info($this->
lng->txt(
"mcst_item_not_found"));
859 $this->
lng->txt(
"mcst_preview"),
860 $this->lng->txt(
"close")
861 )->content([$comp])->send();
867 $f = $this->gui->ui()->factory();
868 $r = $this->gui->ui()->renderer();
869 $ids = $this->mc_request->getItemIds();
870 if (current($ids) ===
'ALL_OBJECTS') {
871 $arr = $this->
object->getSortedItemsArray();
872 $ids = array_keys($arr);
875 foreach ($ids as
$id) {
877 $items[] =
$f->modal()->interruptiveItem()->keyValue(
$id,
"", $item->getTitle());
879 $this->gui->send($r->renderAsync([
880 $f->modal()->interruptive(
881 $this->lng->txt(
"mcst_confirm_deletion"),
882 $this->lng->txt(
"info_delete_sure"),
883 $this->ctrl->getFormAction($this,
"deleteItems")
884 )->withAffectedItems($items)
890 $ilCtrl = $this->ctrl;
893 $ilTabs = $this->tabs;
895 $this->checkPermission(
"write");
896 $ilTabs->activateTab(
"edit_content");
898 $ids = $this->mc_request->getItemIds();
899 if (count($ids) == 0) {
900 $this->listItemsObject();
907 $c_gui->setFormAction($ilCtrl->getFormAction($this,
"deleteItems"));
908 $c_gui->setHeaderText(
$lng->txt(
"info_delete_sure"));
909 $c_gui->setCancel(
$lng->txt(
"cancel"),
"listItems");
910 $c_gui->setConfirm(
$lng->txt(
"confirm"),
"deleteItems");
913 foreach ($ids as $item_id) {
923 $tpl->setContent($c_gui->getHTML());
928 $ilCtrl = $this->ctrl;
930 $this->checkPermission(
"write");
933 $ids = $this->mc_request->getItemIds();
934 foreach ($ids as $item_id) {
938 $this->
object->saveOrder(array_map(
function ($i) {
940 }, $this->
object->readItems()));
941 $ilCtrl->redirect($this,
"listItems");
949 $ilCtrl = $this->ctrl;
950 $ilUser = $this->user;
952 $this->checkPermission(
"read");
953 $news_item =
new ilNewsItem($this->mc_request->getItemId());
954 $this->
object->handleLPUpdate($ilUser->getId(), $news_item->getMobId());
955 if (!$news_item->deliverMobFile(
957 $this->mc_request->getPresentation()
959 $ilCtrl->redirect($this,
"showContent");
966 $ilCtrl = $this->ctrl;
969 $mc_item =
new ilNewsItem($this->mc_request->getItemId());
970 $mob = $mc_item->getMobId();
977 $m_item->determineDuration();
978 $dur = $m_item->getDuration();
980 $mc_item->setPlaytime($this->
object->getPlaytimeForSeconds($dur));
983 $this->tpl->setOnScreenMessage(
'success',
$lng->txt(
"mcst_set_playtime"),
true);
987 $this->tpl->setOnScreenMessage(
'failure',
$lng->txt(
"mcst_unable_to_determin_playtime"),
true);
990 $ilCtrl->redirect($this,
"listItems");
998 if (!$this->checkPermissionBool(
"read")) {
999 $this->checkPermission(
"visible");
1001 $this->
ctrl->redirectByClass(ilInfoScreenGUI::class,
"showSummary");
1006 $ilTabs = $this->tabs;
1008 $ilTabs->activateTab(
"id_info");
1010 if (!$this->checkPermissionBool(
"read")) {
1011 $this->checkPermission(
"visible");
1016 $info->addMetaDataSections($this->
object->getId(), 0, $this->object->getType());
1017 $info->enablePrivateNotes();
1020 $this->
lng->loadLanguageModule(
"meta");
1021 $this->
lng->loadLanguageModule(
"mcst");
1022 $med_items = $this->
object->getItemsArray();
1023 $info->addSection($this->
lng->txt(
"meta_general"));
1025 $this->
lng->txt(
"mcst_nr_items"),
1029 if (count($med_items) > 0) {
1030 $cur = current($med_items);
1036 $info->addProperty($this->
lng->txt(
"mcst_last_submission"), $last);
1044 $ilAccess = $this->access;
1045 $ilTabs = $this->tabs;
1047 $ilHelp = $this->help;
1049 $ilHelp->setScreenIdComponent(
"mcst");
1052 if ($ilAccess->checkAccess(
'read',
"", $this->object->getRefId())) {
1055 $lng->txt(
"content"),
1056 $this->ctrl->getLinkTarget($this,
"showContent")
1061 if ($ilAccess->checkAccess(
'visible',
"", $this->object->getRefId()) ||
1062 $ilAccess->checkAccess(
'read',
"", $this->object->getRefId())) {
1065 $lng->txt(
"info_short"),
1066 $this->ctrl->getLinkTargetByClass(
"ilinfoscreengui",
"showSummary")
1071 if ($ilAccess->checkAccess(
'write',
"", $this->object->getRefId())) {
1074 $lng->txt(
"settings"),
1075 $this->ctrl->getLinkTargetByClass(SettingsGUI::class,
"")
1081 'learning_progress',
1082 $lng->txt(
'learning_progress'),
1083 $this->ctrl->getLinkTargetByClass(array(__CLASS__,
'illearningprogressgui'),
'')
1087 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
1089 $mdtab = $mdgui->getTab();
1091 $this->tabs_gui->addTab(
1093 $this->
lng->txt(
"meta_data"),
1100 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
1103 $lng->txt(
"export"),
1104 $this->ctrl->getLinkTargetByClass(
"ilexportgui",
"")
1109 if ($ilAccess->checkAccess(
'edit_permission',
"", $this->object->getRefId())) {
1112 $lng->txt(
"perm_settings"),
1113 $this->ctrl->getLinkTargetByClass(
"ilpermissiongui",
"perm")
1119 string $a_active =
"content"
1121 $ilTabs = $this->
tabs;
1122 $ilAccess = $this->access;
1128 $this->ctrl->getLinkTarget($this,
"showContent")
1131 if ($ilAccess->checkAccess(
"write",
"", $this->requested_ref_id)) {
1134 $lng->txt(
"mcst_manage"),
1135 $this->ctrl->getLinkTarget($this,
"listItems")
1141 $lng->txt(
"mcst_ordering"),
1142 $this->ctrl->getLinkTarget($this,
"editOrder")
1147 $ilTabs->activateSubTab($a_active);
1148 $ilTabs->activateTab(
"content");
1153 $this->editObject();
1158 $ilLocator = $this->locator;
1160 if (is_object($this->
object)) {
1161 $ilLocator->addItem($this->
object->getTitle(), $this->ctrl->getLinkTarget($this,
"showContent"),
"", $this->requested_ref_id);
1165 public static function _goto(
string $a_target): void
1168 $main_tpl =
$DIC->ui()->mainTemplate();
1170 $ilAccess =
$DIC->access();
1172 $ctrl =
$DIC->ctrl();
1174 if ($ilAccess->checkAccess(
"read",
"", $a_target)) {
1175 $ctrl->setParameterByClass(
"ilobjmediacastgui",
"ref_id", $a_target);
1177 $ctrl->redirectByClass([
"ilmediacasthandlergui",
"ilobjmediacastgui"],
"showContent");
1178 } elseif ($ilAccess->checkAccess(
"visible",
"", $a_target)) {
1181 $main_tpl->setOnScreenMessage(
'failure', sprintf(
1182 $lng->txt(
"msg_no_perm_read_item"),
1191 protected static function isAudio(
string $extension): bool
1193 return strpos($extension,
"audio") !==
false;
1218 $this->form_gui->setValuesByPost();
1225 if ($this->form_gui->getInput(
"value_" . $purpose)) {
1226 $input = $this->form_gui->getItemByPostVar(
"label_value_" . $purpose);
1227 $input->setValue($this->form_gui->getInput(
"value_" . $purpose));
1231 $this->form_gui->setValuesByPost();
1232 $tpl->setContent($this->form_gui->getHTML());
1237 $ilTabs = $this->tabs;
1241 $this->checkPermission(
"write");
1242 $ilTabs->activateTab(
"edit_content");
1244 $this->addContentSubTabs(
"sorting");
1247 switch ($this->
object->getOrder()) {
1251 $this->listItemsObject();
1261 $table_gui->setTitle(
$lng->txt(
"mcst_media_cast"));
1262 $table_gui->setData($this->
object->getSortedItemsArray());
1264 $table_gui->addCommandButton(
"saveOrder",
$lng->txt(
"mcst_save_order"));
1266 $tpl->setContent($table_gui->getHTML());
1273 $ids = $this->mc_request->getItemIds();
1277 foreach (array_keys($ids) as
$id) {
1280 $this->
object->saveOrder($items);
1282 $this->tpl->setOnScreenMessage(
'success',
$lng->txt(
"settings_saved"),
true);
1283 $this->
ctrl->redirect($this,
"editOrder");
1293 $ilUser = $this->user;
1294 $ilTabs = $this->tabs;
1299 $this->
object->getRefId(),
1300 $this->object->getId(),
1308 $this->showGallery();
1310 $view = new \McstImageGalleryGUI($this->
object, $this->tpl, $this->getFeedLink());
1311 $view->setCompletedCallback($this->
ctrl->getLinkTarget(
1313 "handlePlayerCompletedEvent",
1318 $this->
tabs->activateTab(
"content");
1319 $this->addContentSubTabs(
"content");
1320 $tpl->setContent($this->
ctrl->getHTML($view));
1322 $view = new \McstPodcastGUI($this->
object, $this->tpl, $this->getFeedLink());
1323 $this->
tabs->activateTab(
"content");
1324 $this->addContentSubTabs(
"content");
1325 $tpl->setContent($this->
ctrl->getHTML($view));
1327 $ilTabs->activateTab(
"content");
1328 $this->addContentSubTabs(
"content");
1329 $view = new \ILIAS\MediaCast\Presentation\VideoViewGUI($this->
object, $tpl, $this->getFeedLink());
1330 $view->setCompletedCallback($this->
ctrl->getLinkTarget(
1332 "handlePlayerCompletedEvent",
1339 $this->listItemsObject(
true);
1342 $tpl->setPermanentLink($this->
object->getType(), $this->object->getRefId());
1348 $ilTabs = $this->tabs;
1349 $ilCtrl = $this->ctrl;
1351 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
"mcst_view_abandoned"));
1356 $ilCtrl = $this->ctrl;
1357 $this->checkPermission(
"write");
1358 $this->mcst_item =
new ilNewsItem($this->mc_request->getItemId());
1359 $this->video_gui->handleExtractionRequest(
1360 $this->mcst_item->getMobId()
1362 $ilCtrl->redirect($this,
"editCastItem");
1367 if ($this->mc_request->getEvent() ===
"play") {
1368 $player = explode(
"_", $this->mc_request->getPlayer());
1369 $news_id = (
int) $player[1];
1371 $item->increasePlayCounter();
1373 $mob_id = $item->getMobId();
1375 $ilUser = $this->user;
1376 $this->
object->handleLPUpdate($ilUser->getId(), $mob_id);
1384 $mob_id = $this->mc_request->getMobId();
1386 $ilUser = $this->user;
1387 $this->
object->handleLPUpdate($ilUser->getId(), $mob_id);
1394 $this->addMobsToCast($mob_ids,
"",
false);
1399 $this->addMobsToCast([$mob_id], $long_desc);
1404 string $long_desc =
"",
1405 bool $redirect =
true,
1406 bool $extract =
false
1408 $ctrl = $this->
ctrl;
1409 $user = $this->user;
1412 foreach ($mob_ids as $mob_id) {
1413 $item_ids[] = $this->
object->addMobToCast($mob_id, $user->getId(), $long_desc, $extract);
1417 if (count($item_ids) === 1) {
1418 $ctrl->setParameter($this,
"item_id", $item_ids[0]);
1419 $ctrl->redirect($this,
"editCastItem");
1421 $ctrl->redirect($this,
"listItems");
1427 $this->addMobsToCast($mob_ids,
"",
true,
true);
1432 return $this->gui->comments()->commentGUI(
1433 $this->
object->getRefId(),
1434 $this->mc_request->getItemId()
1440 echo $this->getCommentGUI()->getListHTML() .
"<script>ilNotes.init(null);</script>";
1446 $mob_id = $this->mc_request->getMobId();
1447 $html = $this->mob_player_gui->wrapper()->renderComponent(
new ilObjMediaObject($mob_id));
1448 $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, $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 _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