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();
70 $lng = $DIC->language();
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);
402 $this->form_gui->addItem($text_area);
405 if ($enable_internal_rss) {
408 $radio_group->addOption($radio_option);
410 $radio_group->addOption($radio_option);
412 $radio_group->setRequired(
true);
413 $radio_group->setValue($this->
object->getDefaultAccess() == 0 ?
"users" :
"public");
414 $this->form_gui->addItem($radio_group);
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);
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);
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)) {
756 if ($this->form_gui->checkInput()) {
759 $this->mc_request->getItemId()
768 if ($this->form_gui->getInput(
"delete_" . $purpose)) {
769 $mob->removeMediaItem($purpose);
770 $ilLog->write(
"Mcst: deleting purpose $purpose");
773 $media_item = $mob->getMediaItem($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)) {
788 if ($purpose ==
"Standard") {
790 $title = $this->form_gui->getInput(
"title") !=
"" ? $this->form_gui->getInput(
"title") : basename($file);
791 $description = $this->form_gui->getInput(
"description");
793 $mob->setTitle($title);
794 $mob->setDescription($description);
796 $prevpic = $this->form_gui->getInput(
"preview_pic");
797 if ($prevpic[
"size"] > 0) {
798 $mob->uploadVideoPreviewPic($prevpic);
800 $prevpici = $this->form_gui->getItemByPostVar(
"preview_pic");
801 if ($prevpici->getDeletionFlag()) {
802 $mob->removeAdditionalFile($mob->getVideoPreviewPic(
true));
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]);
823 $st_med = $mob->getMediaItem(
"Standard");
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");
848 $ilTabs->activateTab(
"edit_content");
850 $ids = $this->mc_request->getItemIds();
851 if (count($ids) == 0) {
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) {
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");
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");
921 $mc_item =
new ilNewsItem($this->mc_request->getItemId());
925 $m_item = $mob->getMediaItem(
"Standard");
929 $m_item->determineDuration();
930 $dur = $m_item->getDuration();
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");
953 $this->
ctrl->setCmd(
"showSummary");
954 $this->
ctrl->setCmdClass(
"ilinfoscreengui");
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);
1005 if ($ilAccess->checkAccess(
'read',
"", $this->object->getRefId())) {
1009 $this->
ctrl->getLinkTarget($this,
"showContent")
1014 if ($ilAccess->checkAccess(
'visible',
"", $this->object->getRefId()) ||
1015 $ilAccess->checkAccess(
'read',
"", $this->object->getRefId())) {
1019 $this->
ctrl->getLinkTargetByClass(
"ilinfoscreengui",
"showSummary")
1024 if ($ilAccess->checkAccess(
'write',
"", $this->object->getRefId())) {
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())) {
1045 $this->
ctrl->getLinkTargetByClass(
"ilexportgui",
"")
1050 if ($ilAccess->checkAccess(
'edit_permission',
"", $this->object->getRefId())) {
1054 $this->
ctrl->getLinkTargetByClass(
"ilpermissiongui",
"perm")
1060 string $a_active =
"content" 1069 $this->
ctrl->getLinkTarget($this,
"showContent")
1072 if ($ilAccess->checkAccess(
"write",
"", $this->requested_ref_id)) {
1076 $this->
ctrl->getLinkTarget($this,
"listItems")
1083 $this->
ctrl->getLinkTarget($this,
"editOrder")
1088 $ilTabs->activateSubTab($a_active);
1089 $ilTabs->activateTab(
"content");
1098 $ilTabs->activateTab(
"id_settings");
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);
1127 $this->form_gui->addItem($des);
1130 $sh->setTitle(
$lng->
txt(
"rep_activation_availability"));
1131 $this->form_gui->addItem($sh);
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"),
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);
1209 $ti->setMinValue(1);
1211 $vc_opt->addSubItem($ti);
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);
1245 $ch->setChecked((
bool) $public_feed);
1246 $this->form_gui->addItem($ch);
1251 $ni->setMinValue(0);
1252 $ni->setMaxLength(3);
1254 $ni->setInfo($this->
lng->txt(
"news_keep_minimal_x_items_info") .
" (" .
1257 $ch->addSubItem($ni);
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);
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"));
1292 $ilTabs->activateTab(
"id_settings");
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());
1348 if (is_object($this->
object)) {
1353 public static function _goto(
string $a_target): void
1356 $main_tpl = $DIC->ui()->mainTemplate();
1358 $ilAccess = $DIC->access();
1359 $lng = $DIC->language();
1360 $ctrl = $DIC->ctrl();
1362 if ($ilAccess->checkAccess(
"read",
"", $a_target)) {
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();
1429 $ilTabs->activateTab(
"edit_content");
1434 switch ($this->
object->getOrder()) {
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"));
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");
1486 $this->
object->getRefId(),
1487 $this->
object->getId(),
1497 $view = new \McstImageGalleryGUI($this->
object, $this->tpl, $this->
getFeedLink());
1498 $view->setCompletedCallback($this->
ctrl->getLinkTarget(
1500 "handlePlayerCompletedEvent",
1505 $this->
tabs->activateTab(
"content");
1509 $view = new \McstPodcastGUI($this->
object, $this->tpl, $this->
getFeedLink());
1510 $this->
tabs->activateTab(
"content");
1514 $ilTabs->activateTab(
"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",
1545 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
"mcst_view_abandoned"));
1555 $this->mcst_item =
new ilNewsItem($this->mc_request->getItemId());
1559 $sec = $this->mc_request->getSeconds();
1564 $mob->generatePreviewPic(320, 240, $sec);
1565 if ($mob->getVideoPreviewPic() !==
"") {
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);
1622 string $long_desc =
"",
1623 bool $redirect =
true,
1624 bool $extract =
false 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) {
1650 $this->
user->writePref(
1652 $this->mc_request->getAutoplay()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getLastReturnValues()
Get last return values.
redirectByClass( $a_class, string $a_cmd=null, string $a_anchor=null, bool $is_async=false)
initImportForm(string $new_type)
static _lookupRSSPeriod()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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...
redirect(object $a_gui_obj, string $a_cmd=null, string $a_anchor=null, bool $is_async=false)
GUI class for the workflow of copying objects.
$location
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
prepareOutput(bool $show_sub_objects=true)
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
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)
setPlaytime(string $a_playtime)
static _gotoRepositoryNode(int $ref_id, string $cmd="")
setParameterByClass(string $a_class, string $a_parameter, $a_value)
loadLanguageModule(string $a_module)
Load language module.
static checkAccess(int $a_ref_id, bool $a_allow_only_read=true)
check access to learning progress
static _lookupObjId(int $ref_id)
static getASCIIFilename(string $a_filename)
setValue(string $a_value)
static renameExecutables(string $a_dir)
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 supportsImageExtraction(string $a_mime)
Check if mime type supports image extraction.
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...
ilGlobalTemplateInterface $tpl
static _lookup(string $a_type, string $a_setting, int $a_user=0, int $a_block_id=0)
Lookup setting from database.
static _lookupTitle(int $obj_id)
setContent(string $a_html)
Sets content for standard template.
setScreenIdComponent(string $a_comp)
Class ilObjectGUI Basic methods of all Output classes.
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 _write(string $a_type, string $a_setting, string $a_value, int $a_user=0, int $a_block_id=0)
Write setting to database.
ilObjectService $object_service
static moveUploadedFile(string $a_file, string $a_name, string $a_target, bool $a_raise_errors=true, string $a_mode="move_uploaded")
move uploaded file
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
static redirect(string $a_script)
setPermanentLink(string $a_type, ?int $a_id, string $a_append="", string $a_target="", string $a_title="")
Generates and sets a permanent ilias link.
activateTab(string $a_id)
A news item can be created by different sources.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(Container $dic, ilPlugin $plugin)
initCreateForm(string $new_type)
const LP_CONTEXT_REPOSITORY
This class represents a text area property in a property form.
addItem(string $a_title, string $a_link, string $a_frame="", int $a_ref_id=0, ?string $type=null)
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
static enabled()
Checks, whether FFmpeg support is enabled (path is set in the setup)
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
addHeaderAction()
Add header action menu.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
for($i=6; $i< 13; $i++) for($i=1; $i< 13; $i++) $d
static _gotoRepositoryRoot(bool $raise_error=false)
Goto repository root.
static _updateStatus(int $a_obj_id, int $a_usr_id, ?object $a_obj=null, bool $a_percentage=false, bool $a_force_raise=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...