ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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...
 
 redirectAfterCreation ()
 Redirect after creation, see https://docu.ilias.de/goto_docu_wiki_wpage_5035_1357.html. 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
 getObjectService ()
 Get object service. More...
 
 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
 
 $tmp_import_dir
 
 $tabs_gui = null
 
 $ctrl
 
 $object_service
 

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 1372 of file class.ilObjMediaCastGUI.php.

1373 {
1374 global $DIC;
1375
1376 $ilAccess = $DIC->access();
1377 $ilErr = $DIC["ilErr"];
1378 $lng = $DIC->language();
1379
1380 if ($ilAccess->checkAccess("read", "", $a_target)) {
1381 $_GET["cmd"] = "showContent";
1382 $_GET["ref_id"] = $a_target;
1383 $_GET["baseClass"] = "ilmediacasthandlergui";
1384 $_GET["cmdClass"] = "ilobjmediacastgui";
1385 include("ilias.php");
1386 exit;
1387 } elseif ($ilAccess->checkAccess("visible", "", $a_target)) {
1388 ilObjectGUI::_gotoRepositoryNode($a_target, "infoScreen");
1389 } elseif ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID)) {
1390 ilUtil::sendFailure(sprintf(
1391 $lng->txt("msg_no_perm_read_item"),
1393 ));
1395 }
1396
1397 $ilErr->raiseError($lng->txt("msg_no_perm_read"), $ilErr->FATAL);
1398 }
exit
Definition: backend.php:16
$_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, and ilUtil\sendFailure().

+ 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 1109 of file class.ilObjMediaCastGUI.php.

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

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 1363 of file class.ilObjMediaCastGUI.php.

1364 {
1365 $ilLocator = $this->locator;
1366
1367 if (is_object($this->object)) {
1368 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this, "listItems"), "", $_GET["ref_id"]);
1369 }
1370 }

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 redirect($a_script)

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

+ 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 1643 of file class.ilObjMediaCastGUI.php.

1644 {
1646
1647 $this->checkPermission("write");
1648
1649 $this->mcst_item = new ilNewsItem($_GET["item_id"]);
1650 include_once("./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
1651 $mob = new ilObjMediaObject($this->mcst_item->getMobId());
1652
1653 $target_purpose = ilUtil::stripSlashes($_POST["target_purpose"]);
1654 $target_format = ilUtil::stripSlashes($_POST["target_format"]);
1655
1656 try {
1657 include_once("./Services/MediaObjects/classes/class.ilFFmpeg.php");
1658 $med = $mob->getMediaItem("Standard");
1659 $mob_file = ilObjMediaObject::_getDirectory($mob->getId()) . "/" . $med->getLocation();
1660 $new_file = ilFFmpeg::convert($mob_file, $target_format);
1662 $pi = pathinfo($new_file);
1663 $med = $mob->getMediaItem($target_purpose);
1664 if (!is_object($med)) {
1665 $med = new ilMediaItem();
1666 $med->setMobId($mob->getId());
1667 $mob->addMediaItem($med);
1668 $mob->update();
1669 $med->setPurpose($target_purpose);
1670 }
1671 $med->setFormat($target_format);
1672 $med->setLocation($pi["basename"]);
1673 $med->setLocationType("LocalFile");
1674 $med->update();
1675
1676 $add = (is_array($ret) && count($ret) > 0)
1677 ? "<br />" . implode($ret, "<br />")
1678 : "";
1679
1680 ilUtil::sendInfo($this->lng->txt("mcst_converted_file") . $add, true);
1681 } catch (ilException $e) {
1683 $add = (is_array($ret) && count($ret) > 0)
1684 ? "<br />" . implode($ret, "<br />")
1685 : "";
1686 ilUtil::sendFailure($e->getMessage() . $add, true);
1687 }
1688
1689
1690 $ilCtrl->redirect($this, "editCastItem");
1691 }
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 absolute directory.
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 952 of file class.ilObjMediaCastGUI.php.

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

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

+ 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 {
939
940 $this->checkPermission("read");
941 $news_item = new ilNewsItem($_GET["item_id"]);
942 $this->object->handleLPUpdate($ilUser->getId(), $news_item->getMobId());
943 if (!$news_item->deliverMobFile($_GET["purpose"], (int) $_GET["presentation"])) {
944 $ilCtrl->redirect($this, "listItems");
945 }
946 exit;
947 }
$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 1460 of file class.ilObjMediaCastGUI.php.

1461 {
1462 $ilTabs = $this->tabs;
1463 $lng = $this->lng;
1464 $tpl = $this->tpl;
1465
1466 $this->checkPermission("write");
1467 $ilTabs->activateTab("edit_content");
1468
1469 $this->addContentSubTabs("sorting");
1470
1471 // sort by order setting
1472 switch ($this->object->getOrder()) {
1476 return $this->listItemsObject();
1477
1479 // sub-tabs
1480 break;
1481 }
1482
1483 include_once("./Modules/MediaCast/classes/class.ilMediaCastTableGUI.php");
1484 $table_gui = new ilMediaCastTableGUI($this, "editOrder", true);
1485
1486 $table_gui->setTitle($lng->txt("mcst_media_cast"));
1487 $table_gui->setData($this->object->getSortedItemsArray());
1488
1489 $table_gui->addCommandButton("saveOrder", $lng->txt("mcst_save_order"));
1490
1491 $tpl->setContent($table_gui->getHTML());
1492 }
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 1145 of file class.ilObjMediaCastGUI.php.

1146 {
1147 $tpl = $this->tpl;
1148 $ilTabs = $this->tabs;
1149
1150 $this->checkPermission("write");
1151 $ilTabs->activateTab("id_settings");
1152
1153 $this->initSettingsForm();
1154 $tpl->setContent($this->form_gui->getHtml());
1155 }
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 1699 of file class.ilObjMediaCastGUI.php.

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

References $_GET, $i, ilObjectGUI\$lng, ilObjMediaCast\$purposes, $values, 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.

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 1417 of file class.ilObjMediaCastGUI.php.

1418 {
1419 include_once("./Services/News/classes/class.ilNewsItem.php");
1420 $this->mcst_item = new ilNewsItem($id);
1421 // create dummy object in db (we need an id)
1422 include_once("./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
1423 $mob = new ilObjMediaObject($this->mcst_item->getMobId());
1424 return $mob->getMediaItem("Standard");
1425 }

References $id.

◆ getMediaItems()

ilObjMediaCastGUI::getMediaItems (   $id)
protected

get MediaItems for id and updates local variable mcst_item

Returns
array of ilMediaItem

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

1434 {
1435 include_once("./Services/News/classes/class.ilNewsItem.php");
1436 $this->mcst_item = new ilNewsItem($id);
1437 // create dummy object in db (we need an id)
1438 include_once("./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
1439 $mob = new ilObjMediaObject($this->mcst_item->getMobId());
1440 return $mob->getMediaItems();
1441 }

References $id.

Referenced by getCastItemValues().

+ Here is the caller graph for this function:

◆ handlePlayerEventObject()

ilObjMediaCastGUI::handlePlayerEventObject ( )

Handle player event.

Parameters

return

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

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

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

◆ infoScreen()

ilObjMediaCastGUI::infoScreen ( )

show information screen

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

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

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

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
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, $ilCtrl, ilObjectGUI\$lng, PHPMailer\PHPMailer\$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 1160 of file class.ilObjMediaCastGUI.php.

1161 {
1162 $tpl = $this->tpl;
1163 $lng = $this->lng;
1165 $obj_service = $this->object_service;
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 // tile image
1199 $obj_service->commonSettings()->legacyForm($this->form_gui, $this->object)->addTileImage();
1200
1201 // Sorting
1202 $sort = new ilRadioGroupInputGUI($lng->txt("mcst_ordering"), "order");
1203 $sort->addOption(new ilRadioOption(
1204 $lng->txt("mcst_ordering_title"),
1206 ));
1207 $sort->addOption(new ilRadioOption(
1208 $lng->txt("mcst_ordering_creation_date_asc"),
1210 ));
1211 $sort->addOption(new ilRadioOption(
1212 $lng->txt("mcst_ordering_creation_date_desc"),
1214 ));
1215 $sort->addOption(new ilRadioOption(
1216 $lng->txt("mcst_ordering_manual"),
1218 ));
1219 $sort->setValue($this->object->getOrder());
1220 $this->form_gui->addItem($sort);
1221
1222 // view mode
1223 $options = array(
1224 ilObjMediaCast::VIEW_LIST => $lng->txt("mcst_list"),
1225 ilObjMediaCast::VIEW_GALLERY => $lng->txt("mcst_gallery")
1226 );
1227 $si = new ilRadioGroupInputGUI($this->lng->txt("mcst_viewmode"), "viewmode");
1228 $si->addOption(new ilRadioOption(
1229 $lng->txt("mcst_list"),
1231 ));
1232 $si->addOption(new ilRadioOption(
1233 $lng->txt("mcst_gallery"),
1235 ));
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 // webfeed
1254 $sh = new ilFormSectionHeaderGUI();
1255 $sh->setTitle($lng->txt("mcst_webfeed"));
1256 $this->form_gui->addItem($sh);
1257
1258 $radio_group = new ilRadioGroupInputGUI($lng->txt("news_default_visibility"), "defaultaccess");
1259 $radio_option = new ilRadioOption($lng->txt("news_visibility_users"), "0");
1260 $radio_option->setInfo($lng->txt("news_news_item_def_visibility_users_info"));
1261 $radio_group->addOption($radio_option);
1262 $radio_option = new ilRadioOption($lng->txt("news_visibility_public"), "1");
1263 $radio_option->setInfo($lng->txt("news_news_item_def_visibility_public_info"));
1264 $radio_group->addOption($radio_option);
1265 $radio_group->setRequired(false);
1266 $radio_group->setValue($this->object->getDefaultAccess());
1267 #$ch->addSubItem($radio_group);
1268 $this->form_gui->addItem($radio_group);
1269
1270 //Extra Feed
1271 include_once("./Services/Block/classes/class.ilBlockSetting.php");
1272 $public_feed = ilBlockSetting::_lookup("news", "public_feed", 0, $this->object->getId());
1273 $ch = new ilCheckboxInputGUI($lng->txt("news_public_feed"), "extra_feed");
1274 $ch->setInfo($lng->txt("news_public_feed_info"));
1275 $ch->setChecked($public_feed);
1276 $this->form_gui->addItem($ch);
1277
1278 // keep minimal x number of items
1279 $ni = new ilNumberInputGUI($this->lng->txt("news_keep_minimal_x_items"), "keep_rss_min");
1280 $ni->setMaxValue(100);
1281 $ni->setMinValue(0);
1282 $ni->setMaxLength(3);
1283 $ni->setSize(3);
1284 $ni->setInfo($this->lng->txt("news_keep_minimal_x_items_info") . " (" .
1285 ilNewsItem::_lookupRSSPeriod() . " " . (ilNewsItem::_lookupRSSPeriod() == 1 ? $lng->txt("day") : $lng->txt("days")) . ")");
1286 $ni->setValue((int) ilBlockSetting::_lookup("news", "keep_rss_min", 0, $this->object->getId()));
1287 $ch->addSubItem($ni);
1288
1289 // Include Files in Pubic Items
1290 $incl_files = new ilCheckboxInputGUI($lng->txt("mcst_incl_files_in_rss"), "public_files");
1291 $incl_files->setChecked($this->object->getPublicFiles());
1292 $incl_files->setInfo($lng->txt("mcst_incl_files_in_rss_info"));
1293 #$ch->addSubItem($incl_files);
1294 $this->form_gui->addItem($incl_files);
1295 }
1296
1297 // Form action and save button
1298 $this->form_gui->addCommandButton("saveSettings", $lng->txt("save"));
1299 $this->form_gui->setFormAction($ilCtrl->getFormAction($this, "saveSettings"));
1300 }
static _lookupRSSPeriod()
This class represents a number property in a property form.

References ilObjectGUI\$ctrl, $ilCtrl, ilObjectGUI\$lng, ilObjectGUI\$object_service, PHPMailer\PHPMailer\$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 1406 of file class.ilObjMediaCastGUI.php.

1407 {
1408 return strpos($extension, "audio") !== false;
1409 }

◆ 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 1443 of file class.ilObjMediaCastGUI.php.

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

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

1495 {
1496 $lng = $this->lng;
1497
1498 asort($_POST["item_id"]);
1499
1500 $items = array();
1501 foreach (array_keys($_POST["item_id"]) as $id) {
1502 $items[] = $id;
1503 }
1504 $this->object->saveOrder($items);
1505
1506 ilUtil::sendSuccess($lng->txt("settings_saved"), true);
1507 $this->ctrl->redirect($this, "editOrder");
1508 }

References $_POST, $id, and ilObjectGUI\$lng.

◆ saveSettingsObject()

ilObjMediaCastGUI::saveSettingsObject ( )

Save Settings.

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

1306 {
1308 $ilTabs = $this->tabs;
1309 $obj_service = $this->object_service;
1310
1311 $this->checkPermission("write");
1312 $ilTabs->activateTab("id_settings");
1313
1314 $this->initSettingsForm();
1315 if ($this->form_gui->checkInput()) {
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 // tile image
1327 $obj_service->commonSettings()->legacyForm($this->form_gui, $this->object)->saveTileImage();
1328
1329 if ($enable_internal_rss) {
1330 $this->object->setPublicFiles($this->form_gui->getInput("public_files"));
1331 $this->object->setDefaultAccess($this->form_gui->getInput("defaultaccess"));
1332 }
1333 $this->object->update();
1334
1335 if ($enable_internal_rss) {
1336 include_once("./Services/Block/classes/class.ilBlockSetting.php");
1338 "news",
1339 "public_feed",
1340 $this->form_gui->getInput("extra_feed"),
1341 0,
1342 $this->object->getId()
1343 );
1344
1346 "news",
1347 "keep_rss_min",
1348 $this->form_gui->getInput("keep_rss_min"),
1349 0,
1350 $this->object->getId()
1351 );
1352 }
1353
1354 ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
1355 $ilCtrl->redirect($this, "editSettings");
1356 } else {
1357 $this->form_gui->setValuesByPost();
1358 $this->tpl->setContent($this->form_gui->getHTML());
1359 }
1360 }
static _write($a_type, $a_setting, $a_value, $a_user=0, $a_block_id=0)
Write setting to database.

References ilObjectGUI\$ctrl, $ilCtrl, ilObjectGUI\$object_service, $tabs, ilBlockSetting\_write(), ilObjectGUI\checkPermission(), and initSettingsForm().

+ Here is the call graph for this function:

◆ setTabs()

ilObjMediaCastGUI::setTabs ( )

get tabs @access public

Reimplemented from ilObjectGUI.

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

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

1521 {
1523
1524 // need read events for parent for LP statistics
1525 require_once 'Services/Tracking/classes/class.ilChangeEvent.php';
1527 "mcst",
1528 $this->object->getRefId(),
1529 $this->object->getId(),
1530 $ilUser->getId()
1531 );
1532
1533 // trigger LP update
1534 require_once 'Services/Tracking/classes/class.ilLPStatusWrapper.php';
1535 ilLPStatusWrapper::_updateStatus($this->object->getId(), $ilUser->getId());
1536
1537 if ($this->object->getViewMode() == ilObjMediaCast::VIEW_GALLERY) {
1538 $this->showGallery();
1539 } else {
1540 $this->listItemsObject(true);
1541 }
1542 global $tpl;
1543 $tpl->setPermanentLink($this->object->getType(), $this->object->getRefId());
1544 }
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.
static _updateStatus($a_obj_id, $a_usr_id, $a_obj=null, $a_percentage=false, $a_force_raise=false)
Update status.

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

+ Here is the call graph for this function:

◆ showGallery()

ilObjMediaCastGUI::showGallery ( )

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

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