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");
235 $row1 .=
"<A href='$url' target='$target'><img src='$icon' alt='$title'/></A>";
236 if ($this->object->getPublicFiles())
238 $url = preg_replace(
"/https?/i",
"itpc",$url);
239 $title = $lng->txt(
"news_feed_url");
241 $row2 .=
"<A href='$url' target='$target'><img src='$icon' alt='$title'/></A>";
253 $html .=
" ".$row2;
272 $tpl->setContent($this->form_gui->getHTML());
285 include_once(
"./Services/MediaObjects/classes/class.ilFFmpeg.php");
289 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
295 foreach (array(
"Standard") as $p)
336 include_once(
"./Services/Form/classes/class.ilTextInputGUI.php");
341 $ilToolbar->addInputItem($ni,
true);
343 $ilToolbar->addFormButton($this->lng->txt(
"mcst_extract_preview_image"),
"extractPreviewImage");
344 $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
357 $tpl->setContent($this->form_gui->getHTML());
368 $ilTabs->activateTab(
"edit_content");
370 $lng->loadLanguageModule(
"mcst");
373 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
375 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
377 $this->form_gui->setMultipart(
true);
382 $this->form_gui->addItem($text_input);
387 $this->form_gui->addItem($text_area);
390 if ($enable_internal_rss)
393 $radio_option =
new ilRadioOption($lng->txt(
"access_users"),
"users");
394 $radio_group->addOption($radio_option);
395 $radio_option =
new ilRadioOption($lng->txt(
"access_public"),
"public");
396 $radio_group->addOption($radio_option);
397 $radio_group->
setInfo($lng->txt(
"mcst_visibility_info"));
398 $radio_group->setRequired(
true);
399 $radio_group->setValue($this->object->getDefaultAccess() == 0 ?
"users" :
"public");
400 $this->form_gui->addItem($radio_group);
405 $dur->
setInfo($lng->txt(
"mcst_duration_info"));
406 $dur->setShowDays(
false);
407 $dur->setShowHours(
true);
408 $dur->setShowSeconds(
true);
409 $this->form_gui->addItem($dur);
413 if ($purpose ==
"VideoAlternative" &&
420 $section->setTitle($lng->txt(
"mcst_".strtolower($purpose).
"_title"));
422 if ($a_mode !=
"create")
427 $label->setInfo($lng->txt(
"mcst_current_value_info"));
428 $this->form_gui->addItem($label);
429 $this->form_gui->addItem($value);
433 $file->setSuffixes($this->purposeSuffixes[$purpose]);
434 $this->form_gui->addItem(
$file);
437 $text_input->setInfo($lng->txt(
"mcst_reference_info"));
438 $this->form_gui->addItem($text_input);
439 if ($purpose !=
"Standard")
442 $clearCheckBox->setPostVar(
"delete_".$purpose);
443 $clearCheckBox->setTitle($lng->txt(
"mcst_clear_purpose_title"));
444 $this->form_gui->addItem($clearCheckBox);
449 $mimeTypeSelection->setPostVar(
"mimetype_".$purpose);
450 $mimeTypeSelection->setTitle($lng->txt(
"mcst_mimetype"));
451 $mimeTypeSelection->setInfo($lng->txt(
"mcst_mimetype_info"));
452 $options = array(
"" => $lng->txt(
"mcst_automatic_detection"));
453 $options = array_merge($options, $this->mimeTypes);
454 $mimeTypeSelection->setOptions($options);
455 $this->form_gui->addItem($mimeTypeSelection);
460 $pp->setInfo($lng->txt(
"mcst_preview_picture_info").
" mp4, mp3, png, jp(e)g, gif");
461 $this->form_gui->addItem($pp);
468 if ($a_mode ==
"create")
470 $this->form_gui->setTitle($lng->txt(
"mcst_add_new_item"));
471 $this->form_gui->addCommandButton(
"saveCastItem", $lng->txt(
"save"));
475 $this->form_gui->setTitle($lng->txt(
"mcst_edit_item"));
476 $this->form_gui->addCommandButton(
"updateCastItem", $lng->txt(
"save"));
478 $this->form_gui->addCommandButton(
"listItems", $lng->txt(
"cancel"));
479 $this->form_gui->setFormAction($ilCtrl->getFormAction($this,
"saveCastItem"));
492 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
499 $i = $this->form_gui->getItemByPostVar(
"preview_pic");
506 if (count ($mediaItems) > 0)
508 foreach ($mediaItems as $med)
510 if (!isset ($values[
"title"]))
513 $values[
"title"] = $this->mcst_item->getTitle();
514 $values[
"description"] = $this->mcst_item->getContent();
515 $values[
"visibility"] = $this->mcst_item->getVisibility();
516 $length = explode(
":", $this->mcst_item->getPlaytime());
517 $values[
"duration"] = array(
"hh" => $length[0],
"mm" => $length[1],
"ss" => $length[2]);
520 $values[
"value_".$med->getPurpose()] = (strlen($med->getLocation())> 100) ?
"...".substr($med->getLocation(), strlen($med->getLocation()) - 100) : $med->getLocation();
521 $values[
"label_value_".$med->getPurpose()] = (strlen($med->getLocation())> 100) ?
"...".substr($med->getLocation(), strlen($med->getLocation()) - 100) : $med->getLocation();
522 $values[
"mimetype_".$med->getPurpose()] = $med->getFormat();
526 if (!isset ($values[
"value_".$purpose]))
528 $values[
"label_value_".$purpose] = $lng->txt(
"none");
529 $values[
"value_".$purpose] = $lng->txt(
"none");
532 $this->form_gui->setValuesByArray($values);
543 $ilTabs->activateTab(
"edit_content");
547 if (
$_POST[
"url_Standard"] ==
"" && !$_FILES[
'file_Standard'][
'tmp_name']) {
551 else if ($this->form_gui->checkInput())
554 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
563 $title = $this->form_gui->getInput(
"title") !=
"" ? $this->form_gui->getInput(
"title") : basename(
$file);
564 $description = $this->form_gui->getInput(
"description");
565 $mob->setTitle($title);
566 $mob->setDescription($description);
569 $prevpic = $this->form_gui->getInput(
"preview_pic");
570 if ($prevpic[
"size"] > 0)
572 $mob->uploadVideoPreviewPic($prevpic);
579 foreach ($this->additionalPurposes as $purpose)
582 $file_gui = $this->form_gui->getInput(
"file_".$purpose);
583 $url_gui = $this->form_gui->getInput(
"url_".$purpose);
584 if ($url_gui || $file_gui[
"size"] > 0)
592 if ($prevpic[
"size"] == 0)
604 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
607 include_once(
"./Services/News/classes/class.ilNewsItem.php");
609 $mc_item->setMobId($mob->getId());
611 $mc_item->setContextObjId($this->object->getId());
612 $mc_item->setContextObjType($this->object->getType());
613 $mc_item->setUserId($ilUser->getId());
614 $mc_item->setPlaytime($duration);
615 $mc_item->setTitle($title);
616 $mc_item->setContent($description);
617 $mc_item->setLimitation(
false);
618 if ($enable_internal_rss)
620 $mc_item->setVisibility($this->form_gui->getInput(
"visibility"));
624 $mc_item->setVisibility(
"users");
628 $ilCtrl->redirect($this,
"listItems");
644 $duration = isset($this->form_gui)
645 ? $this->form_gui->getInput(
"duration")
646 : array(
"hh"=>0,
"mm"=>0,
"ss"=>0);
647 if ($duration[
"hh"] == 0 && $duration[
"mm"] == 0 && $duration[
"ss"] == 0 && is_file(
$file))
649 include_once(
"./Services/MediaObjects/classes/class.ilMediaAnalyzer.php");
651 $ana->setFile(
$file);
653 $dur = $ana->getPlaytimeString();
654 $dur = explode(
":", $dur);
655 $duration[
"mm"] = $dur[0];
656 $duration[
"ss"] = $dur[1];
658 $duration = str_pad($duration[
"hh"], 2 ,
"0", STR_PAD_LEFT).
":".
659 str_pad($duration[
"mm"], 2 ,
"0", STR_PAD_LEFT).
":".
660 str_pad($duration[
"ss"], 2 ,
"0", STR_PAD_LEFT);
673 $mob->addMediaItem($mediaItem);
674 $mediaItem->setPurpose($purpose);
687 $purpose = $mediaItem->getPurpose();
688 $url_gui = $this->form_gui->getInput (
"url_".$purpose);
689 $file_gui = $this->form_gui->getInput (
"file_".$purpose);
693 $file = $this->form_gui->getInput (
"url_".$purpose);
694 $title = basename (
$file);
695 $location = $this->form_gui->getInput (
"url_".$purpose);
696 $locationType =
"Reference";
697 } elseif ($file_gui[
"size"] > 0){
701 if (!is_dir($mob_dir))
702 $mob->createDirectory();
705 $file_name = str_replace(
" ",
"_", $file_name);
707 $file = $mob_dir.
"/".$file_name;
709 $locationType =
"LocalFile";
717 if (
$_POST[
"mimetype_".$purpose] !=
"")
719 $mediaItem->setFormat(
$_POST[
"mimetype_".$purpose]);
721 elseif ($mediaItem->getLocation () !=
"")
724 $mediaItem->setFormat($format);
736 $mediaItem->setFormat($format);
738 $mediaItem->setLocationType($locationType);
739 $mediaItem->setHAlign(
"Left");
740 $mediaItem->setHeight(self::isAudio($format)?0:180);
743 if ($purpose ==
"Standard")
746 $mob->setTitle ($title);
748 $mob->setDescription($format);
765 if ($this->form_gui->checkInput())
768 include_once(
"./Services/News/classes/class.ilNewsItem.php");
770 $mob_id = $mc_item->getMobId();
773 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
779 if ($this->form_gui->getInput(
"delete_".$purpose))
781 $mob->removeMediaItem($purpose);
782 $log->write (
"Mcst: deleting purpose $purpose");
785 $media_item = $mob->getMediaItem($purpose);
786 $url_gui = $this->form_gui->getInput(
"url_".$purpose);
787 $file_gui = $this->form_gui->getInput(
"file_".$purpose);
789 if ($media_item == null)
791 if ($purpose !=
"Standard" &&
792 ($url_gui || $file_gui[
"size"]>0))
803 if ($purpose ==
"Standard")
806 $title = $this->form_gui->getInput(
"title") !=
"" ? $this->form_gui->getInput(
"title") : basename(
$file);
807 $description = $this->form_gui->getInput(
"description");
809 $mob->setTitle($title);
810 $mob->setDescription($description);
812 $prevpic = $this->form_gui->getInput(
"preview_pic");
813 if ($prevpic[
"size"] > 0)
815 $mob->uploadVideoPreviewPic($prevpic);
819 $prevpici = $this->form_gui->getItemByPostVar(
"preview_pic");
820 if ($prevpici->getDeletionFlag())
822 $mob->removeAdditionalFile($mob->getVideoPreviewPic(
true));
836 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
838 $mc_item->setUserId($ilUser->getId());
839 if (isset($duration))
841 $mc_item->setPlaytime($duration);
843 $mc_item->setTitle($title);
844 $mc_item->setContent($description);
845 if ($enable_internal_rss)
847 $mc_item->setVisibility($this->form_gui->getInput(
"visibility"));
851 $ilCtrl->redirect($this,
"listItems");
867 $ilTabs->activateTab(
"edit_content");
869 if (!is_array(
$_POST[
"item_id"]))
875 include_once(
"Services/Utilities/classes/class.ilConfirmationGUI.php");
879 $c_gui->setFormAction($ilCtrl->getFormAction($this,
"deleteItems"));
880 $c_gui->setHeaderText($lng->txt(
"info_delete_sure"));
881 $c_gui->setCancel($lng->txt(
"cancel"),
"listItems");
882 $c_gui->setConfirm($lng->txt(
"confirm"),
"deleteItems");
885 include_once(
"./Services/News/classes/class.ilNewsItem.php");
886 foreach(
$_POST[
"item_id"] as $item_id)
889 $c_gui->addItem(
"item_id[]", $item_id, $item->getTitle(),
893 $tpl->setContent($c_gui->getHTML());
906 foreach(
$_POST[
"item_id"] as $item_id)
912 $ilCtrl->redirect($this,
"listItems");
924 if (!$news_item->deliverMobFile(
$_GET[
"purpose"], (
int)
$_GET[
"presentation"]))
926 $ilCtrl->redirect($this,
"listItems");
939 $mob = $mc_item->getMobId();
940 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
943 $m_item = $mob->getMediaItem(
"Standard");
944 $file = $mob_dir.
"/".$m_item->getLocation();
946 if ($duration !=
"00:00:00")
948 $mc_item->setPlaytime($duration);
957 $ilCtrl->redirect($this,
"listItems");
968 $this->ctrl->setCmd(
"showSummary");
969 $this->ctrl->setCmdClass(
"ilinfoscreengui");
978 global $ilAccess,
$ilUser, $ilTabs;
980 $ilTabs->activateTab(
"id_info");
982 if (!$ilAccess->checkAccess(
"visible",
"", $this->object->getRefId()))
984 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_read"),$this->ilias->error_obj->MESSAGE);
987 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
990 $info->enablePrivateNotes();
1001 $this->lng->loadLanguageModule(
"meta");
1002 $this->lng->loadLanguageModule(
"mcst");
1003 $med_items = $this->
object->getItemsArray();
1004 $info->addSection($this->lng->txt(
"meta_general"));
1005 $info->addProperty($this->lng->txt(
"mcst_nr_items"),
1006 (int) count($med_items));
1008 if (count($med_items) > 0)
1010 $cur = current($med_items);
1018 $info->addProperty($this->lng->txt(
"mcst_last_submission"), $last);
1021 $this->ctrl->forwardCommand($info);
1030 global $ilAccess, $ilTabs,
$lng, $ilHelp;
1032 $ilHelp->setScreenIdComponent(
"mcst");
1035 if ($ilAccess->checkAccess(
'read',
"", $this->object->getRefId()))
1037 $ilTabs->addTab(
"content",
1038 $lng->txt(
"content"),
1039 $this->ctrl->getLinkTarget($this,
"showContent"));
1043 if ($ilAccess->checkAccess(
'visible',
"", $this->object->getRefId()))
1045 $ilTabs->addTab(
"id_info",
1046 $lng->txt(
"info_short"),
1047 $this->ctrl->getLinkTargetByClass(
"ilinfoscreengui",
"showSummary"));
1051 if ($ilAccess->checkAccess(
'write',
"", $this->object->getRefId()))
1053 $ilTabs->addTab(
"id_settings",
1054 $lng->txt(
"settings"),
1055 $this->ctrl->getLinkTarget($this,
"editSettings"));
1059 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
1061 $ilTabs->addTab(
"export",
1062 $lng->txt(
"export"),
1063 $this->ctrl->getLinkTargetByClass(
"ilexportgui",
""));
1067 if ($ilAccess->checkAccess(
'edit_permission',
"", $this->object->getRefId()))
1069 $ilTabs->addTab(
"id_permissions",
1070 $lng->txt(
"perm_settings"),
1071 $this->ctrl->getLinkTargetByClass(
"ilpermissiongui",
"perm"));
1083 global $ilTabs, $ilAccess,
$lng;
1085 $ilTabs->addSubTab(
"content",
1087 $this->ctrl->getLinkTarget($this,
"showContent"));
1089 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"]))
1091 $ilTabs->addSubTab(
"manage",
1092 $lng->txt(
"mcst_manage"),
1093 $this->ctrl->getLinkTarget($this,
"listItems"));
1097 $ilTabs->addSubTab(
"sorting",
1098 $lng->txt(
"mcst_ordering"),
1099 $this->ctrl->getLinkTarget($this,
"editOrder"));
1103 $ilTabs->activateSubTab($a_active);
1104 $ilTabs->activateTab(
"content");
1113 global
$tpl, $ilTabs;
1116 $ilTabs->activateTab(
"id_settings");
1119 $tpl->setContent($this->form_gui->getHtml());
1129 $lng->loadLanguageModule(
"mcst");
1131 include(
"Services/Form/classes/class.ilPropertyFormGUI.php");
1133 $this->form_gui->setTitle($lng->txt(
"mcst_settings"));
1137 $tit->
setValue($this->object->getTitle());
1138 $tit->setRequired(
true);
1139 $this->form_gui->addItem($tit);
1143 $des->
setValue($this->object->getLongDescription());
1144 $this->form_gui->addItem($des);
1147 $sh->setTitle($lng->txt(
"rep_activation_availability"));
1148 $this->form_gui->addItem($sh);
1152 $online->
setChecked($this->object->getOnline());
1153 $this->form_gui->addItem($online);
1157 $sh->setTitle($lng->txt(
"obj_presentation"));
1158 $this->form_gui->addItem($sh);
1164 $sort->addOption(
new ilRadioOption($lng->txt(
"mcst_ordering_creation_date_asc"),
1166 $sort->addOption(
new ilRadioOption($lng->txt(
"mcst_ordering_creation_date_desc"),
1168 $sort->addOption(
new ilRadioOption($lng->txt(
"mcst_ordering_manual"),
1170 $sort->setValue($this->object->getOrder());
1171 $this->form_gui->addItem($sort);
1185 $si->setValue($this->object->getViewMode());
1186 $this->form_gui->addItem($si);
1190 $downloadable =
new ilCheckboxInputGUI($lng->txt(
"mcst_downloadable"),
"downloadable");
1191 $downloadable->
setChecked($this->object->getDownloadable());
1192 $downloadable->setInfo($lng->txt(
"mcst_downloadable_info"));
1193 $this->form_gui->addItem($downloadable);
1196 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
1199 if ($enable_internal_rss)
1203 $sh->setTitle($lng->txt(
"mcst_webfeed"));
1204 $this->form_gui->addItem($sh);
1206 $radio_group =
new ilRadioGroupInputGUI($lng->txt(
"news_default_visibility"),
"defaultaccess");
1207 $radio_option =
new ilRadioOption($lng->txt(
"news_visibility_users"),
"0");
1208 $radio_option->
setInfo($lng->txt(
"news_news_item_def_visibility_users_info"));
1209 $radio_group->addOption($radio_option);
1210 $radio_option =
new ilRadioOption($lng->txt(
"news_visibility_public"),
"1");
1211 $radio_option->
setInfo($lng->txt(
"news_news_item_def_visibility_public_info"));
1212 $radio_group->addOption($radio_option);
1213 $radio_group->setRequired(
false);
1214 $radio_group->setValue($this->object->getDefaultAccess());
1215 #$ch->addSubItem($radio_group);
1216 $this->form_gui->addItem($radio_group);
1219 include_once(
"./Services/Block/classes/class.ilBlockSetting.php");
1222 $ch->
setInfo($lng->txt(
"news_public_feed_info"));
1223 $ch->setChecked($public_feed);
1224 $this->form_gui->addItem($ch);
1227 $ni =
new ilNumberInputGUI($this->lng->txt(
"news_keep_minimal_x_items"),
"keep_rss_min");
1229 $ni->setMinValue(0);
1230 $ni->setMaxLength(3);
1232 $ni->setInfo($this->lng->txt(
"news_keep_minimal_x_items_info").
" (".
1235 $ch->addSubItem($ni);
1238 $incl_files =
new ilCheckboxInputGUI($lng->txt(
"mcst_incl_files_in_rss"),
"public_files");
1239 $incl_files->
setChecked($this->object->getPublicFiles());
1240 $incl_files->setInfo($lng->txt(
"mcst_incl_files_in_rss_info"));
1241 #$ch->addSubItem($incl_files);
1242 $this->form_gui->addItem($incl_files);
1246 $this->form_gui->addCommandButton(
"saveSettings", $lng->txt(
"save"));
1247 $this->form_gui->setFormAction($ilCtrl->getFormAction($this,
"saveSettings"));
1258 $ilTabs->activateTab(
"id_settings");
1261 if ($this->form_gui->checkInput())
1264 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
1266 $this->
object->setTitle($this->form_gui->getInput(
"title"));
1267 $this->
object->setDescription($this->form_gui->getInput(
"description"));
1268 $this->
object->setOnline($this->form_gui->getInput(
"online"));
1269 $this->
object->setDownloadable($this->form_gui->getInput(
"downloadable"));
1270 $this->
object->setOrder($this->form_gui->getInput(
"order"));
1271 $this->
object->setViewMode($this->form_gui->getInput(
"viewmode"));
1273 if ($enable_internal_rss)
1275 $this->
object->setPublicFiles($this->form_gui->getInput(
"public_files"));
1276 $this->
object->setDefaultAccess($this->form_gui->getInput(
"defaultaccess"));
1278 $this->
object->update();
1280 if ($enable_internal_rss)
1282 include_once(
"./Services/Block/classes/class.ilBlockSetting.php");
1284 $this->form_gui->getInput(
"extra_feed"),
1285 0, $this->
object->getId());
1288 $this->form_gui->getInput(
"keep_rss_min"),
1289 0, $this->
object->getId());
1293 $ilCtrl->redirect($this,
"editSettings");
1297 $this->form_gui->setValuesByPost();
1298 $this->tpl->setContent($this->form_gui->getHTML());
1307 if (is_object($this->
object))
1309 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this,
"listItems"),
"",
$_GET[
"ref_id"]);
1317 if ($ilAccess->checkAccess(
"read",
"", $a_target))
1319 $_GET[
"cmd"] =
"listItems";
1320 $_GET[
"ref_id"] = $a_target;
1321 $_GET[
"baseClass"] =
"ilmediacasthandlergui";
1322 $_GET[
"cmdClass"] =
"ilobjmediacastgui";
1323 include(
"ilias.php");
1326 else if ($ilAccess->checkAccess(
"visible",
"", $a_target))
1330 else if ($ilAccess->checkAccess(
"read",
"", ROOT_FOLDER_ID))
1337 $ilErr->raiseError($lng->txt(
"msg_no_perm_read"), $ilErr->FATAL);
1348 return strpos($extension,
"audio") !==
false;
1358 include_once(
"./Services/News/classes/class.ilNewsItem.php");
1361 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
1373 include_once(
"./Services/News/classes/class.ilNewsItem.php");
1376 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
1390 if (
$_POST[
"value_".$purpose])
1392 $_POST[
"label_value_".$purpose] =
$_POST[
"value_".$purpose];
1396 $this->form_gui->setValuesByPost();
1397 $tpl->setContent($this->form_gui->getHTML());
1405 $ilTabs->activateTab(
"edit_content");
1410 switch($this->object->getOrder())
1422 include_once(
"./Modules/MediaCast/classes/class.ilMediaCastTableGUI.php");
1425 $table_gui->setTitle($lng->txt(
"mcst_media_cast"));
1426 $table_gui->setData($this->object->getSortedItemsArray());
1428 $table_gui->addCommandButton(
"saveOrder", $lng->txt(
"mcst_save_order"));
1430 $tpl->setContent($table_gui->getHTML());
1437 asort(
$_POST[
"item_id"]);
1440 foreach(array_keys(
$_POST[
"item_id"]) as $id)
1444 $this->
object->saveOrder($items);
1447 $this->ctrl->redirect($this,
"editOrder");
1476 $tpl->addJavascript(
"./Modules/MediaCast/js/MediaCast.js");
1478 $ilTabs->activateTab(
"content");
1482 $ctpl =
new ilTemplate(
"tpl.mcst_content.html",
true,
true,
"Modules/MediaCast");
1484 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObject.php");
1485 foreach ($this->object->getSortedItemsArray() as $item)
1488 $med = $mob->getMediaItem(
"Standard");
1490 $ctpl->setCurrentBlock(
"item");
1491 $ctpl->setVariable(
"TITLE", $item[
"title"]);
1492 $ctpl->setVariable(
"TIME", $item[
"playtime"]);
1493 $ctpl->setVariable(
"ID", $item[
"id"]);
1495 if ($mob->getVideoPreviewPic() !=
"")
1497 $ctpl->setVariable(
"PREVIEW_PIC",
1498 ilUtil::img($mob->getVideoPreviewPic(), $item[
"title"], 320, 240));
1502 $ctpl->setVariable(
"PREVIEW_PIC",
1507 if (is_object($med))
1509 include_once(
"./Services/MediaObjects/classes/class.ilMediaPlayerGUI.php");
1513 $ilCtrl->getLinkTarget($this,
"handlePlayerEvent",
"",
true,
false));
1515 if (strcasecmp(
"Reference", $med->getLocationType()) == 0)
1517 $mpl->
setFile($med->getLocation());
1523 $mpl->setMimeType ($med->getFormat());
1525 $mpl->setDisplayHeight(
"480");
1526 $mpl->setDisplayWidth(
"640");
1527 $mpl->setVideoPreviewPic($mob->getVideoPreviewPic());
1528 $mpl->setTitle($item[
"title"]);
1529 $mpl->setDescription($item[
"content"]);
1530 $mpl->setForceAudioPreview(
true);
1531 if ($this->object->getDownloadable())
1533 $ilCtrl->setParameterByClass(
"ilobjmediacastgui",
"item_id", $item[
"id"]);
1534 $ilCtrl->setParameterByClass(
"ilobjmediacastgui",
"purpose",
"Standard");
1535 $mpl->setDownloadLink($ilCtrl->getLinkTargetByClass(
"ilobjmediacastgui",
"downloadItem"));
1537 $med_alt = $mob->getMediaItem(
"VideoAlternative");
1538 if (is_object($med_alt))
1541 $med_alt->getLocation());
1542 $mpl->setAlternativeVideoMimeType($med_alt->getFormat());
1545 $ctpl->setVariable(
"PLAYER", $mpl->getPreviewHtml());
1549 $ctpl->parseCurrentBlock();
1554 if ($feed_icon_html !=
"")
1556 $feed_icon_html =
'<p>'.$feed_icon_html.
'</p>';
1559 $tpl->setContent($feed_icon_html.$ctpl->get());
1575 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
1583 include_once(
"./Services/MediaObjects/classes/class.ilFFmpeg.php");
1584 $med = $mob->getMediaItem(
"Standard");
1588 $pi = pathinfo($new_file);
1589 $med = $mob->getMediaItem($target_purpose);
1590 if (!is_object($med))
1593 $med->setMobId($mob->getId());
1594 $mob->addMediaItem($med);
1596 $med->setPurpose($target_purpose);
1598 $med->setFormat($target_format);
1599 $med->setLocation($pi[
"basename"]);
1600 $med->setLocationType(
"LocalFile");
1603 $add = (is_array(
$ret) && count(
$ret) > 0)
1604 ?
"<br />".implode(
$ret,
"<br />")
1612 $add = (is_array(
$ret) && count(
$ret) > 0)
1613 ?
"<br />".implode(
$ret,
"<br />")
1619 $ilCtrl->redirect($this,
"editCastItem");
1635 include_once(
"./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
1640 $sec = (int)
$_POST[
"sec"];
1645 if ($mob->getVideoPreviewPic() !=
"")
1647 $mob->removeAdditionalFile($mob->getVideoPreviewPic(
true));
1649 include_once(
"./Services/MediaObjects/classes/class.ilFFmpeg.php");
1650 $med = $mob->getMediaItem(
"Standard");
1655 if ($new_file !=
"")
1669 $add = (is_array(
$ret) && count(
$ret) > 0)
1670 ?
"<br />".implode(
$ret,
"<br />")
1677 $ilCtrl->redirect($this,
"editCastItem");
1688 if (
$_GET[
"event"] ==
"play")
1690 $player = explode(
"_",
$_GET[
"player"]);
1691 $news_id = (int) $player[1];
1692 include_once(
"./Services/News/classes/class.ilNewsItem.php");
1694 $item->increasePlayCounter();