53 bool $a_call_by_reference,
54 bool $a_prepare_output =
true
58 $this->
ctrl = $DIC->ctrl();
59 $this->
lng = $DIC->language();
60 $this->
user = $DIC->user();
61 $this->
tabs = $DIC->tabs();
62 $this->tpl =
$DIC[
"tpl"];
63 $this->
access = $DIC->access();
64 $this->
toolbar = $DIC->toolbar();
66 $this->log =
$DIC[
"ilLog"];
67 $this->
help = $DIC[
"ilHelp"];
68 $this->
locator = $DIC[
"ilLocator"];
69 $ilCtrl =
$DIC->ctrl();
71 $this->mc_request =
$DIC->mediaCast()
82 $ilCtrl->saveParameter($this,
"item_id");
85 $this->purposeSuffixes =
$settings->getPurposeSuffixes();
86 $this->mimeTypes = array();
88 foreach ($mime_types as $mt) {
89 $this->mimeTypes[$mt] = $mt;
92 foreach (MimeType::getExt2MimeMap() as $mt) {
95 asort($this->mimeTypes);
97 $this->mc_manager =
$DIC->mediaCast()->internal()
98 ->domain()->mediaCast();
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) {
143 $this->
ctrl->forwardCommand($creation);
146 case "ilinfoscreengui":
155 $ilTabs->activateTab(
"export");
157 $exp_gui->addFormat(
"xml");
158 $ret = $this->
ctrl->forwardCommand($exp_gui);
162 case 'ilpermissiongui':
163 $ilTabs->activateTab(
"id_permissions");
165 $ret = $this->
ctrl->forwardCommand($perm_gui);
168 case 'ilobjectcopygui':
170 $cp->setType(
'mcst');
171 $this->
ctrl->forwardCommand($cp);
174 case "ilcommonactiondispatchergui":
176 $this->
ctrl->forwardCommand($gui);
179 case "illearningprogressgui":
180 $ilTabs->activateTab(
'learning_progress');
183 $this->
object->getRefId(),
184 $this->mc_request->getUserId() ?:
$ilUser->getId()
186 $this->
ctrl->forwardCommand($new_gui);
187 $this->tabs_gui->setTabActive(
'learning_progress');
190 case "mcstimagegallerygui":
191 $view = new \McstImageGalleryGUI($this->
object, $this->tpl, $this->
getFeedLink());
192 $this->
ctrl->forwardCommand($view);
195 case "mcstpodcastgui":
196 $view = new \McstPodcastGUI($this->
object, $this->tpl, $this->
getFeedLink());
197 $this->
ctrl->forwardCommand($view);
205 if ($cmd !=
"infoScreenObject") {
219 $forms = array(self::CFORM_NEW => $this->
initCreateForm($new_type),
229 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"object_added"),
true);
230 ilUtil::redirect(
"ilias.php?baseClass=ilMediaCastHandlerGUI&ref_id=" . $new_object->
getRefId() .
"&cmd=editSettings");
242 if ($a_presentation_mode) {
243 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
"mcst_view_abandoned"));
247 if ($a_presentation_mode) {
253 $med_items = $this->
object->getSortedItemsArray();
255 if ($a_presentation_mode) {
261 $table_gui->setData($med_items);
263 if ($ilAccess->checkAccess(
"write",
"", $this->requested_ref_id) && !$a_presentation_mode) {
264 if (in_array($this->
object->getViewMode(), [
269 $ilToolbar->addButton(
$lng->
txt(
"add"), $this->ctrl->getLinkTargetByClass(
"ilMediaCreationGUI",
""));
271 $ilToolbar->addButton(
$lng->
txt(
"add"), $this->ctrl->getLinkTarget($this,
"addCastItem"));
274 $table_gui->addMultiCommand(
"confirmDeletionItems",
$lng->
txt(
"delete"));
275 $table_gui->setSelectAllCheckbox(
"item_id");
292 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
293 if ($enable_internal_rss) {
324 $this->mc_request->getItemId()
332 $med = $mob->getMediaItem($p);
333 if (is_object($med)) {
337 $ni->setMaxLength(4);
340 $ilToolbar->addInputItem($ni,
true);
342 $ilToolbar->addFormButton($this->
lng->txt(
"mcst_extract_preview_image"),
"extractPreviewImage");
343 $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
355 foreach ($this->
object->getSortedItemsArray() as $item) {
356 if ($mob_id == $item[
"mob_id"]) {
357 $this->
ctrl->setParameter($this,
"item_id", $item[
"id"]);
358 $this->
ctrl->redirect($this,
"editCastItem");
361 $this->
ctrl->redirect($this,
"listItems");
366 foreach ($this->
object->getSortedItemsArray() as $item) {
367 if ($mob_id == $item[
"mob_id"]) {
370 $mc_item->setTitle($mob->getTitle());
371 $mc_item->setContent($mob->getLongDescription());
384 $ilTabs->activateTab(
"edit_content");
389 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
392 $this->form_gui->setMultipart(
true);
396 $text_input->setMaxLength(200);
397 $this->form_gui->addItem($text_input);
401 $text_area->setRequired(
false);
402 $this->form_gui->addItem($text_area);
405 if ($enable_internal_rss) {
408 $radio_group->addOption($radio_option);
410 $radio_group->addOption($radio_option);
411 $radio_group->setInfo(
$lng->
txt(
"mcst_visibility_info"));
412 $radio_group->setRequired(
true);
413 $radio_group->setValue($this->
object->getDefaultAccess() == 0 ?
"users" :
"public");
414 $this->form_gui->addItem($radio_group);
419 $dur->setInfo(
$lng->
txt(
"mcst_duration_info"));
420 $dur->setShowDays(
false);
421 $dur->setShowHours(
true);
422 $dur->setShowSeconds(
true);
423 $this->form_gui->addItem($dur);
426 if ($purpose ==
"VideoAlternative" &&
427 $a_mode ==
"create") {
432 $section->setTitle(
$lng->
txt(
"mcst_" . strtolower($purpose) .
"_title"));
433 $this->form_gui->addItem($section);
434 if ($a_mode !=
"create") {
437 $label->setPostVar(
"label_value_" . $purpose);
438 $label->setInfo(
$lng->
txt(
"mcst_current_value_info"));
439 $this->form_gui->addItem($label);
440 $this->form_gui->addItem($value);
443 $file->setSuffixes($this->mc_manager->getSuffixesForViewMode(
444 $this->object->getViewMode()
446 $this->form_gui->addItem($file);
448 $text_input->setPattern(
"/https?\:\/\/.+/i");
449 $text_input->setInfo(
$lng->
txt(
"mcst_reference_info"));
450 $this->form_gui->addItem($text_input);
451 if ($purpose !=
"Standard") {
453 $clearCheckBox->setPostVar(
"delete_" . $purpose);
454 $clearCheckBox->setTitle(
$lng->
txt(
"mcst_clear_purpose_title"));
455 $this->form_gui->addItem($clearCheckBox);
460 $this->form_gui->addItem($ne);
475 $pp->setSuffixes(array(
"png",
"jpeg",
"jpg"));
476 $pp->setInfo(
$lng->
txt(
"mcst_preview_picture_info") .
" mp4, mp3, png, jp(e)g, gif");
477 $this->form_gui->addItem($pp);
482 if ($a_mode ==
"create") {
483 $this->form_gui->setTitle(
$lng->
txt(
"mcst_add_new_item"));
484 $this->form_gui->addCommandButton(
"saveCastItem",
$lng->
txt(
"save"));
486 $this->form_gui->setTitle(
$lng->
txt(
"mcst_edit_item"));
487 $this->form_gui->addCommandButton(
"updateCastItem",
$lng->
txt(
"save"));
489 $this->form_gui->addCommandButton(
"listItems",
$lng->
txt(
"cancel"));
490 $this->form_gui->setFormAction($ilCtrl->getFormAction($this,
"saveCastItem"));
502 $this->mc_request->getItemId()
507 $ppic = $mob->getVideoPreviewPic();
509 $i = $this->form_gui->getItemByPostVar(
"preview_pic");
516 $this->mc_request->getItemId()
518 if (count($mediaItems) > 0) {
519 foreach ($mediaItems as $med) {
520 if (!isset($values[
"title"])) {
522 $values[
"title"] = $this->mcst_item->getTitle();
523 $values[
"description"] = $this->mcst_item->getContent();
524 $values[
"visibility"] = $this->mcst_item->getVisibility();
525 $length = explode(
":", $this->mcst_item->getPlaytime());
526 $values[
"duration"] = array(
"hh" => $length[0],
"mm" => $length[1],
"ss" => $length[2]);
529 $values[
"value_" . $med->getPurpose()] = (strlen($med->getLocation()) > 100) ?
"..." . substr($med->getLocation(), strlen($med->getLocation()) - 100) : $med->getLocation();
530 $values[
"label_value_" . $med->getPurpose()] = (strlen($med->getLocation()) > 100) ?
"..." . substr($med->getLocation(), strlen($med->getLocation()) - 100) : $med->getLocation();
531 $values[
"mimetype_" . $med->getPurpose()] = $med->getFormat();
535 if (!isset($values[
"value_" . $purpose])) {
536 $values[
"label_value_" . $purpose] =
$lng->
txt(
"none");
537 $values[
"value_" . $purpose] =
$lng->
txt(
"none");
540 $this->form_gui->setValuesByArray($values);
553 $ilTabs->activateTab(
"edit_content");
557 if (!$this->form_gui->checkInput() ||
558 ($this->form_gui->getInput(
"url_Standard") ==
"" && !$_FILES[
'file_Standard'][
'tmp_name'])) {
559 $this->tpl->setOnScreenMessage(
'failure',
$lng->
txt(
"mcst_input_either_file_or_url"));
571 $title = $this->form_gui->getInput(
"title") !=
"" ? $this->form_gui->getInput(
"title") : basename($file);
572 $description = $this->form_gui->getInput(
"description");
573 $mob->setTitle($title);
574 $mob->setDescription($description);
577 $prevpic = $this->form_gui->getInput(
"preview_pic");
578 if ($prevpic[
"size"] > 0) {
579 $mob->uploadVideoPreviewPic($prevpic);
586 foreach ($this->additionalPurposes as $purpose) {
588 $file_gui = $this->form_gui->getInput(
"file_" . $purpose);
589 $url_gui = $this->form_gui->getInput(
"url_" . $purpose);
590 if ($url_gui || $file_gui[
"size"] > 0) {
597 if ($prevpic[
"size"] == 0) {
600 $mob->generatePreviewPic(320, 240);
608 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
612 $mc_item->setMobId($mob->getId());
614 $mc_item->setContextObjId($this->
object->getId());
615 $mc_item->setContextObjType($this->
object->getType());
616 $mc_item->setUserId(
$ilUser->getId());
617 $mc_item->setPlaytime($duration);
618 $mc_item->setTitle($title);
619 $mc_item->setContent($description);
620 $mc_item->setLimitation(
false);
621 if ($enable_internal_rss) {
622 $mc_item->setVisibility($this->form_gui->getInput(
"visibility"));
624 $mc_item->setVisibility(
"users");
628 $ilCtrl->redirect($this,
"listItems");
634 $duration = isset($this->form_gui)
635 ? $this->form_gui->getInput(
"duration")
636 : array(
"hh" => 0,
"mm" => 0,
"ss" => 0);
638 $duration_str = str_pad($duration[
"hh"], 2,
"0", STR_PAD_LEFT) .
":" .
639 str_pad($duration[
"mm"], 2,
"0", STR_PAD_LEFT) .
":" .
640 str_pad($duration[
"ss"], 2,
"0", STR_PAD_LEFT);
642 if ($duration[
"hh"] == 0 && $duration[
"mm"] == 0 && $duration[
"ss"] == 0) {
646 $duration_str = $this->
object->getPlaytimeForSeconds(
$d);
650 return $duration_str;
662 $mediaItem->setPurpose($purpose);
682 $url_gui = $this->form_gui->getInput(
"url_" . $purpose);
683 $file_gui = $this->form_gui->getInput(
"file_" . $purpose);
686 $file = $this->form_gui->getInput(
"url_" . $purpose);
687 $title = basename($file);
688 $location = $this->form_gui->getInput(
"url_" . $purpose);
689 $locationType =
"Reference";
690 } elseif ($file_gui[
"size"] > 0) {
694 if (!is_dir($mob_dir)) {
697 $dir = LegacyPathHelper::createRelativePath($mob_dir);
698 $old_files = $this->
filesystem->finder()->in([$dir])->exclude([$dir .
'/mob_vpreview.png'])->files();
699 foreach ($old_files as $file) {
705 $file_name = str_replace(
" ",
"_", $file_name);
707 $file = $mob_dir .
"/" . $file_name;
709 $locationType =
"LocalFile";
733 if (($purpose ===
"Standard") && isset($title)) {
745 $ilCtrl = $this->ctrl;
752 $this->checkPermission(
"write");
754 $this->initAddCastItemForm(
"edit");
756 if ($this->form_gui->checkInput()) {
759 $this->mc_request->getItemId()
761 $mob_id = $mc_item->getMobId();
768 if ($this->form_gui->getInput(
"delete_" . $purpose)) {
770 $ilLog->write(
"Mcst: deleting purpose $purpose");
774 $url_gui = $this->form_gui->getInput(
"url_" . $purpose);
775 $file_gui = $this->form_gui->getInput(
"file_" . $purpose);
777 if ($media_item ==
null) {
778 if ($purpose !=
"Standard" &&
779 ($url_gui || $file_gui[
"size"] > 0)) {
782 $file = $this->createMediaItemForPurpose($mob, $purpose);
785 $file = $this->updateMediaItem($mob, $media_item);
788 if ($purpose ==
"Standard") {
789 $duration = $this->getDuration($media_item);
790 $title = $this->form_gui->getInput(
"title") !=
"" ? $this->form_gui->getInput(
"title") : basename($file);
791 $description = $this->form_gui->getInput(
"description");
796 $prevpic = $this->form_gui->getInput(
"preview_pic");
797 if ($prevpic[
"size"] > 0) {
800 $prevpici = $this->form_gui->getItemByPostVar(
"preview_pic");
801 if ($prevpici->getDeletionFlag()) {
816 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
818 $mc_item->setUserId(
$ilUser->getId());
819 if (isset($duration)) {
820 $mc_item->setPlaytime($duration);
821 $dur_arr = explode(
":", $duration);
822 $seconds = ((
int) $dur_arr[0] * 60 * 60) + ((
int) $dur_arr[1] * 60) + ((
int) $dur_arr[2]);
824 $st_med->setDuration($seconds);
827 $mc_item->setTitle($title);
828 $mc_item->setContent($description);
829 if ($enable_internal_rss) {
830 $mc_item->setVisibility($this->form_gui->getInput(
"visibility"));
834 $ilCtrl->redirect($this,
"listItems");
836 $this->populateFormFromPost();
842 $ilCtrl = $this->ctrl;
845 $ilTabs = $this->tabs;
847 $this->checkPermission(
"write");
848 $ilTabs->activateTab(
"edit_content");
850 $ids = $this->mc_request->getItemIds();
851 if (count($ids) == 0) {
852 $this->listItemsObject();
859 $c_gui->setFormAction($ilCtrl->getFormAction($this,
"deleteItems"));
860 $c_gui->setHeaderText(
$lng->txt(
"info_delete_sure"));
861 $c_gui->setCancel(
$lng->txt(
"cancel"),
"listItems");
862 $c_gui->setConfirm(
$lng->txt(
"confirm"),
"deleteItems");
865 foreach ($ids as $item_id) {
875 $tpl->setContent($c_gui->getHTML());
880 $ilCtrl = $this->ctrl;
882 $this->checkPermission(
"write");
885 $ids = $this->mc_request->getItemIds();
886 foreach ($ids as $item_id) {
890 $this->
object->saveOrder(array_map(
function(
$i) {
892 }, $this->
object->readItems()));
893 $ilCtrl->redirect($this,
"listItems");
901 $ilCtrl = $this->ctrl;
904 $this->checkPermission(
"read");
905 $news_item =
new ilNewsItem($this->mc_request->getItemId());
906 $this->
object->handleLPUpdate(
$ilUser->getId(), $news_item->getMobId());
907 if (!$news_item->deliverMobFile(
908 $this->mc_request->getPurpose(),
909 $this->mc_request->getPresentation()
911 $ilCtrl->redirect($this,
"listItems");
918 $ilCtrl = $this->ctrl;
921 $mc_item =
new ilNewsItem($this->mc_request->getItemId());
922 $mob = $mc_item->getMobId();
929 $m_item->determineDuration();
930 $dur = $m_item->getDuration();
932 $mc_item->setPlaytime($this->
object->getPlaytimeForSeconds($dur));
935 $this->tpl->setOnScreenMessage(
'success',
$lng->txt(
"mcst_set_playtime"),
true);
939 $this->tpl->setOnScreenMessage(
'failure',
$lng->txt(
"mcst_unable_to_determin_playtime"),
true);
942 $ilCtrl->redirect($this,
"listItems");
950 if (!$this->checkPermissionBool(
"read")) {
951 $this->checkPermission(
"visible");
953 $this->
ctrl->setCmd(
"showSummary");
954 $this->
ctrl->setCmdClass(
"ilinfoscreengui");
960 $ilTabs = $this->tabs;
962 $ilTabs->activateTab(
"id_info");
964 if (!$this->checkPermissionBool(
"read")) {
965 $this->checkPermission(
"visible");
970 $info->enablePrivateNotes();
973 $this->
lng->loadLanguageModule(
"meta");
974 $this->
lng->loadLanguageModule(
"mcst");
975 $med_items = $this->
object->getItemsArray();
976 $info->addSection($this->
lng->txt(
"meta_general"));
978 $this->
lng->txt(
"mcst_nr_items"),
982 if (count($med_items) > 0) {
983 $cur = current($med_items);
989 $info->addProperty($this->
lng->txt(
"mcst_last_submission"), $last);
992 $this->
ctrl->forwardCommand($info);
997 $ilAccess = $this->access;
998 $ilTabs = $this->tabs;
1000 $ilHelp = $this->help;
1002 $ilHelp->setScreenIdComponent(
"mcst");
1005 if ($ilAccess->checkAccess(
'read',
"", $this->object->getRefId())) {
1008 $lng->txt(
"content"),
1009 $this->ctrl->getLinkTarget($this,
"showContent")
1014 if ($ilAccess->checkAccess(
'visible',
"", $this->object->getRefId()) ||
1015 $ilAccess->checkAccess(
'read',
"", $this->object->getRefId())) {
1018 $lng->txt(
"info_short"),
1019 $this->ctrl->getLinkTargetByClass(
"ilinfoscreengui",
"showSummary")
1024 if ($ilAccess->checkAccess(
'write',
"", $this->object->getRefId())) {
1027 $lng->txt(
"settings"),
1028 $this->ctrl->getLinkTarget($this,
"editSettings")
1034 'learning_progress',
1035 $lng->txt(
'learning_progress'),
1036 $this->ctrl->getLinkTargetByClass(array(__CLASS__,
'illearningprogressgui'),
'')
1041 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
1044 $lng->txt(
"export"),
1045 $this->ctrl->getLinkTargetByClass(
"ilexportgui",
"")
1050 if ($ilAccess->checkAccess(
'edit_permission',
"", $this->object->getRefId())) {
1053 $lng->txt(
"perm_settings"),
1054 $this->ctrl->getLinkTargetByClass(
"ilpermissiongui",
"perm")
1060 string $a_active =
"content"
1062 $ilTabs = $this->
tabs;
1063 $ilAccess = $this->access;
1069 $this->ctrl->getLinkTarget($this,
"showContent")
1072 if ($ilAccess->checkAccess(
"write",
"", $this->requested_ref_id)) {
1075 $lng->txt(
"mcst_manage"),
1076 $this->ctrl->getLinkTarget($this,
"listItems")
1082 $lng->txt(
"mcst_ordering"),
1083 $this->ctrl->getLinkTarget($this,
"editOrder")
1088 $ilTabs->activateSubTab($a_active);
1089 $ilTabs->activateTab(
"content");
1095 $ilTabs = $this->tabs;
1097 $this->checkPermission(
"write");
1098 $ilTabs->activateTab(
"id_settings");
1100 $this->initSettingsForm();
1101 $tpl->setContent($this->form_gui->getHTML());
1110 $ilCtrl = $this->ctrl;
1111 $obj_service = $this->object_service;
1113 $lng->loadLanguageModule(
"mcst");
1116 $this->form_gui->setTitle(
$lng->txt(
"mcst_settings"));
1120 $tit->setValue($this->
object->getTitle());
1121 $tit->setRequired(
true);
1122 $this->form_gui->addItem($tit);
1126 $des->setValue($this->
object->getLongDescription());
1127 $this->form_gui->addItem($des);
1130 $sh->setTitle(
$lng->txt(
"rep_activation_availability"));
1131 $this->form_gui->addItem($sh);
1135 $online->setChecked($this->
object->getOnline());
1136 $this->form_gui->addItem($online);
1140 $sh->setTitle(
$lng->txt(
"obj_presentation"));
1141 $this->form_gui->addItem($sh);
1144 $obj_service->commonSettings()->legacyForm($this->form_gui, $this->
object)->addTileImage();
1149 $lng->txt(
"mcst_ordering_title"),
1153 $lng->txt(
"mcst_ordering_creation_date_asc"),
1157 $lng->txt(
"mcst_ordering_creation_date_desc"),
1161 $lng->txt(
"mcst_ordering_manual"),
1164 $sort->setValue($this->
object->getOrder());
1165 $this->form_gui->addItem($sort);
1178 $lng->txt(
"mcst_img_gallery"),
1182 $lng->txt(
"mcst_podcast"),
1186 $lng->txt(
"mcst_video_cast"),
1191 $si->setValue($this->
object->getViewMode());
1192 $this->form_gui->addItem($si);
1201 $si->setInfo(
$lng->txt(
"mcst_autoplay_info"));
1202 $si->setOptions($options);
1203 $si->setValue($this->
object->getAutoplayMode());
1204 $vc_opt->addSubItem($si);
1208 $ti->setValue(max(1, $this->
object->getNumberInitialVideos()));
1209 $ti->setMinValue(1);
1211 $vc_opt->addSubItem($ti);
1215 $downloadable->setChecked($this->
object->getDownloadable());
1216 $downloadable->setInfo(
$lng->txt(
"mcst_downloadable_info"));
1217 $this->form_gui->addItem($downloadable);
1220 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
1223 if ($enable_internal_rss) {
1226 $sh->setTitle(
$lng->txt(
"mcst_webfeed"));
1227 $this->form_gui->addItem($sh);
1231 $radio_option->setInfo(
$lng->txt(
"news_news_item_def_visibility_users_info"));
1232 $radio_group->addOption($radio_option);
1234 $radio_option->setInfo(
$lng->txt(
"news_news_item_def_visibility_public_info"));
1235 $radio_group->addOption($radio_option);
1236 $radio_group->setRequired(
false);
1237 $radio_group->setValue($this->
object->getDefaultAccess());
1238 #$ch->addSubItem($radio_group);
1239 $this->form_gui->addItem($radio_group);
1244 $ch->setInfo(
$lng->txt(
"news_public_feed_info"));
1245 $ch->setChecked((
bool) $public_feed);
1246 $this->form_gui->addItem($ch);
1250 $ni->setMaxValue(100);
1251 $ni->setMinValue(0);
1252 $ni->setMaxLength(3);
1254 $ni->setInfo($this->
lng->txt(
"news_keep_minimal_x_items_info") .
" (" .
1257 $ch->addSubItem($ni);
1261 $incl_files->setChecked($this->
object->getPublicFiles());
1262 $incl_files->setInfo(
$lng->txt(
"mcst_incl_files_in_rss_info"));
1263 #$ch->addSubItem($incl_files);
1264 $this->form_gui->addItem($incl_files);
1269 $sh->setTitle(
$lng->txt(
"learning_progress"));
1270 $this->form_gui->addItem($sh);
1274 $auto_lp->setChecked($this->
object->getNewItemsInLearningProgress());
1275 $auto_lp->setInfo(
$lng->txt(
"mcst_new_items_det_lp_info"));
1276 $this->form_gui->addItem($auto_lp);
1281 $this->form_gui->addCommandButton(
"saveSettings",
$lng->txt(
"save"));
1282 $this->form_gui->setFormAction($ilCtrl->getFormAction($this,
"saveSettings"));
1287 $ilCtrl = $this->ctrl;
1288 $ilTabs = $this->tabs;
1289 $obj_service = $this->object_service;
1291 $this->checkPermission(
"write");
1292 $ilTabs->activateTab(
"id_settings");
1294 $this->initSettingsForm();
1295 if ($this->form_gui->checkInput()) {
1297 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
1299 $this->
object->setTitle($this->form_gui->getInput(
"title"));
1300 $this->
object->setDescription($this->form_gui->getInput(
"description"));
1301 $this->
object->setOnline($this->form_gui->getInput(
"online"));
1302 $this->
object->setDownloadable($this->form_gui->getInput(
"downloadable"));
1303 $this->
object->setOrder($this->form_gui->getInput(
"order"));
1304 $this->
object->setViewMode($this->form_gui->getInput(
"viewmode"));
1305 $this->
object->setAutoplayMode((
int) $this->form_gui->getInput(
"autoplaymode"));
1306 $this->
object->setNumberInitialVideos((
int) $this->form_gui->getInput(
"nr_videos"));
1307 $this->
object->setNewItemsInLearningProgress((
int) $this->form_gui->getInput(
"auto_det_lp"));
1310 $obj_service->commonSettings()->legacyForm($this->form_gui, $this->
object)->saveTileImage();
1312 if ($enable_internal_rss) {
1313 $this->
object->setPublicFiles($this->form_gui->getInput(
"public_files"));
1314 $this->
object->setDefaultAccess($this->form_gui->getInput(
"defaultaccess"));
1316 $this->
object->update();
1318 if ($enable_internal_rss) {
1322 $this->form_gui->getInput(
"extra_feed"),
1324 $this->object->getId()
1330 $this->form_gui->getInput(
"keep_rss_min"),
1332 $this->object->getId()
1336 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"msg_obj_modified"),
true);
1337 $ilCtrl->redirect($this,
"editSettings");
1339 $this->form_gui->setValuesByPost();
1340 $this->tpl->setContent($this->form_gui->getHTML());
1346 $ilLocator = $this->locator;
1348 if (is_object($this->
object)) {
1349 $ilLocator->addItem($this->
object->getTitle(), $this->ctrl->getLinkTarget($this,
"listItems"),
"", $this->requested_ref_id);
1353 public static function _goto(
string $a_target): void
1356 $main_tpl =
$DIC->ui()->mainTemplate();
1358 $ilAccess =
$DIC->access();
1360 $ctrl =
$DIC->ctrl();
1362 if ($ilAccess->checkAccess(
"read",
"", $a_target)) {
1363 $ctrl->setParameterByClass(
"ilobjmediacastgui",
"ref_id", $a_target);
1364 $ctrl->redirectByClass([
"ilmediacasthandlergui",
"ilobjmediacastgui"],
"showContent");
1365 } elseif ($ilAccess->checkAccess(
"visible",
"", $a_target)) {
1368 $main_tpl->setOnScreenMessage(
'failure', sprintf(
1369 $lng->txt(
"msg_no_perm_read_item"),
1378 protected static function isAudio(
string $extension): bool
1380 return strpos($extension,
"audio") !==
false;
1405 $this->form_gui->setValuesByPost();
1412 if ($this->form_gui->getInput(
"value_" . $purpose)) {
1413 $input = $this->form_gui->getItemByPostVar(
"label_value_" . $purpose);
1414 $input->setValue($this->form_gui->getInput(
"value_" . $purpose));
1418 $this->form_gui->setValuesByPost();
1419 $tpl->setContent($this->form_gui->getHTML());
1424 $ilTabs = $this->tabs;
1428 $this->checkPermission(
"write");
1429 $ilTabs->activateTab(
"edit_content");
1431 $this->addContentSubTabs(
"sorting");
1434 switch ($this->
object->getOrder()) {
1438 $this->listItemsObject();
1448 $table_gui->setTitle(
$lng->txt(
"mcst_media_cast"));
1449 $table_gui->setData($this->
object->getSortedItemsArray());
1451 $table_gui->addCommandButton(
"saveOrder",
$lng->txt(
"mcst_save_order"));
1453 $tpl->setContent($table_gui->getHTML());
1460 $ids = $this->mc_request->getItemIds();
1464 foreach (array_keys($ids) as
$id) {
1467 $this->
object->saveOrder($items);
1469 $this->tpl->setOnScreenMessage(
'success',
$lng->txt(
"settings_saved"),
true);
1470 $this->
ctrl->redirect($this,
"editOrder");
1481 $ilTabs = $this->tabs;
1486 $this->
object->getRefId(),
1487 $this->object->getId(),
1495 $this->showGallery();
1497 $view = new \McstImageGalleryGUI($this->
object, $this->tpl, $this->getFeedLink());
1498 $view->setCompletedCallback($this->
ctrl->getLinkTarget(
1500 "handlePlayerCompletedEvent",
1505 $this->
tabs->activateTab(
"content");
1506 $this->addContentSubTabs(
"content");
1507 $tpl->setContent($this->
ctrl->getHTML($view));
1509 $view = new \McstPodcastGUI($this->
object, $this->tpl, $this->getFeedLink());
1510 $this->
tabs->activateTab(
"content");
1511 $this->addContentSubTabs(
"content");
1512 $tpl->setContent($this->
ctrl->getHTML($view));
1514 $ilTabs->activateTab(
"content");
1515 $this->addContentSubTabs(
"content");
1516 $view = new \ILIAS\MediaCast\Presentation\VideoViewGUI($this->
object,
$tpl, $this->getFeedLink());
1517 $view->setCompletedCallback($this->
ctrl->getLinkTarget(
1519 "handlePlayerCompletedEvent",
1524 $view->setAutoplayCallback($this->
ctrl->getLinkTarget(
1526 "handleAutoplayTrigger",
1533 $this->listItemsObject(
true);
1536 $tpl->setPermanentLink($this->
object->getType(), $this->object->getRefId());
1542 $ilTabs = $this->tabs;
1543 $ilCtrl = $this->ctrl;
1545 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
"mcst_view_abandoned"));
1550 $ilCtrl = $this->ctrl;
1553 $this->checkPermission(
"write");
1555 $this->mcst_item =
new ilNewsItem($this->mc_request->getItemId());
1559 $sec = $this->mc_request->getSeconds();
1564 $mob->generatePreviewPic(320, 240, $sec);
1566 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
"mcst_image_extracted"),
true);
1568 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"mcst_no_extraction_possible"),
true);
1573 $add = (is_array($ret) && count($ret) > 0)
1574 ?
"<br />" . implode(
"<br />", $ret)
1577 $this->tpl->setOnScreenMessage(
'failure',
$e->getMessage() . $add,
true);
1580 $ilCtrl->redirect($this,
"editCastItem");
1585 if ($this->mc_request->getEvent() ===
"play") {
1586 $player = explode(
"_", $this->mc_request->getPlayer());
1587 $news_id = (
int) $player[1];
1589 $item->increasePlayCounter();
1591 $mob_id = $item->getMobId();
1594 $this->
object->handleLPUpdate(
$ilUser->getId(), $mob_id);
1602 $mob_id = $this->mc_request->getMobId();
1605 $this->
object->handleLPUpdate(
$ilUser->getId(), $mob_id);
1612 $this->addMobsToCast($mob_ids,
"",
false);
1617 $this->addMobsToCast([$mob_id], $long_desc);
1622 string $long_desc =
"",
1623 bool $redirect =
true,
1624 bool $extract =
false
1626 $ctrl = $this->
ctrl;
1627 $user = $this->user;
1630 foreach ($mob_ids as $mob_id) {
1631 $item_ids[] = $this->
object->addMobToCast($mob_id, $user->getId(), $long_desc, $extract);
1635 if (count($item_ids) === 1) {
1636 $ctrl->setParameter($this,
"item_id", $item_ids[0]);
1637 $ctrl->redirect($this,
"editCastItem");
1639 $ctrl->redirect($this,
"listItems");
1645 $this->addMobsToCast($mob_ids,
"",
true,
true);
1650 $this->
user->writePref(
1652 $this->mc_request->getAutoplay()
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
$location
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class FileNotFoundException.
static _write(string $a_type, string $a_setting, string $a_value, int $a_user=0, int $a_block_id=0)
Write setting to database.
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)
@classDescription Date and time handling
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static enabled()
Checks, whether FFmpeg support is enabled (path is set in the setup)
static getLastReturnValues()
Get last return values.
static supportsImageExtraction(string $a_mime)
Check if mime type supports image extraction.
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
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Component logger with individual log levels by component id.
A news item can be created by different sources.
static _lookupRSSPeriod()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
GUI class for the workflow of copying objects.
Class ilObjectGUI Basic methods of all Output classes.
initImportForm(string $new_type)
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.
fillCloneTemplate(?string $tpl_name, string $type)
Fill object clone template This method can be called from any object GUI class that wants to offer ob...
static _gotoRepositoryNode(int $ref_id, string $cmd="")
prepareOutput(bool $show_sub_objects=true)
initCreateForm(string $new_type)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupObjId(int $ref_id)
static _lookupTitle(int $obj_id)
setDescription(string $desc)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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 $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
static redirect(string $a_script)
for( $i=6;$i< 13;$i++) for($i=1; $i< 13; $i++) $d
setContent(string $a_html)
Sets content for standard template.
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc