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");
36 $lng->loadLanguageModule(
"rep");
38 $ilCtrl->saveParameter($this,
"item_id");
40 include_once (
"./Modules/MediaCast/classes/class.ilMediaCastSettings.php");
42 $this->purposeSuffixes = $settings->getPurposeSuffixes();
43 $this->mimeTypes = array();
44 $mime_types = $settings->getMimeTypes();
45 foreach ($mime_types as $mt)
47 $this->mimeTypes[$mt] = $mt;
50 include_once(
"./Services/Utilities/classes/class.ilMimeTypeUtil.php");
53 $this->mimeTypes[$mt] = $mt;
55 asort($this->mimeTypes);
62 $next_class = $this->ctrl->getNextClass($this);
63 $cmd = $this->ctrl->getCmd();
68 case "ilinfoscreengui":
75 $ilTabs->activateTab(
"export");
76 include_once(
"./Services/Export/classes/class.ilExportGUI.php");
78 $exp_gui->addFormat(
"xml");
79 $ret = $this->ctrl->forwardCommand($exp_gui);
83 case 'ilpermissiongui':
84 $ilTabs->activateTab(
"id_permissions");
85 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
87 $ret =& $this->ctrl->forwardCommand($perm_gui);
90 case "ilcommonactiondispatchergui":
91 include_once(
"Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
93 $this->ctrl->forwardCommand($gui);
102 if (
$cmd !=
"infoScreenObject")
122 $forms = array(self::CFORM_NEW => $this->
initCreateForm($a_new_type),
136 ilUtil::redirect(
"ilias.php?baseClass=ilMediaCastHandlerGUI&ref_id=".$newObj->getRefId().
"&cmd=editSettings");
144 global
$tpl,
$lng, $ilAccess, $ilTabs, $ilToolbar;
148 if ($a_presentation_mode)
157 $med_items = $this->
object->getSortedItemsArray();
159 include_once(
"./Modules/MediaCast/classes/class.ilMediaCastTableGUI.php");
160 if ($a_presentation_mode)
169 $table_gui->setData($med_items);
171 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"]) && !$a_presentation_mode)
173 $ilToolbar->addButton($lng->txt(
"add"), $this->ctrl->getLinkTarget($this,
"addCastItem"));
175 $table_gui->addMultiCommand(
"confirmDeletionItems", $lng->txt(
"delete"));
176 $table_gui->setSelectAllCheckbox(
"item_id");
180 if ($feed_icon_html !=
"")
182 $table_gui->setHeaderHTML($feed_icon_html);
185 $tpl->setContent($table_gui->getHTML());
187 $tpl->setPermanentLink($this->object->getType(), $this->
object->getRefId());
202 include_once(
"./Services/Block/classes/class.ilBlockSetting.php");
204 0, $this->object->getId());
210 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
212 if ($enable_internal_rss)
215 $items = $this->
object->getItemsArray();
216 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
220 foreach ($items as $id => $item)
224 if ($mob->hasPurposeItem($purpose))
230 $url = ILIAS_HTTP_PATH.
"/feed.php?client_id=".rawurlencode(CLIENT_ID).
"&".
"ref_id=".$_GET[
"ref_id"].
"&purpose=$purpose";
231 $title = $lng->txt(
"news_feed_url");
233 include_once(
"./Services/News/classes/class.ilRSSButtonGUI.php");
234 switch (strtolower($purpose))
236 case "audioportable":
241 case "videoportable":
251 $row1 .=
" ".ilRSSButtonGUI::get($type1, $url);
252 if ($this->object->getPublicFiles())
254 $url = preg_replace(
"/https?/i",
"itpc",$url);
255 $title = $lng->txt(
"news_feed_url");
257 include_once(
"./Services/News/classes/class.ilRSSButtonGUI.php");
258 $row2 .=
" ".ilRSSButtonGUI::get($type2, $url);
288 $tpl->setContent($this->form_gui->getHTML());
301 include_once(
"./Services/MediaObjects/classes/class.ilFFmpeg.php");
305 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
311 foreach (array(
"Standard") as $p)
352 include_once(
"./Services/Form/classes/class.ilTextInputGUI.php");
357 $ilToolbar->addInputItem($ni,
true);
359 $ilToolbar->addFormButton($this->lng->txt(
"mcst_extract_preview_image"),
"extractPreviewImage");
360 $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
373 $tpl->setContent($this->form_gui->getHTML());
384 $ilTabs->activateTab(
"edit_content");
386 $lng->loadLanguageModule(
"mcst");
389 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
391 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
393 $this->form_gui->setMultipart(
true);
398 $this->form_gui->addItem($text_input);
403 $this->form_gui->addItem($text_area);
406 if ($enable_internal_rss)
409 $radio_option =
new ilRadioOption($lng->txt(
"access_users"),
"users");
410 $radio_group->addOption($radio_option);
411 $radio_option =
new ilRadioOption($lng->txt(
"access_public"),
"public");
412 $radio_group->addOption($radio_option);
413 $radio_group->
setInfo($lng->txt(
"mcst_visibility_info"));
414 $radio_group->setRequired(
true);
415 $radio_group->setValue($this->object->getDefaultAccess() == 0 ?
"users" :
"public");
416 $this->form_gui->addItem($radio_group);
421 $dur->
setInfo($lng->txt(
"mcst_duration_info"));
422 $dur->setShowDays(
false);
423 $dur->setShowHours(
true);
424 $dur->setShowSeconds(
true);
425 $this->form_gui->addItem($dur);
429 if ($purpose ==
"VideoAlternative" &&
436 $section->setTitle($lng->txt(
"mcst_".strtolower($purpose).
"_title"));
438 if ($a_mode !=
"create")
443 $label->setInfo($lng->txt(
"mcst_current_value_info"));
444 $this->form_gui->addItem($label);
445 $this->form_gui->addItem($value);
449 $file->setSuffixes($this->purposeSuffixes[$purpose]);
450 $this->form_gui->addItem(
$file);
453 $text_input->setInfo($lng->txt(
"mcst_reference_info"));
454 $this->form_gui->addItem($text_input);
455 if ($purpose !=
"Standard")
458 $clearCheckBox->setPostVar(
"delete_".$purpose);
459 $clearCheckBox->setTitle($lng->txt(
"mcst_clear_purpose_title"));
460 $this->form_gui->addItem($clearCheckBox);
465 $mimeTypeSelection->setPostVar(
"mimetype_".$purpose);
466 $mimeTypeSelection->setTitle($lng->txt(
"mcst_mimetype"));
467 $mimeTypeSelection->setInfo($lng->txt(
"mcst_mimetype_info"));
468 $options = array(
"" => $lng->txt(
"mcst_automatic_detection"));
469 $options = array_merge($options, $this->mimeTypes);
470 $mimeTypeSelection->setOptions($options);
471 $this->form_gui->addItem($mimeTypeSelection);
476 $pp->setInfo($lng->txt(
"mcst_preview_picture_info").
" mp4, mp3, png, jp(e)g, gif");
477 $this->form_gui->addItem($pp);
484 if ($a_mode ==
"create")
486 $this->form_gui->setTitle($lng->txt(
"mcst_add_new_item"));
487 $this->form_gui->addCommandButton(
"saveCastItem", $lng->txt(
"save"));
491 $this->form_gui->setTitle($lng->txt(
"mcst_edit_item"));
492 $this->form_gui->addCommandButton(
"updateCastItem", $lng->txt(
"save"));
494 $this->form_gui->addCommandButton(
"listItems", $lng->txt(
"cancel"));
495 $this->form_gui->setFormAction($ilCtrl->getFormAction($this,
"saveCastItem"));
508 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
515 $i = $this->form_gui->getItemByPostVar(
"preview_pic");
522 if (count ($mediaItems) > 0)
524 foreach ($mediaItems as $med)
526 if (!isset ($values[
"title"]))
529 $values[
"title"] = $this->mcst_item->getTitle();
530 $values[
"description"] = $this->mcst_item->getContent();
531 $values[
"visibility"] = $this->mcst_item->getVisibility();
532 $length = explode(
":", $this->mcst_item->getPlaytime());
533 $values[
"duration"] = array(
"hh" => $length[0],
"mm" => $length[1],
"ss" => $length[2]);
536 $values[
"value_".$med->getPurpose()] = (strlen($med->getLocation())> 100) ?
"...".substr($med->getLocation(), strlen($med->getLocation()) - 100) : $med->getLocation();
537 $values[
"label_value_".$med->getPurpose()] = (strlen($med->getLocation())> 100) ?
"...".substr($med->getLocation(), strlen($med->getLocation()) - 100) : $med->getLocation();
538 $values[
"mimetype_".$med->getPurpose()] = $med->getFormat();
542 if (!isset ($values[
"value_".$purpose]))
544 $values[
"label_value_".$purpose] = $lng->txt(
"none");
545 $values[
"value_".$purpose] = $lng->txt(
"none");
548 $this->form_gui->setValuesByArray($values);
559 $ilTabs->activateTab(
"edit_content");
563 if (
$_POST[
"url_Standard"] ==
"" && !$_FILES[
'file_Standard'][
'tmp_name']) {
567 else if ($this->form_gui->checkInput())
570 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
579 $title = $this->form_gui->getInput(
"title") !=
"" ? $this->form_gui->getInput(
"title") : basename(
$file);
580 $description = $this->form_gui->getInput(
"description");
581 $mob->setTitle($title);
582 $mob->setDescription($description);
585 $prevpic = $this->form_gui->getInput(
"preview_pic");
586 if ($prevpic[
"size"] > 0)
588 $mob->uploadVideoPreviewPic($prevpic);
595 foreach ($this->additionalPurposes as $purpose)
598 $file_gui = $this->form_gui->getInput(
"file_".$purpose);
599 $url_gui = $this->form_gui->getInput(
"url_".$purpose);
600 if ($url_gui || $file_gui[
"size"] > 0)
608 if ($prevpic[
"size"] == 0)
620 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
623 include_once(
"./Services/News/classes/class.ilNewsItem.php");
625 $mc_item->setMobId($mob->getId());
627 $mc_item->setContextObjId($this->object->getId());
628 $mc_item->setContextObjType($this->object->getType());
629 $mc_item->setUserId($ilUser->getId());
630 $mc_item->setPlaytime($duration);
631 $mc_item->setTitle($title);
632 $mc_item->setContent($description);
633 $mc_item->setLimitation(
false);
634 if ($enable_internal_rss)
636 $mc_item->setVisibility($this->form_gui->getInput(
"visibility"));
640 $mc_item->setVisibility(
"users");
644 $ilCtrl->redirect($this,
"listItems");
660 $duration = isset($this->form_gui)
661 ? $this->form_gui->getInput(
"duration")
662 : array(
"hh"=>0,
"mm"=>0,
"ss"=>0);
663 if ($duration[
"hh"] == 0 && $duration[
"mm"] == 0 && $duration[
"ss"] == 0 && is_file(
$file))
665 include_once(
"./Services/MediaObjects/classes/class.ilMediaAnalyzer.php");
667 $ana->setFile(
$file);
669 $dur = $ana->getPlaytimeString();
670 $dur = explode(
":", $dur);
671 $duration[
"mm"] = $dur[0];
672 $duration[
"ss"] = $dur[1];
674 $duration = str_pad($duration[
"hh"], 2 ,
"0", STR_PAD_LEFT).
":".
675 str_pad($duration[
"mm"], 2 ,
"0", STR_PAD_LEFT).
":".
676 str_pad($duration[
"ss"], 2 ,
"0", STR_PAD_LEFT);
689 $mob->addMediaItem($mediaItem);
690 $mediaItem->setPurpose($purpose);
703 $purpose = $mediaItem->getPurpose();
704 $url_gui = $this->form_gui->getInput (
"url_".$purpose);
705 $file_gui = $this->form_gui->getInput (
"file_".$purpose);
709 $file = $this->form_gui->getInput (
"url_".$purpose);
710 $title = basename (
$file);
711 $location = $this->form_gui->getInput (
"url_".$purpose);
712 $locationType =
"Reference";
713 } elseif ($file_gui[
"size"] > 0){
717 if (!is_dir($mob_dir))
718 $mob->createDirectory();
721 $file_name = str_replace(
" ",
"_", $file_name);
723 $file = $mob_dir.
"/".$file_name;
725 $locationType =
"LocalFile";
733 if (
$_POST[
"mimetype_".$purpose] !=
"")
735 $mediaItem->setFormat(
$_POST[
"mimetype_".$purpose]);
737 elseif ($mediaItem->getLocation () !=
"")
740 $mediaItem->setFormat($format);
752 $mediaItem->setFormat($format);
754 $mediaItem->setLocationType($locationType);
755 $mediaItem->setHAlign(
"Left");
756 $mediaItem->setHeight(self::isAudio($format)?0:180);
759 if ($purpose ==
"Standard")
762 $mob->setTitle ($title);
764 $mob->setDescription($format);
781 if ($this->form_gui->checkInput())
784 include_once(
"./Services/News/classes/class.ilNewsItem.php");
786 $mob_id = $mc_item->getMobId();
789 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
795 if ($this->form_gui->getInput(
"delete_".$purpose))
797 $mob->removeMediaItem($purpose);
798 $log->write (
"Mcst: deleting purpose $purpose");
801 $media_item = $mob->getMediaItem($purpose);
802 $url_gui = $this->form_gui->getInput(
"url_".$purpose);
803 $file_gui = $this->form_gui->getInput(
"file_".$purpose);
805 if ($media_item == null)
807 if ($purpose !=
"Standard" &&
808 ($url_gui || $file_gui[
"size"]>0))
819 if ($purpose ==
"Standard")
822 $title = $this->form_gui->getInput(
"title") !=
"" ? $this->form_gui->getInput(
"title") : basename(
$file);
823 $description = $this->form_gui->getInput(
"description");
825 $mob->setTitle($title);
826 $mob->setDescription($description);
828 $prevpic = $this->form_gui->getInput(
"preview_pic");
829 if ($prevpic[
"size"] > 0)
831 $mob->uploadVideoPreviewPic($prevpic);
835 $prevpici = $this->form_gui->getItemByPostVar(
"preview_pic");
836 if ($prevpici->getDeletionFlag())
838 $mob->removeAdditionalFile($mob->getVideoPreviewPic(
true));
852 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
854 $mc_item->setUserId($ilUser->getId());
855 if (isset($duration))
857 $mc_item->setPlaytime($duration);
859 $mc_item->setTitle($title);
860 $mc_item->setContent($description);
861 if ($enable_internal_rss)
863 $mc_item->setVisibility($this->form_gui->getInput(
"visibility"));
867 $ilCtrl->redirect($this,
"listItems");
883 $ilTabs->activateTab(
"edit_content");
885 if (!is_array(
$_POST[
"item_id"]))
891 include_once(
"Services/Utilities/classes/class.ilConfirmationGUI.php");
895 $c_gui->setFormAction($ilCtrl->getFormAction($this,
"deleteItems"));
896 $c_gui->setHeaderText($lng->txt(
"info_delete_sure"));
897 $c_gui->setCancel($lng->txt(
"cancel"),
"listItems");
898 $c_gui->setConfirm($lng->txt(
"confirm"),
"deleteItems");
901 include_once(
"./Services/News/classes/class.ilNewsItem.php");
902 foreach(
$_POST[
"item_id"] as $item_id)
905 $c_gui->addItem(
"item_id[]", $item_id, $item->getTitle(),
909 $tpl->setContent($c_gui->getHTML());
922 foreach(
$_POST[
"item_id"] as $item_id)
928 $ilCtrl->redirect($this,
"listItems");
940 if (!$news_item->deliverMobFile(
$_GET[
"purpose"], (
int)
$_GET[
"presentation"]))
942 $ilCtrl->redirect($this,
"listItems");
955 $mob = $mc_item->getMobId();
956 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
959 $m_item = $mob->getMediaItem(
"Standard");
960 $file = $mob_dir.
"/".$m_item->getLocation();
962 if ($duration !=
"00:00:00")
964 $mc_item->setPlaytime($duration);
973 $ilCtrl->redirect($this,
"listItems");
984 $this->ctrl->setCmd(
"showSummary");
985 $this->ctrl->setCmdClass(
"ilinfoscreengui");
994 global $ilAccess,
$ilUser, $ilTabs;
996 $ilTabs->activateTab(
"id_info");
998 if (!$ilAccess->checkAccess(
"visible",
"", $this->object->getRefId()))
1000 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_read"),$this->ilias->error_obj->MESSAGE);
1003 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
1006 $info->enablePrivateNotes();
1017 $this->lng->loadLanguageModule(
"meta");
1018 $this->lng->loadLanguageModule(
"mcst");
1019 $med_items = $this->
object->getItemsArray();
1020 $info->addSection($this->lng->txt(
"meta_general"));
1021 $info->addProperty($this->lng->txt(
"mcst_nr_items"),
1022 (int) count($med_items));
1024 if (count($med_items) > 0)
1026 $cur = current($med_items);
1034 $info->addProperty($this->lng->txt(
"mcst_last_submission"), $last);
1037 $this->ctrl->forwardCommand($info);
1046 global $ilAccess, $ilTabs,
$lng, $ilHelp;
1048 $ilHelp->setScreenIdComponent(
"mcst");
1051 if ($ilAccess->checkAccess(
'read',
"", $this->object->getRefId()))
1053 $ilTabs->addTab(
"content",
1054 $lng->txt(
"content"),
1055 $this->ctrl->getLinkTarget($this,
"showContent"));
1059 if ($ilAccess->checkAccess(
'visible',
"", $this->object->getRefId()))
1061 $ilTabs->addTab(
"id_info",
1062 $lng->txt(
"info_short"),
1063 $this->ctrl->getLinkTargetByClass(
"ilinfoscreengui",
"showSummary"));
1067 if ($ilAccess->checkAccess(
'write',
"", $this->object->getRefId()))
1069 $ilTabs->addTab(
"id_settings",
1070 $lng->txt(
"settings"),
1071 $this->ctrl->getLinkTarget($this,
"editSettings"));
1075 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
1077 $ilTabs->addTab(
"export",
1078 $lng->txt(
"export"),
1079 $this->ctrl->getLinkTargetByClass(
"ilexportgui",
""));
1083 if ($ilAccess->checkAccess(
'edit_permission',
"", $this->object->getRefId()))
1085 $ilTabs->addTab(
"id_permissions",
1086 $lng->txt(
"perm_settings"),
1087 $this->ctrl->getLinkTargetByClass(
"ilpermissiongui",
"perm"));
1099 global $ilTabs, $ilAccess,
$lng;
1101 $ilTabs->addSubTab(
"content",
1103 $this->ctrl->getLinkTarget($this,
"showContent"));
1105 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"]))
1107 $ilTabs->addSubTab(
"manage",
1108 $lng->txt(
"mcst_manage"),
1109 $this->ctrl->getLinkTarget($this,
"listItems"));
1113 $ilTabs->addSubTab(
"sorting",
1114 $lng->txt(
"mcst_ordering"),
1115 $this->ctrl->getLinkTarget($this,
"editOrder"));
1119 $ilTabs->activateSubTab($a_active);
1120 $ilTabs->activateTab(
"content");
1129 global
$tpl, $ilTabs;
1132 $ilTabs->activateTab(
"id_settings");
1135 $tpl->setContent($this->form_gui->getHtml());
1145 $lng->loadLanguageModule(
"mcst");
1147 include(
"Services/Form/classes/class.ilPropertyFormGUI.php");
1149 $this->form_gui->setTitle($lng->txt(
"mcst_settings"));
1153 $tit->
setValue($this->object->getTitle());
1154 $tit->setRequired(
true);
1155 $this->form_gui->addItem($tit);
1159 $des->
setValue($this->object->getLongDescription());
1160 $this->form_gui->addItem($des);
1163 $sh->setTitle($lng->txt(
"rep_activation_availability"));
1164 $this->form_gui->addItem($sh);
1168 $online->
setChecked($this->object->getOnline());
1169 $this->form_gui->addItem($online);
1173 $sh->setTitle($lng->txt(
"obj_presentation"));
1174 $this->form_gui->addItem($sh);
1180 $sort->addOption(
new ilRadioOption($lng->txt(
"mcst_ordering_creation_date_asc"),
1182 $sort->addOption(
new ilRadioOption($lng->txt(
"mcst_ordering_creation_date_desc"),
1184 $sort->addOption(
new ilRadioOption($lng->txt(
"mcst_ordering_manual"),
1186 $sort->setValue($this->object->getOrder());
1187 $this->form_gui->addItem($sort);
1201 $si->setValue($this->object->getViewMode());
1202 $this->form_gui->addItem($si);
1206 $downloadable =
new ilCheckboxInputGUI($lng->txt(
"mcst_downloadable"),
"downloadable");
1207 $downloadable->
setChecked($this->object->getDownloadable());
1208 $downloadable->setInfo($lng->txt(
"mcst_downloadable_info"));
1209 $this->form_gui->addItem($downloadable);
1212 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
1215 if ($enable_internal_rss)
1219 $sh->setTitle($lng->txt(
"mcst_webfeed"));
1220 $this->form_gui->addItem($sh);
1222 $radio_group =
new ilRadioGroupInputGUI($lng->txt(
"news_default_visibility"),
"defaultaccess");
1223 $radio_option =
new ilRadioOption($lng->txt(
"news_visibility_users"),
"0");
1224 $radio_option->
setInfo($lng->txt(
"news_news_item_def_visibility_users_info"));
1225 $radio_group->addOption($radio_option);
1226 $radio_option =
new ilRadioOption($lng->txt(
"news_visibility_public"),
"1");
1227 $radio_option->
setInfo($lng->txt(
"news_news_item_def_visibility_public_info"));
1228 $radio_group->addOption($radio_option);
1229 $radio_group->setRequired(
false);
1230 $radio_group->setValue($this->object->getDefaultAccess());
1231 #$ch->addSubItem($radio_group);
1232 $this->form_gui->addItem($radio_group);
1235 include_once(
"./Services/Block/classes/class.ilBlockSetting.php");
1238 $ch->
setInfo($lng->txt(
"news_public_feed_info"));
1239 $ch->setChecked($public_feed);
1240 $this->form_gui->addItem($ch);
1243 $ni =
new ilNumberInputGUI($this->lng->txt(
"news_keep_minimal_x_items"),
"keep_rss_min");
1245 $ni->setMinValue(0);
1246 $ni->setMaxLength(3);
1248 $ni->setInfo($this->lng->txt(
"news_keep_minimal_x_items_info").
" (".
1251 $ch->addSubItem($ni);
1254 $incl_files =
new ilCheckboxInputGUI($lng->txt(
"mcst_incl_files_in_rss"),
"public_files");
1255 $incl_files->
setChecked($this->object->getPublicFiles());
1256 $incl_files->setInfo($lng->txt(
"mcst_incl_files_in_rss_info"));
1257 #$ch->addSubItem($incl_files);
1258 $this->form_gui->addItem($incl_files);
1262 $this->form_gui->addCommandButton(
"saveSettings", $lng->txt(
"save"));
1263 $this->form_gui->setFormAction($ilCtrl->getFormAction($this,
"saveSettings"));
1274 $ilTabs->activateTab(
"id_settings");
1277 if ($this->form_gui->checkInput())
1280 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
1282 $this->
object->setTitle($this->form_gui->getInput(
"title"));
1283 $this->
object->setDescription($this->form_gui->getInput(
"description"));
1284 $this->
object->setOnline($this->form_gui->getInput(
"online"));
1285 $this->
object->setDownloadable($this->form_gui->getInput(
"downloadable"));
1286 $this->
object->setOrder($this->form_gui->getInput(
"order"));
1287 $this->
object->setViewMode($this->form_gui->getInput(
"viewmode"));
1289 if ($enable_internal_rss)
1291 $this->
object->setPublicFiles($this->form_gui->getInput(
"public_files"));
1292 $this->
object->setDefaultAccess($this->form_gui->getInput(
"defaultaccess"));
1294 $this->
object->update();
1296 if ($enable_internal_rss)
1298 include_once(
"./Services/Block/classes/class.ilBlockSetting.php");
1300 $this->form_gui->getInput(
"extra_feed"),
1301 0, $this->
object->getId());
1304 $this->form_gui->getInput(
"keep_rss_min"),
1305 0, $this->
object->getId());
1309 $ilCtrl->redirect($this,
"editSettings");
1313 $this->form_gui->setValuesByPost();
1314 $this->tpl->setContent($this->form_gui->getHTML());
1323 if (is_object($this->
object))
1325 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this,
"listItems"),
"",
$_GET[
"ref_id"]);
1333 if ($ilAccess->checkAccess(
"read",
"", $a_target))
1335 $_GET[
"cmd"] =
"listItems";
1336 $_GET[
"ref_id"] = $a_target;
1337 $_GET[
"baseClass"] =
"ilmediacasthandlergui";
1338 $_GET[
"cmdClass"] =
"ilobjmediacastgui";
1339 include(
"ilias.php");
1342 else if ($ilAccess->checkAccess(
"visible",
"", $a_target))
1346 else if ($ilAccess->checkAccess(
"read",
"", ROOT_FOLDER_ID))
1353 $ilErr->raiseError($lng->txt(
"msg_no_perm_read"), $ilErr->FATAL);
1364 return strpos($extension,
"audio") !==
false;
1374 include_once(
"./Services/News/classes/class.ilNewsItem.php");
1377 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
1389 include_once(
"./Services/News/classes/class.ilNewsItem.php");
1392 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
1406 if (
$_POST[
"value_".$purpose])
1408 $_POST[
"label_value_".$purpose] =
$_POST[
"value_".$purpose];
1412 $this->form_gui->setValuesByPost();
1413 $tpl->setContent($this->form_gui->getHTML());
1421 $ilTabs->activateTab(
"edit_content");
1426 switch($this->object->getOrder())
1438 include_once(
"./Modules/MediaCast/classes/class.ilMediaCastTableGUI.php");
1441 $table_gui->setTitle($lng->txt(
"mcst_media_cast"));
1442 $table_gui->setData($this->object->getSortedItemsArray());
1444 $table_gui->addCommandButton(
"saveOrder", $lng->txt(
"mcst_save_order"));
1446 $tpl->setContent($table_gui->getHTML());
1453 asort(
$_POST[
"item_id"]);
1456 foreach(array_keys(
$_POST[
"item_id"]) as $id)
1460 $this->
object->saveOrder($items);
1463 $this->ctrl->redirect($this,
"editOrder");
1492 $tpl->addJavascript(
"./Modules/MediaCast/js/MediaCast.js");
1494 $ilTabs->activateTab(
"content");
1498 $ctpl =
new ilTemplate(
"tpl.mcst_content.html",
true,
true,
"Modules/MediaCast");
1500 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
1501 foreach ($this->object->getSortedItemsArray() as $item)
1504 $med = $mob->getMediaItem(
"Standard");
1506 $ctpl->setCurrentBlock(
"item");
1507 $ctpl->setVariable(
"TITLE", $item[
"title"]);
1508 $ctpl->setVariable(
"TIME", $item[
"playtime"]);
1509 $ctpl->setVariable(
"ID", $item[
"id"]);
1511 if ($mob->getVideoPreviewPic() !=
"")
1513 $ctpl->setVariable(
"PREVIEW_PIC",
1514 ilUtil::img($mob->getVideoPreviewPic(), $item[
"title"], 320, 240));
1518 $ctpl->setVariable(
"PREVIEW_PIC",
1523 if (is_object($med))
1525 include_once(
"./Services/MediaObjects/classes/class.ilMediaPlayerGUI.php");
1529 $ilCtrl->getLinkTarget($this,
"handlePlayerEvent",
"",
true,
false));
1531 if (strcasecmp(
"Reference", $med->getLocationType()) == 0)
1533 $mpl->
setFile($med->getLocation());
1539 $mpl->setMimeType ($med->getFormat());
1541 $mpl->setDisplayHeight(
"480");
1542 $mpl->setDisplayWidth(
"640");
1543 $mpl->setVideoPreviewPic($mob->getVideoPreviewPic());
1544 $mpl->setTitle($item[
"title"]);
1545 $mpl->setDescription($item[
"content"]);
1546 $mpl->setForceAudioPreview(
true);
1547 if ($this->object->getDownloadable())
1549 $ilCtrl->setParameterByClass(
"ilobjmediacastgui",
"item_id", $item[
"id"]);
1550 $ilCtrl->setParameterByClass(
"ilobjmediacastgui",
"purpose",
"Standard");
1551 $mpl->setDownloadLink($ilCtrl->getLinkTargetByClass(
"ilobjmediacastgui",
"downloadItem"));
1553 $med_alt = $mob->getMediaItem(
"VideoAlternative");
1554 if (is_object($med_alt))
1557 $med_alt->getLocation());
1558 $mpl->setAlternativeVideoMimeType($med_alt->getFormat());
1561 $ctpl->setVariable(
"PLAYER", $mpl->getPreviewHtml());
1565 $ctpl->parseCurrentBlock();
1570 if ($feed_icon_html !=
"")
1572 $feed_icon_html =
'<p>'.$feed_icon_html.
'</p>';
1575 $tpl->setContent($feed_icon_html.$ctpl->get());
1591 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
1599 include_once(
"./Services/MediaObjects/classes/class.ilFFmpeg.php");
1600 $med = $mob->getMediaItem(
"Standard");
1604 $pi = pathinfo($new_file);
1605 $med = $mob->getMediaItem($target_purpose);
1606 if (!is_object($med))
1609 $med->setMobId($mob->getId());
1610 $mob->addMediaItem($med);
1612 $med->setPurpose($target_purpose);
1614 $med->setFormat($target_format);
1615 $med->setLocation($pi[
"basename"]);
1616 $med->setLocationType(
"LocalFile");
1619 $add = (is_array(
$ret) && count(
$ret) > 0)
1620 ?
"<br />".implode(
$ret,
"<br />")
1628 $add = (is_array(
$ret) && count(
$ret) > 0)
1629 ?
"<br />".implode(
$ret,
"<br />")
1635 $ilCtrl->redirect($this,
"editCastItem");
1651 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
1656 $sec = (int)
$_POST[
"sec"];
1661 if ($mob->getVideoPreviewPic() !=
"")
1663 $mob->removeAdditionalFile($mob->getVideoPreviewPic(
true));
1665 include_once(
"./Services/MediaObjects/classes/class.ilFFmpeg.php");
1666 $med = $mob->getMediaItem(
"Standard");
1671 if ($new_file !=
"")
1685 $add = (is_array(
$ret) && count(
$ret) > 0)
1686 ?
"<br />".implode(
$ret,
"<br />")
1693 $ilCtrl->redirect($this,
"editCastItem");
1704 if (
$_GET[
"event"] ==
"play")
1706 $player = explode(
"_",
$_GET[
"player"]);
1707 $news_id = (int) $player[1];
1708 include_once(
"./Services/News/classes/class.ilNewsItem.php");
1710 $item->increasePlayCounter();