ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilObjMediaCastGUI Class Reference

Class ilObjMediaCastGUI. More...

+ Inheritance diagram for ilObjMediaCastGUI:
+ Collaboration diagram for ilObjMediaCastGUI:

Public Member Functions

 ilObjMediaCastGUI ($a_data, $a_id, $a_call_by_reference, $a_prepare_output=true)
 Constructor @access public. More...
 
 executeCommand ()
 execute command More...
 
 afterSave ($newObj)
 save object @access public More...
 
 listItemsObject ($a_presentation_mode=false)
 List items of media cast. More...
 
 getFeedIconsHTML ()
 Get feed icons HTML. More...
 
 addCastItemObject ()
 Add media cast item. More...
 
 editCastItemObject ()
 Edit media cast item. More...
 
 initAddCastItemForm ($a_mode="create")
 Init add cast item form. More...
 
 getCastItemValues ()
 Get cast item values into form. More...
 
 saveCastItemObject ()
 Save new cast item. More...
 
 updateCastItemObject ()
 Update cast item. More...
 
 confirmDeletionItemsObject ()
 Confirmation Screen. More...
 
 deleteItemsObject ()
 Delete news items. More...
 
 downloadItemObject ()
 Download news media item. More...
 
 determinePlaytimeObject ()
 Delete news items. More...
 
 infoScreenObject ()
 this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually, if everything works through ilCtrl in the future this may be changed More...
 
 infoScreen ()
 show information screen More...
 
 setTabs ()
 get tabs @access public More...
 
 addContentSubTabs ($a_active="content")
 Add content subtabs. More...
 
 editSettingsObject ()
 Edit settings. More...
 
 initSettingsForm ()
 Init Settings Form. More...
 
 saveSettingsObject ()
 Save Settings. More...
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 saveOrderObject ()
 
 showContentObject ()
 Show content. More...
 
 showGallery ()
 
 convertFileObject ()
 Convert file object. More...
 
 extractPreviewImageObject ()
 Extract preview image. More...
 
 handlePlayerEventObject ()
 Handle player event. More...
 
- Public Member Functions inherited from ilObjectGUI
 ilObjectGUI ($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
 Constructor @access public. More...
 
executeCommand ()
 execute command More...
 
 withReferences ()
 determines wether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode ($a_mode=true)
 if true, a creation screen is displayed the current $_GET[ref_id] don't belong to the current class! the mode is determined in ilrepositorygui More...
 
 getCreationMode ()
 get creation mode More...
 
 getAdminTabs (&$tabs_gui)
 administration tabs show only permissions and trash folder More...
 
 getHTML ()
 
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled More...
 
 cancelDeleteObject ()
 cancel deletion of object More...
 
 cancelObject ($in_rep=false)
 cancel action and go back to previous page @access public More...
 
 createObject ()
 create new object form More...
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 save object More...
 
 editObject ()
 edit object More...
 
 addExternalEditFormCustom (ilPropertyFormGUI $a_form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction ($a_cmd, $a_formaction="")
 get form action for command (command is method name without "Object", e.g. More...
 
 isVisible ($a_ref_id, $a_type)
 
 viewObject ()
 list childs of current object More...
 
 deleteObject ($a_error=false)
 Display deletion confirmation screen. More...
 
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI. More...
 

Static Public Member Functions

static _goto ($a_target)
 
- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot ($a_raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode ($a_ref_id, $a_cmd="frameset")
 Goto repository root. More...
 

Protected Member Functions

 initCreationForms ($a_new_type)
 Init creation froms. More...
 
 getMediaItem ($id)
 get MediaItem for id and updates local variable mcst_item More...
 
 getMediaItems ($id)
 get MediaItems for id and updates local variable mcst_item More...
 
 editOrderObject ()
 
- Protected Member Functions inherited from ilObjectGUI
 assignObject ()
 
 prepareOutput ()
 prepare output More...
 
 setTitleAndDescription ()
 called by prepare output More...
 
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction ($a_list_gui)
 Insert header action into main template. More...
 
 addHeaderAction ()
 Add header action menu. More...
 
 redrawHeaderActionObject ()
 Ajax call: redraw action header only. More...
 
 showMountWebfolderIcon ()
 
 setTabs ()
 set admin tabs @access public More...
 
 setAdminTabs ()
 set admin tabs @access public More...
 
 setLocator ()
 set Locator More...
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator ($a_omit=true)
 
 addAdminLocatorItems ($a_do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 initCreationForms ($a_new_type)
 Init creation froms. More...
 
 getCreationFormsHTML (array $a_forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm ($a_new_type)
 Init object creation form. More...
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 Show didactic template types. More...
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 getDidacticTemplateVar ($a_type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position. More...
 
 afterSave (ilObject $a_new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 Init object edit form. More...
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 Get values for edit form. More...
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $a_form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $a_form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 initImportForm ($a_new_type)
 Init object import form. More...
 
 importFileObject ($parent_id=null, $a_catch_errors=true)
 Import. More...
 
 afterImport (ilObject $a_new_object)
 Post (successful) object import hook. More...
 
 setFormAction ($a_cmd, $a_formaction)
 set specific form action for command More...
 
 getReturnLocation ($a_cmd, $a_location="")
 get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command More...
 
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame ($a_cmd, $a_target_frame)
 set specific target frame for command More...
 
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu) More...
 
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl. More...
 
 getTitlesByRefId ($a_ref_ids)
 get Titles of objects this method is used for error messages in methods cut/copy/paste More...
 
 getTabs (&$tabs_gui)
 get tabs abstract method. More...
 
 __showButton ($a_cmd, $a_text, $a_target='')
 
 hitsperpageObject ()
 
__initTableGUI ()
 
 __setTableGUIBasicData (&$tbl, &$result_set, $a_from="")
 standard implementation for tables use 'from' variable use different initial setting of table More...
 
 redirectToRefId ($a_ref_id, $a_cmd="")
 redirects to (repository) view per ref id usually to a container and usually used at the end of a save/import method where the object gui type (of the new object) doesn't match with the type of the current $_GET["ref_id"] value More...
 
 fillCloneTemplate ($a_tpl_varname, $a_type)
 Fill object clone template This method can be called from any object GUI class that wants to offer object cloning. More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 setColumnSettings ($column_gui)
 May be overwritten in subclasses. More...
 
 checkPermission ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission and redirect on error. More...
 
 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission. More...
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 handleAutoRating (ilObject $a_new_obj)
 Activate rating automatically if parent container setting. More...
 

Static Protected Member Functions

static isAudio ($extension)
 detect audio mimetype More...
 

Private Member Functions

 getDuration ($file)
 get duration from form or from file analyzer More...
 
 createMediaItemForPurpose ($mob, $purpose)
 handle media item for given purpose More...
 
 updateMediaItem ($mob, & $mediaItem)
 update media item from form More...
 
 populateFormFromPost ()
 

Private Attributes

 $additionalPurposes = array ("VideoPortable", "AudioPortable")
 
 $purposeSuffixes = array ()
 
 $mimeTypes = array()
 

Additional Inherited Members

- Data Fields inherited from ilObjectGUI
const COPY_WIZARD_NEEDS_PAGE = 1
 
 $ilias
 
 $objDefinition
 
 $tpl
 
 $tree
 
 $lng
 
 $data
 
 $object
 
 $ref_id
 
 $obj_id
 
 $maxcount
 
 $formaction
 
 $return_location
 
 $target_frame
 
 $tab_target_script
 
 $actions
 
 $sub_objects
 
 $omit_locator = false
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 
- Protected Attributes inherited from ilObjectGUI
 $tmp_import_dir
 

Detailed Description

Member Function Documentation

◆ _goto()

static ilObjMediaCastGUI::_goto (   $a_target)
static

Definition at line 1366 of file class.ilObjMediaCastGUI.php.

1367 {
1368 global $ilAccess, $ilErr, $lng;
1369
1370 if ($ilAccess->checkAccess("read", "", $a_target))
1371 {
1372 $_GET["cmd"] = "showContent";
1373 $_GET["ref_id"] = $a_target;
1374 $_GET["baseClass"] = "ilmediacasthandlergui";
1375 $_GET["cmdClass"] = "ilobjmediacastgui";
1376 include("ilias.php");
1377 exit;
1378 }
1379 else if ($ilAccess->checkAccess("visible", "", $a_target))
1380 {
1381 ilObjectGUI::_gotoRepositoryNode($a_target, "infoScreen");
1382 }
1383 else if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID))
1384 {
1385 ilUtil::sendFailure(sprintf($lng->txt("msg_no_perm_read_item"),
1388 }
1389
1390 $ilErr->raiseError($lng->txt("msg_no_perm_read"), $ilErr->FATAL);
1391
1392 }
$_GET["client_id"]
static _gotoRepositoryNode($a_ref_id, $a_cmd="frameset")
Goto repository root.
static _gotoRepositoryRoot($a_raise_error=false)
Goto repository root.
static _lookupObjId($a_id)
static _lookupTitle($a_id)
lookup object title
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
exit
Definition: login.php:54

References $_GET, $ilErr, ilObjectGUI\$lng, ilObjectGUI\_gotoRepositoryNode(), ilObjectGUI\_gotoRepositoryRoot(), ilObject\_lookupObjId(), ilObject\_lookupTitle(), exit, and ilUtil\sendFailure().

+ Here is the call graph for this function:

◆ addCastItemObject()

ilObjMediaCastGUI::addCastItemObject ( )

Add media cast item.

Definition at line 302 of file class.ilObjMediaCastGUI.php.

303 {
304 global $tpl;
305
306 $this->checkPermission("write");
307
308 $this->initAddCastItemForm();
309 $tpl->setContent($this->form_gui->getHTML());
310 }
initAddCastItemForm($a_mode="create")
Init add cast item form.
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.

References ilObjectGUI\$tpl, ilObjectGUI\checkPermission(), and initAddCastItemForm().

+ Here is the call graph for this function:

◆ addContentSubTabs()

ilObjMediaCastGUI::addContentSubTabs (   $a_active = "content")

Add content subtabs.

Parameters

return

Definition at line 1134 of file class.ilObjMediaCastGUI.php.

1135 {
1136 global $ilTabs, $ilAccess, $lng;
1137
1138 $ilTabs->addSubTab("content",
1139 $lng->txt("view"),
1140 $this->ctrl->getLinkTarget($this, "showContent"));
1141
1142 if ($ilAccess->checkAccess("write", "", $_GET["ref_id"]))
1143 {
1144 $ilTabs->addSubTab("manage",
1145 $lng->txt("mcst_manage"),
1146 $this->ctrl->getLinkTarget($this, "listItems"));
1147
1148 if ($this->object->getOrder() == ilObjMediaCast::ORDER_MANUAL)
1149 {
1150 $ilTabs->addSubTab("sorting",
1151 $lng->txt("mcst_ordering"),
1152 $this->ctrl->getLinkTarget($this, "editOrder"));
1153 }
1154 }
1155
1156 $ilTabs->activateSubTab($a_active);
1157 $ilTabs->activateTab("content");
1158 }

References $_GET, ilObjectGUI\$lng, and ilObjMediaCast\ORDER_MANUAL.

Referenced by editOrderObject(), listItemsObject(), and showGallery().

+ Here is the caller graph for this function:

◆ addLocatorItems()

ilObjMediaCastGUI::addLocatorItems ( )

should be overwritten to add object specific items (repository items are preloaded)

Reimplemented from ilObjectGUI.

Definition at line 1356 of file class.ilObjMediaCastGUI.php.

1357 {
1358 global $ilLocator;
1359
1360 if (is_object($this->object))
1361 {
1362 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this, "listItems"), "", $_GET["ref_id"]);
1363 }
1364 }

References $_GET.

◆ afterSave()

ilObjMediaCastGUI::afterSave (   $newObj)

save object @access public

Definition at line 153 of file class.ilObjMediaCastGUI.php.

154 {
155 // always send a message
156 ilUtil::sendSuccess($this->lng->txt("object_added"),true);
157 ilUtil::redirect("ilias.php?baseClass=ilMediaCastHandlerGUI&ref_id=".$newObj->getRefId()."&cmd=editSettings");
158 }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static redirect($a_script)
http redirect to other script

References ilUtil\redirect(), and ilUtil\sendSuccess().

+ Here is the call graph for this function:

◆ confirmDeletionItemsObject()

ilObjMediaCastGUI::confirmDeletionItemsObject ( )

Confirmation Screen.

Definition at line 900 of file class.ilObjMediaCastGUI.php.

901 {
902 global $ilCtrl, $lng, $tpl, $ilTabs;
903
904 $this->checkPermission("write");
905 $ilTabs->activateTab("edit_content");
906
907 if (!is_array($_POST["item_id"]))
908 {
909 $this->listItemsObject();
910 return;
911 }
912
913 include_once("Services/Utilities/classes/class.ilConfirmationGUI.php");
914 $c_gui = new ilConfirmationGUI();
915
916 // set confirm/cancel commands
917 $c_gui->setFormAction($ilCtrl->getFormAction($this, "deleteItems"));
918 $c_gui->setHeaderText($lng->txt("info_delete_sure"));
919 $c_gui->setCancel($lng->txt("cancel"), "listItems");
920 $c_gui->setConfirm($lng->txt("confirm"), "deleteItems");
921
922 // add items to delete
923 include_once("./Services/News/classes/class.ilNewsItem.php");
924 foreach($_POST["item_id"] as $item_id)
925 {
926 $item = new ilNewsItem($item_id);
927 $c_gui->addItem("item_id[]", $item_id, $item->getTitle(),
928 ilUtil::getImagePath("icon_mcst.svg"));
929 }
930
931 $tpl->setContent($c_gui->getHTML());
932 }
Confirmation screen class.
listItemsObject($a_presentation_mode=false)
List items of media cast.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
$_POST['username']
Definition: cron.php:12
global $ilCtrl
Definition: ilias.php:18

References $_POST, $ilCtrl, ilObjectGUI\$lng, ilObjectGUI\$tpl, ilObjectGUI\checkPermission(), ilUtil\getImagePath(), and listItemsObject().

+ Here is the call graph for this function:

◆ convertFileObject()

ilObjMediaCastGUI::convertFileObject ( )

Convert file object.

Parameters

return

Definition at line 1632 of file class.ilObjMediaCastGUI.php.

1633 {
1634 global $ilCtrl;
1635
1636 $this->checkPermission("write");
1637
1638 $this->mcst_item = new ilNewsItem($_GET["item_id"]);
1639 include_once("./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
1640 $mob = new ilObjMediaObject($this->mcst_item->getMobId());
1641
1642 $target_purpose = ilUtil::stripSlashes($_POST["target_purpose"]);
1643 $target_format = ilUtil::stripSlashes($_POST["target_format"]);
1644
1645 try
1646 {
1647 include_once("./Services/MediaObjects/classes/class.ilFFmpeg.php");
1648 $med = $mob->getMediaItem("Standard");
1649 $mob_file = ilObjMediaObject::_getDirectory($mob->getId())."/".$med->getLocation();
1650 $new_file = ilFFmpeg::convert($mob_file, $target_format);
1652 $pi = pathinfo($new_file);
1653 $med = $mob->getMediaItem($target_purpose);
1654 if (!is_object($med))
1655 {
1656 $med = new ilMediaItem();
1657 $med->setMobId($mob->getId());
1658 $mob->addMediaItem($med);
1659 $mob->update();
1660 $med->setPurpose($target_purpose);
1661 }
1662 $med->setFormat($target_format);
1663 $med->setLocation($pi["basename"]);
1664 $med->setLocationType("LocalFile");
1665 $med->update();
1666
1667 $add = (is_array($ret) && count($ret) > 0)
1668 ? "<br />".implode($ret, "<br />")
1669 : "";
1670
1671 ilUtil::sendInfo($this->lng->txt("mcst_converted_file").$add, true);
1672 }
1673 catch (ilException $e)
1674 {
1676 $add = (is_array($ret) && count($ret) > 0)
1677 ? "<br />".implode($ret, "<br />")
1678 : "";
1679 ilUtil::sendFailure($e->getMessage().$add, true);
1680 }
1681
1682
1683 $ilCtrl->redirect($this, "editCastItem");
1684 }
Base class for ILIAS Exception handling.
static convert($a_file, $a_target_mime, $a_target_dir="", $a_target_filename="")
Convert file to target mime type.
getLastReturnValues()
Get last return values.
Class ilMediaItem.
Class ilObjMediaObject.
_getDirectory($a_mob_id)
get directory for files of media object (static)
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.

References $_GET, $_POST, $ilCtrl, $ret, ilObjMediaObject\_getDirectory(), ilObjectGUI\checkPermission(), ilFFmpeg\convert(), ilFFmpeg\getLastReturnValues(), ilUtil\sendFailure(), ilUtil\sendInfo(), and ilUtil\stripSlashes().

+ Here is the call graph for this function:

◆ createMediaItemForPurpose()

ilObjMediaCastGUI::createMediaItemForPurpose (   $mob,
  $purpose 
)
private

handle media item for given purpose

Parameters
ilMediaObject$mob
stringfile

Definition at line 708 of file class.ilObjMediaCastGUI.php.

709 {
710 $mediaItem = new ilMediaItem();
711 $mob->addMediaItem($mediaItem);
712 $mediaItem->setPurpose($purpose);
713 return $this->updateMediaItem($mob, $mediaItem);
714 }
updateMediaItem($mob, & $mediaItem)
update media item from form

References updateMediaItem().

Referenced by saveCastItemObject(), and updateCastItemObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deleteItemsObject()

ilObjMediaCastGUI::deleteItemsObject ( )

Delete news items.

Definition at line 937 of file class.ilObjMediaCastGUI.php.

938 {
939 global $ilCtrl;
940
941 $this->checkPermission("write");
942
943 // delete all selected news items
944 foreach($_POST["item_id"] as $item_id)
945 {
946 $mc_item = new ilNewsItem($item_id);
947 $mc_item->delete();
948 }
949
950 $ilCtrl->redirect($this, "listItems");
951 }

References $_POST, $ilCtrl, and ilObjectGUI\checkPermission().

+ Here is the call graph for this function:

◆ determinePlaytimeObject()

ilObjMediaCastGUI::determinePlaytimeObject ( )

Delete news items.

Definition at line 977 of file class.ilObjMediaCastGUI.php.

978 {
979 global $ilCtrl, $lng;
980
981 $mc_item = new ilNewsItem($_GET["item_id"]);
982 $mob = $mc_item->getMobId();
983 include_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
984 $mob = new ilObjMediaObject($mob);
985 $mob_dir = ilObjMediaObject::_getDirectory($mob->getId());
986 $m_item = $mob->getMediaItem("Standard");
987 $file = $mob_dir."/".$m_item->getLocation();
988 $duration = $this->getDuration($file);
989 if ($duration != "00:00:00")
990 {
991 $mc_item->setPlaytime($duration);
992 $mc_item->update();
993 ilUtil::sendSuccess($lng->txt("mcst_set_playtime"), true);
994 }
995 else
996 {
997 ilUtil::sendFailure($lng->txt("mcst_unable_to_determin_playtime"), true);
998 }
999
1000 $ilCtrl->redirect($this, "listItems");
1001 }
print $file
getDuration($file)
get duration from form or from file analyzer

References $_GET, $file, $ilCtrl, ilObjectGUI\$lng, ilObjMediaObject\_getDirectory(), getDuration(), ilUtil\sendFailure(), and ilUtil\sendSuccess().

+ Here is the call graph for this function:

◆ downloadItemObject()

ilObjMediaCastGUI::downloadItemObject ( )

Download news media item.

Definition at line 956 of file class.ilObjMediaCastGUI.php.

957 {
958 global $ilCtrl;
959 $this->checkPermission("read");
960
961 $news_item = new ilNewsItem($_GET["item_id"]);
962 if (!$news_item->deliverMobFile($_GET["purpose"], (int) $_GET["presentation"]))
963 {
964 $ilCtrl->redirect($this, "listItems");
965 }
966 else
967 {
968 global $ilUser;
969 $this->object->handleLPUpdate($ilUser->getId(), $news_item->getMobId());
970 }
971 exit;
972 }
global $ilUser
Definition: imgupload.php:15

References $_GET, $ilCtrl, $ilUser, ilObjectGUI\checkPermission(), and exit.

+ Here is the call graph for this function:

◆ editCastItemObject()

ilObjMediaCastGUI::editCastItemObject ( )

Edit media cast item.

Definition at line 315 of file class.ilObjMediaCastGUI.php.

316 {
317 global $tpl, $ilToolbar, $ilCtrl;
318
319 $this->checkPermission("write");
320
321 // conversion toolbar
322 include_once("./Services/MediaObjects/classes/class.ilFFmpeg.php");
323 if (ilFFmpeg::enabled())
324 {
325 $this->mcst_item = new ilNewsItem($_GET["item_id"]);
326 include_once("./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
327 $mob = new ilObjMediaObject($this->mcst_item->getMobId());
328
329 $conv_cnt = 0;
330 // we had other purposes as source as well, but
331 // currently only "Standard" is implemented in the convertFile method
332 foreach (array("Standard") as $p)
333 {
334 /*
335 $med = $mob->getMediaItem($p);
336 if (is_object($med))
337 {
338 $options = ilFFmpeg::getPossibleTargetMimeTypes($med->getFormat());
339 if (count($options) > 0)
340 {
341 if ($conv_cnt > 0)
342 {
343 $ilToolbar->addSeparator();
344 }
345
346 include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
347 $si = new ilSelectInputGUI($this->lng->txt("mcst_conv_".
348 strtolower($p)."_to"), "target_format");
349 $si->setOptions($options);
350 $ilToolbar->addInputItem($si, true);
351
352 $si = new ilSelectInputGUI(", ".$this->lng->txt("mcst_target").": ",
353 "target_purpose");
354 $si->setOptions(array("Standard" => $this->lng->txt("mcst_purpose_standard"),
355 "VideoAlternative" => $this->lng->txt("mcst_purpose_videoalternative")
356 ));
357 $si->setValue($p);
358 $ilToolbar->addInputItem($si, true);
359
360 $ilToolbar->addFormButton($this->lng->txt("mcst_convert"), "convertFile");
361
362 $conv_cnt++;
363 }
364 }
365 */
366
367 $med = $mob->getMediaItem($p);
368 if (is_object($med))
369 {
370 if (ilFFmpeg::supportsImageExtraction($med->getFormat()))
371 {
372 // second
373 include_once("./Services/Form/classes/class.ilTextInputGUI.php");
374 $ni = new ilTextInputGUI($this->lng->txt("mcst_second"), "sec");
375 $ni->setMaxLength(4);
376 $ni->setSize(4);
377 $ni->setValue(1);
378 $ilToolbar->addInputItem($ni, true);
379
380 $ilToolbar->addFormButton($this->lng->txt("mcst_extract_preview_image"), "extractPreviewImage");
381 $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
382 }
383 }
384
385 /*if ($conv_cnt > 0)
386 {
387 $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
388 }*/
389 }
390 }
391
392 $this->initAddCastItemForm("edit");
393 $this->getCastItemValues();
394 $tpl->setContent($this->form_gui->getHTML());
395 }
static enabled()
Checks, whether FFmpeg support is enabled (path is set in the setup)
static supportsImageExtraction($a_mime)
Check if mime type supports image extraction.
getCastItemValues()
Get cast item values into form.
This class represents a text property in a property form.

References $_GET, $ilCtrl, ilObjectGUI\$tpl, ilObjectGUI\checkPermission(), ilFFmpeg\enabled(), getCastItemValues(), initAddCastItemForm(), and ilFFmpeg\supportsImageExtraction().

+ Here is the call graph for this function:

◆ editOrderObject()

ilObjMediaCastGUI::editOrderObject ( )
protected

Definition at line 1453 of file class.ilObjMediaCastGUI.php.

1454 {
1455 global $ilTabs, $lng, $tpl;
1456
1457 $this->checkPermission("write");
1458 $ilTabs->activateTab("edit_content");
1459
1460 $this->addContentSubTabs("sorting");
1461
1462 // sort by order setting
1463 switch($this->object->getOrder())
1464 {
1468 return $this->listItemsObject();
1469
1471 // sub-tabs
1472 break;
1473 }
1474
1475 include_once("./Modules/MediaCast/classes/class.ilMediaCastTableGUI.php");
1476 $table_gui = new ilMediaCastTableGUI($this, "editOrder", true);
1477
1478 $table_gui->setTitle($lng->txt("mcst_media_cast"));
1479 $table_gui->setData($this->object->getSortedItemsArray());
1480
1481 $table_gui->addCommandButton("saveOrder", $lng->txt("mcst_save_order"));
1482
1483 $tpl->setContent($table_gui->getHTML());
1484 }
TableGUI class for table NewsForContext.
addContentSubTabs($a_active="content")
Add content subtabs.

References ilObjectGUI\$lng, ilObjectGUI\$tpl, addContentSubTabs(), ilObjectGUI\checkPermission(), listItemsObject(), ilObjMediaCast\ORDER_CREATION_DATE_ASC, ilObjMediaCast\ORDER_CREATION_DATE_DESC, ilObjMediaCast\ORDER_MANUAL, and ilObjMediaCast\ORDER_TITLE.

+ Here is the call graph for this function:

◆ editSettingsObject()

ilObjMediaCastGUI::editSettingsObject ( )

Edit settings.

Definition at line 1164 of file class.ilObjMediaCastGUI.php.

1165 {
1166 global $tpl, $ilTabs;
1167
1168 $this->checkPermission("write");
1169 $ilTabs->activateTab("id_settings");
1170
1171 $this->initSettingsForm();
1172 $tpl->setContent($this->form_gui->getHtml());
1173 }
initSettingsForm()
Init Settings Form.

References ilObjectGUI\$tpl, ilObjectGUI\checkPermission(), and initSettingsForm().

+ Here is the call graph for this function:

◆ executeCommand()

ilObjMediaCastGUI::executeCommand ( )

execute command

Reimplemented from ilObjectGUI.

Definition at line 59 of file class.ilObjMediaCastGUI.php.

60 {
61 global $ilUser, $ilTabs;
62
63 $next_class = $this->ctrl->getNextClass($this);
64 $cmd = $this->ctrl->getCmd();
65 $this->prepareOutput();
66
67 switch($next_class)
68 {
69 case "ilinfoscreengui":
70 $this->checkPermission("visible");
71 $this->infoScreen(); // forwards command
72 break;
73
74 case "ilexportgui":
75// $this->prepareOutput();
76 $ilTabs->activateTab("export");
77 include_once("./Services/Export/classes/class.ilExportGUI.php");
78 $exp_gui = new ilExportGUI($this);
79 $exp_gui->addFormat("xml");
80 $ret = $this->ctrl->forwardCommand($exp_gui);
81// $this->tpl->show();
82 break;
83
84 case 'ilpermissiongui':
85 $ilTabs->activateTab("id_permissions");
86 include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
87 $perm_gui =& new ilPermissionGUI($this);
88 $ret =& $this->ctrl->forwardCommand($perm_gui);
89 break;
90
91 case 'ilobjectcopygui':
92 include_once './Services/Object/classes/class.ilObjectCopyGUI.php';
93 $cp = new ilObjectCopyGUI($this);
94 $cp->setType('mcst');
95 $this->ctrl->forwardCommand($cp);
96 break;
97
98 case "ilcommonactiondispatchergui":
99 include_once("Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
101 $this->ctrl->forwardCommand($gui);
102 break;
103
104 case "illearningprogressgui":
105 $ilTabs->activateTab('learning_progress');
106 require_once 'Services/Tracking/classes/class.ilLearningProgressGUI.php';
107 $new_gui =& new ilLearningProgressGUI(
109 $this->object->getRefId(),
110 $_GET['user_id'] ? $_GET['user_id'] : $ilUser->getId()
111 );
112 $this->ctrl->forwardCommand($new_gui);
113 $this->tabs_gui->setTabActive('learning_progress');
114 break;
115
116 default:
117 if(!$cmd)
118 {
119 $cmd = "infoScreen";
120 }
121 $cmd .= "Object";
122 if ($cmd != "infoScreenObject")
123 {
124 $this->checkPermission("read");
125 }
126 else
127 {
128 $this->checkPermission("visible");
129 }
130 $this->$cmd();
131
132 break;
133 }
134
135 $this->addHeaderAction();
136
137 return true;
138 }
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
Export User Interface Class.
Class ilObjUserTrackingGUI.
infoScreen()
show information screen
GUI class for the workflow of copying objects.
prepareOutput()
prepare output
addHeaderAction()
Add header action menu.
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
$cmd
Definition: sahs_server.php:35

References $_GET, $cmd, $ilUser, $ret, ilObjectGUI\addHeaderAction(), ilObjectGUI\checkPermission(), ilCommonActionDispatcherGUI\getInstanceFromAjaxCall(), infoScreen(), ilLearningProgressBaseGUI\LP_CONTEXT_REPOSITORY, and ilObjectGUI\prepareOutput().

+ Here is the call graph for this function:

◆ extractPreviewImageObject()

ilObjMediaCastGUI::extractPreviewImageObject ( )

Extract preview image.

Parameters

return

Definition at line 1692 of file class.ilObjMediaCastGUI.php.

1693 {
1694 global $ilCtrl;
1695
1696 $this->checkPermission("write");
1697
1698 $this->mcst_item = new ilNewsItem($_GET["item_id"]);
1699 include_once("./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
1700 $mob = new ilObjMediaObject($this->mcst_item->getMobId());
1701
1702 try
1703 {
1704 $sec = (int) $_POST["sec"];
1705 if ($sec < 0)
1706 {
1707 $sec = 0;
1708 }
1709 if ($mob->getVideoPreviewPic() != "")
1710 {
1711 $mob->removeAdditionalFile($mob->getVideoPreviewPic(true));
1712 }
1713 include_once("./Services/MediaObjects/classes/class.ilFFmpeg.php");
1714 $med = $mob->getMediaItem("Standard");
1715 $mob_file = ilObjMediaObject::_getDirectory($mob->getId())."/".$med->getLocation();
1716 $new_file = ilFFmpeg::extractImage($mob_file, "mob_vpreview.png",
1717 ilObjMediaObject::_getDirectory($mob->getId()), $sec);
1718
1719 if ($new_file != "")
1720 {
1721 ilUtil::sendInfo($this->lng->txt("mcst_image_extracted"), true);
1722 }
1723 else
1724 {
1725 ilUtil::sendFailure($this->lng->txt("mcst_no_extraction_possible"), true);
1726 }
1727 }
1728 catch (ilException $e)
1729 {
1730 if (DEVMODE == 1)
1731 {
1733 $add = (is_array($ret) && count($ret) > 0)
1734 ? "<br />".implode($ret, "<br />")
1735 : "";
1736 }
1737 ilUtil::sendFailure($e->getMessage().$add, true);
1738 }
1739
1740
1741 $ilCtrl->redirect($this, "editCastItem");
1742 }
static extractImage($a_file, $a_target_filename, $a_target_dir="", $a_sec=1)
Extract image from video file.

References $_GET, $_POST, $ilCtrl, $ret, ilObjMediaObject\_getDirectory(), ilObjectGUI\checkPermission(), ilFFmpeg\extractImage(), ilFFmpeg\getLastReturnValues(), ilUtil\sendFailure(), and ilUtil\sendInfo().

+ Here is the call graph for this function:

◆ getCastItemValues()

ilObjMediaCastGUI::getCastItemValues ( )

Get cast item values into form.

Definition at line 523 of file class.ilObjMediaCastGUI.php.

524 {
525 global $lng;
526
527 // get mob
528 $this->mcst_item = new ilNewsItem($_GET["item_id"]);
529 include_once("./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
530 $mob = new ilObjMediaObject($this->mcst_item->getMobId());
531
532 // preview
533 $ppic = $mob->getVideoPreviewPic();
534 if ($ppic != "")
535 {
536 $i = $this->form_gui->getItemByPostVar("preview_pic");
537 $i->setImage($ppic);
538 }
539
540
541 $values = array();
542 $mediaItems = $this->getMediaItems($_GET["item_id"]);
543 if (count ($mediaItems) > 0)
544 {
545 foreach ($mediaItems as $med)
546 {
547 if (!isset ($values["title"]))
548 {
549 // first item, so set title, description, ...
550 $values["title"] = $this->mcst_item->getTitle();
551 $values["description"] = $this->mcst_item->getContent();
552 $values["visibility"] = $this->mcst_item->getVisibility();
553 $length = explode(":", $this->mcst_item->getPlaytime());
554 $values["duration"] = array("hh" => $length[0], "mm" => $length[1], "ss" => $length[2]);
555 }
556
557 $values["value_".$med->getPurpose()] = (strlen($med->getLocation())> 100) ? "...".substr($med->getLocation(), strlen($med->getLocation()) - 100) : $med->getLocation();
558 $values["label_value_".$med->getPurpose()] = (strlen($med->getLocation())> 100) ? "...".substr($med->getLocation(), strlen($med->getLocation()) - 100) : $med->getLocation();
559 $values["mimetype_".$med->getPurpose()] = $med->getFormat();
560 }
561 }
562 foreach (ilObjMediaCast::$purposes as $purpose) {
563 if (!isset ($values["value_".$purpose]))
564 {
565 $values["label_value_".$purpose] = $lng->txt("none");
566 $values["value_".$purpose] = $lng->txt("none");
567 }
568 }
569 $this->form_gui->setValuesByArray($values);
570 }
getMediaItems($id)
get MediaItems for id and updates local variable mcst_item

References $_GET, ilObjectGUI\$lng, ilObjMediaCast\$purposes, and getMediaItems().

Referenced by editCastItemObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getDuration()

ilObjMediaCastGUI::getDuration (   $file)
private

get duration from form or from file analyzer

Parameters
unknown_type$file
Returns
unknown

Definition at line 680 of file class.ilObjMediaCastGUI.php.

681 {
682 $duration = isset($this->form_gui)
683 ? $this->form_gui->getInput("duration")
684 : array("hh"=>0, "mm"=>0, "ss"=>0);
685 if ($duration["hh"] == 0 && $duration["mm"] == 0 && $duration["ss"] == 0 && is_file($file))
686 {
687 include_once("./Services/MediaObjects/classes/class.ilMediaAnalyzer.php");
688 $ana = new ilMediaAnalyzer();
689 $ana->setFile($file);
690 $ana->analyzeFile();
691 $dur = $ana->getPlaytimeString();
692 $dur = explode(":", $dur);
693 $duration["mm"] = $dur[0];
694 $duration["ss"] = $dur[1];
695 }
696 $duration = str_pad($duration["hh"], 2 , "0", STR_PAD_LEFT).":".
697 str_pad($duration["mm"], 2 , "0", STR_PAD_LEFT).":".
698 str_pad($duration["ss"], 2 , "0", STR_PAD_LEFT);
699 return $duration;
700 }
Analyzes media files.

References $file.

Referenced by determinePlaytimeObject(), saveCastItemObject(), and updateCastItemObject().

+ Here is the caller graph for this function:

◆ getFeedIconsHTML()

ilObjMediaCastGUI::getFeedIconsHTML ( )

Get feed icons HTML.

Parameters

return

Definition at line 217 of file class.ilObjMediaCastGUI.php.

218 {
219 global $lng;
220
221 $html = "";
222
223 include_once("./Services/Block/classes/class.ilBlockSetting.php");
224 $public_feed = ilBlockSetting::_lookup("news", "public_feed",
225 0, $this->object->getId());
226
227 // rss icon/link
228 if ($public_feed)
229 {
230 $news_set = new ilSetting("news");
231 $enable_internal_rss = $news_set->get("enable_rss_for_internal");
232
233 if ($enable_internal_rss)
234 {
235 // create dummy object in db (we need an id)
236 $items = $this->object->getItemsArray();
237 include_once("./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
238 $html = "";
239 foreach (ilObjMediaCast::$purposes as $purpose)
240 {
241 foreach ($items as $id => $item)
242 {
243 $mob = new ilObjMediaObject($item["mob_id"]);
244 $mob->read();
245 if ($mob->hasPurposeItem($purpose))
246 {
247 if ($html == "")
248 {
249 $html = " ";
250 }
251 $url = ILIAS_HTTP_PATH."/feed.php?client_id=".rawurlencode(CLIENT_ID)."&"."ref_id=".$_GET["ref_id"]."&purpose=$purpose";
252 $title = $lng->txt("news_feed_url");
253
254 include_once("./Services/News/classes/class.ilRSSButtonGUI.php");
255 switch (strtolower($purpose))
256 {
257 case "audioportable":
260 break;
261
262 case "videoportable":
265 break;
266
267 default:
270 break;
271 }
272 $row1 .= "&nbsp;".ilRSSButtonGUI::get($type1, $url);
273 if ($this->object->getPublicFiles())
274 {
275 $url = preg_replace("/https?/i","itpc",$url);
276 $title = $lng->txt("news_feed_url");
277
278 include_once("./Services/News/classes/class.ilRSSButtonGUI.php");
279 $row2 .= "&nbsp;".ilRSSButtonGUI::get($type2, $url);
280 }
281 break;
282 }
283 }
284 }
285 if ($html != "")
286 {
287 $html .= $row1;
288 if ($row2 != "")
289 {
290 $html .= $row2;
291 }
292 }
293 }
294 }
295 return $html;
296 }
static _lookup($a_type, $a_setting, $a_user=0, $a_block_id=0)
Lookup setting from database.
ILIAS Setting Class.
$html
Definition: example_001.php:87
$url
Definition: shib_logout.php:72

References $html, ilObjectGUI\$lng, ilObjMediaCast\$purposes, $url, ilBlockSetting\_lookup(), ilRSSButtonGUI\ICON_ITUNES, ilRSSButtonGUI\ICON_ITUNES_AUDIO, ilRSSButtonGUI\ICON_ITUNES_VIDEO, ilRSSButtonGUI\ICON_RSS, ilRSSButtonGUI\ICON_RSS_AUDIO, and ilRSSButtonGUI\ICON_RSS_VIDEO.

Referenced by listItemsObject(), and showGallery().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMediaItem()

ilObjMediaCastGUI::getMediaItem (   $id)
protected

get MediaItem for id and updates local variable mcst_item

Returns
ilMediaItem

Definition at line 1410 of file class.ilObjMediaCastGUI.php.

1410 {
1411 include_once("./Services/News/classes/class.ilNewsItem.php");
1412 $this->mcst_item = new ilNewsItem($id);
1413 // create dummy object in db (we need an id)
1414 include_once("./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
1415 $mob = new ilObjMediaObject($this->mcst_item->getMobId());
1416 return $mob->getMediaItem("Standard");
1417 }

◆ getMediaItems()

ilObjMediaCastGUI::getMediaItems (   $id)
protected

get MediaItems for id and updates local variable mcst_item

Returns
array of ilMediaItem

Definition at line 1425 of file class.ilObjMediaCastGUI.php.

1425 {
1426 include_once("./Services/News/classes/class.ilNewsItem.php");
1427 $this->mcst_item = new ilNewsItem($id);
1428 // create dummy object in db (we need an id)
1429 include_once("./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
1430 $mob = new ilObjMediaObject($this->mcst_item->getMobId());
1431 return $mob->getMediaItems();
1432 }

Referenced by getCastItemValues().

+ Here is the caller graph for this function:

◆ handlePlayerEventObject()

ilObjMediaCastGUI::handlePlayerEventObject ( )

Handle player event.

Parameters

return

Definition at line 1750 of file class.ilObjMediaCastGUI.php.

1751 {
1752 if ($_GET["event"] == "play")
1753 {
1754 $player = explode("_", $_GET["player"]);
1755 $news_id = (int) $player[1];
1756 include_once("./Services/News/classes/class.ilNewsItem.php");
1757 $item = new ilNewsItem($news_id);
1758 $item->increasePlayCounter();
1759
1760 $mob_id = $item->getMobId();
1761 if($mob_id)
1762 {
1763 global $ilUser;
1764 $this->object->handleLPUpdate($ilUser->getId(), $mob_id);
1765 }
1766 }
1767 exit;
1768 }

References $_GET, $ilUser, and exit.

◆ ilObjMediaCastGUI()

ilObjMediaCastGUI::ilObjMediaCastGUI (   $a_data,
  $a_id,
  $a_call_by_reference,
  $a_prepare_output = true 
)

Constructor @access public.

Definition at line 29 of file class.ilObjMediaCastGUI.php.

30 {
31 global $ilCtrl, $lng;
32
33 $this->type = "mcst";
34 $this->ilObjectGUI($a_data,$a_id,$a_call_by_reference,$a_prepare_output);
35 $lng->loadLanguageModule("mcst");
36 $lng->loadLanguageModule("news");
37 $lng->loadLanguageModule("rep");
38
39 $ilCtrl->saveParameter($this, "item_id");
40
41 include_once ("./Modules/MediaCast/classes/class.ilMediaCastSettings.php");
43 $this->purposeSuffixes = $settings->getPurposeSuffixes();
44 $this->mimeTypes = array();
45 $mime_types = $settings->getMimeTypes();
46 foreach ($mime_types as $mt)
47 {
48 $this->mimeTypes[$mt] = $mt;
49 }
50
51 include_once("./Services/Utilities/classes/class.ilMimeTypeUtil.php");
52 foreach (ilMimeTypeUtil::getExt2MimeMap() as $mt)
53 {
54 $this->mimeTypes[$mt] = $mt;
55 }
56 asort($this->mimeTypes);
57 }
static _getInstance()
get singleton instance
ilObjectGUI($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
Constructor @access public.

References $ilCtrl, ilObjectGUI\$lng, ilMediaCastSettings\_getInstance(), ilMimeTypeUtil\getExt2MimeMap(), and ilObjectGUI\ilObjectGUI().

+ Here is the call graph for this function:

◆ infoScreen()

ilObjMediaCastGUI::infoScreen ( )

show information screen

Definition at line 1019 of file class.ilObjMediaCastGUI.php.

1020 {
1021 global $ilAccess, $ilUser, $ilTabs;
1022
1023 $ilTabs->activateTab("id_info");
1024
1025 if (!$ilAccess->checkAccess("visible", "", $this->object->getRefId()))
1026 {
1027 $this->ilias->raiseError($this->lng->txt("msg_no_perm_read"),$this->ilias->error_obj->MESSAGE);
1028 }
1029
1030 include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
1031 $info = new ilInfoScreenGUI($this);
1032
1033 $info->enablePrivateNotes();
1034
1035 /*
1036 $info->enableNews();
1037 if ($ilAccess->checkAccess("write", "", $_GET["ref_id"]))
1038 {
1039 //$info->enableNewsEditing();
1040 $info->setBlockProperty("news", "settings", true);
1041 }*/
1042
1043 // general information
1044 $this->lng->loadLanguageModule("meta");
1045 $this->lng->loadLanguageModule("mcst");
1046 $med_items = $this->object->getItemsArray();
1047 $info->addSection($this->lng->txt("meta_general"));
1048 $info->addProperty($this->lng->txt("mcst_nr_items"),
1049 (int) count($med_items));
1050
1051 if (count($med_items) > 0)
1052 {
1053 $cur = current($med_items);
1054 $last = ilDatePresentation::formatDate(new ilDateTime($cur["creation_date"], IL_CAL_DATETIME));
1055 }
1056 else
1057 {
1058 $last = "-";
1059 }
1060
1061 $info->addProperty($this->lng->txt("mcst_last_submission"), $last);
1062
1063 // forward the command
1064 $this->ctrl->forwardCommand($info);
1065 }
const IL_CAL_DATETIME
static formatDate(ilDateTime $date)
Format a date @access public.
@classDescription Date and time handling
Class ilInfoScreenGUI.
$info
Definition: example_052.php:80
redirection script todo: (a better solution should control the processing via a xml file)

References $ilUser, $info, ilDatePresentation\formatDate(), and IL_CAL_DATETIME.

Referenced by executeCommand(), and infoScreenObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ infoScreenObject()

ilObjMediaCastGUI::infoScreenObject ( )

this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually, if everything works through ilCtrl in the future this may be changed

Definition at line 1008 of file class.ilObjMediaCastGUI.php.

1009 {
1010 $this->checkPermission("visible");
1011 $this->ctrl->setCmd("showSummary");
1012 $this->ctrl->setCmdClass("ilinfoscreengui");
1013 $this->infoScreen();
1014 }

References ilObjectGUI\checkPermission(), and infoScreen().

+ Here is the call graph for this function:

◆ initAddCastItemForm()

ilObjMediaCastGUI::initAddCastItemForm (   $a_mode = "create")

Init add cast item form.

Definition at line 400 of file class.ilObjMediaCastGUI.php.

401 {
402 global $lng, $ilCtrl, $ilTabs;
403
404 $this->checkPermission("write");
405 $ilTabs->activateTab("edit_content");
406
407 $lng->loadLanguageModule("mcst");
408
409 $news_set = new ilSetting("news");
410 $enable_internal_rss = $news_set->get("enable_rss_for_internal");
411
412 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
413 $this->form_gui = new ilPropertyFormGUI();
414 $this->form_gui->setMultipart(true);
415
416 // Property Title
417 $text_input = new ilTextInputGUI($lng->txt("title"), "title");
418 $text_input->setMaxLength(200);
419 $this->form_gui->addItem($text_input);
420
421 // Property Content
422 $text_area = new ilTextAreaInputGUI($lng->txt("description"), "description");
423 $text_area->setRequired(false);
424 $this->form_gui->addItem($text_area);
425
426 // Property Visibility
427 if ($enable_internal_rss)
428 {
429 $radio_group = new ilRadioGroupInputGUI($lng->txt("access_scope"), "visibility");
430 $radio_option = new ilRadioOption($lng->txt("access_users"), "users");
431 $radio_group->addOption($radio_option);
432 $radio_option = new ilRadioOption($lng->txt("access_public"), "public");
433 $radio_group->addOption($radio_option);
434 $radio_group->setInfo($lng->txt("mcst_visibility_info"));
435 $radio_group->setRequired(true);
436 $radio_group->setValue($this->object->getDefaultAccess() == 0 ? "users" : "public");
437 $this->form_gui->addItem($radio_group);
438 }
439
440 // Duration
441 $dur = new ilDurationInputGUI($lng->txt("mcst_duration"), "duration");
442 $dur->setInfo($lng->txt("mcst_duration_info"));
443 $dur->setShowDays(false);
444 $dur->setShowHours(true);
445 $dur->setShowSeconds(true);
446 $this->form_gui->addItem($dur);
447
448 foreach (ilObjMediaCast::$purposes as $purpose)
449 {
450 if ($purpose == "VideoAlternative" &&
451 $a_mode == "create")
452 {
453 continue;
454 }
455
457 $section->setTitle($lng->txt("mcst_".strtolower($purpose)."_title"));
458 $this->form_gui->addItem($section);
459 if ($a_mode != "create")
460 {
461 $value = new ilHiddenInputGUI("value_".$purpose);
462 $label = new ilNonEditableValueGUI($lng->txt("value"));
463 $label->setPostVar("label_value_".$purpose);
464 $label->setInfo($lng->txt("mcst_current_value_info"));
465 $this->form_gui->addItem($label);
466 $this->form_gui->addItem($value);
467
468 }
469 $file = new ilFileInputGUI($lng->txt("file"), "file_".$purpose);
470 $file->setSuffixes($this->purposeSuffixes[$purpose]);
471 $this->form_gui->addItem($file);
472 $text_input = new ilRegExpInputGUI($lng->txt("url"), "url_".$purpose);
473 $text_input->setPattern("/https?\:\/\/.+/i");
474 $text_input->setInfo($lng->txt("mcst_reference_info"));
475 $this->form_gui->addItem($text_input);
476 if ($purpose != "Standard")
477 {
478 $clearCheckBox = new ilCheckboxInputGUI();
479 $clearCheckBox->setPostVar("delete_".$purpose);
480 $clearCheckBox->setTitle($lng->txt("mcst_clear_purpose_title"));
481 $this->form_gui->addItem($clearCheckBox);
482 } else {
483
484 // mime type selection
485 $mimeTypeSelection = new ilSelectInputGUI();
486 $mimeTypeSelection->setPostVar("mimetype_".$purpose);
487 $mimeTypeSelection->setTitle($lng->txt("mcst_mimetype"));
488 $mimeTypeSelection->setInfo($lng->txt("mcst_mimetype_info"));
489 $options = array("" => $lng->txt("mcst_automatic_detection"));
490 $options = array_merge($options, $this->mimeTypes);
491 $mimeTypeSelection->setOptions($options);
492 $this->form_gui->addItem($mimeTypeSelection);
493
494 // preview picure
495 $pp = new ilImageFileInputGUI($lng->txt("mcst_preview_picture"), "preview_pic");
496 $pp->setSuffixes(array("png", "jpeg", "jpg"));
497 $pp->setInfo($lng->txt("mcst_preview_picture_info")." mp4, mp3, png, jp(e)g, gif");
498 $this->form_gui->addItem($pp);
499
500 }
501
502 }
503
504 // save/cancel button
505 if ($a_mode == "create")
506 {
507 $this->form_gui->setTitle($lng->txt("mcst_add_new_item"));
508 $this->form_gui->addCommandButton("saveCastItem", $lng->txt("save"));
509 }
510 else
511 {
512 $this->form_gui->setTitle($lng->txt("mcst_edit_item"));
513 $this->form_gui->addCommandButton("updateCastItem", $lng->txt("save"));
514 }
515 $this->form_gui->addCommandButton("listItems", $lng->txt("cancel"));
516 $this->form_gui->setFormAction($ilCtrl->getFormAction($this, "saveCastItem"));
517
518 }
$section
Definition: Utf8Test.php:84
This class represents a checkbox property in a property form.
This class represents a duration (typical hh:mm:ss) property in a property form.
This class represents a file property in a property form.
This class represents a section header in a property form.
This class represents a hidden form property in a property form.
This class represents an image file property in a property form.
This class represents a non editable value in a property form.
This class represents a property form user interface.
This class represents a property in a property form.
This class represents an option in a radio group.
This class represents a regular expression input property in a property form.
This class represents a selection list property in a property form.
This class represents a text area property in a property form.
if(!is_array($argv)) $options

References $file, $ilCtrl, ilObjectGUI\$lng, $options, ilObjMediaCast\$purposes, $section, and ilObjectGUI\checkPermission().

Referenced by addCastItemObject(), editCastItemObject(), saveCastItemObject(), and updateCastItemObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initCreationForms()

ilObjMediaCastGUI::initCreationForms (   $a_new_type)
protected

Init creation froms.

this will create the default creation forms: new, import, clone

Parameters
string$a_new_type
Returns
array

Reimplemented from ilObjectGUI.

Definition at line 140 of file class.ilObjMediaCastGUI.php.

141 {
142 $forms = array(self::CFORM_NEW => $this->initCreateForm($a_new_type),
143 self::CFORM_IMPORT => $this->initImportForm($a_new_type),
144 self::CFORM_CLONE => $this->fillCloneTemplate(null, $a_new_type));
145
146 return $forms;
147 }
initImportForm($a_new_type)
Init object import form.
initCreateForm($a_new_type)
Init object creation form.
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...

References ilObjectGUI\fillCloneTemplate(), ilObjectGUI\initCreateForm(), and ilObjectGUI\initImportForm().

+ Here is the call graph for this function:

◆ initSettingsForm()

ilObjMediaCastGUI::initSettingsForm ( )

Init Settings Form.

Definition at line 1178 of file class.ilObjMediaCastGUI.php.

1179 {
1180 global $tpl, $lng, $ilCtrl;
1181
1182 $lng->loadLanguageModule("mcst");
1183
1184 include("Services/Form/classes/class.ilPropertyFormGUI.php");
1185 $this->form_gui = new ilPropertyFormGUI();
1186 $this->form_gui->setTitle($lng->txt("mcst_settings"));
1187
1188 // Title
1189 $tit = new ilTextInputGUI($lng->txt("title"), "title");
1190 $tit->setValue($this->object->getTitle());
1191 $tit->setRequired(true);
1192 $this->form_gui->addItem($tit);
1193
1194 // description
1195 $des = new ilTextAreaInputGUI($lng->txt("description"), "description");
1196 $des->setValue($this->object->getLongDescription());
1197 $this->form_gui->addItem($des);
1198
1199 $sh = new ilFormSectionHeaderGUI();
1200 $sh->setTitle($lng->txt("rep_activation_availability"));
1201 $this->form_gui->addItem($sh);
1202
1203 // Online
1204 $online = new ilCheckboxInputGUI($lng->txt("online"), "online");
1205 $online->setChecked($this->object->getOnline());
1206 $this->form_gui->addItem($online);
1207
1208 // presentation
1209 $sh = new ilFormSectionHeaderGUI();
1210 $sh->setTitle($lng->txt("obj_presentation"));
1211 $this->form_gui->addItem($sh);
1212
1213 // Sorting
1214 $sort = new ilRadioGroupInputGUI($lng->txt("mcst_ordering"), "order");
1215 $sort->addOption(new ilRadioOption($lng->txt("mcst_ordering_title"),
1217 $sort->addOption(new ilRadioOption($lng->txt("mcst_ordering_creation_date_asc"),
1219 $sort->addOption(new ilRadioOption($lng->txt("mcst_ordering_creation_date_desc"),
1221 $sort->addOption(new ilRadioOption($lng->txt("mcst_ordering_manual"),
1223 $sort->setValue($this->object->getOrder());
1224 $this->form_gui->addItem($sort);
1225
1226 // view mode
1227 $options = array(
1228 ilObjMediaCast::VIEW_LIST => $lng->txt("mcst_list"),
1229 ilObjMediaCast::VIEW_GALLERY => $lng->txt("mcst_gallery")
1230 );
1231 $si = new ilRadioGroupInputGUI($this->lng->txt("mcst_viewmode"), "viewmode");
1232 $si->addOption(new ilRadioOption($lng->txt("mcst_list"),
1234 $si->addOption(new ilRadioOption($lng->txt("mcst_gallery"),
1236
1237// $si->setOptions($options);
1238 $si->setValue($this->object->getViewMode());
1239 $this->form_gui->addItem($si);
1240
1241
1242 // Downloadable
1243 $downloadable = new ilCheckboxInputGUI($lng->txt("mcst_downloadable"), "downloadable");
1244 $downloadable->setChecked($this->object->getDownloadable());
1245 $downloadable->setInfo($lng->txt("mcst_downloadable_info"));
1246 $this->form_gui->addItem($downloadable);
1247
1248 $news_set = new ilSetting("news");
1249 $enable_internal_rss = $news_set->get("enable_rss_for_internal");
1250
1251 //Default Visibility
1252 if ($enable_internal_rss)
1253 {
1254 // webfeed
1255 $sh = new ilFormSectionHeaderGUI();
1256 $sh->setTitle($lng->txt("mcst_webfeed"));
1257 $this->form_gui->addItem($sh);
1258
1259 $radio_group = new ilRadioGroupInputGUI($lng->txt("news_default_visibility"), "defaultaccess");
1260 $radio_option = new ilRadioOption($lng->txt("news_visibility_users"), "0");
1261 $radio_option->setInfo($lng->txt("news_news_item_def_visibility_users_info"));
1262 $radio_group->addOption($radio_option);
1263 $radio_option = new ilRadioOption($lng->txt("news_visibility_public"), "1");
1264 $radio_option->setInfo($lng->txt("news_news_item_def_visibility_public_info"));
1265 $radio_group->addOption($radio_option);
1266 $radio_group->setRequired(false);
1267 $radio_group->setValue($this->object->getDefaultAccess());
1268 #$ch->addSubItem($radio_group);
1269 $this->form_gui->addItem($radio_group);
1270
1271 //Extra Feed
1272 include_once("./Services/Block/classes/class.ilBlockSetting.php");
1273 $public_feed = ilBlockSetting::_lookup("news", "public_feed", 0, $this->object->getId());
1274 $ch = new ilCheckboxInputGUI($lng->txt("news_public_feed"), "extra_feed");
1275 $ch->setInfo($lng->txt("news_public_feed_info"));
1276 $ch->setChecked($public_feed);
1277 $this->form_gui->addItem($ch);
1278
1279 // keep minimal x number of items
1280 $ni = new ilNumberInputGUI($this->lng->txt("news_keep_minimal_x_items"), "keep_rss_min");
1281 $ni->setMaxValue(100);
1282 $ni->setMinValue(0);
1283 $ni->setMaxLength(3);
1284 $ni->setSize(3);
1285 $ni->setInfo($this->lng->txt("news_keep_minimal_x_items_info")." (".
1286 ilNewsItem::_lookupRSSPeriod()." ".(ilNewsItem::_lookupRSSPeriod() == 1 ? $lng->txt("day") : $lng->txt("days")).")");
1287 $ni->setValue((int) ilBlockSetting::_lookup("news", "keep_rss_min", 0, $this->object->getId()));
1288 $ch->addSubItem($ni);
1289
1290 // Include Files in Pubic Items
1291 $incl_files = new ilCheckboxInputGUI($lng->txt("mcst_incl_files_in_rss"), "public_files");
1292 $incl_files->setChecked($this->object->getPublicFiles());
1293 $incl_files->setInfo($lng->txt("mcst_incl_files_in_rss_info"));
1294 #$ch->addSubItem($incl_files);
1295 $this->form_gui->addItem($incl_files);
1296 }
1297
1298 // Form action and save button
1299 $this->form_gui->addCommandButton("saveSettings", $lng->txt("save"));
1300 $this->form_gui->setFormAction($ilCtrl->getFormAction($this, "saveSettings"));
1301 }
This class represents a number property in a property form.

References $ilCtrl, ilObjectGUI\$lng, $options, $si, ilObjectGUI\$tpl, ilBlockSetting\_lookup(), ilNewsItem\_lookupRSSPeriod(), ilObjMediaCast\ORDER_CREATION_DATE_ASC, ilObjMediaCast\ORDER_CREATION_DATE_DESC, ilObjMediaCast\ORDER_MANUAL, ilObjMediaCast\ORDER_TITLE, ilObjMediaCast\VIEW_GALLERY, and ilObjMediaCast\VIEW_LIST.

Referenced by editSettingsObject(), and saveSettingsObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isAudio()

static ilObjMediaCastGUI::isAudio (   $extension)
staticprotected

detect audio mimetype

Parameters
string$extension
Returns
true, if extension contains string "audio"

Definition at line 1400 of file class.ilObjMediaCastGUI.php.

1400 {
1401 return strpos($extension,"audio") !== false;
1402 }

◆ listItemsObject()

ilObjMediaCastGUI::listItemsObject (   $a_presentation_mode = false)

List items of media cast.

Definition at line 163 of file class.ilObjMediaCastGUI.php.

164 {
165 global $tpl, $lng, $ilAccess, $ilTabs, $ilToolbar;
166
167 $this->checkPermission("read");
168
169 if ($a_presentation_mode)
170 {
171 $this->addContentSubTabs("content");
172 }
173 else
174 {
175 $this->addContentSubTabs("manage");
176 }
177
178 $med_items = $this->object->getSortedItemsArray();
179
180 include_once("./Modules/MediaCast/classes/class.ilMediaCastTableGUI.php");
181 if ($a_presentation_mode)
182 {
183 $table_gui = new ilMediaCastTableGUI($this, "showContent", false, true);
184 }
185 else
186 {
187 $table_gui = new ilMediaCastTableGUI($this, "listItems");
188 }
189
190 $table_gui->setData($med_items);
191
192 if ($ilAccess->checkAccess("write", "", $_GET["ref_id"]) && !$a_presentation_mode)
193 {
194 $ilToolbar->addButton($lng->txt("add"), $this->ctrl->getLinkTarget($this, "addCastItem"));
195
196 $table_gui->addMultiCommand("confirmDeletionItems", $lng->txt("delete"));
197 $table_gui->setSelectAllCheckbox("item_id");
198 }
199
200 $feed_icon_html = $this->getFeedIconsHTML();
201 if ($feed_icon_html != "")
202 {
203 $table_gui->setHeaderHTML($feed_icon_html);
204 }
205
206 $tpl->setContent($table_gui->getHTML());
207
208 $tpl->setPermanentLink($this->object->getType(), $this->object->getRefId());
209 }
getFeedIconsHTML()
Get feed icons HTML.

References $_GET, ilObjectGUI\$lng, ilObjectGUI\$tpl, addContentSubTabs(), ilObjectGUI\checkPermission(), and getFeedIconsHTML().

Referenced by confirmDeletionItemsObject(), editOrderObject(), and showContentObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ populateFormFromPost()

ilObjMediaCastGUI::populateFormFromPost ( )
private

Definition at line 1434 of file class.ilObjMediaCastGUI.php.

1435 {
1436 global $tpl;
1437 //issue: we have to display the current settings
1438 // problem: POST does not contain values of disabled textfields
1439 // solution: use hidden field and label to display-> here we need to synchronize the labels
1440 // with the values from the hidden fields.
1441 foreach (ilObjMediaCast::$purposes as $purpose)
1442 {
1443 if ($_POST["value_".$purpose])
1444 {
1445 $_POST["label_value_".$purpose] = $_POST["value_".$purpose];
1446 }
1447 }
1448
1449 $this->form_gui->setValuesByPost();
1450 $tpl->setContent($this->form_gui->getHTML());
1451 }

References $_POST, ilObjMediaCast\$purposes, and ilObjectGUI\$tpl.

Referenced by saveCastItemObject(), and updateCastItemObject().

+ Here is the caller graph for this function:

◆ saveCastItemObject()

ilObjMediaCastGUI::saveCastItemObject ( )

Save new cast item.

Definition at line 575 of file class.ilObjMediaCastGUI.php.

576 {
577 global $tpl, $ilCtrl, $ilUser, $lng, $ilTabs;
578
579 $this->checkPermission("write");
580 $ilTabs->activateTab("edit_content");
581
582 $this->initAddCastItemForm();
583
584 if (!$this->form_gui->checkInput() ||
585 ($_POST["url_Standard"] == "" && !$_FILES['file_Standard']['tmp_name']))
586 {
587 if (($_POST["url_Standard"] == "" && !$_FILES['file_Standard']['tmp_name']))
588 {
589 ilUtil::sendFailure($lng->txt("mcst_input_either_file_or_url"));
590 }
591 $this->populateFormFromPost();
592 }
593 else
594 {
595 // create dummy object in db (we need an id)
596 include_once("./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
597 $mob = new ilObjMediaObject();
598 $mob->create();
599
600 //handle standard purpose
601 $file = $this->createMediaItemForPurpose($mob, "Standard");
602
603 // set title and description
604 // set title to basename of file if left empty
605 $title = $this->form_gui->getInput("title") != "" ? $this->form_gui->getInput("title") : basename($file);
606 $description = $this->form_gui->getInput("description");
607 $mob->setTitle($title);
608 $mob->setDescription($description);
609
610 // save preview pic
611 $prevpic = $this->form_gui->getInput("preview_pic");
612 if ($prevpic["size"] > 0)
613 {
614 $mob->uploadVideoPreviewPic($prevpic);
615 }
616
617 // determine duration for standard purpose
618 $duration = $this->getDuration($file);
619
620 // handle other purposes
621 foreach ($this->additionalPurposes as $purpose)
622 {
623 // check if some purpose has been uploaded
624 $file_gui = $this->form_gui->getInput("file_".$purpose);
625 $url_gui = $this->form_gui->getInput("url_".$purpose);
626 if ($url_gui || $file_gui["size"] > 0)
627 {
628 $this->createMediaItemForPurpose ($mob, $purpose);
629 }
630 }
631
632 $mob->update();
633
634 if ($prevpic["size"] == 0)
635 {
636 // re-read media object
637 $mob = new ilObjMediaObject($mob->getId());
638 $mob->generatePreviewPic(320, 240);
639 }
640
641 //
642 // @todo: save usage
643 //
644
645 $news_set = new ilSetting("news");
646 $enable_internal_rss = $news_set->get("enable_rss_for_internal");
647
648 // create new media cast item
649 include_once("./Services/News/classes/class.ilNewsItem.php");
650 $mc_item = new ilNewsItem();
651 $mc_item->setMobId($mob->getId());
652 $mc_item->setContentType(NEWS_AUDIO);
653 $mc_item->setContextObjId($this->object->getId());
654 $mc_item->setContextObjType($this->object->getType());
655 $mc_item->setUserId($ilUser->getId());
656 $mc_item->setPlaytime($duration);
657 $mc_item->setTitle($title);
658 $mc_item->setContent($description);
659 $mc_item->setLimitation(false);
660 if ($enable_internal_rss)
661 {
662 $mc_item->setVisibility($this->form_gui->getInput("visibility"));
663 }
664 else
665 {
666 $mc_item->setVisibility("users");
667 }
668 $mc_item->create();
669
670 $ilCtrl->redirect($this, "listItems");
671 }
672 }
const NEWS_AUDIO
createMediaItemForPurpose($mob, $purpose)
handle media item for given purpose

References $_POST, $file, $ilCtrl, $ilUser, ilObjectGUI\$lng, ilObjectGUI\$tpl, ilObjectGUI\checkPermission(), createMediaItemForPurpose(), getDuration(), initAddCastItemForm(), NEWS_AUDIO, populateFormFromPost(), and ilUtil\sendFailure().

+ Here is the call graph for this function:

◆ saveOrderObject()

ilObjMediaCastGUI::saveOrderObject ( )

Definition at line 1486 of file class.ilObjMediaCastGUI.php.

1487 {
1488 global $lng;
1489
1490 asort($_POST["item_id"]);
1491
1492 $items = array();
1493 foreach(array_keys($_POST["item_id"]) as $id)
1494 {
1495 $items[] = $id;
1496 }
1497 $this->object->saveOrder($items);
1498
1499 ilUtil::sendSuccess($lng->txt("settings_saved"), true);
1500 $this->ctrl->redirect($this, "editOrder");
1501 }

References $_POST, ilObjectGUI\$lng, and ilUtil\sendSuccess().

+ Here is the call graph for this function:

◆ saveSettingsObject()

ilObjMediaCastGUI::saveSettingsObject ( )

Save Settings.

Definition at line 1306 of file class.ilObjMediaCastGUI.php.

1307 {
1308 global $ilCtrl, $ilTabs;
1309
1310 $this->checkPermission("write");
1311 $ilTabs->activateTab("id_settings");
1312
1313 $this->initSettingsForm();
1314 if ($this->form_gui->checkInput())
1315 {
1316 $news_set = new ilSetting("news");
1317 $enable_internal_rss = $news_set->get("enable_rss_for_internal");
1318
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"));
1325
1326 if ($enable_internal_rss)
1327 {
1328 $this->object->setPublicFiles($this->form_gui->getInput("public_files"));
1329 $this->object->setDefaultAccess($this->form_gui->getInput("defaultaccess"));
1330 }
1331 $this->object->update();
1332
1333 if ($enable_internal_rss)
1334 {
1335 include_once("./Services/Block/classes/class.ilBlockSetting.php");
1336 ilBlockSetting::_write("news", "public_feed",
1337 $this->form_gui->getInput("extra_feed"),
1338 0, $this->object->getId());
1339
1340 ilBlockSetting::_write("news", "keep_rss_min",
1341 $this->form_gui->getInput("keep_rss_min"),
1342 0, $this->object->getId());
1343 }
1344
1345 ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"),true);
1346 $ilCtrl->redirect($this, "editSettings");
1347 }
1348 else
1349 {
1350 $this->form_gui->setValuesByPost();
1351 $this->tpl->setContent($this->form_gui->getHTML());
1352 }
1353 }
static _write($a_type, $a_setting, $a_value, $a_user=0, $a_block_id=0)
Write setting to database.

References $ilCtrl, ilBlockSetting\_write(), ilObjectGUI\checkPermission(), initSettingsForm(), and ilUtil\sendSuccess().

+ Here is the call graph for this function:

◆ setTabs()

ilObjMediaCastGUI::setTabs ( )

get tabs @access public

Reimplemented from ilObjectGUI.

Definition at line 1071 of file class.ilObjMediaCastGUI.php.

1072 {
1073 global $ilAccess, $ilTabs, $lng, $ilHelp;
1074
1075 $ilHelp->setScreenIdComponent("mcst");
1076
1077 // list items
1078 if ($ilAccess->checkAccess('read', "", $this->object->getRefId()))
1079 {
1080 $ilTabs->addTab("content",
1081 $lng->txt("content"),
1082 $this->ctrl->getLinkTarget($this, "showContent"));
1083 }
1084
1085 // info screen
1086 if ($ilAccess->checkAccess('visible', "", $this->object->getRefId()))
1087 {
1088 $ilTabs->addTab("id_info",
1089 $lng->txt("info_short"),
1090 $this->ctrl->getLinkTargetByClass("ilinfoscreengui", "showSummary"));
1091 }
1092
1093 // settings
1094 if ($ilAccess->checkAccess('write', "", $this->object->getRefId()))
1095 {
1096 $ilTabs->addTab("id_settings",
1097 $lng->txt("settings"),
1098 $this->ctrl->getLinkTarget($this, "editSettings"));
1099 }
1100
1101 require_once 'Services/Tracking/classes/class.ilLearningProgressAccess.php';
1102 if(ilLearningProgressAccess::checkAccess($this->object->getRefId()))
1103 {
1104 $ilTabs->addTab(
1105 'learning_progress',
1106 $lng->txt('learning_progress'),
1107 $this->ctrl->getLinkTargetByClass(array(__CLASS__, 'illearningprogressgui'),'')
1108 );
1109 }
1110
1111 // export
1112 if ($ilAccess->checkAccess("write", "", $this->object->getRefId()))
1113 {
1114 $ilTabs->addTab("export",
1115 $lng->txt("export"),
1116 $this->ctrl->getLinkTargetByClass("ilexportgui", ""));
1117 }
1118
1119 // edit permissions
1120 if ($ilAccess->checkAccess('edit_permission', "", $this->object->getRefId()))
1121 {
1122 $ilTabs->addTab("id_permissions",
1123 $lng->txt("perm_settings"),
1124 $this->ctrl->getLinkTargetByClass("ilpermissiongui", "perm"));
1125 }
1126 }
static checkAccess($a_ref_id, $a_allow_only_read=true)
check access to learning progress

References ilObjectGUI\$lng, and ilLearningProgressAccess\checkAccess().

+ Here is the call graph for this function:

◆ showContentObject()

ilObjMediaCastGUI::showContentObject ( )

Show content.

Parameters

return

Definition at line 1513 of file class.ilObjMediaCastGUI.php.

1514 {
1515 global $ilUser;
1516
1517 // need read events for parent for LP statistics
1518 require_once 'Services/Tracking/classes/class.ilChangeEvent.php';
1519 ilChangeEvent::_recordReadEvent("mcst", $this->object->getRefId(),
1520 $this->object->getId(), $ilUser->getId());
1521
1522 if ($this->object->getViewMode() == ilObjMediaCast::VIEW_GALLERY)
1523 {
1524 $this->showGallery();
1525 }
1526 else
1527 {
1528 $this->listItemsObject(true);
1529 }
1530 }
_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.

References $ilUser, ilChangeEvent\_recordReadEvent(), listItemsObject(), showGallery(), and ilObjMediaCast\VIEW_GALLERY.

+ Here is the call graph for this function:

◆ showGallery()

ilObjMediaCastGUI::showGallery ( )

Definition at line 1532 of file class.ilObjMediaCastGUI.php.

1533 {
1534 global $tpl, $ilTabs, $ilCtrl;
1535
1536 $tpl->addJavascript("./Modules/MediaCast/js/MediaCast.js");
1537
1538 $ilTabs->activateTab("content");
1539
1540 $this->addContentSubTabs("content");
1541
1542 $ctpl = new ilTemplate("tpl.mcst_content.html", true, true, "Modules/MediaCast");
1543
1544 include_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
1545 require_once('./Services/WebAccessChecker/classes/class.ilWACSignedPath.php');
1546 foreach ($this->object->getSortedItemsArray() as $item)
1547 {
1548 $mob = new ilObjMediaObject($item["mob_id"]);
1549 $med = $mob->getMediaItem("Standard");
1550
1551 $ctpl->setCurrentBlock("item");
1552 $ctpl->setVariable("TITLE", $item["title"]);
1553 $ctpl->setVariable("TIME", $item["playtime"]);
1554 $ctpl->setVariable("ID", $item["id"]);
1555
1556 if ($mob->getVideoPreviewPic() != "")
1557 {
1558 $ctpl->setVariable("PREVIEW_PIC",
1559 ilUtil::img(ilWACSignedPath::signFile($mob->getVideoPreviewPic()), $item["title"], 320, 240));
1560 }
1561 else
1562 {
1563 $ctpl->setVariable("PREVIEW_PIC",
1564 ilUtil::img(ilUtil::getImagePath("mcst_preview.svg"), $item["title"], 320, 240));
1565 }
1566
1567 // player
1568 if (is_object($med))
1569 {
1570 include_once("./Services/MediaObjects/classes/class.ilMediaPlayerGUI.php");
1571
1572 // the news id will be used as player id, see also ilMediaCastTableGUI
1573 $mpl = new ilMediaPlayerGUI($item["id"],
1574 $ilCtrl->getLinkTarget($this, "handlePlayerEvent", "", true, false));
1575
1576 if (strcasecmp("Reference", $med->getLocationType()) == 0)
1577 {
1578 ilWACSignedPath::signFolderOfStartFile($med->getLocation());
1579 $mpl->setFile($med->getLocation());
1580 }
1581 else
1582 {
1583 $path_to_file = ilObjMediaObject::_getURL($mob->getId()) . "/" . $med->getLocation();
1585 $mpl->setFile($path_to_file);
1586 }
1587 $mpl->setMimeType ($med->getFormat());
1588 //$mpl->setDisplayHeight($med->getHeight());
1589 $mpl->setDisplayHeight("480");
1590 $mpl->setDisplayWidth("640");
1591 $mpl->setVideoPreviewPic(ilWACSignedPath::signFile($mob->getVideoPreviewPic()));
1592 $mpl->setTitle($item["title"]);
1593 $mpl->setDescription($item["content"]);
1594 $mpl->setForceAudioPreview(true);
1595 if ($this->object->getDownloadable())
1596 {
1597 $ilCtrl->setParameterByClass("ilobjmediacastgui", "item_id", $item["id"]);
1598 $ilCtrl->setParameterByClass("ilobjmediacastgui", "purpose", "Standard");
1599 $mpl->setDownloadLink($ilCtrl->getLinkTargetByClass("ilobjmediacastgui", "downloadItem"));
1600 }
1601 $med_alt = $mob->getMediaItem("VideoAlternative");
1602 if (is_object($med_alt))
1603 {
1604 $mpl->setAlternativeVideoFile(ilWACSignedPath::signFile(ilObjMediaObject::_getURL($mob->getId())."/".
1605 $med_alt->getLocation()));
1606 $mpl->setAlternativeVideoMimeType($med_alt->getFormat());
1607 }
1608
1609 $ctpl->setVariable("PLAYER", $mpl->getPreviewHtml());
1610 }
1611
1612
1613 $ctpl->parseCurrentBlock();
1614 }
1615
1616 $feed_icon_html = $this->getFeedIconsHTML();
1617
1618 if ($feed_icon_html != "")
1619 {
1620 $feed_icon_html = '<p>'.$feed_icon_html.'</p>';
1621 }
1622
1623 $tpl->setContent($feed_icon_html.$ctpl->get());
1624 }
User interface for media player.
static _getURL($a_mob_id)
get directory for files of media object (static)
special template class to simplify handling of ITX/PEAR
static img($a_src, $a_alt="", $a_width="", $a_height="", $a_border=0, $a_id="", $a_class="")
Build img tag.
static signFile($path_to_file)
static signFolderOfStartFile($start_file_path, ilWACCookieInterface $ilWACCookieInterface=null)

References $ilCtrl, ilObjectGUI\$tpl, ilObjMediaObject\_getURL(), addContentSubTabs(), getFeedIconsHTML(), ilUtil\getImagePath(), ilUtil\img(), ilWACSignedPath\signFile(), and ilWACSignedPath\signFolderOfStartFile().

Referenced by showContentObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateCastItemObject()

ilObjMediaCastGUI::updateCastItemObject ( )

Update cast item.

Definition at line 795 of file class.ilObjMediaCastGUI.php.

796 {
797 global $tpl, $lng, $ilCtrl, $ilUser, $log;
798
799 $this->checkPermission("write");
800
801 $this->initAddCastItemForm("edit");
802
803 if ($this->form_gui->checkInput())
804 {
805 // create new media cast item
806 include_once("./Services/News/classes/class.ilNewsItem.php");
807 $mc_item = new ilNewsItem($_GET["item_id"]);
808 $mob_id = $mc_item->getMobId();
809
810 // create dummy object in db (we need an id)
811 include_once("./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
812 $mob = new ilObjMediaObject($mob_id);
813
814
815 foreach (ilObjMediaCast::$purposes as $purpose)
816 {
817 if ($this->form_gui->getInput("delete_".$purpose))
818 {
819 $mob->removeMediaItem($purpose);
820 $log->write ("Mcst: deleting purpose $purpose");
821 continue;
822 }
823 $media_item = $mob->getMediaItem($purpose);
824 $url_gui = $this->form_gui->getInput("url_".$purpose);
825 $file_gui = $this->form_gui->getInput("file_".$purpose);
826
827 if ($media_item == null)
828 {
829 if ($purpose != "Standard" &&
830 ($url_gui || $file_gui["size"]>0))
831 {
832 // check if we added an additional purpose when updating
833 // either by url or by file
834 $file = $this->createMediaItemForPurpose($mob, $purpose);
835 }
836 } else
837 {
838 $file = $this->updateMediaItem($mob, $media_item);
839 }
840
841 if ($purpose == "Standard")
842 {
843 $duration = $this->getDuration($file);
844 $title = $this->form_gui->getInput("title") != "" ? $this->form_gui->getInput("title") : basename($file);
845 $description = $this->form_gui->getInput("description");
846
847 $mob->setTitle($title);
848 $mob->setDescription($description);
849
850 $prevpic = $this->form_gui->getInput("preview_pic");
851 if ($prevpic["size"] > 0)
852 {
853 $mob->uploadVideoPreviewPic($prevpic);
854 }
855 else
856 {
857 $prevpici = $this->form_gui->getItemByPostVar("preview_pic");
858 if ($prevpici->getDeletionFlag())
859 {
860 $mob->removeAdditionalFile($mob->getVideoPreviewPic(true));
861 }
862 }
863 }
864 }
865
866 // set real meta and object data
867 $mob->update();
868
869 //
870 // @todo: save usage
871 //
872
873 $news_set = new ilSetting("news");
874 $enable_internal_rss = $news_set->get("enable_rss_for_internal");
875
876 $mc_item->setUserId($ilUser->getId());
877 if (isset($duration))
878 {
879 $mc_item->setPlaytime($duration);
880 }
881 $mc_item->setTitle($title);
882 $mc_item->setContent($description);
883 if ($enable_internal_rss)
884 {
885 $mc_item->setVisibility($this->form_gui->getInput("visibility"));
886 }
887 $mc_item->update();
888
889 $ilCtrl->redirect($this, "listItems");
890 }
891 else
892 {
893 $this->populateFormFromPost();
894 }
895 }

References $_GET, $file, $ilCtrl, $ilUser, ilObjectGUI\$lng, $log, ilObjMediaCast\$purposes, ilObjectGUI\$tpl, ilObjectGUI\checkPermission(), createMediaItemForPurpose(), getDuration(), initAddCastItemForm(), populateFormFromPost(), and updateMediaItem().

+ Here is the call graph for this function:

◆ updateMediaItem()

ilObjMediaCastGUI::updateMediaItem (   $mob,
$mediaItem 
)
private

update media item from form

Parameters
IlObjectMediaObject$mob
IlMediaItem$mediaItem
Returns
string file

Definition at line 723 of file class.ilObjMediaCastGUI.php.

724 {
725 $purpose = $mediaItem->getPurpose();
726 $url_gui = $this->form_gui->getInput ("url_".$purpose);
727 $file_gui = $this->form_gui->getInput ("file_".$purpose);
728 if ($url_gui)
729 {
730 // http
731 $file = $this->form_gui->getInput ("url_".$purpose);
732 $title = basename ($file);
733 $location = $this->form_gui->getInput ("url_".$purpose);
734 $locationType = "Reference";
735 } elseif ($file_gui["size"] > 0){
736 // lokal
737 // determine and create mob directory, move uploaded file to directory
738 $mob_dir = ilObjMediaObject::_getDirectory($mob->getId());
739 if (!is_dir($mob_dir))
740 $mob->createDirectory();
741
742 $file_name = ilUtil::getASCIIFilename($_FILES['file_'.$purpose]['name']);
743 $file_name = str_replace(" ", "_", $file_name);
744
745 $file = $mob_dir."/".$file_name;
746 $title = $file_name;
747 $locationType = "LocalFile";
748 $location = $title;
749 ilUtil::moveUploadedFile($_FILES['file_'.$purpose]['tmp_name'], $file_name, $file);
751
752 }
753
754 // check if not automatic mimetype detection
755 if ($_POST["mimetype_".$purpose] != "")
756 {
757 $mediaItem->setFormat($_POST["mimetype_".$purpose]);
758 }
759 elseif ($mediaItem->getLocation () != "")
760 {
761 $format = ilObjMediaObject::getMimeType($mediaItem->getLocation(), ($locationType == "Reference"));
762 $mediaItem->setFormat($format);
763 }
764
765 if (isset($file))
766 {
767 // get mime type, if not already set!
768 if (!isset($format))
769 {
770 $format = ilObjMediaObject::getMimeType($file, ($locationType == "Reference"));
771 }
772
773 // set real meta and object data
774 $mediaItem->setFormat($format);
775 $mediaItem->setLocation($location);
776 $mediaItem->setLocationType($locationType);
777 $mediaItem->setHAlign("Left");
778 $mediaItem->setHeight(self::isAudio($format)?0:180);
779 }
780
781 if ($purpose == "Standard")
782 {
783 if (isset($title))
784 $mob->setTitle ($title);
785 if (isset($format))
786 $mob->setDescription($format);
787 }
788
789 return $file;
790 }
$location
Definition: buildRTE.php:44
static getMimeType($a_file, $a_external=false)
get mime type for file
static moveUploadedFile($a_file, $a_name, $a_target, $a_raise_errors=true, $a_mode="move_uploaded")
move uploaded file
static getASCIIFilename($a_filename)
convert utf8 to ascii filename
static renameExecutables($a_dir)
Rename uploaded executables for security reasons.

References $_POST, $file, $location, ilObjMediaObject\_getDirectory(), ilUtil\getASCIIFilename(), ilObjMediaObject\getMimeType(), ilUtil\moveUploadedFile(), and ilUtil\renameExecutables().

Referenced by createMediaItemForPurpose(), and updateCastItemObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $additionalPurposes

ilObjMediaCastGUI::$additionalPurposes = array ("VideoPortable", "AudioPortable")
private

Definition at line 21 of file class.ilObjMediaCastGUI.php.

◆ $mimeTypes

ilObjMediaCastGUI::$mimeTypes = array()
private

Definition at line 23 of file class.ilObjMediaCastGUI.php.

◆ $purposeSuffixes

ilObjMediaCastGUI::$purposeSuffixes = array ()
private

Definition at line 22 of file class.ilObjMediaCastGUI.php.


The documentation for this class was generated from the following file: