5 require_once
"./Services/Object/classes/class.ilObjectGUI.php";
49 public function __construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output =
true)
53 $this->ctrl = $DIC->ctrl();
54 $this->lng = $DIC->language();
55 $this->
user = $DIC->user();
56 $this->tabs = $DIC->tabs();
57 $this->tpl = $DIC[
"tpl"];
58 $this->access = $DIC->access();
59 $this->toolbar = $DIC->toolbar();
60 $this->log = $DIC[
"ilLog"];
61 $this->error = $DIC[
"ilErr"];
62 $this->help = $DIC[
"ilHelp"];
63 $this->locator = $DIC[
"ilLocator"];
65 $lng = $DIC->language();
68 parent::__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
69 $lng->loadLanguageModule(
"mcst");
70 $lng->loadLanguageModule(
"news");
71 $lng->loadLanguageModule(
"rep");
73 $ilCtrl->saveParameter($this,
"item_id");
75 include_once(
"./Modules/MediaCast/classes/class.ilMediaCastSettings.php");
77 $this->purposeSuffixes =
$settings->getPurposeSuffixes();
78 $this->mimeTypes = array();
80 foreach ($mime_types as $mt) {
81 $this->mimeTypes[$mt] = $mt;
84 include_once(
"./Services/Utilities/classes/class.ilMimeTypeUtil.php");
86 $this->mimeTypes[$mt] = $mt;
88 asort($this->mimeTypes);
96 $next_class = $this->ctrl->getNextClass($this);
97 $cmd = $this->ctrl->getCmd();
100 switch ($next_class) {
101 case "ilinfoscreengui":
110 $ilTabs->activateTab(
"export");
111 include_once(
"./Services/Export/classes/class.ilExportGUI.php");
113 $exp_gui->addFormat(
"xml");
114 $ret = $this->ctrl->forwardCommand($exp_gui);
118 case 'ilpermissiongui':
119 $ilTabs->activateTab(
"id_permissions");
120 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
122 $ret = $this->ctrl->forwardCommand($perm_gui);
125 case 'ilobjectcopygui':
126 include_once
'./Services/Object/classes/class.ilObjectCopyGUI.php';
128 $cp->setType(
'mcst');
129 $this->ctrl->forwardCommand($cp);
132 case "ilcommonactiondispatchergui":
133 include_once(
"Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
135 $this->ctrl->forwardCommand($gui);
138 case "illearningprogressgui":
139 $ilTabs->activateTab(
'learning_progress');
140 require_once
'Services/Tracking/classes/class.ilLearningProgressGUI.php';
143 $this->object->getRefId(),
146 $this->ctrl->forwardCommand($new_gui);
147 $this->tabs_gui->setTabActive(
'learning_progress');
155 if ($cmd !=
"infoScreenObject") {
172 $forms = array(self::CFORM_NEW => $this->
initCreateForm($a_new_type),
186 ilUtil::sendSuccess($this->lng->txt(
"object_added"),
true);
203 if ($a_presentation_mode) {
209 $med_items = $this->
object->getSortedItemsArray();
211 include_once(
"./Modules/MediaCast/classes/class.ilMediaCastTableGUI.php");
212 if ($a_presentation_mode) {
218 $table_gui->setData($med_items);
220 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"]) && !$a_presentation_mode) {
221 $ilToolbar->addButton(
$lng->txt(
"add"), $this->ctrl->getLinkTarget($this,
"addCastItem"));
223 $table_gui->addMultiCommand(
"confirmDeletionItems",
$lng->txt(
"delete"));
224 $table_gui->setSelectAllCheckbox(
"item_id");
228 if ($feed_icon_html !=
"") {
229 $table_gui->setHeaderHTML($feed_icon_html);
232 $tpl->setContent($table_gui->getHTML());
247 include_once(
"./Services/Block/classes/class.ilBlockSetting.php");
252 $this->object->getId()
258 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
260 if ($enable_internal_rss) {
262 $items = $this->
object->getItemsArray();
263 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
266 foreach ($items as
$id => $item) {
269 if ($mob->hasPurposeItem($purpose)) {
273 $url = ILIAS_HTTP_PATH .
"/feed.php?client_id=" . rawurlencode(CLIENT_ID) .
"&" .
"ref_id=" .
$_GET[
"ref_id"] .
"&purpose=$purpose";
276 include_once(
"./Services/News/classes/class.ilRSSButtonGUI.php");
277 switch (strtolower($purpose)) {
278 case "audioportable":
283 case "videoportable":
294 if ($this->object->getPublicFiles()) {
295 $url = preg_replace(
"/https?/i",
"itpc",
$url);
298 include_once(
"./Services/News/classes/class.ilRSSButtonGUI.php");
327 $tpl->setContent($this->form_gui->getHTML());
342 include_once(
"./Services/MediaObjects/classes/class.ilFFmpeg.php");
345 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
351 foreach (array(
"Standard") as $p) {
386 if (is_object($med)) {
389 include_once(
"./Services/Form/classes/class.ilTextInputGUI.php");
394 $ilToolbar->addInputItem($ni,
true);
396 $ilToolbar->addFormButton($this->lng->txt(
"mcst_extract_preview_image"),
"extractPreviewImage");
397 $ilToolbar->setFormAction(
$ilCtrl->getFormAction($this));
410 $tpl->setContent($this->form_gui->getHTML());
423 $ilTabs->activateTab(
"edit_content");
425 $lng->loadLanguageModule(
"mcst");
428 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
430 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
432 $this->form_gui->setMultipart(
true);
437 $this->form_gui->addItem($text_input);
442 $this->form_gui->addItem($text_area);
445 if ($enable_internal_rss) {
448 $radio_group->addOption($radio_option);
450 $radio_group->addOption($radio_option);
451 $radio_group->
setInfo(
$lng->txt(
"mcst_visibility_info"));
452 $radio_group->setRequired(
true);
453 $radio_group->setValue($this->object->getDefaultAccess() == 0 ?
"users" :
"public");
454 $this->form_gui->addItem($radio_group);
460 $dur->setShowDays(
false);
461 $dur->setShowHours(
true);
462 $dur->setShowSeconds(
true);
463 $this->form_gui->addItem($dur);
466 if ($purpose ==
"VideoAlternative" &&
467 $a_mode ==
"create") {
472 $section->setTitle(
$lng->txt(
"mcst_" . strtolower($purpose) .
"_title"));
474 if ($a_mode !=
"create") {
477 $label->
setPostVar(
"label_value_" . $purpose);
478 $label->setInfo(
$lng->txt(
"mcst_current_value_info"));
479 $this->form_gui->addItem($label);
480 $this->form_gui->addItem($value);
483 $file->
setSuffixes($this->purposeSuffixes[$purpose]);
484 $this->form_gui->addItem($file);
487 $text_input->setInfo(
$lng->txt(
"mcst_reference_info"));
488 $this->form_gui->addItem($text_input);
489 if ($purpose !=
"Standard") {
491 $clearCheckBox->setPostVar(
"delete_" . $purpose);
492 $clearCheckBox->setTitle(
$lng->txt(
"mcst_clear_purpose_title"));
493 $this->form_gui->addItem($clearCheckBox);
498 $mimeTypeSelection->setPostVar(
"mimetype_" . $purpose);
499 $mimeTypeSelection->setTitle(
$lng->txt(
"mcst_mimetype"));
500 $mimeTypeSelection->setInfo(
$lng->txt(
"mcst_mimetype_info"));
501 $options = array(
"" =>
$lng->txt(
"mcst_automatic_detection"));
502 $options = array_merge($options, $this->mimeTypes);
503 $mimeTypeSelection->setOptions($options);
504 $this->form_gui->addItem($mimeTypeSelection);
509 $pp->setInfo(
$lng->txt(
"mcst_preview_picture_info") .
" mp4, mp3, png, jp(e)g, gif");
510 $this->form_gui->addItem($pp);
515 if ($a_mode ==
"create") {
516 $this->form_gui->setTitle(
$lng->txt(
"mcst_add_new_item"));
517 $this->form_gui->addCommandButton(
"saveCastItem",
$lng->txt(
"save"));
519 $this->form_gui->setTitle(
$lng->txt(
"mcst_edit_item"));
520 $this->form_gui->addCommandButton(
"updateCastItem",
$lng->txt(
"save"));
522 $this->form_gui->addCommandButton(
"listItems",
$lng->txt(
"cancel"));
523 $this->form_gui->setFormAction(
$ilCtrl->getFormAction($this,
"saveCastItem"));
535 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
541 $i = $this->form_gui->getItemByPostVar(
"preview_pic");
548 if (count($mediaItems) > 0) {
549 foreach ($mediaItems as $med) {
550 if (!isset(
$values[
"title"])) {
552 $values[
"title"] = $this->mcst_item->getTitle();
553 $values[
"description"] = $this->mcst_item->getContent();
554 $values[
"visibility"] = $this->mcst_item->getVisibility();
555 $length = explode(
":", $this->mcst_item->getPlaytime());
556 $values[
"duration"] = array(
"hh" => $length[0],
"mm" => $length[1],
"ss" => $length[2]);
559 $values[
"value_" . $med->getPurpose()] = (strlen($med->getLocation()) > 100) ?
"..." . substr($med->getLocation(), strlen($med->getLocation()) - 100) : $med->getLocation();
560 $values[
"label_value_" . $med->getPurpose()] = (strlen($med->getLocation()) > 100) ?
"..." . substr($med->getLocation(), strlen($med->getLocation()) - 100) : $med->getLocation();
561 $values[
"mimetype_" . $med->getPurpose()] = $med->getFormat();
565 if (!isset(
$values[
"value_" . $purpose])) {
566 $values[
"label_value_" . $purpose] =
$lng->txt(
"none");
570 $this->form_gui->setValuesByArray(
$values);
585 $ilTabs->activateTab(
"edit_content");
589 if (!$this->form_gui->checkInput() ||
590 (
$_POST[
"url_Standard"] ==
"" && !$_FILES[
'file_Standard'][
'tmp_name'])) {
591 if ((
$_POST[
"url_Standard"] ==
"" && !$_FILES[
'file_Standard'][
'tmp_name'])) {
597 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
606 $title = $this->form_gui->getInput(
"title") !=
"" ? $this->form_gui->getInput(
"title") : basename($file);
607 $description = $this->form_gui->getInput(
"description");
612 $prevpic = $this->form_gui->getInput(
"preview_pic");
613 if ($prevpic[
"size"] > 0) {
614 $mob->uploadVideoPreviewPic($prevpic);
621 foreach ($this->additionalPurposes as $purpose) {
623 $file_gui = $this->form_gui->getInput(
"file_" . $purpose);
624 $url_gui = $this->form_gui->getInput(
"url_" . $purpose);
625 if ($url_gui || $file_gui[
"size"] > 0) {
632 if ($prevpic[
"size"] == 0) {
643 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
646 include_once(
"./Services/News/classes/class.ilNewsItem.php");
648 $mc_item->setMobId($mob->getId());
650 $mc_item->setContextObjId($this->object->getId());
651 $mc_item->setContextObjType($this->object->getType());
652 $mc_item->setUserId(
$ilUser->getId());
653 $mc_item->setPlaytime($duration);
654 $mc_item->setTitle(
$title);
656 $mc_item->setLimitation(
false);
657 if ($enable_internal_rss) {
658 $mc_item->setVisibility($this->form_gui->getInput(
"visibility"));
660 $mc_item->setVisibility(
"users");
664 $ilCtrl->redirect($this,
"listItems");
676 $duration = isset($this->form_gui)
677 ? $this->form_gui->getInput(
"duration")
678 : array(
"hh" => 0,
"mm" => 0,
"ss" => 0);
679 if ($duration[
"hh"] == 0 && $duration[
"mm"] == 0 && $duration[
"ss"] == 0 && is_file($file)) {
680 include_once(
"./Services/MediaObjects/classes/class.ilMediaAnalyzer.php");
682 $ana->setFile($file);
684 $dur = $ana->getPlaytimeString();
685 $dur = explode(
":", $dur);
686 $duration[
"mm"] = $dur[0];
687 $duration[
"ss"] = $dur[1];
689 $duration = str_pad($duration[
"hh"], 2,
"0", STR_PAD_LEFT) .
":" .
690 str_pad($duration[
"mm"], 2,
"0", STR_PAD_LEFT) .
":" .
691 str_pad($duration[
"ss"], 2,
"0", STR_PAD_LEFT);
704 $mob->addMediaItem($mediaItem);
705 $mediaItem->setPurpose($purpose);
718 $purpose = $mediaItem->getPurpose();
719 $url_gui = $this->form_gui->getInput(
"url_" . $purpose);
720 $file_gui = $this->form_gui->getInput(
"file_" . $purpose);
723 $file = $this->form_gui->getInput(
"url_" . $purpose);
725 $location = $this->form_gui->getInput(
"url_" . $purpose);
726 $locationType =
"Reference";
727 } elseif ($file_gui[
"size"] > 0) {
731 if (!is_dir($mob_dir)) {
732 $mob->createDirectory();
736 $file_name = str_replace(
" ",
"_", $file_name);
738 $file = $mob_dir .
"/" . $file_name;
740 $locationType =
"LocalFile";
742 ilUtil::moveUploadedFile($_FILES[
'file_' . $purpose][
'tmp_name'], $file_name, $file);
747 if (
$_POST[
"mimetype_" . $purpose] !=
"") {
748 $mediaItem->setFormat(
$_POST[
"mimetype_" . $purpose]);
749 } elseif ($mediaItem->getLocation() !=
"") {
751 $mediaItem->setFormat(
$format);
761 $mediaItem->setFormat(
$format);
763 $mediaItem->setLocationType($locationType);
764 $mediaItem->setHAlign(
"Left");
765 $mediaItem->setHeight(self::isAudio(
$format)?0:180);
768 if ($purpose ==
"Standard") {
793 if ($this->form_gui->checkInput()) {
795 include_once(
"./Services/News/classes/class.ilNewsItem.php");
797 $mob_id = $mc_item->getMobId();
800 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
805 if ($this->form_gui->getInput(
"delete_" . $purpose)) {
806 $mob->removeMediaItem($purpose);
807 $ilLog->write(
"Mcst: deleting purpose $purpose");
810 $media_item = $mob->getMediaItem($purpose);
811 $url_gui = $this->form_gui->getInput(
"url_" . $purpose);
812 $file_gui = $this->form_gui->getInput(
"file_" . $purpose);
814 if ($media_item == null) {
815 if ($purpose !=
"Standard" &&
816 ($url_gui || $file_gui[
"size"] > 0)) {
825 if ($purpose ==
"Standard") {
827 $title = $this->form_gui->getInput(
"title") !=
"" ? $this->form_gui->getInput(
"title") : basename($file);
828 $description = $this->form_gui->getInput(
"description");
833 $prevpic = $this->form_gui->getInput(
"preview_pic");
834 if ($prevpic[
"size"] > 0) {
835 $mob->uploadVideoPreviewPic($prevpic);
837 $prevpici = $this->form_gui->getItemByPostVar(
"preview_pic");
838 if ($prevpici->getDeletionFlag()) {
839 $mob->removeAdditionalFile($mob->getVideoPreviewPic(
true));
853 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
855 $mc_item->setUserId(
$ilUser->getId());
856 if (isset($duration)) {
857 $mc_item->setPlaytime($duration);
859 $mc_item->setTitle(
$title);
861 if ($enable_internal_rss) {
862 $mc_item->setVisibility($this->form_gui->getInput(
"visibility"));
866 $ilCtrl->redirect($this,
"listItems");
883 $ilTabs->activateTab(
"edit_content");
885 if (!is_array(
$_POST[
"item_id"])) {
890 include_once(
"Services/Utilities/classes/class.ilConfirmationGUI.php");
894 $c_gui->setFormAction(
$ilCtrl->getFormAction($this,
"deleteItems"));
895 $c_gui->setHeaderText(
$lng->txt(
"info_delete_sure"));
896 $c_gui->setCancel(
$lng->txt(
"cancel"),
"listItems");
897 $c_gui->setConfirm(
$lng->txt(
"confirm"),
"deleteItems");
900 include_once(
"./Services/News/classes/class.ilNewsItem.php");
901 foreach (
$_POST[
"item_id"] as $item_id) {
911 $tpl->setContent($c_gui->getHTML());
924 foreach (
$_POST[
"item_id"] as $item_id) {
929 $ilCtrl->redirect($this,
"listItems");
942 $this->
object->handleLPUpdate(
$ilUser->getId(), $news_item->getMobId());
943 if (!$news_item->deliverMobFile(
$_GET[
"purpose"], (
int)
$_GET[
"presentation"])) {
944 $ilCtrl->redirect($this,
"listItems");
958 $mob = $mc_item->getMobId();
959 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
962 $m_item = $mob->getMediaItem(
"Standard");
963 $file = $mob_dir .
"/" . $m_item->getLocation();
965 if ($duration !=
"00:00:00") {
966 $mc_item->setPlaytime($duration);
968 ilUtil::sendSuccess(
$lng->txt(
"mcst_set_playtime"),
true);
973 $ilCtrl->redirect($this,
"listItems");
986 $this->ctrl->setCmd(
"showSummary");
987 $this->ctrl->setCmdClass(
"ilinfoscreengui");
1000 $ilTabs->activateTab(
"id_info");
1006 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
1009 $info->enablePrivateNotes();
1012 $this->lng->loadLanguageModule(
"meta");
1013 $this->lng->loadLanguageModule(
"mcst");
1014 $med_items = $this->
object->getItemsArray();
1015 $info->addSection($this->lng->txt(
"meta_general"));
1017 $this->lng->txt(
"mcst_nr_items"),
1018 (int) count($med_items)
1021 if (count($med_items) > 0) {
1022 $cur = current($med_items);
1028 $info->addProperty($this->lng->txt(
"mcst_last_submission"), $last);
1031 $this->ctrl->forwardCommand(
$info);
1045 $ilHelp->setScreenIdComponent(
"mcst");
1048 if ($ilAccess->checkAccess(
'read',
"", $this->object->getRefId())) {
1051 $lng->txt(
"content"),
1052 $this->ctrl->getLinkTarget($this,
"showContent")
1057 if ($ilAccess->checkAccess(
'visible',
"", $this->object->getRefId()) ||
1058 $ilAccess->checkAccess(
'read',
"", $this->object->getRefId())) {
1061 $lng->txt(
"info_short"),
1062 $this->ctrl->getLinkTargetByClass(
"ilinfoscreengui",
"showSummary")
1067 if ($ilAccess->checkAccess(
'write',
"", $this->object->getRefId())) {
1070 $lng->txt(
"settings"),
1071 $this->ctrl->getLinkTarget($this,
"editSettings")
1075 require_once
'Services/Tracking/classes/class.ilLearningProgressAccess.php';
1078 'learning_progress',
1079 $lng->txt(
'learning_progress'),
1080 $this->ctrl->getLinkTargetByClass(array(__CLASS__,
'illearningprogressgui'),
'')
1085 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
1088 $lng->txt(
"export"),
1089 $this->ctrl->getLinkTargetByClass(
"ilexportgui",
"")
1094 if ($ilAccess->checkAccess(
'edit_permission',
"", $this->object->getRefId())) {
1097 $lng->txt(
"perm_settings"),
1098 $this->ctrl->getLinkTargetByClass(
"ilpermissiongui",
"perm")
1118 $this->ctrl->getLinkTarget($this,
"showContent")
1121 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"])) {
1124 $lng->txt(
"mcst_manage"),
1125 $this->ctrl->getLinkTarget($this,
"listItems")
1131 $lng->txt(
"mcst_ordering"),
1132 $this->ctrl->getLinkTarget($this,
"editOrder")
1137 $ilTabs->activateSubTab($a_active);
1138 $ilTabs->activateTab(
"content");
1151 $ilTabs->activateTab(
"id_settings");
1154 $tpl->setContent($this->form_gui->getHtml());
1167 $lng->loadLanguageModule(
"mcst");
1169 require_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
1171 $this->form_gui->setTitle(
$lng->txt(
"mcst_settings"));
1175 $tit->
setValue($this->object->getTitle());
1176 $tit->setRequired(
true);
1177 $this->form_gui->addItem($tit);
1181 $des->
setValue($this->object->getLongDescription());
1182 $this->form_gui->addItem($des);
1185 $sh->setTitle(
$lng->txt(
"rep_activation_availability"));
1186 $this->form_gui->addItem($sh);
1190 $online->
setChecked($this->object->getOnline());
1191 $this->form_gui->addItem($online);
1195 $sh->setTitle(
$lng->txt(
"obj_presentation"));
1196 $this->form_gui->addItem($sh);
1199 $obj_service->commonSettings()->legacyForm($this->form_gui, $this->
object)->addTileImage();
1204 $lng->txt(
"mcst_ordering_title"),
1208 $lng->txt(
"mcst_ordering_creation_date_asc"),
1212 $lng->txt(
"mcst_ordering_creation_date_desc"),
1216 $lng->txt(
"mcst_ordering_manual"),
1219 $sort->setValue($this->object->getOrder());
1220 $this->form_gui->addItem($sort);
1229 $lng->txt(
"mcst_list"),
1233 $lng->txt(
"mcst_gallery"),
1238 $si->setValue($this->object->getViewMode());
1239 $this->form_gui->addItem($si);
1244 $downloadable->
setChecked($this->object->getDownloadable());
1245 $downloadable->setInfo(
$lng->txt(
"mcst_downloadable_info"));
1246 $this->form_gui->addItem($downloadable);
1249 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
1252 if ($enable_internal_rss) {
1255 $sh->setTitle(
$lng->txt(
"mcst_webfeed"));
1256 $this->form_gui->addItem($sh);
1260 $radio_option->
setInfo(
$lng->txt(
"news_news_item_def_visibility_users_info"));
1261 $radio_group->addOption($radio_option);
1263 $radio_option->
setInfo(
$lng->txt(
"news_news_item_def_visibility_public_info"));
1264 $radio_group->addOption($radio_option);
1265 $radio_group->setRequired(
false);
1266 $radio_group->setValue($this->object->getDefaultAccess());
1267 #$ch->addSubItem($radio_group); 1268 $this->form_gui->addItem($radio_group);
1271 include_once(
"./Services/Block/classes/class.ilBlockSetting.php");
1275 $ch->setChecked($public_feed);
1276 $this->form_gui->addItem($ch);
1279 $ni =
new ilNumberInputGUI($this->lng->txt(
"news_keep_minimal_x_items"),
"keep_rss_min");
1281 $ni->setMinValue(0);
1282 $ni->setMaxLength(3);
1284 $ni->setInfo($this->lng->txt(
"news_keep_minimal_x_items_info") .
" (" .
1287 $ch->addSubItem($ni);
1291 $incl_files->
setChecked($this->object->getPublicFiles());
1292 $incl_files->setInfo(
$lng->txt(
"mcst_incl_files_in_rss_info"));
1293 #$ch->addSubItem($incl_files); 1294 $this->form_gui->addItem($incl_files);
1298 $this->form_gui->addCommandButton(
"saveSettings",
$lng->txt(
"save"));
1299 $this->form_gui->setFormAction(
$ilCtrl->getFormAction($this,
"saveSettings"));
1312 $ilTabs->activateTab(
"id_settings");
1315 if ($this->form_gui->checkInput()) {
1317 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
1319 $this->
object->setTitle($this->form_gui->getInput(
"title"));
1320 $this->
object->setDescription($this->form_gui->getInput(
"description"));
1321 $this->
object->setOnline($this->form_gui->getInput(
"online"));
1322 $this->
object->setDownloadable($this->form_gui->getInput(
"downloadable"));
1323 $this->
object->setOrder($this->form_gui->getInput(
"order"));
1324 $this->
object->setViewMode($this->form_gui->getInput(
"viewmode"));
1327 $obj_service->commonSettings()->legacyForm($this->form_gui, $this->
object)->saveTileImage();
1329 if ($enable_internal_rss) {
1330 $this->
object->setPublicFiles($this->form_gui->getInput(
"public_files"));
1331 $this->
object->setDefaultAccess($this->form_gui->getInput(
"defaultaccess"));
1333 $this->
object->update();
1335 if ($enable_internal_rss) {
1336 include_once(
"./Services/Block/classes/class.ilBlockSetting.php");
1340 $this->form_gui->getInput(
"extra_feed"),
1342 $this->
object->getId()
1348 $this->form_gui->getInput(
"keep_rss_min"),
1350 $this->
object->getId()
1354 ilUtil::sendSuccess($this->lng->txt(
"msg_obj_modified"),
true);
1355 $ilCtrl->redirect($this,
"editSettings");
1357 $this->form_gui->setValuesByPost();
1358 $this->tpl->setContent($this->form_gui->getHTML());
1367 if (is_object($this->
object)) {
1368 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this,
"listItems"),
"",
$_GET[
"ref_id"]);
1376 $ilAccess = $DIC->access();
1378 $lng = $DIC->language();
1380 if ($ilAccess->checkAccess(
"read",
"", $a_target)) {
1381 $_GET[
"cmd"] =
"showContent";
1382 $_GET[
"ref_id"] = $a_target;
1383 $_GET[
"baseClass"] =
"ilmediacasthandlergui";
1384 $_GET[
"cmdClass"] =
"ilobjmediacastgui";
1385 include(
"ilias.php");
1387 } elseif ($ilAccess->checkAccess(
"visible",
"", $a_target)) {
1389 } elseif ($ilAccess->checkAccess(
"read",
"", ROOT_FOLDER_ID)) {
1391 $lng->txt(
"msg_no_perm_read_item"),
1408 return strpos($extension,
"audio") !==
false;
1419 include_once(
"./Services/News/classes/class.ilNewsItem.php");
1422 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
1435 include_once(
"./Services/News/classes/class.ilNewsItem.php");
1438 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
1451 if (
$_POST[
"value_" . $purpose]) {
1452 $_POST[
"label_value_" . $purpose] =
$_POST[
"value_" . $purpose];
1456 $this->form_gui->setValuesByPost();
1457 $tpl->setContent($this->form_gui->getHTML());
1467 $ilTabs->activateTab(
"edit_content");
1472 switch ($this->object->getOrder()) {
1483 include_once(
"./Modules/MediaCast/classes/class.ilMediaCastTableGUI.php");
1486 $table_gui->setTitle(
$lng->txt(
"mcst_media_cast"));
1487 $table_gui->setData($this->object->getSortedItemsArray());
1489 $table_gui->addCommandButton(
"saveOrder",
$lng->txt(
"mcst_save_order"));
1491 $tpl->setContent($table_gui->getHTML());
1498 asort(
$_POST[
"item_id"]);
1501 foreach (array_keys(
$_POST[
"item_id"]) as
$id) {
1504 $this->
object->saveOrder($items);
1506 ilUtil::sendSuccess(
$lng->txt(
"settings_saved"),
true);
1507 $this->ctrl->redirect($this,
"editOrder");
1525 require_once
'Services/Tracking/classes/class.ilChangeEvent.php';
1528 $this->object->getRefId(),
1529 $this->
object->getId(),
1534 require_once
'Services/Tracking/classes/class.ilLPStatusWrapper.php';
1543 $tpl->setPermanentLink($this->object->getType(), $this->
object->getRefId());
1552 $tpl->addJavascript(
"./Modules/MediaCast/js/MediaCast.js");
1554 $ilTabs->activateTab(
"content");
1558 $ctpl =
new ilTemplate(
"tpl.mcst_content.html",
true,
true,
"Modules/MediaCast");
1560 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
1561 require_once(
'./Services/WebAccessChecker/classes/class.ilWACSignedPath.php');
1562 foreach ($this->object->getSortedItemsArray() as $item) {
1564 $med = $mob->getMediaItem(
"Standard");
1566 $ctpl->setCurrentBlock(
"item");
1567 $ctpl->setVariable(
"TITLE", $item[
"title"]);
1568 $ctpl->setVariable(
"TIME", $item[
"playtime"]);
1569 $ctpl->setVariable(
"ID", $item[
"id"]);
1571 if ($mob->getVideoPreviewPic() !=
"") {
1584 if (is_object($med)) {
1585 include_once(
"./Services/MediaObjects/classes/class.ilMediaPlayerGUI.php");
1590 $ilCtrl->getLinkTarget($this,
"handlePlayerEvent",
"",
true,
false)
1593 if (strcasecmp(
"Reference", $med->getLocationType()) == 0) {
1595 $mpl->setFile($med->getLocation());
1599 $mpl->setFile($path_to_file);
1601 $mpl->setMimeType($med->getFormat());
1603 $mpl->setDisplayHeight(
"480");
1604 $mpl->setDisplayWidth(
"640");
1606 $mpl->setTitle($item[
"title"]);
1607 $mpl->setDescription($item[
"content"]);
1608 $mpl->setForceAudioPreview(
true);
1609 if ($this->object->getDownloadable()) {
1610 $ilCtrl->setParameterByClass(
"ilobjmediacastgui",
"item_id", $item[
"id"]);
1611 $ilCtrl->setParameterByClass(
"ilobjmediacastgui",
"purpose",
"Standard");
1612 $mpl->setDownloadLink(
$ilCtrl->getLinkTargetByClass(
"ilobjmediacastgui",
"downloadItem"));
1614 $med_alt = $mob->getMediaItem(
"VideoAlternative");
1615 if (is_object($med_alt)) {
1617 $med_alt->getLocation()));
1618 $mpl->setAlternativeVideoMimeType($med_alt->getFormat());
1621 $ctpl->setVariable(
"PLAYER", $mpl->getPreviewHtml());
1625 $ctpl->parseCurrentBlock();
1630 if ($feed_icon_html !=
"") {
1631 $feed_icon_html =
'<p>' . $feed_icon_html .
'</p>';
1634 $tpl->setContent($feed_icon_html . $ctpl->get());
1650 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
1657 include_once(
"./Services/MediaObjects/classes/class.ilFFmpeg.php");
1658 $med = $mob->getMediaItem(
"Standard");
1662 $pi = pathinfo($new_file);
1663 $med = $mob->getMediaItem($target_purpose);
1664 if (!is_object($med)) {
1666 $med->setMobId($mob->getId());
1667 $mob->addMediaItem($med);
1669 $med->setPurpose($target_purpose);
1671 $med->setFormat($target_format);
1672 $med->setLocation($pi[
"basename"]);
1673 $med->setLocationType(
"LocalFile");
1676 $add = (is_array(
$ret) && count(
$ret) > 0)
1677 ?
"<br />" . implode(
$ret,
"<br />")
1683 $add = (is_array(
$ret) && count(
$ret) > 0)
1684 ?
"<br />" . implode(
$ret,
"<br />")
1690 $ilCtrl->redirect($this,
"editCastItem");
1706 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
1710 $sec = (int)
$_POST[
"sec"];
1714 if ($mob->getVideoPreviewPic() !=
"") {
1715 $mob->removeAdditionalFile($mob->getVideoPreviewPic(
true));
1717 include_once(
"./Services/MediaObjects/classes/class.ilFFmpeg.php");
1718 $med = $mob->getMediaItem(
"Standard");
1727 if ($new_file !=
"") {
1735 $add = (is_array(
$ret) && count(
$ret) > 0)
1736 ?
"<br />" . implode(
$ret,
"<br />")
1743 $ilCtrl->redirect($this,
"editCastItem");
1754 if (
$_GET[
"event"] ==
"play") {
1755 $player = explode(
"_",
$_GET[
"player"]);
1756 $news_id = (int) $player[1];
1757 include_once(
"./Services/News/classes/class.ilNewsItem.php");
1759 $item->increasePlayCounter();
1761 $mob_id = $item->getMobId();
1764 $this->
object->handleLPUpdate(
$ilUser->getId(), $mob_id);
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.
if(!array_key_exists('StateId', $_REQUEST)) $id
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.
static signFolderOfStartFile($start_file_path)
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)
Class ilObjectGUI Basic methods of all Output classes.
static _lookupObjId($a_id)
special template class to simplify handling of ITX/PEAR
static _lookup($a_type, $a_setting, $a_user=0, $a_block_id=0)
Lookup setting from database.
This class represents a text property in a property form.
setMaxLength($a_maxlength)
Set Max Length.
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.
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)
setValue($a_value)
Set Value.
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.