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":
112 $this->
ctrl->setReturn($this,
"listItems");
113 $ilTabs->activateTab(
"content");
116 switch ($this->
object->getViewMode()) {
129 },
function ($mob_id, $long_desc) {
131 },
function ($mob_ids) {
133 },
function ($mob_id) {
135 },
function ($mob_id) {
141 $this->
ctrl->forwardCommand($creation);
144 case "ilinfoscreengui":
153 $ilTabs->activateTab(
"export");
155 $exp_gui->addFormat(
"xml");
156 $ret = $this->
ctrl->forwardCommand($exp_gui);
160 case 'ilpermissiongui':
161 $ilTabs->activateTab(
"id_permissions");
163 $ret = $this->
ctrl->forwardCommand($perm_gui);
166 case 'ilobjectcopygui':
168 $cp->setType(
'mcst');
169 $this->
ctrl->forwardCommand($cp);
172 case "ilcommonactiondispatchergui":
174 $this->
ctrl->forwardCommand($gui);
177 case "illearningprogressgui":
178 $ilTabs->activateTab(
'learning_progress');
181 $this->
object->getRefId(),
182 $this->mc_request->getUserId() ?:
$ilUser->getId()
184 $this->
ctrl->forwardCommand($new_gui);
185 $this->tabs_gui->setTabActive(
'learning_progress');
188 case "mcstimagegallerygui":
189 $view = new \McstImageGalleryGUI($this->
object, $this->tpl, $this->
getFeedLink());
190 $this->
ctrl->forwardCommand($view);
193 case "mcstpodcastgui":
194 $view = new \McstPodcastGUI($this->
object, $this->tpl, $this->
getFeedLink());
195 $this->
ctrl->forwardCommand($view);
203 if ($cmd !=
"infoScreenObject") {
217 $forms = array(self::CFORM_NEW => $this->
initCreateForm($new_type),
227 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"object_added"),
true);
228 ilUtil::redirect(
"ilias.php?baseClass=ilMediaCastHandlerGUI&ref_id=" . $new_object->
getRefId() .
"&cmd=editSettings");
240 if ($a_presentation_mode) {
241 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
"mcst_view_abandoned"));
245 if ($a_presentation_mode) {
251 $med_items = $this->
object->getSortedItemsArray();
253 if ($a_presentation_mode) {
259 $table_gui->setData($med_items);
261 if ($ilAccess->checkAccess(
"write",
"", $this->requested_ref_id) && !$a_presentation_mode) {
262 if (in_array($this->
object->getViewMode(), [
267 $ilToolbar->addButton(
$lng->
txt(
"add"), $this->
ctrl->getLinkTargetByClass(
"ilMediaCreationGUI",
""));
269 $ilToolbar->addButton(
$lng->
txt(
"add"), $this->
ctrl->getLinkTarget($this,
"addCastItem"));
272 $table_gui->addMultiCommand(
"confirmDeletionItems",
$lng->
txt(
"delete"));
273 $table_gui->setSelectAllCheckbox(
"item_id");
290 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
291 if ($enable_internal_rss) {
322 $this->mc_request->getItemId()
330 $med = $mob->getMediaItem($p);
331 if (is_object($med)) {
335 $ni->setMaxLength(4);
338 $ilToolbar->addInputItem($ni,
true);
340 $ilToolbar->addFormButton($this->
lng->txt(
"mcst_extract_preview_image"),
"extractPreviewImage");
341 $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
353 foreach ($this->
object->getSortedItemsArray() as $item) {
354 if ($mob_id == $item[
"mob_id"]) {
355 $this->
ctrl->setParameter($this,
"item_id", $item[
"id"]);
356 $this->
ctrl->redirect($this,
"editCastItem");
359 $this->
ctrl->redirect($this,
"listItems");
364 foreach ($this->
object->getSortedItemsArray() as $item) {
365 if ($mob_id == $item[
"mob_id"]) {
368 $mc_item->setTitle($mob->getTitle());
369 $mc_item->setContent($mob->getLongDescription());
382 $ilTabs->activateTab(
"edit_content");
387 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
390 $this->form_gui->setMultipart(
true);
394 $text_input->setMaxLength(200);
395 $this->form_gui->addItem($text_input);
400 $this->form_gui->addItem($text_area);
403 if ($enable_internal_rss) {
406 $radio_group->addOption($radio_option);
408 $radio_group->addOption($radio_option);
410 $radio_group->setRequired(
true);
411 $radio_group->setValue($this->
object->getDefaultAccess() == 0 ?
"users" :
"public");
412 $this->form_gui->addItem($radio_group);
418 $dur->setShowDays(
false);
419 $dur->setShowHours(
true);
420 $dur->setShowSeconds(
true);
421 $this->form_gui->addItem($dur);
424 if ($purpose ==
"VideoAlternative" &&
425 $a_mode ==
"create") {
430 $section->setTitle(
$lng->
txt(
"mcst_" . strtolower($purpose) .
"_title"));
431 $this->form_gui->addItem($section);
432 if ($a_mode !=
"create") {
435 $label->
setPostVar(
"label_value_" . $purpose);
436 $label->setInfo(
$lng->
txt(
"mcst_current_value_info"));
437 $this->form_gui->addItem($label);
438 $this->form_gui->addItem($value);
441 $file->
setSuffixes($this->mc_manager->getSuffixesForViewMode(
442 $this->object->getViewMode()
444 $this->form_gui->addItem($file);
447 $text_input->setInfo(
$lng->
txt(
"mcst_reference_info"));
448 $this->form_gui->addItem($text_input);
449 if ($purpose !=
"Standard") {
451 $clearCheckBox->setPostVar(
"delete_" . $purpose);
452 $clearCheckBox->setTitle(
$lng->
txt(
"mcst_clear_purpose_title"));
453 $this->form_gui->addItem($clearCheckBox);
458 $this->form_gui->addItem($ne);
474 $pp->setInfo(
$lng->
txt(
"mcst_preview_picture_info") .
" mp4, mp3, png, jp(e)g, gif");
475 $this->form_gui->addItem($pp);
480 if ($a_mode ==
"create") {
481 $this->form_gui->setTitle(
$lng->
txt(
"mcst_add_new_item"));
482 $this->form_gui->addCommandButton(
"saveCastItem",
$lng->
txt(
"save"));
484 $this->form_gui->setTitle(
$lng->
txt(
"mcst_edit_item"));
485 $this->form_gui->addCommandButton(
"updateCastItem",
$lng->
txt(
"save"));
487 $this->form_gui->addCommandButton(
"listItems",
$lng->
txt(
"cancel"));
488 $this->form_gui->setFormAction($ilCtrl->getFormAction($this,
"saveCastItem"));
500 $this->mc_request->getItemId()
505 $ppic = $mob->getVideoPreviewPic();
507 $i = $this->form_gui->getItemByPostVar(
"preview_pic");
514 $this->mc_request->getItemId()
516 if (count($mediaItems) > 0) {
517 foreach ($mediaItems as $med) {
518 if (!isset($values[
"title"])) {
520 $values[
"title"] = $this->mcst_item->getTitle();
521 $values[
"description"] = $this->mcst_item->getContent();
522 $values[
"visibility"] = $this->mcst_item->getVisibility();
523 $length = explode(
":", $this->mcst_item->getPlaytime());
524 $values[
"duration"] = array(
"hh" => $length[0],
"mm" => $length[1],
"ss" => $length[2]);
527 $values[
"value_" . $med->getPurpose()] = (strlen($med->getLocation()) > 100) ?
"..." . substr($med->getLocation(), strlen($med->getLocation()) - 100) : $med->getLocation();
528 $values[
"label_value_" . $med->getPurpose()] = (strlen($med->getLocation()) > 100) ?
"..." . substr($med->getLocation(), strlen($med->getLocation()) - 100) : $med->getLocation();
529 $values[
"mimetype_" . $med->getPurpose()] = $med->getFormat();
533 if (!isset($values[
"value_" . $purpose])) {
534 $values[
"label_value_" . $purpose] =
$lng->
txt(
"none");
535 $values[
"value_" . $purpose] =
$lng->
txt(
"none");
538 $this->form_gui->setValuesByArray($values);
551 $ilTabs->activateTab(
"edit_content");
555 if (!$this->form_gui->checkInput() ||
556 ($this->form_gui->getInput(
"url_Standard") ==
"" && !$_FILES[
'file_Standard'][
'tmp_name'])) {
557 $this->tpl->setOnScreenMessage(
'failure',
$lng->
txt(
"mcst_input_either_file_or_url"));
569 $title = $this->form_gui->getInput(
"title") !=
"" ? $this->form_gui->getInput(
"title") : basename($file);
570 $description = $this->form_gui->getInput(
"description");
571 $mob->setTitle($title);
572 $mob->setDescription($description);
575 $prevpic = $this->form_gui->getInput(
"preview_pic");
576 if ($prevpic[
"size"] > 0) {
577 $mob->uploadVideoPreviewPic($prevpic);
584 foreach ($this->additionalPurposes as $purpose) {
586 $file_gui = $this->form_gui->getInput(
"file_" . $purpose);
587 $url_gui = $this->form_gui->getInput(
"url_" . $purpose);
588 if ($url_gui || $file_gui[
"size"] > 0) {
595 if ($prevpic[
"size"] == 0) {
598 $mob->generatePreviewPic(320, 240);
606 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
610 $mc_item->setMobId($mob->getId());
612 $mc_item->setContextObjId($this->
object->getId());
613 $mc_item->setContextObjType($this->
object->getType());
614 $mc_item->setUserId(
$ilUser->getId());
615 $mc_item->setPlaytime($duration);
616 $mc_item->setTitle($title);
617 $mc_item->setContent($description);
618 $mc_item->setLimitation(
false);
619 if ($enable_internal_rss) {
620 $mc_item->setVisibility($this->form_gui->getInput(
"visibility"));
622 $mc_item->setVisibility(
"users");
626 $ilCtrl->redirect($this,
"listItems");
632 $duration = isset($this->form_gui)
633 ? $this->form_gui->getInput(
"duration")
634 : array(
"hh" => 0,
"mm" => 0,
"ss" => 0);
636 $duration_str = str_pad($duration[
"hh"], 2,
"0", STR_PAD_LEFT) .
":" .
637 str_pad($duration[
"mm"], 2,
"0", STR_PAD_LEFT) .
":" .
638 str_pad($duration[
"ss"], 2,
"0", STR_PAD_LEFT);
640 if ($duration[
"hh"] == 0 && $duration[
"mm"] == 0 && $duration[
"ss"] == 0) {
644 $duration_str = $this->
object->getPlaytimeForSeconds(
$d);
648 return $duration_str;
660 $mediaItem->setPurpose($purpose);
680 $url_gui = $this->form_gui->getInput(
"url_" . $purpose);
681 $file_gui = $this->form_gui->getInput(
"file_" . $purpose);
684 $file = $this->form_gui->getInput(
"url_" . $purpose);
685 $title = basename($file);
686 $location = $this->form_gui->getInput(
"url_" . $purpose);
687 $locationType =
"Reference";
688 } elseif ($file_gui[
"size"] > 0) {
692 if (!is_dir($mob_dir)) {
695 $dir = LegacyPathHelper::createRelativePath($mob_dir);
696 $old_files = $this->
filesystem->finder()->in([$dir])->exclude([$dir .
'/mob_vpreview.png'])->files();
697 foreach ($old_files as $file) {
703 $file_name = str_replace(
" ",
"_", $file_name);
705 $file = $mob_dir .
"/" . $file_name;
707 $locationType =
"LocalFile";
731 if (($purpose ===
"Standard") && isset($title)) {
754 if ($this->form_gui->checkInput()) {
757 $this->mc_request->getItemId()
766 if ($this->form_gui->getInput(
"delete_" . $purpose)) {
767 $mob->removeMediaItem($purpose);
768 $ilLog->write(
"Mcst: deleting purpose $purpose");
771 $media_item = $mob->getMediaItem($purpose);
772 $url_gui = $this->form_gui->getInput(
"url_" . $purpose);
773 $file_gui = $this->form_gui->getInput(
"file_" . $purpose);
775 if ($media_item == null) {
776 if ($purpose !=
"Standard" &&
777 ($url_gui || $file_gui[
"size"] > 0)) {
786 if ($purpose ==
"Standard") {
788 $title = $this->form_gui->getInput(
"title") !=
"" ? $this->form_gui->getInput(
"title") : basename($file);
789 $description = $this->form_gui->getInput(
"description");
791 $mob->setTitle($title);
792 $mob->setDescription($description);
794 $prevpic = $this->form_gui->getInput(
"preview_pic");
795 if ($prevpic[
"size"] > 0) {
796 $mob->uploadVideoPreviewPic($prevpic);
798 $prevpici = $this->form_gui->getItemByPostVar(
"preview_pic");
799 if ($prevpici->getDeletionFlag()) {
800 $mob->removeAdditionalFile($mob->getVideoPreviewPic(
true));
814 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
816 $mc_item->setUserId(
$ilUser->getId());
817 if (isset($duration)) {
818 $mc_item->setPlaytime($duration);
819 $dur_arr = explode(
":", $duration);
820 $seconds = ((
int) $dur_arr[0] * 60 * 60) + ((
int) $dur_arr[1] * 60) + ((
int) $dur_arr[2]);
821 $st_med = $mob->getMediaItem(
"Standard");
822 $st_med->setDuration($seconds);
825 $mc_item->setTitle($title);
826 $mc_item->setContent($description);
827 if ($enable_internal_rss) {
828 $mc_item->setVisibility($this->form_gui->getInput(
"visibility"));
832 $ilCtrl->redirect($this,
"listItems");
846 $ilTabs->activateTab(
"edit_content");
848 $ids = $this->mc_request->getItemIds();
849 if (count($ids) == 0) {
857 $c_gui->setFormAction($ilCtrl->getFormAction($this,
"deleteItems"));
858 $c_gui->setHeaderText(
$lng->
txt(
"info_delete_sure"));
859 $c_gui->setCancel(
$lng->
txt(
"cancel"),
"listItems");
860 $c_gui->setConfirm(
$lng->
txt(
"confirm"),
"deleteItems");
863 foreach ($ids as $item_id) {
883 $ids = $this->mc_request->getItemIds();
884 foreach ($ids as $item_id) {
888 $this->
object->saveOrder(array_map(
function(
$i) {
890 }, $this->
object->readItems()));
891 $ilCtrl->redirect($this,
"listItems");
903 $news_item =
new ilNewsItem($this->mc_request->getItemId());
904 $this->
object->handleLPUpdate(
$ilUser->getId(), $news_item->getMobId());
905 if (!$news_item->deliverMobFile(
906 $this->mc_request->getPurpose(),
907 $this->mc_request->getPresentation()
909 $ilCtrl->redirect($this,
"listItems");
919 $mc_item =
new ilNewsItem($this->mc_request->getItemId());
923 $m_item = $mob->getMediaItem(
"Standard");
927 $m_item->determineDuration();
928 $dur = $m_item->getDuration();
933 $this->tpl->setOnScreenMessage(
'success',
$lng->
txt(
"mcst_set_playtime"),
true);
937 $this->tpl->setOnScreenMessage(
'failure',
$lng->
txt(
"mcst_unable_to_determin_playtime"),
true);
940 $ilCtrl->redirect($this,
"listItems");
951 $this->
ctrl->setCmd(
"showSummary");
952 $this->
ctrl->setCmdClass(
"ilinfoscreengui");
968 $info->enablePrivateNotes();
971 $this->
lng->loadLanguageModule(
"meta");
972 $this->
lng->loadLanguageModule(
"mcst");
973 $med_items = $this->
object->getItemsArray();
974 $info->addSection($this->
lng->txt(
"meta_general"));
976 $this->
lng->txt(
"mcst_nr_items"),
980 if (count($med_items) > 0) {
981 $cur = current($med_items);
987 $info->addProperty($this->
lng->txt(
"mcst_last_submission"), $last);
990 $this->
ctrl->forwardCommand($info);
1003 if ($ilAccess->checkAccess(
'read',
"", $this->object->getRefId())) {
1007 $this->
ctrl->getLinkTarget($this,
"showContent")
1012 if ($ilAccess->checkAccess(
'visible',
"", $this->object->getRefId()) ||
1013 $ilAccess->checkAccess(
'read',
"", $this->object->getRefId())) {
1017 $this->
ctrl->getLinkTargetByClass(
"ilinfoscreengui",
"showSummary")
1022 if ($ilAccess->checkAccess(
'write',
"", $this->object->getRefId())) {
1026 $this->
ctrl->getLinkTarget($this,
"editSettings")
1032 'learning_progress',
1033 $lng->
txt(
'learning_progress'),
1034 $this->
ctrl->getLinkTargetByClass(array(__CLASS__,
'illearningprogressgui'),
'')
1039 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
1043 $this->
ctrl->getLinkTargetByClass(
"ilexportgui",
"")
1048 if ($ilAccess->checkAccess(
'edit_permission',
"", $this->object->getRefId())) {
1052 $this->
ctrl->getLinkTargetByClass(
"ilpermissiongui",
"perm")
1058 string $a_active =
"content" 1067 $this->
ctrl->getLinkTarget($this,
"showContent")
1070 if ($ilAccess->checkAccess(
"write",
"", $this->requested_ref_id)) {
1074 $this->
ctrl->getLinkTarget($this,
"listItems")
1081 $this->
ctrl->getLinkTarget($this,
"editOrder")
1086 $ilTabs->activateSubTab($a_active);
1087 $ilTabs->activateTab(
"content");
1096 $ilTabs->activateTab(
"id_settings");
1114 $this->form_gui->setTitle(
$lng->
txt(
"mcst_settings"));
1118 $tit->setValue($this->
object->getTitle());
1119 $tit->setRequired(
true);
1120 $this->form_gui->addItem($tit);
1125 $this->form_gui->addItem($des);
1128 $sh->setTitle(
$lng->
txt(
"rep_activation_availability"));
1129 $this->form_gui->addItem($sh);
1134 $this->form_gui->addItem($online);
1138 $sh->setTitle(
$lng->
txt(
"obj_presentation"));
1139 $this->form_gui->addItem($sh);
1142 $obj_service->commonSettings()->legacyForm($this->form_gui, $this->
object)->addTileImage();
1147 $lng->
txt(
"mcst_ordering_title"),
1151 $lng->
txt(
"mcst_ordering_creation_date_asc"),
1155 $lng->
txt(
"mcst_ordering_creation_date_desc"),
1159 $lng->
txt(
"mcst_ordering_manual"),
1162 $sort->setValue($this->
object->getOrder());
1163 $this->form_gui->addItem($sort);
1176 $lng->
txt(
"mcst_img_gallery"),
1189 $si->setValue($this->
object->getViewMode());
1190 $this->form_gui->addItem($si);
1199 $si->setInfo(
$lng->
txt(
"mcst_autoplay_info"));
1200 $si->setOptions($options);
1201 $si->setValue($this->
object->getAutoplayMode());
1202 $vc_opt->addSubItem($si);
1207 $ti->setMinValue(1);
1209 $vc_opt->addSubItem($ti);
1214 $downloadable->setInfo(
$lng->
txt(
"mcst_downloadable_info"));
1215 $this->form_gui->addItem($downloadable);
1218 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
1221 if ($enable_internal_rss) {
1224 $sh->setTitle(
$lng->
txt(
"mcst_webfeed"));
1225 $this->form_gui->addItem($sh);
1229 $radio_option->
setInfo(
$lng->
txt(
"news_news_item_def_visibility_users_info"));
1230 $radio_group->addOption($radio_option);
1232 $radio_option->
setInfo(
$lng->
txt(
"news_news_item_def_visibility_public_info"));
1233 $radio_group->addOption($radio_option);
1234 $radio_group->setRequired(
false);
1235 $radio_group->setValue($this->
object->getDefaultAccess());
1236 #$ch->addSubItem($radio_group); 1237 $this->form_gui->addItem($radio_group);
1243 $ch->setChecked((
bool) $public_feed);
1244 $this->form_gui->addItem($ch);
1249 $ni->setMinValue(0);
1250 $ni->setMaxLength(3);
1252 $ni->setInfo($this->
lng->txt(
"news_keep_minimal_x_items_info") .
" (" .
1255 $ch->addSubItem($ni);
1260 $incl_files->setInfo(
$lng->
txt(
"mcst_incl_files_in_rss_info"));
1261 #$ch->addSubItem($incl_files); 1262 $this->form_gui->addItem($incl_files);
1267 $sh->setTitle(
$lng->
txt(
"learning_progress"));
1268 $this->form_gui->addItem($sh);
1273 $auto_lp->setInfo(
$lng->
txt(
"mcst_new_items_det_lp_info"));
1274 $this->form_gui->addItem($auto_lp);
1279 $this->form_gui->addCommandButton(
"saveSettings",
$lng->
txt(
"save"));
1280 $this->form_gui->setFormAction($ilCtrl->getFormAction($this,
"saveSettings"));
1290 $ilTabs->activateTab(
"id_settings");
1293 if ($this->form_gui->checkInput()) {
1295 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
1297 $this->
object->setTitle($this->form_gui->getInput(
"title"));
1298 $this->
object->setDescription($this->form_gui->getInput(
"description"));
1299 $this->
object->setOnline($this->form_gui->getInput(
"online"));
1300 $this->
object->setDownloadable($this->form_gui->getInput(
"downloadable"));
1301 $this->
object->setOrder($this->form_gui->getInput(
"order"));
1302 $this->
object->setViewMode($this->form_gui->getInput(
"viewmode"));
1303 $this->
object->setAutoplayMode((
int) $this->form_gui->getInput(
"autoplaymode"));
1304 $this->
object->setNumberInitialVideos((
int) $this->form_gui->getInput(
"nr_videos"));
1305 $this->
object->setNewItemsInLearningProgress((
int) $this->form_gui->getInput(
"auto_det_lp"));
1308 $obj_service->commonSettings()->legacyForm($this->form_gui, $this->
object)->saveTileImage();
1310 if ($enable_internal_rss) {
1311 $this->
object->setPublicFiles($this->form_gui->getInput(
"public_files"));
1312 $this->
object->setDefaultAccess($this->form_gui->getInput(
"defaultaccess"));
1314 $this->
object->update();
1316 if ($enable_internal_rss) {
1320 $this->form_gui->getInput(
"extra_feed"),
1322 $this->
object->getId()
1328 $this->form_gui->getInput(
"keep_rss_min"),
1330 $this->
object->getId()
1334 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"msg_obj_modified"),
true);
1335 $ilCtrl->redirect($this,
"editSettings");
1337 $this->form_gui->setValuesByPost();
1338 $this->tpl->setContent($this->form_gui->getHTML());
1346 if (is_object($this->
object)) {
1351 public static function _goto(
string $a_target): void
1354 $main_tpl = $DIC->ui()->mainTemplate();
1356 $ilAccess = $DIC->access();
1357 $lng = $DIC->language();
1358 $ctrl = $DIC->ctrl();
1360 if ($ilAccess->checkAccess(
"read",
"", $a_target)) {
1363 } elseif ($ilAccess->checkAccess(
"visible",
"", $a_target)) {
1366 $main_tpl->setOnScreenMessage(
'failure', sprintf(
1367 $lng->
txt(
"msg_no_perm_read_item"),
1376 protected static function isAudio(
string $extension): bool
1378 return strpos($extension,
"audio") !==
false;
1403 $this->form_gui->setValuesByPost();
1410 if ($this->form_gui->getInput(
"value_" . $purpose)) {
1411 $input = $this->form_gui->getItemByPostVar(
"label_value_" . $purpose);
1412 $input->setValue($this->form_gui->getInput(
"value_" . $purpose));
1416 $this->form_gui->setValuesByPost();
1427 $ilTabs->activateTab(
"edit_content");
1432 switch ($this->
object->getOrder()) {
1446 $table_gui->setTitle(
$lng->
txt(
"mcst_media_cast"));
1447 $table_gui->setData($this->
object->getSortedItemsArray());
1449 $table_gui->addCommandButton(
"saveOrder",
$lng->
txt(
"mcst_save_order"));
1458 $ids = $this->mc_request->getItemIds();
1462 foreach (array_keys($ids) as
$id) {
1465 $this->
object->saveOrder($items);
1467 $this->tpl->setOnScreenMessage(
'success',
$lng->
txt(
"settings_saved"),
true);
1468 $this->
ctrl->redirect($this,
"editOrder");
1484 $this->
object->getRefId(),
1485 $this->
object->getId(),
1495 $view = new \McstImageGalleryGUI($this->
object, $this->tpl, $this->
getFeedLink());
1496 $view->setCompletedCallback($this->
ctrl->getLinkTarget(
1498 "handlePlayerCompletedEvent",
1503 $this->
tabs->activateTab(
"content");
1507 $view = new \McstPodcastGUI($this->
object, $this->tpl, $this->
getFeedLink());
1508 $this->
tabs->activateTab(
"content");
1512 $ilTabs->activateTab(
"content");
1514 $view = new \ILIAS\MediaCast\Presentation\VideoViewGUI($this->
object,
$tpl, $this->
getFeedLink());
1515 $view->setCompletedCallback($this->
ctrl->getLinkTarget(
1517 "handlePlayerCompletedEvent",
1522 $view->setAutoplayCallback($this->
ctrl->getLinkTarget(
1524 "handleAutoplayTrigger",
1543 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
"mcst_view_abandoned"));
1553 $this->mcst_item =
new ilNewsItem($this->mc_request->getItemId());
1557 $sec = $this->mc_request->getSeconds();
1562 $mob->generatePreviewPic(320, 240, $sec);
1563 if ($mob->getVideoPreviewPic() !==
"") {
1564 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
"mcst_image_extracted"),
true);
1566 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"mcst_no_extraction_possible"),
true);
1571 $add = (is_array($ret) && count($ret) > 0)
1572 ?
"<br />" . implode(
"<br />", $ret)
1575 $this->tpl->setOnScreenMessage(
'failure', $e->getMessage() . $add,
true);
1578 $ilCtrl->redirect($this,
"editCastItem");
1583 if ($this->mc_request->getEvent() ===
"play") {
1584 $player = explode(
"_", $this->mc_request->getPlayer());
1585 $news_id = (
int) $player[1];
1587 $item->increasePlayCounter();
1589 $mob_id = $item->getMobId();
1592 $this->
object->handleLPUpdate(
$ilUser->getId(), $mob_id);
1600 $mob_id = $this->mc_request->getMobId();
1603 $this->
object->handleLPUpdate(
$ilUser->getId(), $mob_id);
1620 string $long_desc =
"",
1621 bool $redirect =
true,
1622 bool $extract =
false 1628 foreach ($mob_ids as $mob_id) {
1629 $item_ids[] = $this->
object->addMobToCast($mob_id,
$user->
getId(), $long_desc, $extract);
1633 if (count($item_ids) === 1) {
1648 $this->
user->writePref(
1650 $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...