5 require_once
"./Services/Object/classes/class.ilObjectGUI.php";
33 $this->
ilObjectGUI($a_data,$a_id,$a_call_by_reference,$a_prepare_output);
34 $lng->loadLanguageModule(
"mcst");
35 $lng->loadLanguageModule(
"news");
37 $ilCtrl->saveParameter($this,
"item_id");
39 include_once (
"./Modules/MediaCast/classes/class.ilMediaCastSettings.php");
41 $this->purposeSuffixes = $settings->getPurposeSuffixes();
42 $this->mimeTypes = array();
43 $mime_types = $settings->getMimeTypes();
44 foreach ($mime_types as $mt)
46 $this->mimeTypes[$mt] = $mt;
49 include_once(
"./Services/Utilities/classes/class.ilMimeTypeUtil.php");
52 $this->mimeTypes[$mt] = $mt;
54 asort($this->mimeTypes);
61 $next_class = $this->ctrl->getNextClass($this);
62 $cmd = $this->ctrl->getCmd();
67 case "ilinfoscreengui":
74 $ilTabs->activateTab(
"export");
75 include_once(
"./Services/Export/classes/class.ilExportGUI.php");
77 $exp_gui->addFormat(
"xml");
78 $ret = $this->ctrl->forwardCommand($exp_gui);
82 case 'ilpermissiongui':
83 $ilTabs->activateTab(
"id_permissions");
84 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
86 $ret =& $this->ctrl->forwardCommand($perm_gui);
89 case "ilcommonactiondispatchergui":
90 include_once(
"Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
92 $this->ctrl->forwardCommand($gui);
101 if (
$cmd !=
"infoScreenObject")
121 $forms = array(self::CFORM_NEW => $this->
initCreateForm($a_new_type),
135 ilUtil::redirect(
"ilias.php?baseClass=ilMediaCastHandlerGUI&ref_id=".$newObj->getRefId().
"&cmd=editSettings");
143 global
$tpl,
$lng, $ilAccess, $ilTabs, $ilToolbar;
147 if ($a_presentation_mode)
156 $med_items = $this->
object->getSortedItemsArray();
158 include_once(
"./Modules/MediaCast/classes/class.ilMediaCastTableGUI.php");
159 if ($a_presentation_mode)
168 $table_gui->setData($med_items);
170 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"]) && !$a_presentation_mode)
172 $ilToolbar->addButton($lng->txt(
"add"), $this->ctrl->getLinkTarget($this,
"addCastItem"));
174 $table_gui->addMultiCommand(
"confirmDeletionItems", $lng->txt(
"delete"));
175 $table_gui->setSelectAllCheckbox(
"item_id");
179 if ($feed_icon_html !=
"")
181 $table_gui->setHeaderHTML($feed_icon_html);
184 $tpl->setContent($table_gui->getHTML());
186 $tpl->setPermanentLink($this->object->getType(), $this->
object->getRefId());
201 include_once(
"./Services/Block/classes/class.ilBlockSetting.php");
203 0, $this->object->getId());
209 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
211 if ($enable_internal_rss)
214 $items = $this->
object->getItemsArray();
215 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
219 foreach ($items as $id => $item)
223 if ($mob->hasPurposeItem($purpose))
229 $url = ILIAS_HTTP_PATH.
"/feed.php?client_id=".rawurlencode(CLIENT_ID).
"&".
"ref_id=".$_GET[
"ref_id"].
"&purpose=$purpose";
230 $title = $lng->txt(
"news_feed_url");
234 $row1 .=
"<A href='$url' target='$target'><img src='$icon' alt='$title'/></A>";
235 if ($this->object->getPublicFiles())
237 $url = preg_replace(
"/https?/i",
"itpc",$url);
238 $title = $lng->txt(
"news_feed_url");
240 $row2 .=
"<A href='$url' target='$target'><img src='$icon' alt='$title'/></A>";
252 $html .=
" ".$row2;
271 $tpl->setContent($this->form_gui->getHTML());
284 include_once(
"./Services/MediaObjects/classes/class.ilFFmpeg.php");
288 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
294 foreach (array(
"Standard") as $p)
335 include_once(
"./Services/Form/classes/class.ilTextInputGUI.php");
340 $ilToolbar->addInputItem($ni,
true);
342 $ilToolbar->addFormButton($this->lng->txt(
"mcst_extract_preview_image"),
"extractPreviewImage");
343 $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
356 $tpl->setContent($this->form_gui->getHTML());
367 $ilTabs->activateTab(
"edit_content");
369 $lng->loadLanguageModule(
"mcst");
372 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
374 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
376 $this->form_gui->setMultipart(
true);
381 $this->form_gui->addItem($text_input);
386 $this->form_gui->addItem($text_area);
389 if ($enable_internal_rss)
392 $radio_option =
new ilRadioOption($lng->txt(
"access_users"),
"users");
393 $radio_group->addOption($radio_option);
394 $radio_option =
new ilRadioOption($lng->txt(
"access_public"),
"public");
395 $radio_group->addOption($radio_option);
396 $radio_group->
setInfo($lng->txt(
"mcst_visibility_info"));
397 $radio_group->setRequired(
true);
398 $radio_group->setValue($this->object->getDefaultAccess() == 0 ?
"users" :
"public");
399 $this->form_gui->addItem($radio_group);
404 $dur->
setInfo($lng->txt(
"mcst_duration_info"));
405 $dur->setShowDays(
false);
406 $dur->setShowHours(
true);
407 $dur->setShowSeconds(
true);
408 $this->form_gui->addItem($dur);
412 if ($purpose ==
"VideoAlternative" &&
419 $section->setTitle($lng->txt(
"mcst_".strtolower($purpose).
"_title"));
421 if ($a_mode !=
"create")
426 $label->setInfo($lng->txt(
"mcst_current_value_info"));
427 $this->form_gui->addItem($label);
428 $this->form_gui->addItem($value);
432 $file->setSuffixes($this->purposeSuffixes[$purpose]);
433 $this->form_gui->addItem(
$file);
436 $text_input->setInfo($lng->txt(
"mcst_reference_info"));
437 $this->form_gui->addItem($text_input);
438 if ($purpose !=
"Standard")
441 $clearCheckBox->setPostVar(
"delete_".$purpose);
442 $clearCheckBox->setTitle($lng->txt(
"mcst_clear_purpose_title"));
443 $this->form_gui->addItem($clearCheckBox);
448 $mimeTypeSelection->setPostVar(
"mimetype_".$purpose);
449 $mimeTypeSelection->setTitle($lng->txt(
"mcst_mimetype"));
450 $mimeTypeSelection->setInfo($lng->txt(
"mcst_mimetype_info"));
451 $options = array(
"" => $lng->txt(
"mcst_automatic_detection"));
452 $options = array_merge($options, $this->mimeTypes);
453 $mimeTypeSelection->setOptions($options);
454 $this->form_gui->addItem($mimeTypeSelection);
459 $pp->setInfo($lng->txt(
"mcst_preview_picture_info").
" mp4, mp3, png, jp(e)g, gif");
460 $this->form_gui->addItem($pp);
467 if ($a_mode ==
"create")
469 $this->form_gui->setTitle($lng->txt(
"mcst_add_new_item"));
470 $this->form_gui->addCommandButton(
"saveCastItem", $lng->txt(
"save"));
474 $this->form_gui->setTitle($lng->txt(
"mcst_edit_item"));
475 $this->form_gui->addCommandButton(
"updateCastItem", $lng->txt(
"save"));
477 $this->form_gui->addCommandButton(
"listItems", $lng->txt(
"cancel"));
478 $this->form_gui->setFormAction($ilCtrl->getFormAction($this,
"saveCastItem"));
491 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
498 $i = $this->form_gui->getItemByPostVar(
"preview_pic");
505 if (count ($mediaItems) > 0)
507 foreach ($mediaItems as $med)
509 if (!isset ($values[
"title"]))
512 $values[
"title"] = $this->mcst_item->getTitle();
513 $values[
"description"] = $this->mcst_item->getContent();
514 $values[
"visibility"] = $this->mcst_item->getVisibility();
515 $length = explode(
":", $this->mcst_item->getPlaytime());
516 $values[
"duration"] = array(
"hh" => $length[0],
"mm" => $length[1],
"ss" => $length[2]);
519 $values[
"value_".$med->getPurpose()] = (strlen($med->getLocation())> 100) ?
"...".substr($med->getLocation(), strlen($med->getLocation()) - 100) : $med->getLocation();
520 $values[
"label_value_".$med->getPurpose()] = (strlen($med->getLocation())> 100) ?
"...".substr($med->getLocation(), strlen($med->getLocation()) - 100) : $med->getLocation();
521 $values[
"mimetype_".$med->getPurpose()] = $med->getFormat();
525 if (!isset ($values[
"value_".$purpose]))
527 $values[
"label_value_".$purpose] = $lng->txt(
"none");
528 $values[
"value_".$purpose] = $lng->txt(
"none");
531 $this->form_gui->setValuesByArray($values);
542 $ilTabs->activateTab(
"edit_content");
546 if (
$_POST[
"url_Standard"] ==
"" && !$_FILES[
'file_Standard'][
'tmp_name']) {
550 else if ($this->form_gui->checkInput())
553 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
562 $title = $this->form_gui->getInput(
"title") !=
"" ? $this->form_gui->getInput(
"title") : basename(
$file);
563 $description = $this->form_gui->getInput(
"description");
565 $mob->setDescription($description);
568 $prevpic = $this->form_gui->getInput(
"preview_pic");
569 if ($prevpic[
"size"] > 0)
571 $mob->uploadVideoPreviewPic($prevpic);
578 foreach ($this->additionalPurposes as $purpose)
581 $file_gui = $this->form_gui->getInput(
"file_".$purpose);
582 $url_gui = $this->form_gui->getInput(
"url_".$purpose);
583 if ($url_gui || $file_gui[
"size"] > 0)
591 if ($prevpic[
"size"] == 0)
603 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
606 include_once(
"./Services/News/classes/class.ilNewsItem.php");
608 $mc_item->setMobId($mob->getId());
610 $mc_item->setContextObjId($this->object->getId());
611 $mc_item->setContextObjType($this->object->getType());
612 $mc_item->setUserId($ilUser->getId());
613 $mc_item->setPlaytime($duration);
614 $mc_item->setTitle(
$title);
615 $mc_item->setContent($description);
616 $mc_item->setLimitation(
false);
617 if ($enable_internal_rss)
619 $mc_item->setVisibility($this->form_gui->getInput(
"visibility"));
623 $mc_item->setVisibility(
"users");
627 $ilCtrl->redirect($this,
"listItems");
643 $duration = isset($this->form_gui)
644 ? $this->form_gui->getInput(
"duration")
645 : array(
"hh"=>0,
"mm"=>0,
"ss"=>0);
646 if ($duration[
"hh"] == 0 && $duration[
"mm"] == 0 && $duration[
"ss"] == 0 && is_file(
$file))
648 include_once(
"./Services/MediaObjects/classes/class.ilMediaAnalyzer.php");
650 $ana->setFile(
$file);
652 $dur = $ana->getPlaytimeString();
653 $dur = explode(
":", $dur);
654 $duration[
"mm"] = $dur[0];
655 $duration[
"ss"] = $dur[1];
657 $duration = str_pad($duration[
"hh"], 2 ,
"0", STR_PAD_LEFT).
":".
658 str_pad($duration[
"mm"], 2 ,
"0", STR_PAD_LEFT).
":".
659 str_pad($duration[
"ss"], 2 ,
"0", STR_PAD_LEFT);
672 $mob->addMediaItem($mediaItem);
673 $mediaItem->setPurpose($purpose);
686 $purpose = $mediaItem->getPurpose();
687 $url_gui = $this->form_gui->getInput (
"url_".$purpose);
688 $file_gui = $this->form_gui->getInput (
"file_".$purpose);
692 $file = $this->form_gui->getInput (
"url_".$purpose);
694 $location = $this->form_gui->getInput (
"url_".$purpose);
695 $locationType =
"Reference";
696 } elseif ($file_gui[
"size"] > 0){
700 if (!is_dir($mob_dir))
701 $mob->createDirectory();
704 $file_name = str_replace(
" ",
"_", $file_name);
706 $file = $mob_dir.
"/".$file_name;
708 $locationType =
"LocalFile";
716 if (
$_POST[
"mimetype_".$purpose] !=
"")
718 $mediaItem->setFormat(
$_POST[
"mimetype_".$purpose]);
720 elseif ($mediaItem->getLocation () !=
"")
723 $mediaItem->setFormat($format);
735 $mediaItem->setFormat($format);
737 $mediaItem->setLocationType($locationType);
738 $mediaItem->setHAlign(
"Left");
739 $mediaItem->setHeight(self::isAudio($format)?0:180);
742 if ($purpose ==
"Standard")
747 $mob->setDescription($format);
764 if ($this->form_gui->checkInput())
767 include_once(
"./Services/News/classes/class.ilNewsItem.php");
769 $mob_id = $mc_item->getMobId();
772 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
778 if ($this->form_gui->getInput(
"delete_".$purpose))
780 $mob->removeMediaItem($purpose);
781 $log->write (
"Mcst: deleting purpose $purpose");
784 $media_item = $mob->getMediaItem($purpose);
785 $url_gui = $this->form_gui->getInput(
"url_".$purpose);
786 $file_gui = $this->form_gui->getInput(
"file_".$purpose);
788 if ($media_item == null)
790 if ($purpose !=
"Standard" &&
791 ($url_gui || $file_gui[
"size"]>0))
802 if ($purpose ==
"Standard")
805 $title = $this->form_gui->getInput(
"title") !=
"" ? $this->form_gui->getInput(
"title") : basename(
$file);
806 $description = $this->form_gui->getInput(
"description");
809 $mob->setDescription($description);
811 $prevpic = $this->form_gui->getInput(
"preview_pic");
812 if ($prevpic[
"size"] > 0)
814 $mob->uploadVideoPreviewPic($prevpic);
818 $prevpici = $this->form_gui->getItemByPostVar(
"preview_pic");
819 if ($prevpici->getDeletionFlag())
821 $mob->removeAdditionalFile($mob->getVideoPreviewPic(
true));
835 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
837 $mc_item->setUserId($ilUser->getId());
838 if (isset($duration))
840 $mc_item->setPlaytime($duration);
842 $mc_item->setTitle(
$title);
843 $mc_item->setContent($description);
844 if ($enable_internal_rss)
846 $mc_item->setVisibility($this->form_gui->getInput(
"visibility"));
850 $ilCtrl->redirect($this,
"listItems");
866 $ilTabs->activateTab(
"edit_content");
868 if (!is_array(
$_POST[
"item_id"]))
874 include_once(
"Services/Utilities/classes/class.ilConfirmationGUI.php");
878 $c_gui->setFormAction($ilCtrl->getFormAction($this,
"deleteItems"));
879 $c_gui->setHeaderText($lng->txt(
"info_delete_sure"));
880 $c_gui->setCancel($lng->txt(
"cancel"),
"listItems");
881 $c_gui->setConfirm($lng->txt(
"confirm"),
"deleteItems");
884 include_once(
"./Services/News/classes/class.ilNewsItem.php");
885 foreach(
$_POST[
"item_id"] as $item_id)
888 $c_gui->addItem(
"item_id[]", $item_id, $item->getTitle(),
892 $tpl->setContent($c_gui->getHTML());
905 foreach(
$_POST[
"item_id"] as $item_id)
911 $ilCtrl->redirect($this,
"listItems");
923 $mob = $mc_item->getMobId();
924 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
927 $purpose =
$_GET[
"purpose"];
928 $m_item = $mob->getMediaItem($purpose);
929 if ($m_item->getLocationType() !=
"Reference")
931 $file = $mob_dir.
"/".$m_item->getLocation();
938 $ilCtrl->redirect($this,
"listItems");
956 $mob = $mc_item->getMobId();
957 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
960 $m_item = $mob->getMediaItem(
"Standard");
961 $file = $mob_dir.
"/".$m_item->getLocation();
963 if ($duration !=
"00:00:00")
965 $mc_item->setPlaytime($duration);
974 $ilCtrl->redirect($this,
"listItems");
985 $this->ctrl->setCmd(
"showSummary");
986 $this->ctrl->setCmdClass(
"ilinfoscreengui");
995 global $ilAccess,
$ilUser, $ilTabs;
997 $ilTabs->activateTab(
"id_info");
999 if (!$ilAccess->checkAccess(
"visible",
"", $this->object->getRefId()))
1001 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_read"),$this->ilias->error_obj->MESSAGE);
1004 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
1007 $info->enablePrivateNotes();
1018 $this->lng->loadLanguageModule(
"meta");
1019 $this->lng->loadLanguageModule(
"mcst");
1020 $med_items = $this->
object->getItemsArray();
1021 $info->addSection($this->lng->txt(
"meta_general"));
1022 $info->addProperty($this->lng->txt(
"mcst_nr_items"),
1023 (int) count($med_items));
1025 if (count($med_items) > 0)
1027 $cur = current($med_items);
1035 $info->addProperty($this->lng->txt(
"mcst_last_submission"), $last);
1038 $this->ctrl->forwardCommand($info);
1047 global $ilAccess, $ilTabs,
$lng, $ilHelp;
1049 $ilHelp->setScreenIdComponent(
"mcst");
1052 if ($ilAccess->checkAccess(
'read',
"", $this->object->getRefId()))
1054 $ilTabs->addTab(
"content",
1055 $lng->txt(
"content"),
1056 $this->ctrl->getLinkTarget($this,
"showContent"));
1060 if ($ilAccess->checkAccess(
'visible',
"", $this->object->getRefId()))
1062 $ilTabs->addTab(
"id_info",
1063 $lng->txt(
"info_short"),
1064 $this->ctrl->getLinkTargetByClass(
"ilinfoscreengui",
"showSummary"));
1068 if ($ilAccess->checkAccess(
'write',
"", $this->object->getRefId()))
1070 $ilTabs->addTab(
"id_settings",
1071 $lng->txt(
"settings"),
1072 $this->ctrl->getLinkTarget($this,
"editSettings"));
1076 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
1078 $ilTabs->addTab(
"export",
1079 $lng->txt(
"export"),
1080 $this->ctrl->getLinkTargetByClass(
"ilexportgui",
""));
1084 if ($ilAccess->checkAccess(
'edit_permission',
"", $this->object->getRefId()))
1086 $ilTabs->addTab(
"id_permissions",
1087 $lng->txt(
"perm_settings"),
1088 $this->ctrl->getLinkTargetByClass(
"ilpermissiongui",
"perm"));
1100 global $ilTabs, $ilAccess,
$lng;
1102 $ilTabs->addSubTab(
"content",
1104 $this->ctrl->getLinkTarget($this,
"showContent"));
1106 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"]))
1108 $ilTabs->addSubTab(
"manage",
1109 $lng->txt(
"mcst_manage"),
1110 $this->ctrl->getLinkTarget($this,
"listItems"));
1114 $ilTabs->addSubTab(
"sorting",
1115 $lng->txt(
"mcst_ordering"),
1116 $this->ctrl->getLinkTarget($this,
"editOrder"));
1120 $ilTabs->activateSubTab($a_active);
1121 $ilTabs->activateTab(
"content");
1130 global
$tpl, $ilTabs;
1133 $ilTabs->activateTab(
"id_settings");
1136 $tpl->setContent($this->form_gui->getHtml());
1146 $lng->loadLanguageModule(
"mcst");
1148 include(
"Services/Form/classes/class.ilPropertyFormGUI.php");
1150 $this->form_gui->setTitle($lng->txt(
"mcst_settings"));
1154 $tit->
setValue($this->object->getTitle());
1155 $tit->setRequired(
true);
1156 $this->form_gui->addItem($tit);
1160 $des->
setValue($this->object->getLongDescription());
1161 $this->form_gui->addItem($des);
1165 $online->
setChecked($this->object->getOnline());
1166 $this->form_gui->addItem($online);
1172 $sort->addOption(
new ilRadioOption($lng->txt(
"mcst_ordering_creation_date_asc"),
1174 $sort->addOption(
new ilRadioOption($lng->txt(
"mcst_ordering_creation_date_desc"),
1176 $sort->addOption(
new ilRadioOption($lng->txt(
"mcst_ordering_manual"),
1178 $sort->setValue($this->object->getOrder());
1179 $this->form_gui->addItem($sort);
1188 $si->setValue($this->object->getViewMode());
1189 $this->form_gui->addItem($si);
1193 $downloadable =
new ilCheckboxInputGUI($lng->txt(
"mcst_downloadable"),
"downloadable");
1194 $downloadable->
setChecked($this->object->getDownloadable());
1195 $downloadable->setInfo($lng->txt(
"mcst_downloadable_info"));
1196 $this->form_gui->addItem($downloadable);
1199 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
1202 if ($enable_internal_rss)
1204 $radio_group =
new ilRadioGroupInputGUI($lng->txt(
"news_default_visibility"),
"defaultaccess");
1205 $radio_option =
new ilRadioOption($lng->txt(
"news_visibility_users"),
"0");
1206 $radio_group->addOption($radio_option);
1207 $radio_option =
new ilRadioOption($lng->txt(
"news_visibility_public"),
"1");
1208 $radio_group->addOption($radio_option);
1209 $radio_group->
setInfo($lng->txt(
"news_news_item_visibility_info"));
1210 $radio_group->setRequired(
false);
1211 $radio_group->setValue($this->object->getDefaultAccess());
1212 #$ch->addSubItem($radio_group);
1213 $this->form_gui->addItem($radio_group);
1216 include_once(
"./Services/Block/classes/class.ilBlockSetting.php");
1219 $ch->
setInfo($lng->txt(
"news_public_feed_info"));
1220 $ch->setChecked($public_feed);
1221 $this->form_gui->addItem($ch);
1224 $ni =
new ilNumberInputGUI($this->lng->txt(
"news_keep_minimal_x_items"),
"keep_rss_min");
1226 $ni->setMinValue(0);
1227 $ni->setMaxLength(3);
1229 $ni->setInfo($this->lng->txt(
"news_keep_minimal_x_items_info").
" (".
1232 $ch->addSubItem($ni);
1235 $incl_files =
new ilCheckboxInputGUI($lng->txt(
"mcst_incl_files_in_rss"),
"public_files");
1236 $incl_files->
setChecked($this->object->getPublicFiles());
1237 $incl_files->setInfo($lng->txt(
"mcst_incl_files_in_rss_info"));
1238 #$ch->addSubItem($incl_files);
1239 $this->form_gui->addItem($incl_files);
1243 $this->form_gui->addCommandButton(
"saveSettings", $lng->txt(
"save"));
1244 $this->form_gui->setFormAction($ilCtrl->getFormAction($this,
"saveSettings"));
1255 $ilTabs->activateTab(
"id_settings");
1258 if ($this->form_gui->checkInput())
1261 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
1263 $this->
object->setTitle($this->form_gui->getInput(
"title"));
1264 $this->
object->setDescription($this->form_gui->getInput(
"description"));
1265 $this->
object->setOnline($this->form_gui->getInput(
"online"));
1266 $this->
object->setDownloadable($this->form_gui->getInput(
"downloadable"));
1267 $this->
object->setOrder($this->form_gui->getInput(
"order"));
1268 $this->
object->setViewMode($this->form_gui->getInput(
"viewmode"));
1270 if ($enable_internal_rss)
1272 $this->
object->setPublicFiles($this->form_gui->getInput(
"public_files"));
1273 $this->
object->setDefaultAccess($this->form_gui->getInput(
"defaultaccess"));
1275 $this->
object->update();
1277 if ($enable_internal_rss)
1279 include_once(
"./Services/Block/classes/class.ilBlockSetting.php");
1281 $this->form_gui->getInput(
"extra_feed"),
1282 0, $this->
object->getId());
1285 $this->form_gui->getInput(
"keep_rss_min"),
1286 0, $this->
object->getId());
1290 $ilCtrl->redirect($this,
"editSettings");
1294 $this->form_gui->setValuesByPost();
1295 $this->tpl->setContent($this->form_gui->getHTML());
1304 if (is_object($this->
object))
1306 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this,
"listItems"),
"",
$_GET[
"ref_id"]);
1314 if ($ilAccess->checkAccess(
"read",
"", $a_target))
1316 $_GET[
"cmd"] =
"listItems";
1317 $_GET[
"ref_id"] = $a_target;
1318 $_GET[
"baseClass"] =
"ilmediacasthandlergui";
1319 $_GET[
"cmdClass"] =
"ilobjmediacastgui";
1320 include(
"ilias.php");
1323 else if ($ilAccess->checkAccess(
"visible",
"", $a_target))
1327 else if ($ilAccess->checkAccess(
"read",
"", ROOT_FOLDER_ID))
1334 $ilErr->raiseError($lng->txt(
"msg_no_perm_read"), $ilErr->FATAL);
1345 return strpos($extension,
"audio") !==
false;
1355 include_once(
"./Services/News/classes/class.ilNewsItem.php");
1358 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
1370 include_once(
"./Services/News/classes/class.ilNewsItem.php");
1373 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
1387 if (
$_POST[
"value_".$purpose])
1389 $_POST[
"label_value_".$purpose] =
$_POST[
"value_".$purpose];
1393 $this->form_gui->setValuesByPost();
1394 $tpl->setContent($this->form_gui->getHTML());
1402 $ilTabs->activateTab(
"edit_content");
1407 switch($this->object->getOrder())
1419 include_once(
"./Modules/MediaCast/classes/class.ilMediaCastTableGUI.php");
1422 $table_gui->setTitle($lng->txt(
"mcst_media_cast"));
1423 $table_gui->setData($this->object->getSortedItemsArray());
1425 $table_gui->addCommandButton(
"saveOrder", $lng->txt(
"mcst_save_order"));
1427 $tpl->setContent($table_gui->getHTML());
1434 asort(
$_POST[
"item_id"]);
1437 foreach(array_keys(
$_POST[
"item_id"]) as $id)
1441 $this->
object->saveOrder($items);
1444 $this->ctrl->redirect($this,
"editOrder");
1471 global
$tpl, $ilTabs;
1473 $tpl->addJavascript(
"./Modules/MediaCast/js/MediaCast.js");
1475 $ilTabs->activateTab(
"content");
1479 $ctpl =
new ilTemplate(
"tpl.mcst_content.html",
true,
true,
"Modules/MediaCast");
1481 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
1482 foreach ($this->object->getSortedItemsArray() as $item)
1485 $med = $mob->getMediaItem(
"Standard");
1487 $ctpl->setCurrentBlock(
"item");
1488 $ctpl->setVariable(
"TITLE", $item[
"title"]);
1489 $ctpl->setVariable(
"TIME", $item[
"playtime"]);
1490 $ctpl->setVariable(
"ID", $item[
"id"]);
1492 if ($mob->getVideoPreviewPic() !=
"")
1494 $ctpl->setVariable(
"PREVIEW_PIC",
1495 ilUtil::img($mob->getVideoPreviewPic(), $item[
"title"], 320, 240));
1499 $ctpl->setVariable(
"PREVIEW_PIC",
1504 if (is_object($med))
1506 include_once(
"./Services/MediaObjects/classes/class.ilMediaPlayerGUI.php");
1509 if (strcasecmp(
"Reference", $med->getLocationType()) == 0)
1511 $mpl->setFile($med->getLocation());
1517 $mpl->setMimeType ($med->getFormat());
1519 $mpl->setDisplayHeight(
"480");
1520 $mpl->setDisplayWidth(
"640");
1521 $mpl->setVideoPreviewPic($mob->getVideoPreviewPic());
1522 $mpl->setTitle($item[
"title"]);
1523 $mpl->setDescription($item[
"content"]);
1524 $mpl->setForceAudioPreview(
true);
1525 $med_alt = $mob->getMediaItem(
"VideoAlternative");
1526 if (is_object($med_alt))
1529 $med_alt->getLocation());
1530 $mpl->setAlternativeVideoMimeType($med_alt->getFormat());
1533 $ctpl->setVariable(
"PLAYER", $mpl->getPreviewHtml());
1537 $ctpl->parseCurrentBlock();
1542 if ($feed_icon_html !=
"")
1544 $feed_icon_html =
'<p>'.$feed_icon_html.
'</p>';
1547 $tpl->setContent($feed_icon_html.$ctpl->get());
1563 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
1571 include_once(
"./Services/MediaObjects/classes/class.ilFFmpeg.php");
1572 $med = $mob->getMediaItem(
"Standard");
1576 $pi = pathinfo($new_file);
1577 $med = $mob->getMediaItem($target_purpose);
1578 if (!is_object($med))
1581 $med->setMobId($mob->getId());
1582 $mob->addMediaItem($med);
1584 $med->setPurpose($target_purpose);
1586 $med->setFormat($target_format);
1587 $med->setLocation($pi[
"basename"]);
1588 $med->setLocationType(
"LocalFile");
1591 $add = (is_array(
$ret) && count(
$ret) > 0)
1592 ?
"<br />".implode(
$ret,
"<br />")
1600 $add = (is_array(
$ret) && count(
$ret) > 0)
1601 ?
"<br />".implode(
$ret,
"<br />")
1607 $ilCtrl->redirect($this,
"editCastItem");
1623 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
1628 $sec = (int)
$_POST[
"sec"];
1633 if ($mob->getVideoPreviewPic() !=
"")
1635 $mob->removeAdditionalFile($mob->getVideoPreviewPic(
true));
1637 include_once(
"./Services/MediaObjects/classes/class.ilFFmpeg.php");
1638 $med = $mob->getMediaItem(
"Standard");
1643 if ($new_file !=
"")
1657 $add = (is_array(
$ret) && count(
$ret) > 0)
1658 ?
"<br />".implode(
$ret,
"<br />")
1665 $ilCtrl->redirect($this,
"editCastItem");