ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilObjMediaCastGUI Class Reference

Class ilObjMediaCastGUI. More...

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

Public Member Functions

 __construct ($a_data, $a_id, $a_call_by_reference, $a_prepare_output=true)
 Constructor @access public. More...
 
 executeCommand ()
 execute command More...
 
 afterSave (ilObject $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
 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...
 
 prepareOutput ($a_show_subobjects=true)
 prepare output More...
 
 getAdminTabs ()
 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 ()
 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...
 
 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...
 
 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 ()
 
 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...
 
 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...
 
 getTabs ()
 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 (ilColumnGUI $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...
 

Protected Attributes

 $tabs
 
 $log
 
 $error
 
 $help
 
- Protected Attributes inherited from ilObjectGUI
 $ilErr
 
 $locator
 
 $user
 
 $access
 
 $settings
 
 $rbacreview
 
 $toolbar
 
 $rbacsystem
 
 $tmp_import_dir
 
 $tabs_gui = null
 
 $ctrl
 

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
 
 $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
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

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

Constructor @access public.

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

50 {
51 global $DIC;
52
53 $this->ctrl = $DIC->ctrl();
54 $this->lng = $DIC->language();
55 $this->user = $DIC->user();
56 $this->tabs = $DIC->tabs();
57 $this->tpl = $DIC["tpl"];
58 $this->access = $DIC->access();
59 $this->toolbar = $DIC->toolbar();
60 $this->log = $DIC["ilLog"];
61 $this->error = $DIC["ilErr"];
62 $this->help = $DIC["ilHelp"];
63 $this->locator = $DIC["ilLocator"];
64 $ilCtrl = $DIC->ctrl();
65 $lng = $DIC->language();
66
67 $this->type = "mcst";
68 parent::__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
69 $lng->loadLanguageModule("mcst");
70 $lng->loadLanguageModule("news");
71 $lng->loadLanguageModule("rep");
72
73 $ilCtrl->saveParameter($this, "item_id");
74
75 include_once("./Modules/MediaCast/classes/class.ilMediaCastSettings.php");
77 $this->purposeSuffixes = $settings->getPurposeSuffixes();
78 $this->mimeTypes = array();
79 $mime_types = $settings->getMimeTypes();
80 foreach ($mime_types as $mt) {
81 $this->mimeTypes[$mt] = $mt;
82 }
83
84 include_once("./Services/Utilities/classes/class.ilMimeTypeUtil.php");
85 foreach (ilMimeTypeUtil::getExt2MimeMap() as $mt) {
86 $this->mimeTypes[$mt] = $mt;
87 }
88 asort($this->mimeTypes);
89 }
user()
Definition: user.php:4
error($a_errmsg)
set error message @access public
static _getInstance()
get singleton instance
global $ilCtrl
Definition: ilias.php:18
global $DIC
Definition: saml.php:7

References $DIC, $ilCtrl, ilObjectGUI\$lng, ilObjectGUI\$settings, ilMediaCastSettings\_getInstance(), error(), ilMimeTypeUtil\getExt2MimeMap(), and user().

+ Here is the call graph for this function:

Member Function Documentation

◆ _goto()

static ilObjMediaCastGUI::_goto (   $a_target)
static

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

1366 {
1367 global $DIC;
1368
1369 $ilAccess = $DIC->access();
1370 $ilErr = $DIC["ilErr"];
1371 $lng = $DIC->language();
1372
1373 if ($ilAccess->checkAccess("read", "", $a_target)) {
1374 $_GET["cmd"] = "showContent";
1375 $_GET["ref_id"] = $a_target;
1376 $_GET["baseClass"] = "ilmediacasthandlergui";
1377 $_GET["cmdClass"] = "ilobjmediacastgui";
1378 include("ilias.php");
1379 exit;
1380 } elseif ($ilAccess->checkAccess("visible", "", $a_target)) {
1381 ilObjectGUI::_gotoRepositoryNode($a_target, "infoScreen");
1382 } elseif ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID)) {
1384 $lng->txt("msg_no_perm_read_item"),
1386 ));
1388 }
1389
1390 $ilErr->raiseError($lng->txt("msg_no_perm_read"), $ilErr->FATAL);
1391 }
sprintf('%.4f', $callTime)
$_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.

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

+ Here is the call graph for this function:

◆ addCastItemObject()

ilObjMediaCastGUI::addCastItemObject ( )

Add media cast item.

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

321 {
323
324 $this->checkPermission("write");
325
326 $this->initAddCastItemForm();
327 $tpl->setContent($this->form_gui->getHTML());
328 }
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 1110 of file class.ilObjMediaCastGUI.php.

1111 {
1112 $ilTabs = $this->tabs;
1113 $ilAccess = $this->access;
1114 $lng = $this->lng;
1115
1116 $ilTabs->addSubTab(
1117 "content",
1118 $lng->txt("view"),
1119 $this->ctrl->getLinkTarget($this, "showContent")
1120 );
1121
1122 if ($ilAccess->checkAccess("write", "", $_GET["ref_id"])) {
1123 $ilTabs->addSubTab(
1124 "manage",
1125 $lng->txt("mcst_manage"),
1126 $this->ctrl->getLinkTarget($this, "listItems")
1127 );
1128
1129 if ($this->object->getOrder() == ilObjMediaCast::ORDER_MANUAL) {
1130 $ilTabs->addSubTab(
1131 "sorting",
1132 $lng->txt("mcst_ordering"),
1133 $this->ctrl->getLinkTarget($this, "editOrder")
1134 );
1135 }
1136 }
1137
1138 $ilTabs->activateSubTab($a_active);
1139 $ilTabs->activateTab("content");
1140 }

References $_GET, ilObjectGUI\$access, ilObjectGUI\$lng, $tabs, 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 $ilLocator = $this->locator;
1359
1360 if (is_object($this->object)) {
1361 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this, "listItems"), "", $_GET["ref_id"]);
1362 }
1363 }

References $_GET, and ilObjectGUI\$locator.

◆ afterSave()

ilObjMediaCastGUI::afterSave ( ilObject  $newObj)

save object @access public

Reimplemented from ilObjectGUI.

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

184 {
185 // always send a message
186 ilUtil::sendSuccess($this->lng->txt("object_added"), true);
187 ilUtil::redirect("ilias.php?baseClass=ilMediaCastHandlerGUI&ref_id=" . $newObj->getRefId() . "&cmd=editSettings");
188 }
getRefId()
get reference id @access public
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static redirect($a_script)

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

+ Here is the call graph for this function:

◆ confirmDeletionItemsObject()

ilObjMediaCastGUI::confirmDeletionItemsObject ( )

Confirmation Screen.

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

876 {
880 $ilTabs = $this->tabs;
881
882 $this->checkPermission("write");
883 $ilTabs->activateTab("edit_content");
884
885 if (!is_array($_POST["item_id"])) {
886 $this->listItemsObject();
887 return;
888 }
889
890 include_once("Services/Utilities/classes/class.ilConfirmationGUI.php");
891 $c_gui = new ilConfirmationGUI();
892
893 // set confirm/cancel commands
894 $c_gui->setFormAction($ilCtrl->getFormAction($this, "deleteItems"));
895 $c_gui->setHeaderText($lng->txt("info_delete_sure"));
896 $c_gui->setCancel($lng->txt("cancel"), "listItems");
897 $c_gui->setConfirm($lng->txt("confirm"), "deleteItems");
898
899 // add items to delete
900 include_once("./Services/News/classes/class.ilNewsItem.php");
901 foreach ($_POST["item_id"] as $item_id) {
902 $item = new ilNewsItem($item_id);
903 $c_gui->addItem(
904 "item_id[]",
905 $item_id,
906 $item->getTitle(),
907 ilUtil::getImagePath("icon_mcst.svg")
908 );
909 }
910
911 $tpl->setContent($c_gui->getHTML());
912 }
$_POST["username"]
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)

References $_POST, ilObjectGUI\$ctrl, $ilCtrl, ilObjectGUI\$lng, $tabs, 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 {
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 include_once("./Services/MediaObjects/classes/class.ilFFmpeg.php");
1647 $med = $mob->getMediaItem("Standard");
1648 $mob_file = ilObjMediaObject::_getDirectory($mob->getId()) . "/" . $med->getLocation();
1649 $new_file = ilFFmpeg::convert($mob_file, $target_format);
1651 $pi = pathinfo($new_file);
1652 $med = $mob->getMediaItem($target_purpose);
1653 if (!is_object($med)) {
1654 $med = new ilMediaItem();
1655 $med->setMobId($mob->getId());
1656 $mob->addMediaItem($med);
1657 $mob->update();
1658 $med->setPurpose($target_purpose);
1659 }
1660 $med->setFormat($target_format);
1661 $med->setLocation($pi["basename"]);
1662 $med->setLocationType("LocalFile");
1663 $med->update();
1664
1665 $add = (is_array($ret) && count($ret) > 0)
1666 ? "<br />" . implode($ret, "<br />")
1667 : "";
1668
1669 ilUtil::sendInfo($this->lng->txt("mcst_converted_file") . $add, true);
1670 } catch (ilException $e) {
1672 $add = (is_array($ret) && count($ret) > 0)
1673 ? "<br />" . implode($ret, "<br />")
1674 : "";
1675 ilUtil::sendFailure($e->getMessage() . $add, true);
1676 }
1677
1678
1679 $ilCtrl->redirect($this, "editCastItem");
1680 }
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.
static getLastReturnValues()
Get last return values.
Class ilMediaItem.
Class ilObjMediaObject.
static _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.
$ret
Definition: parser.php:6

References $_GET, $_POST, ilObjectGUI\$ctrl, $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 701 of file class.ilObjMediaCastGUI.php.

702 {
703 $mediaItem = new ilMediaItem();
704 $mob->addMediaItem($mediaItem);
705 $mediaItem->setPurpose($purpose);
706 return $this->updateMediaItem($mob, $mediaItem);
707 }
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 917 of file class.ilObjMediaCastGUI.php.

918 {
920
921 $this->checkPermission("write");
922
923 // delete all selected news items
924 foreach ($_POST["item_id"] as $item_id) {
925 $mc_item = new ilNewsItem($item_id);
926 $mc_item->delete();
927 }
928
929 $ilCtrl->redirect($this, "listItems");
930 }

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

+ Here is the call graph for this function:

◆ determinePlaytimeObject()

ilObjMediaCastGUI::determinePlaytimeObject ( )

Delete news items.

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

954 {
957
958 $mc_item = new ilNewsItem($_GET["item_id"]);
959 $mob = $mc_item->getMobId();
960 include_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
961 $mob = new ilObjMediaObject($mob);
962 $mob_dir = ilObjMediaObject::_getDirectory($mob->getId());
963 $m_item = $mob->getMediaItem("Standard");
964 $file = $mob_dir . "/" . $m_item->getLocation();
965 $duration = $this->getDuration($file);
966 if ($duration != "00:00:00") {
967 $mc_item->setPlaytime($duration);
968 $mc_item->update();
969 ilUtil::sendSuccess($lng->txt("mcst_set_playtime"), true);
970 } else {
971 ilUtil::sendFailure($lng->txt("mcst_unable_to_determin_playtime"), true);
972 }
973
974 $ilCtrl->redirect($this, "listItems");
975 }
getDuration($file)
get duration from form or from file analyzer
if(!file_exists("$old.txt")) if( $old===$new) if(file_exists("$new.txt")) $file

References $_GET, ilObjectGUI\$ctrl, $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 935 of file class.ilObjMediaCastGUI.php.

936 {
938 $this->checkPermission("read");
939
940 $news_item = new ilNewsItem($_GET["item_id"]);
941 if (!$news_item->deliverMobFile($_GET["purpose"], (int) $_GET["presentation"])) {
942 $ilCtrl->redirect($this, "listItems");
943 } else {
945 $this->object->handleLPUpdate($ilUser->getId(), $news_item->getMobId());
946 }
947 exit;
948 }
$ilUser
Definition: imgupload.php:18

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

+ Here is the call graph for this function:

◆ editCastItemObject()

ilObjMediaCastGUI::editCastItemObject ( )

Edit media cast item.

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

334 {
336 $ilToolbar = $this->toolbar;
338
339 $this->checkPermission("write");
340
341 // conversion toolbar
342 include_once("./Services/MediaObjects/classes/class.ilFFmpeg.php");
343 if (ilFFmpeg::enabled()) {
344 $this->mcst_item = new ilNewsItem($_GET["item_id"]);
345 include_once("./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
346 $mob = new ilObjMediaObject($this->mcst_item->getMobId());
347
348 $conv_cnt = 0;
349 // we had other purposes as source as well, but
350 // currently only "Standard" is implemented in the convertFile method
351 foreach (array("Standard") as $p) {
352 /*
353 $med = $mob->getMediaItem($p);
354 if (is_object($med))
355 {
356 $options = ilFFmpeg::getPossibleTargetMimeTypes($med->getFormat());
357 if (count($options) > 0)
358 {
359 if ($conv_cnt > 0)
360 {
361 $ilToolbar->addSeparator();
362 }
363
364 include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
365 $si = new ilSelectInputGUI($this->lng->txt("mcst_conv_".
366 strtolower($p)."_to"), "target_format");
367 $si->setOptions($options);
368 $ilToolbar->addInputItem($si, true);
369
370 $si = new ilSelectInputGUI(", ".$this->lng->txt("mcst_target").": ",
371 "target_purpose");
372 $si->setOptions(array("Standard" => $this->lng->txt("mcst_purpose_standard"),
373 "VideoAlternative" => $this->lng->txt("mcst_purpose_videoalternative")
374 ));
375 $si->setValue($p);
376 $ilToolbar->addInputItem($si, true);
377
378 $ilToolbar->addFormButton($this->lng->txt("mcst_convert"), "convertFile");
379
380 $conv_cnt++;
381 }
382 }
383 */
384
385 $med = $mob->getMediaItem($p);
386 if (is_object($med)) {
387 if (ilFFmpeg::supportsImageExtraction($med->getFormat())) {
388 // second
389 include_once("./Services/Form/classes/class.ilTextInputGUI.php");
390 $ni = new ilTextInputGUI($this->lng->txt("mcst_second"), "sec");
391 $ni->setMaxLength(4);
392 $ni->setSize(4);
393 $ni->setValue(1);
394 $ilToolbar->addInputItem($ni, true);
395
396 $ilToolbar->addFormButton($this->lng->txt("mcst_extract_preview_image"), "extractPreviewImage");
397 $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
398 }
399 }
400
401 /*if ($conv_cnt > 0)
402 {
403 $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
404 }*/
405 }
406 }
407
408 $this->initAddCastItemForm("edit");
409 $this->getCastItemValues();
410 $tpl->setContent($this->form_gui->getHTML());
411 }
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, ilObjectGUI\$ctrl, $ilCtrl, ilObjectGUI\$toolbar, 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 $ilTabs = $this->tabs;
1456 $lng = $this->lng;
1457 $tpl = $this->tpl;
1458
1459 $this->checkPermission("write");
1460 $ilTabs->activateTab("edit_content");
1461
1462 $this->addContentSubTabs("sorting");
1463
1464 // sort by order setting
1465 switch ($this->object->getOrder()) {
1469 return $this->listItemsObject();
1470
1472 // sub-tabs
1473 break;
1474 }
1475
1476 include_once("./Modules/MediaCast/classes/class.ilMediaCastTableGUI.php");
1477 $table_gui = new ilMediaCastTableGUI($this, "editOrder", true);
1478
1479 $table_gui->setTitle($lng->txt("mcst_media_cast"));
1480 $table_gui->setData($this->object->getSortedItemsArray());
1481
1482 $table_gui->addCommandButton("saveOrder", $lng->txt("mcst_save_order"));
1483
1484 $tpl->setContent($table_gui->getHTML());
1485 }
TableGUI class for table NewsForContext.
addContentSubTabs($a_active="content")
Add content subtabs.

References ilObjectGUI\$lng, $tabs, 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 1146 of file class.ilObjMediaCastGUI.php.

1147 {
1148 $tpl = $this->tpl;
1149 $ilTabs = $this->tabs;
1150
1151 $this->checkPermission("write");
1152 $ilTabs->activateTab("id_settings");
1153
1154 $this->initSettingsForm();
1155 $tpl->setContent($this->form_gui->getHtml());
1156 }
initSettingsForm()
Init Settings Form.

References $tabs, 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 91 of file class.ilObjMediaCastGUI.php.

92 {
94 $ilTabs = $this->tabs;
95
96 $next_class = $this->ctrl->getNextClass($this);
97 $cmd = $this->ctrl->getCmd();
98 $this->prepareOutput();
99
100 switch ($next_class) {
101 case "ilinfoscreengui":
102 if (!$this->checkPermissionBool("read")) {
103 $this->checkPermission("visible");
104 }
105 $this->infoScreen(); // forwards command
106 break;
107
108 case "ilexportgui":
109// $this->prepareOutput();
110 $ilTabs->activateTab("export");
111 include_once("./Services/Export/classes/class.ilExportGUI.php");
112 $exp_gui = new ilExportGUI($this);
113 $exp_gui->addFormat("xml");
114 $ret = $this->ctrl->forwardCommand($exp_gui);
115// $this->tpl->show();
116 break;
117
118 case 'ilpermissiongui':
119 $ilTabs->activateTab("id_permissions");
120 include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
121 $perm_gui = new ilPermissionGUI($this);
122 $ret = $this->ctrl->forwardCommand($perm_gui);
123 break;
124
125 case 'ilobjectcopygui':
126 include_once './Services/Object/classes/class.ilObjectCopyGUI.php';
127 $cp = new ilObjectCopyGUI($this);
128 $cp->setType('mcst');
129 $this->ctrl->forwardCommand($cp);
130 break;
131
132 case "ilcommonactiondispatchergui":
133 include_once("Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
135 $this->ctrl->forwardCommand($gui);
136 break;
137
138 case "illearningprogressgui":
139 $ilTabs->activateTab('learning_progress');
140 require_once 'Services/Tracking/classes/class.ilLearningProgressGUI.php';
141 $new_gui = new ilLearningProgressGUI(
143 $this->object->getRefId(),
144 $_GET['user_id'] ? $_GET['user_id'] : $ilUser->getId()
145 );
146 $this->ctrl->forwardCommand($new_gui);
147 $this->tabs_gui->setTabActive('learning_progress');
148 break;
149
150 default:
151 if (!$cmd) {
152 $cmd = "infoScreen";
153 }
154 $cmd .= "Object";
155 if ($cmd != "infoScreenObject") {
156 $this->checkPermission("read");
157 } else {
158 $this->checkPermission("visible");
159 }
160 $this->$cmd();
161
162 break;
163 }
164
165 $this->addHeaderAction();
166
167 return true;
168 }
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($a_show_subobjects=true)
prepare output
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission.
addHeaderAction()
Add header action menu.
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.

References $_GET, $ilUser, $ret, $tabs, ilObjectGUI\$user, ilObjectGUI\addHeaderAction(), ilObjectGUI\checkPermission(), ilObjectGUI\checkPermissionBool(), 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 1688 of file class.ilObjMediaCastGUI.php.

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

References $_GET, $_POST, ilObjectGUI\$ctrl, $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 529 of file class.ilObjMediaCastGUI.php.

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

References $_GET, $i, 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 674 of file class.ilObjMediaCastGUI.php.

675 {
676 $duration = isset($this->form_gui)
677 ? $this->form_gui->getInput("duration")
678 : array("hh"=>0, "mm"=>0, "ss"=>0);
679 if ($duration["hh"] == 0 && $duration["mm"] == 0 && $duration["ss"] == 0 && is_file($file)) {
680 include_once("./Services/MediaObjects/classes/class.ilMediaAnalyzer.php");
681 $ana = new ilMediaAnalyzer();
682 $ana->setFile($file);
683 $ana->analyzeFile();
684 $dur = $ana->getPlaytimeString();
685 $dur = explode(":", $dur);
686 $duration["mm"] = $dur[0];
687 $duration["ss"] = $dur[1];
688 }
689 $duration = str_pad($duration["hh"], 2, "0", STR_PAD_LEFT) . ":" .
690 str_pad($duration["mm"], 2, "0", STR_PAD_LEFT) . ":" .
691 str_pad($duration["ss"], 2, "0", STR_PAD_LEFT);
692 return $duration;
693 }
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 241 of file class.ilObjMediaCastGUI.php.

242 {
244
245 $html = "";
246
247 include_once("./Services/Block/classes/class.ilBlockSetting.php");
248 $public_feed = ilBlockSetting::_lookup(
249 "news",
250 "public_feed",
251 0,
252 $this->object->getId()
253 );
254
255 // rss icon/link
256 if ($public_feed) {
257 $news_set = new ilSetting("news");
258 $enable_internal_rss = $news_set->get("enable_rss_for_internal");
259
260 if ($enable_internal_rss) {
261 // create dummy object in db (we need an id)
262 $items = $this->object->getItemsArray();
263 include_once("./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
264 $html = "";
265 foreach (ilObjMediaCast::$purposes as $purpose) {
266 foreach ($items as $id => $item) {
267 $mob = new ilObjMediaObject($item["mob_id"]);
268 $mob->read();
269 if ($mob->hasPurposeItem($purpose)) {
270 if ($html == "") {
271 $html = " ";
272 }
273 $url = ILIAS_HTTP_PATH . "/feed.php?client_id=" . rawurlencode(CLIENT_ID) . "&" . "ref_id=" . $_GET["ref_id"] . "&purpose=$purpose";
274 $title = $lng->txt("news_feed_url");
275
276 include_once("./Services/News/classes/class.ilRSSButtonGUI.php");
277 switch (strtolower($purpose)) {
278 case "audioportable":
281 break;
282
283 case "videoportable":
286 break;
287
288 default:
291 break;
292 }
293 $row1 .= "&nbsp;" . ilRSSButtonGUI::get($type1, $url);
294 if ($this->object->getPublicFiles()) {
295 $url = preg_replace("/https?/i", "itpc", $url);
296 $title = $lng->txt("news_feed_url");
297
298 include_once("./Services/News/classes/class.ilRSSButtonGUI.php");
299 $row2 .= "&nbsp;" . ilRSSButtonGUI::get($type2, $url);
300 }
301 break;
302 }
303 }
304 }
305 if ($html != "") {
306 $html .= $row1;
307 if ($row2 != "") {
308 $html .= $row2;
309 }
310 }
311 }
312 }
313 return $html;
314 }
static _lookup($a_type, $a_setting, $a_user=0, $a_block_id=0)
Lookup setting from database.
static get($a_type, $a_href="")
Get icon html.
ILIAS Setting Class.
$html
Definition: example_001.php:87
if(!array_key_exists('StateId', $_REQUEST)) $id
$url

References $_GET, $html, $id, ilObjectGUI\$lng, ilObjMediaCast\$purposes, $title, $url, ilBlockSetting\_lookup(), ilRSSButtonGUI\get(), 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.

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

References $id.

◆ getMediaItems()

ilObjMediaCastGUI::getMediaItems (   $id)
protected

get MediaItems for id and updates local variable mcst_item

Returns
array of ilMediaItem

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

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

References $id.

Referenced by getCastItemValues().

+ Here is the caller graph for this function:

◆ handlePlayerEventObject()

ilObjMediaCastGUI::handlePlayerEventObject ( )

Handle player event.

Parameters

return

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

1742 {
1743 if ($_GET["event"] == "play") {
1744 $player = explode("_", $_GET["player"]);
1745 $news_id = (int) $player[1];
1746 include_once("./Services/News/classes/class.ilNewsItem.php");
1747 $item = new ilNewsItem($news_id);
1748 $item->increasePlayCounter();
1749
1750 $mob_id = $item->getMobId();
1751 if ($mob_id) {
1753 $this->object->handleLPUpdate($ilUser->getId(), $mob_id);
1754 }
1755 }
1756 exit;
1757 }

References $_GET, $ilUser, ilObjectGUI\$user, and exit.

◆ infoScreen()

ilObjMediaCastGUI::infoScreen ( )

show information screen

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

996 {
997 $ilAccess = $this->access;
999 $ilTabs = $this->tabs;
1000
1001 $ilTabs->activateTab("id_info");
1002
1003 if (!$this->checkPermissionBool("read")) {
1004 $this->checkPermission("visible");
1005 }
1006
1007 include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
1008 $info = new ilInfoScreenGUI($this);
1009
1010 $info->enablePrivateNotes();
1011
1012 // general information
1013 $this->lng->loadLanguageModule("meta");
1014 $this->lng->loadLanguageModule("mcst");
1015 $med_items = $this->object->getItemsArray();
1016 $info->addSection($this->lng->txt("meta_general"));
1017 $info->addProperty(
1018 $this->lng->txt("mcst_nr_items"),
1019 (int) count($med_items)
1020 );
1021
1022 if (count($med_items) > 0) {
1023 $cur = current($med_items);
1024 $last = ilDatePresentation::formatDate(new ilDateTime($cur["creation_date"], IL_CAL_DATETIME));
1025 } else {
1026 $last = "-";
1027 }
1028
1029 $info->addProperty($this->lng->txt("mcst_last_submission"), $last);
1030
1031 // forward the command
1032 $this->ctrl->forwardCommand($info);
1033 }
const IL_CAL_DATETIME
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false)
Format a date @access public.
@classDescription Date and time handling
Class ilInfoScreenGUI.
$info
Definition: index.php:5

References ilObjectGUI\$access, $error, ilObjectGUI\$ilErr, $info, $tabs, ilObjectGUI\checkPermission(), ilObjectGUI\checkPermissionBool(), 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 982 of file class.ilObjMediaCastGUI.php.

983 {
984 if (!$this->checkPermissionBool("read")) {
985 $this->checkPermission("visible");
986 }
987 $this->ctrl->setCmd("showSummary");
988 $this->ctrl->setCmdClass("ilinfoscreengui");
989 $this->infoScreen();
990 }

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

+ Here is the call graph for this function:

◆ initAddCastItemForm()

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

Init add cast item form.

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

417 {
420 $ilTabs = $this->tabs;
421
422 $this->checkPermission("write");
423 $ilTabs->activateTab("edit_content");
424
425 $lng->loadLanguageModule("mcst");
426
427 $news_set = new ilSetting("news");
428 $enable_internal_rss = $news_set->get("enable_rss_for_internal");
429
430 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
431 $this->form_gui = new ilPropertyFormGUI();
432 $this->form_gui->setMultipart(true);
433
434 // Property Title
435 $text_input = new ilTextInputGUI($lng->txt("title"), "title");
436 $text_input->setMaxLength(200);
437 $this->form_gui->addItem($text_input);
438
439 // Property Content
440 $text_area = new ilTextAreaInputGUI($lng->txt("description"), "description");
441 $text_area->setRequired(false);
442 $this->form_gui->addItem($text_area);
443
444 // Property Visibility
445 if ($enable_internal_rss) {
446 $radio_group = new ilRadioGroupInputGUI($lng->txt("access_scope"), "visibility");
447 $radio_option = new ilRadioOption($lng->txt("access_users"), "users");
448 $radio_group->addOption($radio_option);
449 $radio_option = new ilRadioOption($lng->txt("access_public"), "public");
450 $radio_group->addOption($radio_option);
451 $radio_group->setInfo($lng->txt("mcst_visibility_info"));
452 $radio_group->setRequired(true);
453 $radio_group->setValue($this->object->getDefaultAccess() == 0 ? "users" : "public");
454 $this->form_gui->addItem($radio_group);
455 }
456
457 // Duration
458 $dur = new ilDurationInputGUI($lng->txt("mcst_duration"), "duration");
459 $dur->setInfo($lng->txt("mcst_duration_info"));
460 $dur->setShowDays(false);
461 $dur->setShowHours(true);
462 $dur->setShowSeconds(true);
463 $this->form_gui->addItem($dur);
464
465 foreach (ilObjMediaCast::$purposes as $purpose) {
466 if ($purpose == "VideoAlternative" &&
467 $a_mode == "create") {
468 continue;
469 }
470
472 $section->setTitle($lng->txt("mcst_" . strtolower($purpose) . "_title"));
473 $this->form_gui->addItem($section);
474 if ($a_mode != "create") {
475 $value = new ilHiddenInputGUI("value_" . $purpose);
476 $label = new ilNonEditableValueGUI($lng->txt("value"));
477 $label->setPostVar("label_value_" . $purpose);
478 $label->setInfo($lng->txt("mcst_current_value_info"));
479 $this->form_gui->addItem($label);
480 $this->form_gui->addItem($value);
481 }
482 $file = new ilFileInputGUI($lng->txt("file"), "file_" . $purpose);
483 $file->setSuffixes($this->purposeSuffixes[$purpose]);
484 $this->form_gui->addItem($file);
485 $text_input = new ilRegExpInputGUI($lng->txt("url"), "url_" . $purpose);
486 $text_input->setPattern("/https?\:\/\/.+/i");
487 $text_input->setInfo($lng->txt("mcst_reference_info"));
488 $this->form_gui->addItem($text_input);
489 if ($purpose != "Standard") {
490 $clearCheckBox = new ilCheckboxInputGUI();
491 $clearCheckBox->setPostVar("delete_" . $purpose);
492 $clearCheckBox->setTitle($lng->txt("mcst_clear_purpose_title"));
493 $this->form_gui->addItem($clearCheckBox);
494 } else {
495
496 // mime type selection
497 $mimeTypeSelection = new ilSelectInputGUI();
498 $mimeTypeSelection->setPostVar("mimetype_" . $purpose);
499 $mimeTypeSelection->setTitle($lng->txt("mcst_mimetype"));
500 $mimeTypeSelection->setInfo($lng->txt("mcst_mimetype_info"));
501 $options = array("" => $lng->txt("mcst_automatic_detection"));
502 $options = array_merge($options, $this->mimeTypes);
503 $mimeTypeSelection->setOptions($options);
504 $this->form_gui->addItem($mimeTypeSelection);
505
506 // preview picure
507 $pp = new ilImageFileInputGUI($lng->txt("mcst_preview_picture"), "preview_pic");
508 $pp->setSuffixes(array("png", "jpeg", "jpg"));
509 $pp->setInfo($lng->txt("mcst_preview_picture_info") . " mp4, mp3, png, jp(e)g, gif");
510 $this->form_gui->addItem($pp);
511 }
512 }
513
514 // save/cancel button
515 if ($a_mode == "create") {
516 $this->form_gui->setTitle($lng->txt("mcst_add_new_item"));
517 $this->form_gui->addCommandButton("saveCastItem", $lng->txt("save"));
518 } else {
519 $this->form_gui->setTitle($lng->txt("mcst_edit_item"));
520 $this->form_gui->addCommandButton("updateCastItem", $lng->txt("save"));
521 }
522 $this->form_gui->addCommandButton("listItems", $lng->txt("cancel"));
523 $this->form_gui->setFormAction($ilCtrl->getFormAction($this, "saveCastItem"));
524 }
$section
Definition: Utf8Test.php:83
if(!isset( $_REQUEST[ 'ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options
Definition: as_login.php:20
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.

References ilObjectGUI\$ctrl, $file, $ilCtrl, ilObjectGUI\$lng, $options, ilObjMediaCast\$purposes, $section, $tabs, 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 170 of file class.ilObjMediaCastGUI.php.

171 {
172 $forms = array(self::CFORM_NEW => $this->initCreateForm($a_new_type),
173 self::CFORM_IMPORT => $this->initImportForm($a_new_type),
174 self::CFORM_CLONE => $this->fillCloneTemplate(null, $a_new_type));
175
176 return $forms;
177 }
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 1161 of file class.ilObjMediaCastGUI.php.

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

References ilObjectGUI\$ctrl, $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 1399 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 193 of file class.ilObjMediaCastGUI.php.

194 {
197 $ilAccess = $this->access;
198 $ilTabs = $this->tabs;
199 $ilToolbar = $this->toolbar;
200
201 $this->checkPermission("read");
202
203 if ($a_presentation_mode) {
204 $this->addContentSubTabs("content");
205 } else {
206 $this->addContentSubTabs("manage");
207 }
208
209 $med_items = $this->object->getSortedItemsArray();
210
211 include_once("./Modules/MediaCast/classes/class.ilMediaCastTableGUI.php");
212 if ($a_presentation_mode) {
213 $table_gui = new ilMediaCastTableGUI($this, "showContent", false, true);
214 } else {
215 $table_gui = new ilMediaCastTableGUI($this, "listItems");
216 }
217
218 $table_gui->setData($med_items);
219
220 if ($ilAccess->checkAccess("write", "", $_GET["ref_id"]) && !$a_presentation_mode) {
221 $ilToolbar->addButton($lng->txt("add"), $this->ctrl->getLinkTarget($this, "addCastItem"));
222
223 $table_gui->addMultiCommand("confirmDeletionItems", $lng->txt("delete"));
224 $table_gui->setSelectAllCheckbox("item_id");
225 }
226
227 $feed_icon_html = $this->getFeedIconsHTML();
228 if ($feed_icon_html != "") {
229 $table_gui->setHeaderHTML($feed_icon_html);
230 }
231
232 $tpl->setContent($table_gui->getHTML());
233 }
getFeedIconsHTML()
Get feed icons HTML.

References $_GET, ilObjectGUI\$access, ilObjectGUI\$lng, $tabs, ilObjectGUI\$toolbar, 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 1436 of file class.ilObjMediaCastGUI.php.

1437 {
1438 $tpl = $this->tpl;
1439 //issue: we have to display the current settings
1440 // problem: POST does not contain values of disabled textfields
1441 // solution: use hidden field and label to display-> here we need to synchronize the labels
1442 // with the values from the hidden fields.
1443 foreach (ilObjMediaCast::$purposes as $purpose) {
1444 if ($_POST["value_" . $purpose]) {
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 576 of file class.ilObjMediaCastGUI.php.

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

References $_POST, ilObjectGUI\$ctrl, $description, $file, $ilCtrl, $ilUser, ilObjectGUI\$lng, $tabs, $title, ilObjectGUI\$tpl, ilObjectGUI\$user, 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 1487 of file class.ilObjMediaCastGUI.php.

1488 {
1489 $lng = $this->lng;
1490
1491 asort($_POST["item_id"]);
1492
1493 $items = array();
1494 foreach (array_keys($_POST["item_id"]) as $id) {
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, $id, ilObjectGUI\$lng, and ilUtil\sendSuccess().

+ Here is the call graph for this function:

◆ saveSettingsObject()

ilObjMediaCastGUI::saveSettingsObject ( )

Save Settings.

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

1303 {
1305 $ilTabs = $this->tabs;
1306
1307 $this->checkPermission("write");
1308 $ilTabs->activateTab("id_settings");
1309
1310 $this->initSettingsForm();
1311 if ($this->form_gui->checkInput()) {
1312 $news_set = new ilSetting("news");
1313 $enable_internal_rss = $news_set->get("enable_rss_for_internal");
1314
1315 $this->object->setTitle($this->form_gui->getInput("title"));
1316 $this->object->setDescription($this->form_gui->getInput("description"));
1317 $this->object->setOnline($this->form_gui->getInput("online"));
1318 $this->object->setDownloadable($this->form_gui->getInput("downloadable"));
1319 $this->object->setOrder($this->form_gui->getInput("order"));
1320 $this->object->setViewMode($this->form_gui->getInput("viewmode"));
1321
1322 if ($enable_internal_rss) {
1323 $this->object->setPublicFiles($this->form_gui->getInput("public_files"));
1324 $this->object->setDefaultAccess($this->form_gui->getInput("defaultaccess"));
1325 }
1326 $this->object->update();
1327
1328 if ($enable_internal_rss) {
1329 include_once("./Services/Block/classes/class.ilBlockSetting.php");
1331 "news",
1332 "public_feed",
1333 $this->form_gui->getInput("extra_feed"),
1334 0,
1335 $this->object->getId()
1336 );
1337
1339 "news",
1340 "keep_rss_min",
1341 $this->form_gui->getInput("keep_rss_min"),
1342 0,
1343 $this->object->getId()
1344 );
1345 }
1346
1347 ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
1348 $ilCtrl->redirect($this, "editSettings");
1349 } else {
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 ilObjectGUI\$ctrl, $ilCtrl, $tabs, 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 1039 of file class.ilObjMediaCastGUI.php.

1040 {
1041 $ilAccess = $this->access;
1042 $ilTabs = $this->tabs;
1043 $lng = $this->lng;
1044 $ilHelp = $this->help;
1045
1046 $ilHelp->setScreenIdComponent("mcst");
1047
1048 // list items
1049 if ($ilAccess->checkAccess('read', "", $this->object->getRefId())) {
1050 $ilTabs->addTab(
1051 "content",
1052 $lng->txt("content"),
1053 $this->ctrl->getLinkTarget($this, "showContent")
1054 );
1055 }
1056
1057 // info screen
1058 if ($ilAccess->checkAccess('visible', "", $this->object->getRefId()) ||
1059 $ilAccess->checkAccess('read', "", $this->object->getRefId())) {
1060 $ilTabs->addTab(
1061 "id_info",
1062 $lng->txt("info_short"),
1063 $this->ctrl->getLinkTargetByClass("ilinfoscreengui", "showSummary")
1064 );
1065 }
1066
1067 // settings
1068 if ($ilAccess->checkAccess('write', "", $this->object->getRefId())) {
1069 $ilTabs->addTab(
1070 "id_settings",
1071 $lng->txt("settings"),
1072 $this->ctrl->getLinkTarget($this, "editSettings")
1073 );
1074 }
1075
1076 require_once 'Services/Tracking/classes/class.ilLearningProgressAccess.php';
1077 if (ilLearningProgressAccess::checkAccess($this->object->getRefId())) {
1078 $ilTabs->addTab(
1079 'learning_progress',
1080 $lng->txt('learning_progress'),
1081 $this->ctrl->getLinkTargetByClass(array(__CLASS__, 'illearningprogressgui'), '')
1082 );
1083 }
1084
1085 // export
1086 if ($ilAccess->checkAccess("write", "", $this->object->getRefId())) {
1087 $ilTabs->addTab(
1088 "export",
1089 $lng->txt("export"),
1090 $this->ctrl->getLinkTargetByClass("ilexportgui", "")
1091 );
1092 }
1093
1094 // edit permissions
1095 if ($ilAccess->checkAccess('edit_permission', "", $this->object->getRefId())) {
1096 $ilTabs->addTab(
1097 "id_permissions",
1098 $lng->txt("perm_settings"),
1099 $this->ctrl->getLinkTargetByClass("ilpermissiongui", "perm")
1100 );
1101 }
1102 }
static checkAccess($a_ref_id, $a_allow_only_read=true)
check access to learning progress

References ilObjectGUI\$access, $help, ilObjectGUI\$lng, $tabs, 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 {
1516
1517 // need read events for parent for LP statistics
1518 require_once 'Services/Tracking/classes/class.ilChangeEvent.php';
1520 "mcst",
1521 $this->object->getRefId(),
1522 $this->object->getId(),
1523 $ilUser->getId()
1524 );
1525
1526 if ($this->object->getViewMode() == ilObjMediaCast::VIEW_GALLERY) {
1527 $this->showGallery();
1528 } else {
1529 $this->listItemsObject(true);
1530 }
1531 global $tpl;
1532 $tpl->setPermanentLink($this->object->getType(), $this->object->getRefId());
1533 }
static _recordReadEvent( $a_type, $a_ref_id, $obj_id, $usr_id, $isCatchupWriteEvents=true, $a_ext_rc=false, $a_ext_time=false)
Records a read event and catches up with write events.

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

+ Here is the call graph for this function:

◆ showGallery()

ilObjMediaCastGUI::showGallery ( )

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

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

References ilObjectGUI\$ctrl, $ilCtrl, $tabs, 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 783 of file class.ilObjMediaCastGUI.php.

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

References $_GET, ilObjectGUI\$ctrl, $description, $file, $ilCtrl, $ilLog, $ilUser, $log, ilObjMediaCast\$purposes, $title, ilObjectGUI\$user, 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 716 of file class.ilObjMediaCastGUI.php.

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

References $_POST, $file, $format, $location, $title, ilObjMediaObject\_getDirectory(), ilUtil\getASCIIFilename(), ilObjMediaObject\getMimeType(), 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 41 of file class.ilObjMediaCastGUI.php.

◆ $error

ilObjMediaCastGUI::$error
protected

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

Referenced by infoScreen().

◆ $help

ilObjMediaCastGUI::$help
protected

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

Referenced by setTabs().

◆ $log

ilObjMediaCastGUI::$log
protected

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

Referenced by updateCastItemObject().

◆ $mimeTypes

ilObjMediaCastGUI::$mimeTypes = array()
private

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

◆ $purposeSuffixes

ilObjMediaCastGUI::$purposeSuffixes = array()
private

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

◆ $tabs


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