10 require_once
"./Services/Object/classes/class.ilObjectGUI.php";
59 public function __construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output =
true)
63 $this->ctrl = $DIC->ctrl();
64 $this->lng = $DIC->language();
65 $this->
user = $DIC->user();
66 $this->tabs = $DIC->tabs();
67 $this->tpl = $DIC[
"tpl"];
68 $this->access = $DIC->access();
69 $this->toolbar = $DIC->toolbar();
70 $this->filesystem = $DIC->filesystem()->web();
71 $this->log = $DIC[
"ilLog"];
72 $this->error = $DIC[
"ilErr"];
73 $this->
help = $DIC[
"ilHelp"];
74 $this->locator = $DIC[
"ilLocator"];
75 $ilCtrl = $DIC->ctrl();
76 $lng = $DIC->language();
80 $lng->loadLanguageModule(
"mcst");
81 $lng->loadLanguageModule(
"news");
82 $lng->loadLanguageModule(
"rep");
84 $ilCtrl->saveParameter($this,
"item_id");
86 include_once(
"./Modules/MediaCast/classes/class.ilMediaCastSettings.php");
88 $this->purposeSuffixes =
$settings->getPurposeSuffixes();
89 $this->mimeTypes = array();
91 foreach ($mime_types as $mt) {
92 $this->mimeTypes[$mt] = $mt;
95 include_once(
"./Services/Utilities/classes/class.ilMimeTypeUtil.php");
99 asort($this->mimeTypes);
107 $next_class = $this->ctrl->getNextClass($this);
108 $cmd = $this->ctrl->getCmd();
111 switch ($next_class) {
113 case "ilmediacreationgui":
114 $this->ctrl->setReturn($this,
"listItems");
115 $ilTabs->activateTab(
"content");
119 },
function ($mob_id, $long_desc) {
121 },
function ($mob_ids) {
125 $creation->setAllMimeTypes($this->mimeTypes);
126 $this->ctrl->forwardCommand($creation);
129 case "ilinfoscreengui":
138 $ilTabs->activateTab(
"export");
139 include_once(
"./Services/Export/classes/class.ilExportGUI.php");
141 $exp_gui->addFormat(
"xml");
142 $ret = $this->ctrl->forwardCommand($exp_gui);
146 case 'ilpermissiongui':
147 $ilTabs->activateTab(
"id_permissions");
148 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
150 $ret = $this->ctrl->forwardCommand($perm_gui);
153 case 'ilobjectcopygui':
154 include_once
'./Services/Object/classes/class.ilObjectCopyGUI.php';
156 $cp->setType(
'mcst');
157 $this->ctrl->forwardCommand($cp);
160 case "ilcommonactiondispatchergui":
161 include_once(
"Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
163 $this->ctrl->forwardCommand($gui);
166 case "illearningprogressgui":
167 $ilTabs->activateTab(
'learning_progress');
168 require_once
'Services/Tracking/classes/class.ilLearningProgressGUI.php';
171 $this->object->getRefId(),
174 $this->ctrl->forwardCommand($new_gui);
175 $this->tabs_gui->setTabActive(
'learning_progress');
183 if ($cmd !=
"infoScreenObject") {
200 $forms = array(self::CFORM_NEW => $this->
initCreateForm($a_new_type),
214 ilUtil::sendSuccess($this->lng->txt(
"object_added"),
true);
231 if ($a_presentation_mode) {
237 $med_items = $this->
object->getSortedItemsArray();
239 include_once(
"./Modules/MediaCast/classes/class.ilMediaCastTableGUI.php");
240 if ($a_presentation_mode) {
246 $table_gui->setData($med_items);
248 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"]) && !$a_presentation_mode) {
249 $ilToolbar->addButton(
$lng->txt(
"add"), $this->ctrl->getLinkTargetByClass(
"ilMediaCreationGUI",
""));
251 $table_gui->addMultiCommand(
"confirmDeletionItems",
$lng->txt(
"delete"));
252 $table_gui->setSelectAllCheckbox(
"item_id");
256 if ($feed_icon_html !=
"") {
257 $table_gui->setHeaderHTML($feed_icon_html);
260 $tpl->setContent($table_gui->getHTML());
275 include_once(
"./Services/Block/classes/class.ilBlockSetting.php");
280 $this->object->getId()
286 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
288 if ($enable_internal_rss) {
290 $items = $this->
object->getItemsArray();
291 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
294 foreach ($items as $id => $item) {
297 if ($mob->hasPurposeItem($purpose)) {
301 $url = ILIAS_HTTP_PATH .
"/feed.php?client_id=" . rawurlencode(
CLIENT_ID) .
"&" .
"ref_id=" .
$_GET[
"ref_id"] .
"&purpose=$purpose";
302 $title =
$lng->txt(
"news_feed_url");
304 include_once(
"./Services/News/classes/class.ilRSSButtonGUI.php");
305 switch (strtolower($purpose)) {
306 case "audioportable":
311 case "videoportable":
322 if ($this->object->getPublicFiles()) {
323 $url = preg_replace(
"/https?/i",
"itpc",
$url);
324 $title =
$lng->txt(
"news_feed_url");
326 include_once(
"./Services/News/classes/class.ilRSSButtonGUI.php");
355 $tpl->setContent($this->form_gui->getHTML());
370 include_once(
"./Services/MediaObjects/classes/class.ilFFmpeg.php");
373 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
379 foreach (array(
"Standard") as $p) {
414 if (is_object($med)) {
417 include_once(
"./Services/Form/classes/class.ilTextInputGUI.php");
419 $ni->setMaxLength(4);
422 $ilToolbar->addInputItem($ni,
true);
424 $ilToolbar->addFormButton($this->lng->txt(
"mcst_extract_preview_image"),
"extractPreviewImage");
425 $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
438 $tpl->setContent($this->form_gui->getHTML());
451 $ilTabs->activateTab(
"edit_content");
453 $lng->loadLanguageModule(
"mcst");
456 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
458 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
460 $this->form_gui->setMultipart(
true);
464 $text_input->setMaxLength(200);
465 $this->form_gui->addItem($text_input);
470 $this->form_gui->addItem($text_area);
473 if ($enable_internal_rss) {
476 $radio_group->addOption($radio_option);
478 $radio_group->addOption($radio_option);
479 $radio_group->
setInfo(
$lng->txt(
"mcst_visibility_info"));
480 $radio_group->setRequired(
true);
481 $radio_group->setValue($this->object->getDefaultAccess() == 0 ?
"users" :
"public");
482 $this->form_gui->addItem($radio_group);
488 $dur->setShowDays(
false);
489 $dur->setShowHours(
true);
490 $dur->setShowSeconds(
true);
491 $this->form_gui->addItem($dur);
494 if ($purpose ==
"VideoAlternative" &&
495 $a_mode ==
"create") {
500 $section->setTitle(
$lng->txt(
"mcst_" . strtolower($purpose) .
"_title"));
502 if ($a_mode !=
"create") {
505 $label->
setPostVar(
"label_value_" . $purpose);
506 $label->setInfo(
$lng->txt(
"mcst_current_value_info"));
507 $this->form_gui->addItem($label);
508 $this->form_gui->addItem($value);
511 $file->
setSuffixes($this->purposeSuffixes[$purpose]);
512 $this->form_gui->addItem($file);
515 $text_input->setInfo(
$lng->txt(
"mcst_reference_info"));
516 $this->form_gui->addItem($text_input);
517 if ($purpose !=
"Standard") {
519 $clearCheckBox->setPostVar(
"delete_" . $purpose);
520 $clearCheckBox->setTitle(
$lng->txt(
"mcst_clear_purpose_title"));
521 $this->form_gui->addItem($clearCheckBox);
526 $this->form_gui->addItem($ne);
542 $pp->setInfo(
$lng->txt(
"mcst_preview_picture_info") .
" mp4, mp3, png, jp(e)g, gif");
543 $this->form_gui->addItem($pp);
548 if ($a_mode ==
"create") {
549 $this->form_gui->setTitle(
$lng->txt(
"mcst_add_new_item"));
550 $this->form_gui->addCommandButton(
"saveCastItem",
$lng->txt(
"save"));
552 $this->form_gui->setTitle(
$lng->txt(
"mcst_edit_item"));
553 $this->form_gui->addCommandButton(
"updateCastItem",
$lng->txt(
"save"));
555 $this->form_gui->addCommandButton(
"listItems",
$lng->txt(
"cancel"));
556 $this->form_gui->setFormAction($ilCtrl->getFormAction($this,
"saveCastItem"));
568 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
574 $i = $this->form_gui->getItemByPostVar(
"preview_pic");
581 if (count($mediaItems) > 0) {
582 foreach ($mediaItems as $med) {
583 if (!isset($values[
"title"])) {
585 $values[
"title"] = $this->mcst_item->getTitle();
586 $values[
"description"] = $this->mcst_item->getContent();
587 $values[
"visibility"] = $this->mcst_item->getVisibility();
588 $length = explode(
":", $this->mcst_item->getPlaytime());
589 $values[
"duration"] = array(
"hh" => $length[0],
"mm" => $length[1],
"ss" => $length[2]);
592 $values[
"value_" . $med->getPurpose()] = (strlen($med->getLocation()) > 100) ?
"..." . substr($med->getLocation(), strlen($med->getLocation()) - 100) : $med->getLocation();
593 $values[
"label_value_" . $med->getPurpose()] = (strlen($med->getLocation()) > 100) ?
"..." . substr($med->getLocation(), strlen($med->getLocation()) - 100) : $med->getLocation();
594 $values[
"mimetype_" . $med->getPurpose()] = $med->getFormat();
598 if (!isset($values[
"value_" . $purpose])) {
599 $values[
"label_value_" . $purpose] =
$lng->txt(
"none");
600 $values[
"value_" . $purpose] =
$lng->txt(
"none");
603 $this->form_gui->setValuesByArray($values);
618 $ilTabs->activateTab(
"edit_content");
622 if (!$this->form_gui->checkInput() ||
623 (
$_POST[
"url_Standard"] ==
"" && !$_FILES[
'file_Standard'][
'tmp_name'])) {
624 if ((
$_POST[
"url_Standard"] ==
"" && !$_FILES[
'file_Standard'][
'tmp_name'])) {
630 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
639 $title = $this->form_gui->getInput(
"title") !=
"" ? $this->form_gui->getInput(
"title") : basename($file);
640 $description = $this->form_gui->getInput(
"description");
641 $mob->setTitle($title);
642 $mob->setDescription($description);
645 $prevpic = $this->form_gui->getInput(
"preview_pic");
646 if ($prevpic[
"size"] > 0) {
647 $mob->uploadVideoPreviewPic($prevpic);
654 foreach ($this->additionalPurposes as $purpose) {
656 $file_gui = $this->form_gui->getInput(
"file_" . $purpose);
657 $url_gui = $this->form_gui->getInput(
"url_" . $purpose);
658 if ($url_gui || $file_gui[
"size"] > 0) {
665 if ($prevpic[
"size"] == 0) {
668 $mob->generatePreviewPic(320, 240);
676 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
679 include_once(
"./Services/News/classes/class.ilNewsItem.php");
681 $mc_item->setMobId($mob->getId());
683 $mc_item->setContextObjId($this->object->getId());
684 $mc_item->setContextObjType($this->object->getType());
685 $mc_item->setUserId(
$ilUser->getId());
686 $mc_item->setPlaytime($duration);
687 $mc_item->setTitle($title);
688 $mc_item->setContent($description);
689 $mc_item->setLimitation(
false);
690 if ($enable_internal_rss) {
691 $mc_item->setVisibility($this->form_gui->getInput(
"visibility"));
693 $mc_item->setVisibility(
"users");
697 $ilCtrl->redirect($this,
"listItems");
709 $duration = isset($this->form_gui)
710 ? $this->form_gui->getInput(
"duration")
711 : array(
"hh" => 0,
"mm" => 0,
"ss" => 0);
712 if ($duration[
"hh"] == 0 && $duration[
"mm"] == 0 && $duration[
"ss"] == 0 && is_file($file)) {
713 include_once(
"./Services/MediaObjects/classes/class.ilMediaAnalyzer.php");
715 $ana->setFile($file);
717 $dur = $ana->getPlaytimeString();
718 $dur = explode(
":", $dur);
720 $duration[
"hh"] = $dur[$cnt - 3] ?? 0;
721 $duration[
"mm"] = $dur[$cnt - 2] ?? 0;
722 $duration[
"ss"] = $dur[$cnt - 1];
724 $duration = str_pad($duration[
"hh"], 2,
"0", STR_PAD_LEFT) .
":" .
725 str_pad($duration[
"mm"], 2,
"0", STR_PAD_LEFT) .
":" .
726 str_pad($duration[
"ss"], 2,
"0", STR_PAD_LEFT);
739 $mob->addMediaItem($mediaItem);
740 $mediaItem->setPurpose($purpose);
755 $purpose = $mediaItem->getPurpose();
756 $locationType = $mediaItem->getLocationType();
757 $url_gui = $this->form_gui->getInput(
"url_" . $purpose);
758 $file_gui = $this->form_gui->getInput(
"file_" . $purpose);
761 $file = $this->form_gui->getInput(
"url_" . $purpose);
762 $title = basename($file);
763 $location = $this->form_gui->getInput(
"url_" . $purpose);
764 $locationType =
"Reference";
765 } elseif ($file_gui[
"size"] > 0) {
769 if (!is_dir($mob_dir)) {
770 $mob->createDirectory();
772 $dir = LegacyPathHelper::createRelativePath($mob_dir);
773 $old_files = $this->filesystem->finder()->in([$dir])->exclude([$dir .
'/mob_vpreview.png'])->files();
774 foreach ($old_files as $file) {
775 $this->filesystem->delete($file->getPath());
780 $file_name = str_replace(
" ",
"_", $file_name);
782 $file = $mob_dir .
"/" . $file_name;
784 $locationType =
"LocalFile";
795 $mediaItem->setFormat(
$format);
805 $mediaItem->setFormat(
$format);
807 $mediaItem->setLocationType($locationType);
808 $mediaItem->setHAlign(
"Left");
809 $mediaItem->setHeight(self::isAudio(
$format)?0:180);
812 if ($purpose ==
"Standard") {
814 $mob->setTitle($title);
837 if ($this->form_gui->checkInput()) {
839 include_once(
"./Services/News/classes/class.ilNewsItem.php");
841 $mob_id = $mc_item->getMobId();
844 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
849 if ($this->form_gui->getInput(
"delete_" . $purpose)) {
850 $mob->removeMediaItem($purpose);
851 $ilLog->write(
"Mcst: deleting purpose $purpose");
854 $media_item = $mob->getMediaItem($purpose);
855 $url_gui = $this->form_gui->getInput(
"url_" . $purpose);
856 $file_gui = $this->form_gui->getInput(
"file_" . $purpose);
858 if ($media_item == null) {
859 if ($purpose !=
"Standard" &&
860 ($url_gui || $file_gui[
"size"] > 0)) {
869 if ($purpose ==
"Standard") {
871 $title = $this->form_gui->getInput(
"title") !=
"" ? $this->form_gui->getInput(
"title") : basename($file);
872 $description = $this->form_gui->getInput(
"description");
874 $mob->setTitle($title);
875 $mob->setDescription($description);
877 $prevpic = $this->form_gui->getInput(
"preview_pic");
878 if ($prevpic[
"size"] > 0) {
879 $mob->uploadVideoPreviewPic($prevpic);
881 $prevpici = $this->form_gui->getItemByPostVar(
"preview_pic");
882 if ($prevpici->getDeletionFlag()) {
883 $mob->removeAdditionalFile($mob->getVideoPreviewPic(
true));
897 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
899 $mc_item->setUserId(
$ilUser->getId());
900 if (isset($duration)) {
901 $mc_item->setPlaytime($duration);
903 $mc_item->setTitle($title);
904 $mc_item->setContent($description);
905 if ($enable_internal_rss) {
906 $mc_item->setVisibility($this->form_gui->getInput(
"visibility"));
910 $ilCtrl->redirect($this,
"listItems");
927 $ilTabs->activateTab(
"edit_content");
929 if (!is_array(
$_POST[
"item_id"])) {
934 include_once(
"Services/Utilities/classes/class.ilConfirmationGUI.php");
938 $c_gui->setFormAction($ilCtrl->getFormAction($this,
"deleteItems"));
939 $c_gui->setHeaderText(
$lng->txt(
"info_delete_sure"));
940 $c_gui->setCancel(
$lng->txt(
"cancel"),
"listItems");
941 $c_gui->setConfirm(
$lng->txt(
"confirm"),
"deleteItems");
944 include_once(
"./Services/News/classes/class.ilNewsItem.php");
945 foreach (
$_POST[
"item_id"] as $item_id) {
955 $tpl->setContent($c_gui->getHTML());
968 foreach (
$_POST[
"item_id"] as $item_id) {
973 $ilCtrl->redirect($this,
"listItems");
986 $this->
object->handleLPUpdate(
$ilUser->getId(), $news_item->getMobId());
987 if (!$news_item->deliverMobFile(
$_GET[
"purpose"], (
int)
$_GET[
"presentation"])) {
988 $ilCtrl->redirect($this,
"listItems");
1002 $mob = $mc_item->getMobId();
1003 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
1006 $m_item = $mob->getMediaItem(
"Standard");
1007 $file = $mob_dir .
"/" . $m_item->getLocation();
1009 if ($duration !=
"00:00:00") {
1010 $mc_item->setPlaytime($duration);
1012 ilUtil::sendSuccess(
$lng->txt(
"mcst_set_playtime"),
true);
1017 $ilCtrl->redirect($this,
"listItems");
1030 $this->ctrl->setCmd(
"showSummary");
1031 $this->ctrl->setCmdClass(
"ilinfoscreengui");
1044 $ilTabs->activateTab(
"id_info");
1050 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
1053 $info->enablePrivateNotes();
1056 $this->lng->loadLanguageModule(
"meta");
1057 $this->lng->loadLanguageModule(
"mcst");
1058 $med_items = $this->
object->getItemsArray();
1059 $info->addSection($this->lng->txt(
"meta_general"));
1061 $this->lng->txt(
"mcst_nr_items"),
1062 (int) count($med_items)
1065 if (count($med_items) > 0) {
1066 $cur = current($med_items);
1072 $info->addProperty($this->lng->txt(
"mcst_last_submission"), $last);
1075 $this->ctrl->forwardCommand($info);
1089 $ilHelp->setScreenIdComponent(
"mcst");
1092 if ($ilAccess->checkAccess(
'read',
"", $this->object->getRefId())) {
1095 $lng->txt(
"content"),
1096 $this->ctrl->getLinkTarget($this,
"showContent")
1101 if ($ilAccess->checkAccess(
'visible',
"", $this->object->getRefId()) ||
1102 $ilAccess->checkAccess(
'read',
"", $this->object->getRefId())) {
1105 $lng->txt(
"info_short"),
1106 $this->ctrl->getLinkTargetByClass(
"ilinfoscreengui",
"showSummary")
1111 if ($ilAccess->checkAccess(
'write',
"", $this->object->getRefId())) {
1114 $lng->txt(
"settings"),
1115 $this->ctrl->getLinkTarget($this,
"editSettings")
1119 require_once
'Services/Tracking/classes/class.ilLearningProgressAccess.php';
1122 'learning_progress',
1123 $lng->txt(
'learning_progress'),
1124 $this->ctrl->getLinkTargetByClass(array(__CLASS__,
'illearningprogressgui'),
'')
1129 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
1132 $lng->txt(
"export"),
1133 $this->ctrl->getLinkTargetByClass(
"ilexportgui",
"")
1138 if ($ilAccess->checkAccess(
'edit_permission',
"", $this->object->getRefId())) {
1141 $lng->txt(
"perm_settings"),
1142 $this->ctrl->getLinkTargetByClass(
"ilpermissiongui",
"perm")
1162 $this->ctrl->getLinkTarget($this,
"showContent")
1165 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"])) {
1168 $lng->txt(
"mcst_manage"),
1169 $this->ctrl->getLinkTarget($this,
"listItems")
1175 $lng->txt(
"mcst_ordering"),
1176 $this->ctrl->getLinkTarget($this,
"editOrder")
1181 $ilTabs->activateSubTab($a_active);
1182 $ilTabs->activateTab(
"content");
1195 $ilTabs->activateTab(
"id_settings");
1198 $tpl->setContent($this->form_gui->getHtml());
1211 $lng->loadLanguageModule(
"mcst");
1213 require_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
1215 $this->form_gui->setTitle(
$lng->txt(
"mcst_settings"));
1219 $tit->setValue($this->object->getTitle());
1220 $tit->setRequired(
true);
1221 $this->form_gui->addItem($tit);
1225 $des->
setValue($this->object->getLongDescription());
1226 $this->form_gui->addItem($des);
1229 $sh->setTitle(
$lng->txt(
"rep_activation_availability"));
1230 $this->form_gui->addItem($sh);
1234 $online->
setChecked($this->object->getOnline());
1235 $this->form_gui->addItem($online);
1239 $sh->setTitle(
$lng->txt(
"obj_presentation"));
1240 $this->form_gui->addItem($sh);
1243 $obj_service->commonSettings()->legacyForm($this->form_gui, $this->
object)->addTileImage();
1248 $lng->txt(
"mcst_ordering_title"),
1252 $lng->txt(
"mcst_ordering_creation_date_asc"),
1256 $lng->txt(
"mcst_ordering_creation_date_desc"),
1260 $lng->txt(
"mcst_ordering_manual"),
1263 $sort->setValue($this->object->getOrder());
1264 $this->form_gui->addItem($sort);
1273 $lng->txt(
"mcst_list"),
1277 $lng->txt(
"mcst_gallery"),
1282 $si->setValue($this->object->getViewMode());
1283 $this->form_gui->addItem($si);
1288 $downloadable->
setChecked($this->object->getDownloadable());
1289 $downloadable->setInfo(
$lng->txt(
"mcst_downloadable_info"));
1290 $this->form_gui->addItem($downloadable);
1293 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
1296 if ($enable_internal_rss) {
1299 $sh->setTitle(
$lng->txt(
"mcst_webfeed"));
1300 $this->form_gui->addItem($sh);
1304 $radio_option->
setInfo(
$lng->txt(
"news_news_item_def_visibility_users_info"));
1305 $radio_group->addOption($radio_option);
1307 $radio_option->
setInfo(
$lng->txt(
"news_news_item_def_visibility_public_info"));
1308 $radio_group->addOption($radio_option);
1309 $radio_group->setRequired(
false);
1310 $radio_group->setValue($this->object->getDefaultAccess());
1311 #$ch->addSubItem($radio_group); 1312 $this->form_gui->addItem($radio_group);
1315 include_once(
"./Services/Block/classes/class.ilBlockSetting.php");
1319 $ch->setChecked($public_feed);
1320 $this->form_gui->addItem($ch);
1323 $ni =
new ilNumberInputGUI($this->lng->txt(
"news_keep_minimal_x_items"),
"keep_rss_min");
1325 $ni->setMinValue(0);
1326 $ni->setMaxLength(3);
1328 $ni->setInfo($this->lng->txt(
"news_keep_minimal_x_items_info") .
" (" .
1331 $ch->addSubItem($ni);
1335 $incl_files->
setChecked($this->object->getPublicFiles());
1336 $incl_files->setInfo(
$lng->txt(
"mcst_incl_files_in_rss_info"));
1337 #$ch->addSubItem($incl_files); 1338 $this->form_gui->addItem($incl_files);
1342 $this->form_gui->addCommandButton(
"saveSettings",
$lng->txt(
"save"));
1343 $this->form_gui->setFormAction($ilCtrl->getFormAction($this,
"saveSettings"));
1356 $ilTabs->activateTab(
"id_settings");
1359 if ($this->form_gui->checkInput()) {
1361 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
1363 $this->
object->setTitle($this->form_gui->getInput(
"title"));
1364 $this->
object->setDescription($this->form_gui->getInput(
"description"));
1365 $this->
object->setOnline($this->form_gui->getInput(
"online"));
1366 $this->
object->setDownloadable($this->form_gui->getInput(
"downloadable"));
1367 $this->
object->setOrder($this->form_gui->getInput(
"order"));
1368 $this->
object->setViewMode($this->form_gui->getInput(
"viewmode"));
1371 $obj_service->commonSettings()->legacyForm($this->form_gui, $this->
object)->saveTileImage();
1373 if ($enable_internal_rss) {
1374 $this->
object->setPublicFiles($this->form_gui->getInput(
"public_files"));
1375 $this->
object->setDefaultAccess($this->form_gui->getInput(
"defaultaccess"));
1377 $this->
object->update();
1379 if ($enable_internal_rss) {
1380 include_once(
"./Services/Block/classes/class.ilBlockSetting.php");
1384 $this->form_gui->getInput(
"extra_feed"),
1386 $this->
object->getId()
1392 $this->form_gui->getInput(
"keep_rss_min"),
1394 $this->
object->getId()
1398 ilUtil::sendSuccess($this->lng->txt(
"msg_obj_modified"),
true);
1399 $ilCtrl->redirect($this,
"editSettings");
1401 $this->form_gui->setValuesByPost();
1402 $this->tpl->setContent($this->form_gui->getHTML());
1411 if (is_object($this->
object)) {
1412 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this,
"listItems"),
"",
$_GET[
"ref_id"]);
1420 $ilAccess = $DIC->access();
1422 $lng = $DIC->language();
1424 if ($ilAccess->checkAccess(
"read",
"", $a_target)) {
1425 $_GET[
"cmd"] =
"showContent";
1426 $_GET[
"ref_id"] = $a_target;
1427 $_GET[
"baseClass"] =
"ilmediacasthandlergui";
1428 $_GET[
"cmdClass"] =
"ilobjmediacastgui";
1429 include(
"ilias.php");
1431 } elseif ($ilAccess->checkAccess(
"visible",
"", $a_target)) {
1435 $lng->txt(
"msg_no_perm_read_item"),
1452 return strpos($extension,
"audio") !==
false;
1463 include_once(
"./Services/News/classes/class.ilNewsItem.php");
1466 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
1479 include_once(
"./Services/News/classes/class.ilNewsItem.php");
1482 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
1495 if (
$_POST[
"value_" . $purpose]) {
1496 $_POST[
"label_value_" . $purpose] =
$_POST[
"value_" . $purpose];
1500 $this->form_gui->setValuesByPost();
1501 $tpl->setContent($this->form_gui->getHTML());
1511 $ilTabs->activateTab(
"edit_content");
1516 switch ($this->object->getOrder()) {
1527 include_once(
"./Modules/MediaCast/classes/class.ilMediaCastTableGUI.php");
1530 $table_gui->setTitle(
$lng->txt(
"mcst_media_cast"));
1531 $table_gui->setData($this->object->getSortedItemsArray());
1533 $table_gui->addCommandButton(
"saveOrder",
$lng->txt(
"mcst_save_order"));
1535 $tpl->setContent($table_gui->getHTML());
1542 asort(
$_POST[
"item_id"]);
1545 foreach (array_keys(
$_POST[
"item_id"]) as $id) {
1548 $this->
object->saveOrder($items);
1550 ilUtil::sendSuccess(
$lng->txt(
"settings_saved"),
true);
1551 $this->ctrl->redirect($this,
"editOrder");
1570 require_once
'Services/Tracking/classes/class.ilChangeEvent.php';
1573 $this->object->getRefId(),
1574 $this->
object->getId(),
1579 require_once
'Services/Tracking/classes/class.ilLPStatusWrapper.php';
1588 $tpl->setPermanentLink($this->object->getType(), $this->
object->getRefId());
1597 $tpl->addJavascript(
"./Modules/MediaCast/js/MediaCast.js");
1599 $ilTabs->activateTab(
"content");
1603 $ctpl =
new ilTemplate(
"tpl.mcst_content.html",
true,
true,
"Modules/MediaCast");
1605 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
1606 require_once(
'./Services/WebAccessChecker/classes/class.ilWACSignedPath.php');
1607 foreach ($this->object->getSortedItemsArray() as $item) {
1609 $med = $mob->getMediaItem(
"Standard");
1611 $ctpl->setCurrentBlock(
"item");
1612 $ctpl->setVariable(
"TITLE", $item[
"title"]);
1613 $ctpl->setVariable(
"TIME", $item[
"playtime"]);
1614 $ctpl->setVariable(
"ID", $item[
"id"]);
1616 if ($mob->getVideoPreviewPic() !=
"") {
1629 if (is_object($med)) {
1630 include_once(
"./Services/MediaObjects/classes/class.ilMediaPlayerGUI.php");
1635 $ilCtrl->getLinkTarget($this,
"handlePlayerEvent",
"",
true,
false)
1638 if (strcasecmp(
"Reference", $med->getLocationType()) == 0) {
1644 $mpl->setMimeType($med->getFormat());
1649 $mpl->setTitle($item[
"title"]);
1650 $mpl->setDescription($item[
"content"]);
1651 $mpl->setForceAudioPreview(
true);
1652 if ($this->object->getDownloadable()) {
1653 $ilCtrl->setParameterByClass(
"ilobjmediacastgui",
"item_id", $item[
"id"]);
1654 $ilCtrl->setParameterByClass(
"ilobjmediacastgui",
"purpose",
"Standard");
1655 $mpl->setDownloadLink($ilCtrl->getLinkTargetByClass(
"ilobjmediacastgui",
"downloadItem"));
1657 $med_alt = $mob->getMediaItem(
"VideoAlternative");
1658 if (is_object($med_alt)) {
1660 $med_alt->getLocation()));
1661 $mpl->setAlternativeVideoMimeType($med_alt->getFormat());
1664 $ctpl->setVariable(
"PLAYER", $mpl->getPreviewHtml());
1668 $ctpl->parseCurrentBlock();
1673 if ($feed_icon_html !=
"") {
1674 $feed_icon_html =
'<p>' . $feed_icon_html .
'</p>';
1677 $tpl->setContent($feed_icon_html . $ctpl->get());
1693 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
1700 include_once(
"./Services/MediaObjects/classes/class.ilFFmpeg.php");
1701 $med = $mob->getMediaItem(
"Standard");
1705 $pi = pathinfo($new_file);
1706 $med = $mob->getMediaItem($target_purpose);
1707 if (!is_object($med)) {
1709 $med->setMobId($mob->getId());
1710 $mob->addMediaItem($med);
1712 $med->setPurpose($target_purpose);
1714 $med->setFormat($target_format);
1715 $med->setLocation($pi[
"basename"]);
1716 $med->setLocationType(
"LocalFile");
1719 $add = (is_array(
$ret) && count(
$ret) > 0)
1720 ?
"<br />" . implode(
"<br />",
$ret)
1726 $add = (is_array(
$ret) && count(
$ret) > 0)
1727 ?
"<br />" . implode(
"<br />",
$ret)
1733 $ilCtrl->redirect($this,
"editCastItem");
1749 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
1753 $sec = (int)
$_POST[
"sec"];
1757 if ($mob->getVideoPreviewPic() !=
"") {
1758 $mob->removeAdditionalFile($mob->getVideoPreviewPic(
true));
1760 include_once(
"./Services/MediaObjects/classes/class.ilFFmpeg.php");
1761 $med = $mob->getMediaItem(
"Standard");
1770 if ($new_file !=
"") {
1778 $add = (is_array(
$ret) && count(
$ret) > 0)
1779 ?
"<br />" . implode(
"<br />",
$ret)
1786 $ilCtrl->redirect($this,
"editCastItem");
1797 if (
$_GET[
"event"] ==
"play") {
1798 $player = explode(
"_",
$_GET[
"player"]);
1799 $news_id = (int) $player[1];
1800 include_once(
"./Services/News/classes/class.ilNewsItem.php");
1802 $item->increasePlayCounter();
1804 $mob_id = $item->getMobId();
1807 $this->
object->handleLPUpdate(
$ilUser->getId(), $mob_id);
1820 $mob_id = (int)
$_GET[
"mob_id"];
1823 $this->
object->handleLPUpdate(
$ilUser->getId(), $mob_id);
1835 $med_item = $mob->getMediaItem(
"Standard");
1836 $med_item->determineDuration();
1862 foreach ($mob_ids as $mob_id) {
1863 $item_ids[] = $this->
object->addMobToCast($mob_id,
$user->getId(), $long_desc);
1866 if (count($item_ids) == 1) {
1867 $ctrl->setParameter($this,
"item_id", $item_ids[0]);
1868 $ctrl->setParameter($this,
"pupose",
"Standard");
1869 $ctrl->redirect($this,
"editCastItem");
1871 $ctrl->redirect($this,
"listItems");
1886 $this->
user->writePref(
"mcst_autoplay", (
int)
$_GET[
"autoplay"]);
static _recordReadEvent( $a_type, $a_ref_id, $obj_id, $usr_id, $isCatchupWriteEvents=true, $a_ext_rc=false, $a_ext_time=false)
Records a read event and catches up with write events.
This class represents an option in a radio group.
static getLastReturnValues()
Get last return values.
static _write($a_type, $a_setting, $a_value, $a_user=0, $a_block_id=0)
Write setting to database.
static _lookupRSSPeriod()
GUI class for the workflow of copying objects.
static convert($a_file, $a_target_mime, $a_target_dir="", $a_target_filename="")
Convert file to target mime type.
static _updateStatus($a_obj_id, $a_usr_id, $a_obj=null, $a_percentage=false, $a_force_raise=false)
Update status.
setValue($a_value)
Set Value.
static _gotoRepositoryRoot($a_raise_error=false)
Goto repository root.
static _lookupTitle($a_id)
lookup object title
fillCloneTemplate($a_tpl_varname, $a_type)
Fill object clone template This method can be called from any object GUI class that wants to offer ob...
setInfo($a_info)
Set Info.
static getASCIIFilename($a_filename)
convert utf8 to ascii filename
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date public.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
Export User Interface Class.
static checkAccess($a_ref_id, $a_allow_only_read=true)
check access to learning progress
initImportForm($a_new_type)
Init object import form.
prepareOutput($a_show_subobjects=true)
prepare output
static extractImage( $a_file, $a_target_filename, $a_target_dir="", $a_sec=1)
Extract image from video file.
static _gotoRepositoryNode($a_ref_id, $a_cmd="frameset")
Goto repository root.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static moveUploadedFile($a_file, $a_name, $a_target, $a_raise_errors=true, $a_mode="move_uploaded")
move uploaded file
Class ilObjectGUI Basic methods of all Output classes.
static _lookupObjId($a_id)
static _lookup($a_type, $a_setting, $a_user=0, $a_block_id=0)
Lookup setting from database.
initCreateForm($a_new_type)
Init object creation form.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static signFile($path_to_file)
static img($a_src, $a_alt=null, $a_width="", $a_height="", $a_border=0, $a_id="", $a_class="")
Build img tag.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
This class represents a non editable value in a property form.
static renameExecutables($a_dir)
Rename uploaded executables for security reasons.
__construct(Container $dic, ilPlugin $plugin)
const LP_CONTEXT_REPOSITORY
This class represents a text area property in a property form.
getRefId()
get reference id public
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
static enabled()
Checks, whether FFmpeg support is enabled (path is set in the setup)
static redirect($a_script)
addHeaderAction()
Add header action menu.
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission.
Class ilObjUserTrackingGUI.
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
Confirmation screen class.
static supportsImageExtraction($a_mime)
Check if mime type supports image extraction.