ILIAS  release_8 Revision v8.24
ilObjMediaCastGUI Class Reference
+ Inheritance diagram for ilObjMediaCastGUI:
+ Collaboration diagram for ilObjMediaCastGUI:

Public Member Functions

 __construct ( $a_data, int $a_id, bool $a_call_by_reference, bool $a_prepare_output=true)
 
 executeCommand ()
 
 listItemsObject (bool $a_presentation_mode=false)
 
 getFeedLink ()
 
 addCastItemObject ()
 Add media cast item. More...
 
 editCastItemObject ()
 
 finishSingleUpload (int $mob_id)
 
 initAddCastItemForm (string $a_mode="create")
 
 getCastItemValues ()
 Get cast item values into form. More...
 
 saveCastItemObject ()
 
 updateCastItemObject ()
 Update cast item. More...
 
 confirmDeletionItemsObject ()
 
 deleteItemsObject ()
 
 downloadItemObject ()
 Download news media item. More...
 
 determinePlaytimeObject ()
 
 infoScreenObject ()
 This one is called from the info button in the repository. More...
 
 infoScreen ()
 
 addContentSubTabs (string $a_active="content")
 
 editSettingsObject ()
 
 initSettingsForm ()
 Init Settings Form. More...
 
 saveSettingsObject ()
 
 saveOrderObject ()
 
 showContentObject ()
 
 showGallery ()
 
 extractPreviewImageObject ()
 
 handlePlayerEventObject ()
 
- Public Member Functions inherited from ilObjectGUI
 __construct ($data, int $id=0, bool $call_by_reference=true, bool $prepare_output=true)
 
 getRefId ()
 
 setAdminMode (string $mode)
 
 getAdminMode ()
 
 getObject ()
 
 executeCommand ()
 
 withReferences ()
 determines whether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode (bool $mode=true)
 if true, a creation screen is displayed the current [ref_id] don't belong to the current class! The mode is determined in ilRepositoryGUI More...
 
 getCreationMode ()
 
 prepareOutput (bool $show_sub_objects=true)
 
 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 More...
 
 createObject ()
 create new object form More...
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 
 getDidacticTemplateVar (string $type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $obj, int $parent_node_id=null)
 Add object to tree at given position. More...
 
 editObject ()
 
 addExternalEditFormCustom (ilPropertyFormGUI $form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction (string $cmd, string $default_form_action="")
 Get form action for command (command is method name without "Object", e.g. More...
 
 isVisible (int $ref_id, string $type)
 
 viewObject ()
 viewObject container presentation for "administration -> repository, trash, permissions" More...
 
 deleteObject (bool $error=false)
 Display deletion confirmation screen. More...
 
 setColumnSettings (ilColumnGUI $column_gui)
 
 redirectAfterCreation ()
 Redirect after creation, see https://docu.ilias.de/goto_docu_wiki_wpage_5035_1357.html Should be overwritten and redirect to settings screen. More...
 
 addToDeskObject ()
 
 removeFromDeskObject ()
 
- Public Member Functions inherited from ILIAS\Object\ImplementsCreationCallback
 callCreationCallback (\ilObject $object, \ilObjectDefinition $obj_definition, int $requested_crtcb)
 

Static Public Member Functions

static _goto (string $a_target)
 
- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot (bool $raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode (int $ref_id, string $cmd="")
 
static _gotoSharedWorkspaceNode (int $wsp_id)
 

Protected Member Functions

 initCreationForms (string $new_type)
 Init creation forms. More...
 
 afterSave (ilObject $new_object)
 Post (successful) object creation hook. More...
 
 onMobUpdate (int $mob_id)
 
 setTabs ()
 set admin tabs More...
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 getMediaItem (int $id)
 Get MediaItem for id and updates local variable mcst_item. More...
 
 getMediaItems (int $id)
 
 editOrderObject ()
 
 handlePlayerCompletedEventObject ()
 
 afterUpload ($mob_ids)
 
 afterUrlSaving (int $mob_id, string $long_desc)
 
 addMobsToCast (array $mob_ids, string $long_desc="", bool $redirect=true, bool $extract=false)
 
 afterPoolInsert (array $mob_ids)
 
 handleAutoplayTriggerObject ()
 
- Protected Member Functions inherited from ilObjectGUI
 getObjectService ()
 
 assignObject ()
 
 setTitleAndDescription ()
 
 initHeaderAction (?string $sub_type=null, ?int $sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction (?ilObjectListGUI $list_gui=null)
 Insert header action into main template. More...
 
 addHeaderAction ()
 Add header action menu. More...
 
 redrawHeaderActionObject ()
 Ajax call: redraw action header only. More...
 
 setTabs ()
 set admin tabs More...
 
 setAdminTabs ()
 set admin tabs More...
 
 setLocator ()
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator (bool $omit=true)
 
 addAdminLocatorItems (bool $do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 initCreationForms (string $new_type)
 Init creation forms. More...
 
 getCreationFormsHTML (array $forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm (string $new_type)
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 afterSave (ilObject $new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 initImportForm (string $new_type)
 
 importFileObject (int $parent_id=null)
 
 afterImport (ilObject $new_object)
 Post (successful) object import hook. More...
 
 setFormAction (string $cmd, string $form_action)
 
 getReturnLocation (string $cmd, string $default_location="")
 Get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation (string $cmd, string $location)
 set specific return location for command More...
 
 getTargetFrame (string $cmd, string $default_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame (string $cmd, string $target_frame)
 Set specific target frame for command. More...
 
 showPossibleSubObjects ()
 show possible sub objects (pull down menu) More...
 
 getTabs ()
 @abstract overwrite in derived GUI class of your object type More...
 
 redirectToRefId (int $ref_id, string $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 ["ref_id"] value of the request More...
 
 fillCloneTemplate (?string $tpl_name, string $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...
 
 checkPermission (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 checkPermissionBool (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 showCustomIconsEditing ( $input_colspan=1, ilPropertyFormGUI $form=null, $as_section=true)
 show edit section of custom icons for container More...
 

Static Protected Member Functions

static isAudio (string $extension)
 

Protected Attributes

ILIAS MediaCast MediaCastManager $mc_manager
 
ilPropertyFormGUI $form_gui
 
ilNewsItem $mcst_item
 
StandardGUIRequest $mc_request
 
ilTabsGUI $tabs
 
ilLogger $log
 
ilHelpGUI $help
 
FileSystem $filesystem
 
- Protected Attributes inherited from ilObjectGUI
ILIAS Notes Service $notes_service
 
ServerRequestInterface $request
 
ilLocatorGUI $locator
 
ilObjUser $user
 
ilAccessHandler $access
 
ilSetting $settings
 
ilToolbarGUI $toolbar
 
ilRbacAdmin $rbac_admin
 
ilRbacSystem $rbac_system
 
ilRbacReview $rbac_review
 
ilObjectService $object_service
 
ilObjectDefinition $obj_definition
 
ilGlobalTemplateInterface $tpl
 
ilTree $tree
 
ilCtrl $ctrl
 
ilErrorHandling $error
 
ilLanguage $lng
 
ilTabsGUI $tabs_gui
 
ILIAS $ilias
 
ArrayBasedRequestWrapper $post_wrapper
 
RequestWrapper $request_wrapper
 
Factory $refinery
 
ilFavouritesManager $favourites
 
ilObjectCustomIconFactory $custom_icon_factory
 
ilObject $object = null
 
bool $creation_mode = false
 
 $data
 
int $id
 
bool $call_by_reference = false
 
bool $prepare_output
 
int $ref_id
 
int $obj_id
 
int $maxcount
 
array $form_action = []
 
array $return_location = []
 
array $target_frame = []
 
string $tmp_import_dir
 
string $sub_objects = ""
 
bool $omit_locator = false
 
string $type = ""
 
string $admin_mode = self::ADMIN_MODE_NONE
 
int $requested_ref_id = 0
 
int $requested_crtptrefid = 0
 
int $requested_crtcb = 0
 
string $requested_new_type = ""
 
string $link_params
 
string $html = ""
 

Private Member Functions

 getDuration (ilMediaItem $media_item)
 
 createMediaItemForPurpose (ilObjMediaObject $mob, string $purpose)
 Handle media item for given purpose. More...
 
 updateMediaItem (ilObjMediaObject $mob, ilMediaItem $mediaItem)
 Update media item from form. More...
 
 populateFormFromPost ()
 

Private Attributes

array $additionalPurposes = []
 
array $purposeSuffixes = []
 
array $mimeTypes = []
 

Additional Inherited Members

- Data Fields inherited from ilObjectGUI
const ALLOWED_TAGS_IN_TITLE_AND_DESCRIPTION
 
const ADMIN_MODE_NONE = ""
 
const ADMIN_MODE_SETTINGS = "settings"
 
const ADMIN_MODE_REPOSITORY = "repository"
 
const UPLOAD_TYPE_LOCAL = 1
 
const UPLOAD_TYPE_UPLOAD_DIRECTORY = 2
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilObjMediaCastGUI::__construct (   $a_data,
int  $a_id,
bool  $a_call_by_reference,
bool  $a_prepare_output = true 
)
Parameters
mixed$a_data

Reimplemented from ilObjectGUI.

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

55 {
56 global $DIC;
57
58 $this->ctrl = $DIC->ctrl();
59 $this->lng = $DIC->language();
60 $this->user = $DIC->user();
61 $this->tabs = $DIC->tabs();
62 $this->tpl = $DIC["tpl"];
63 $this->access = $DIC->access();
64 $this->toolbar = $DIC->toolbar();
65 $this->filesystem = $DIC->filesystem()->web();
66 $this->log = $DIC["ilLog"];
67 $this->help = $DIC["ilHelp"];
68 $this->locator = $DIC["ilLocator"];
69 $ilCtrl = $DIC->ctrl();
70 $lng = $DIC->language();
71 $this->mc_request = $DIC->mediaCast()
72 ->internal()
73 ->gui()
74 ->standardRequest();
75
76 $this->type = "mcst";
77 parent::__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
78 $lng->loadLanguageModule("mcst");
79 $lng->loadLanguageModule("news");
81
82 $ilCtrl->saveParameter($this, "item_id");
83
85 $this->purposeSuffixes = $settings->getPurposeSuffixes();
86 $this->mimeTypes = array();
87 $mime_types = $settings->getMimeTypes();
88 foreach ($mime_types as $mt) {
89 $this->mimeTypes[$mt] = $mt;
90 }
91
92 foreach (MimeType::getExt2MimeMap() as $mt) {
93 // $this->mimeTypes[$mt] = $mt;
94 }
95 asort($this->mimeTypes);
96
97 $this->mc_manager = $DIC->mediaCast()->internal()
98 ->domain()->mediaCast();
99 }
loadLanguageModule(string $a_module)
Load language module.
ilSetting $settings
ilLanguage $lng
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References $DIC, ilObjectGUI\$lng, ilObjectGUI\$settings, ILIAS\GlobalScreen\Provider\__construct(), ilMediaCastSettings\_getInstance(), ILIAS\Repository\access(), ILIAS\Repository\ctrl(), ILIAS\Repository\filesystem(), ILIAS\Repository\help(), ILIAS\Repository\lng(), ilLanguage\loadLanguageModule(), ILIAS\Repository\locator(), ILIAS\Repository\tabs(), ILIAS\Repository\toolbar(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

Member Function Documentation

◆ _goto()

static ilObjMediaCastGUI::_goto ( string  $a_target)
static

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

1353 : void
1354 {
1355 global $DIC;
1356 $main_tpl = $DIC->ui()->mainTemplate();
1357
1358 $ilAccess = $DIC->access();
1359 $lng = $DIC->language();
1360 $ctrl = $DIC->ctrl();
1361
1362 if ($ilAccess->checkAccess("read", "", $a_target)) {
1363 $ctrl->setParameterByClass("ilobjmediacastgui", "ref_id", $a_target);
1364 $ctrl->redirectByClass(["ilmediacasthandlergui", "ilobjmediacastgui"], "showContent");
1365 } elseif ($ilAccess->checkAccess("visible", "", $a_target)) {
1366 ilObjectGUI::_gotoRepositoryNode($a_target, "infoScreen");
1367 } elseif ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID)) {
1368 $main_tpl->setOnScreenMessage('failure', sprintf(
1369 $lng->txt("msg_no_perm_read_item"),
1371 ));
1373 }
1374
1375 throw new ilPermissionException($lng->txt("msg_no_perm_read"));
1376 }
redirectByClass( $a_class, string $a_cmd=null, string $a_anchor=null, bool $is_async=false)
@inheritDoc
setParameterByClass(string $a_class, string $a_parameter, $a_value)
@inheritDoc
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static _gotoRepositoryRoot(bool $raise_error=false)
Goto repository root.
static _gotoRepositoryNode(int $ref_id, string $cmd="")
static _lookupObjId(int $ref_id)
static _lookupTitle(int $obj_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const ROOT_FOLDER_ID
Definition: constants.php:32

References $DIC, $lng, ilObjectGUI\_gotoRepositoryNode(), ilObjectGUI\_gotoRepositoryRoot(), ilObject\_lookupObjId(), ilObject\_lookupTitle(), and ROOT_FOLDER_ID.

+ Here is the call graph for this function:

◆ addCastItemObject()

ilObjMediaCastGUI::addCastItemObject ( )

Add media cast item.

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

303 : void
304 {
306
307 $this->checkPermission("write");
308
309 $this->initAddCastItemForm();
310 $tpl->setContent($this->form_gui->getHTML());
311 }
initAddCastItemForm(string $a_mode="create")
ilGlobalTemplateInterface $tpl
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
setContent(string $a_html)
Sets content for standard template.

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

+ Here is the call graph for this function:

◆ addContentSubTabs()

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

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

1061 : void {
1062 $ilTabs = $this->tabs;
1063 $ilAccess = $this->access;
1064 $lng = $this->lng;
1065
1066 $ilTabs->addSubTab(
1067 "content",
1068 $lng->txt("view"),
1069 $this->ctrl->getLinkTarget($this, "showContent")
1070 );
1071
1072 if ($ilAccess->checkAccess("write", "", $this->requested_ref_id)) {
1073 $ilTabs->addSubTab(
1074 "manage",
1075 $lng->txt("mcst_manage"),
1076 $this->ctrl->getLinkTarget($this, "listItems")
1077 );
1078
1079 if ($this->object->getOrder() == ilObjMediaCast::ORDER_MANUAL) {
1080 $ilTabs->addSubTab(
1081 "sorting",
1082 $lng->txt("mcst_ordering"),
1083 $this->ctrl->getLinkTarget($this, "editOrder")
1084 );
1085 }
1086 }
1087
1088 $ilTabs->activateSubTab($a_active);
1089 $ilTabs->activateTab("content");
1090 }
ilAccessHandler $access

References $lng, ILIAS\Repository\object(), and ilObjMediaCast\ORDER_MANUAL.

Referenced by executeCommand(), and listItemsObject().

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

◆ addLocatorItems()

ilObjMediaCastGUI::addLocatorItems ( )
protected

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

Reimplemented from ilObjectGUI.

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

1344 : void
1345 {
1346 $ilLocator = $this->locator;
1347
1348 if (is_object($this->object)) {
1349 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this, "listItems"), "", $this->requested_ref_id);
1350 }
1351 }
addItem(string $a_title, string $a_link, string $a_frame="", int $a_ref_id=0, ?string $type=null)
ilLocatorGUI $locator

References ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ addMobsToCast()

ilObjMediaCastGUI::addMobsToCast ( array  $mob_ids,
string  $long_desc = "",
bool  $redirect = true,
bool  $extract = false 
)
protected

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

1625 : void {
1628
1629 $item_ids = [];
1630 foreach ($mob_ids as $mob_id) {
1631 $item_ids[] = $this->object->addMobToCast($mob_id, $user->getId(), $long_desc, $extract);
1632 }
1633
1634 if ($redirect) {
1635 if (count($item_ids) === 1) {
1636 $ctrl->setParameter($this, "item_id", $item_ids[0]);
1637 $ctrl->redirect($this, "editCastItem");
1638 }
1639 $ctrl->redirect($this, "listItems");
1640 }
1641 }
redirect(object $a_gui_obj, string $a_cmd=null, string $a_anchor=null, bool $is_async=false)
@inheritDoc
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
@inheritDoc

◆ afterPoolInsert()

ilObjMediaCastGUI::afterPoolInsert ( array  $mob_ids)
protected

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

1643 : void
1644 {
1645 $this->addMobsToCast($mob_ids, "", true, true);
1646 }
addMobsToCast(array $mob_ids, string $long_desc="", bool $redirect=true, bool $extract=false)

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ afterSave()

ilObjMediaCastGUI::afterSave ( ilObject  $new_object)
protected

Post (successful) object creation hook.

Reimplemented from ilObjectGUI.

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

226 : void
227 {
228 // always send a message
229 $this->tpl->setOnScreenMessage('success', $this->lng->txt("object_added"), true);
230 ilUtil::redirect("ilias.php?baseClass=ilMediaCastHandlerGUI&ref_id=" . $new_object->getRefId() . "&cmd=editSettings");
231 }
static redirect(string $a_script)

References ilObject\getRefId(), ILIAS\Repository\lng(), and ilUtil\redirect().

+ Here is the call graph for this function:

◆ afterUpload()

ilObjMediaCastGUI::afterUpload (   $mob_ids)
protected

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

1610 : void
1611 {
1612 $this->addMobsToCast($mob_ids, "", false);
1613 }

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ afterUrlSaving()

ilObjMediaCastGUI::afterUrlSaving ( int  $mob_id,
string  $long_desc 
)
protected

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

1615 : void
1616 {
1617 $this->addMobsToCast([$mob_id], $long_desc);
1618 }

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ confirmDeletionItemsObject()

ilObjMediaCastGUI::confirmDeletionItemsObject ( )

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

840 : void
841 {
842 $ilCtrl = $this->ctrl;
845 $ilTabs = $this->tabs;
846
847 $this->checkPermission("write");
848 $ilTabs->activateTab("edit_content");
849
850 $ids = $this->mc_request->getItemIds();
851 if (count($ids) == 0) {
852 $this->listItemsObject();
853 return;
854 }
855
856 $c_gui = new ilConfirmationGUI();
857
858 // set confirm/cancel commands
859 $c_gui->setFormAction($ilCtrl->getFormAction($this, "deleteItems"));
860 $c_gui->setHeaderText($lng->txt("info_delete_sure"));
861 $c_gui->setCancel($lng->txt("cancel"), "listItems");
862 $c_gui->setConfirm($lng->txt("confirm"), "deleteItems");
863
864 // add items to delete
865 foreach ($ids as $item_id) {
866 $item = new ilNewsItem($item_id);
867 $c_gui->addItem(
868 "item_id[]",
869 $item_id,
870 $item->getTitle(),
871 ilUtil::getImagePath("icon_mcst.svg")
872 );
873 }
874
875 $tpl->setContent($c_gui->getHTML());
876 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
A news item can be created by different sources.
listItemsObject(bool $a_presentation_mode=false)
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)

References $lng, $tpl, and ilUtil\getImagePath().

+ Here is the call graph for this function:

◆ createMediaItemForPurpose()

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

Handle media item for given purpose.

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

659 : string {
660 $mediaItem = new ilMediaItem();
661 $mob->addMediaItem($mediaItem);
662 $mediaItem->setPurpose($purpose);
663 return $this->updateMediaItem($mob, $mediaItem);
664 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
updateMediaItem(ilObjMediaObject $mob, ilMediaItem $mediaItem)
Update media item from form.
addMediaItem(ilMediaItem $a_item)

Referenced by saveCastItemObject().

+ Here is the caller graph for this function:

◆ deleteItemsObject()

ilObjMediaCastGUI::deleteItemsObject ( )

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

878 : void
879 {
880 $ilCtrl = $this->ctrl;
881
882 $this->checkPermission("write");
883
884 // delete all selected news items
885 $ids = $this->mc_request->getItemIds();
886 foreach ($ids as $item_id) {
887 $mc_item = new ilNewsItem($item_id);
888 $mc_item->delete();
889 }
890 $this->object->saveOrder(array_map(function($i) {
891 return $i["id"];
892 }, $this->object->readItems()));
893 $ilCtrl->redirect($this, "listItems");
894 }
$i
Definition: metadata.php:41

References $i.

◆ determinePlaytimeObject()

ilObjMediaCastGUI::determinePlaytimeObject ( )

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

916 : void
917 {
918 $ilCtrl = $this->ctrl;
920
921 $mc_item = new ilNewsItem($this->mc_request->getItemId());
922 $mob = $mc_item->getMobId();
923 $mob = new ilObjMediaObject($mob);
924 $mob_dir = ilObjMediaObject::_getDirectory($mob->getId());
925 $m_item = $mob->getMediaItem("Standard");
926
927 $success = false;
928
929 $m_item->determineDuration();
930 $dur = $m_item->getDuration();
931 if ($dur > 0) {
932 $mc_item->setPlaytime($this->object->getPlaytimeForSeconds($dur));
933 $mc_item->update();
934 $success = true;
935 $this->tpl->setOnScreenMessage('success', $lng->txt("mcst_set_playtime"), true);
936 }
937
938 if (!$success) {
939 $this->tpl->setOnScreenMessage('failure', $lng->txt("mcst_unable_to_determin_playtime"), true);
940 }
941
942 $ilCtrl->redirect($this, "listItems");
943 }
static _getDirectory(int $a_mob_id)
Get absolute directory.

References $lng, ilObjMediaObject\_getDirectory(), ilObject\getId(), ilObjMediaObject\getMediaItem(), and ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ downloadItemObject()

ilObjMediaCastGUI::downloadItemObject ( )

Download news media item.

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

899 : void
900 {
901 $ilCtrl = $this->ctrl;
903
904 $this->checkPermission("read");
905 $news_item = new ilNewsItem($this->mc_request->getItemId());
906 $this->object->handleLPUpdate($ilUser->getId(), $news_item->getMobId());
907 if (!$news_item->deliverMobFile(
908 $this->mc_request->getPurpose(),
909 $this->mc_request->getPresentation()
910 )) {
911 $ilCtrl->redirect($this, "listItems");
912 }
913 exit;
914 }
$ilUser
Definition: imgupload.php:34
exit
Definition: login.php:28

References $ilUser, and exit.

◆ editCastItemObject()

ilObjMediaCastGUI::editCastItemObject ( )

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

313 : void
314 {
316 $ilToolbar = $this->toolbar;
317 $ilCtrl = $this->ctrl;
318
319 $this->checkPermission("write");
320
321 // conversion toolbar
322 if (ilFFmpeg::enabled()) {
323 $this->mcst_item = new ilNewsItem(
324 $this->mc_request->getItemId()
325 );
326 $mob = new ilObjMediaObject($this->mcst_item->getMobId());
327
328 $conv_cnt = 0;
329 // we had other purposes as source as well, but
330 // currently only "Standard" is implemented in the convertFile method
331 $p = "Standard";
332 $med = $mob->getMediaItem($p);
333 if (is_object($med)) {
334 if (ilFFmpeg::supportsImageExtraction($med->getFormat())) {
335 // second
336 $ni = new ilTextInputGUI($this->lng->txt("mcst_second"), "sec");
337 $ni->setMaxLength(4);
338 $ni->setSize(4);
339 $ni->setValue(1);
340 $ilToolbar->addInputItem($ni, true);
341
342 $ilToolbar->addFormButton($this->lng->txt("mcst_extract_preview_image"), "extractPreviewImage");
343 $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
344 }
345 }
346 }
347
348 $this->initAddCastItemForm("edit");
349 $this->getCastItemValues();
350 $tpl->setContent($this->form_gui->getHTML());
351 }
static enabled()
Checks, whether FFmpeg support is enabled (path is set in the setup)
static supportsImageExtraction(string $a_mime)
Check if mime type supports image extraction.
getCastItemValues()
Get cast item values into form.
ilToolbarGUI $toolbar
This class represents a text property in a property form.

References ilObjectGUI\$ctrl, ilObjectGUI\$toolbar, ilObjectGUI\$tpl, ilObjectGUI\checkPermission(), ilFFmpeg\enabled(), getCastItemValues(), initAddCastItemForm(), ILIAS\Repository\lng(), ilGlobalTemplateInterface\setContent(), and ilFFmpeg\supportsImageExtraction().

+ Here is the call graph for this function:

◆ editOrderObject()

ilObjMediaCastGUI::editOrderObject ( )
protected

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

1422 : void
1423 {
1424 $ilTabs = $this->tabs;
1425 $lng = $this->lng;
1426 $tpl = $this->tpl;
1427
1428 $this->checkPermission("write");
1429 $ilTabs->activateTab("edit_content");
1430
1431 $this->addContentSubTabs("sorting");
1432
1433 // sort by order setting
1434 switch ($this->object->getOrder()) {
1438 $this->listItemsObject();
1439 return;
1440
1442 // sub-tabs
1443 break;
1444 }
1445
1446 $table_gui = new ilMediaCastTableGUI($this, "editOrder", true);
1447
1448 $table_gui->setTitle($lng->txt("mcst_media_cast"));
1449 $table_gui->setData($this->object->getSortedItemsArray());
1450
1451 $table_gui->addCommandButton("saveOrder", $lng->txt("mcst_save_order"));
1452
1453 $tpl->setContent($table_gui->getHTML());
1454 }
TableGUI class for table NewsForContext.
addContentSubTabs(string $a_active="content")

References $lng, $tpl, ILIAS\Repository\object(), 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 ( )

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

1092 : void
1093 {
1094 $tpl = $this->tpl;
1095 $ilTabs = $this->tabs;
1096
1097 $this->checkPermission("write");
1098 $ilTabs->activateTab("id_settings");
1099
1100 $this->initSettingsForm();
1101 $tpl->setContent($this->form_gui->getHTML());
1102 }
initSettingsForm()
Init Settings Form.

References $tpl.

◆ executeCommand()

ilObjMediaCastGUI::executeCommand ( )

Reimplemented from ilObjectGUI.

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

101 : void
102 {
104 $ilTabs = $this->tabs;
105
106 $next_class = $this->ctrl->getNextClass($this);
107 $cmd = $this->ctrl->getCmd();
108 $this->prepareOutput();
109
110 switch ($next_class) {
111 case "ilmediacreationgui":
112 $this->checkPermission('write');
113
114 $this->ctrl->setReturn($this, "listItems");
115 $ilTabs->activateTab("content");
116 $this->addContentSubTabs("manage");
117 $med_type = [];
118 switch ($this->object->getViewMode()) {
120 $med_type = [ilMediaCreationGUI::TYPE_VIDEO];
121 break;
123 $med_type = [ilMediaCreationGUI::TYPE_IMAGE];
124 break;
126 $med_type = [ilMediaCreationGUI::TYPE_AUDIO];
127 break;
128 }
129 $creation = new ilMediaCreationGUI($med_type, function ($mob_id) {
130 $this->afterUpload($mob_id);
131 }, function ($mob_id, $long_desc) {
132 $this->afterUrlSaving($mob_id, $long_desc);
133 }, function ($mob_ids) {
134 $this->afterPoolInsert($mob_ids);
135 }, function ($mob_id) {
136 $this->finishSingleUpload($mob_id);
137 }, function ($mob_id) {
138 $this->onMobUpdate($mob_id);
139 });
140 /*
141 $creation->setAllSuffixes($this->purposeSuffixes["Standard"]);
142 $creation->setAllMimeTypes($this->mimeTypes);*/
143 $this->ctrl->forwardCommand($creation);
144 break;
145
146 case "ilinfoscreengui":
147 if (!$this->checkPermissionBool("read")) {
148 $this->checkPermission("visible");
149 }
150 $this->infoScreen(); // forwards command
151 break;
152
153 case "ilexportgui":
154 // $this->prepareOutput();
155 $ilTabs->activateTab("export");
156 $exp_gui = new ilExportGUI($this);
157 $exp_gui->addFormat("xml");
158 $ret = $this->ctrl->forwardCommand($exp_gui);
159 // $this->tpl->show();
160 break;
161
162 case 'ilpermissiongui':
163 $ilTabs->activateTab("id_permissions");
164 $perm_gui = new ilPermissionGUI($this);
165 $ret = $this->ctrl->forwardCommand($perm_gui);
166 break;
167
168 case 'ilobjectcopygui':
169 $cp = new ilObjectCopyGUI($this);
170 $cp->setType('mcst');
171 $this->ctrl->forwardCommand($cp);
172 break;
173
174 case "ilcommonactiondispatchergui":
176 $this->ctrl->forwardCommand($gui);
177 break;
178
179 case "illearningprogressgui":
180 $ilTabs->activateTab('learning_progress');
181 $new_gui = new ilLearningProgressGUI(
183 $this->object->getRefId(),
184 $this->mc_request->getUserId() ?: $ilUser->getId()
185 );
186 $this->ctrl->forwardCommand($new_gui);
187 $this->tabs_gui->setTabActive('learning_progress');
188 break;
189
190 case "mcstimagegallerygui":
191 $view = new \McstImageGalleryGUI($this->object, $this->tpl, $this->getFeedLink());
192 $this->ctrl->forwardCommand($view);
193 break;
194
195 case "mcstpodcastgui":
196 $view = new \McstPodcastGUI($this->object, $this->tpl, $this->getFeedLink());
197 $this->ctrl->forwardCommand($view);
198 break;
199
200 default:
201 if (!$cmd) {
202 $cmd = "infoScreen";
203 }
204 $cmd .= "Object";
205 if ($cmd != "infoScreenObject") {
206 $this->checkPermission("read");
207 } else {
208 $this->checkPermission("visible");
209 }
210 $this->$cmd();
211
212 break;
213 }
214 $this->addHeaderAction();
215 }
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
afterUrlSaving(int $mob_id, string $long_desc)
GUI class for the workflow of copying objects.
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
addHeaderAction()
Add header action menu.
prepareOutput(bool $show_sub_objects=true)
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.

References $ilUser, $tabs, ilObjectGUI\$user, addContentSubTabs(), ilObjectGUI\addHeaderAction(), afterPoolInsert(), afterUpload(), afterUrlSaving(), ilObjectGUI\checkPermission(), ilObjectGUI\checkPermissionBool(), ILIAS\Repository\ctrl(), finishSingleUpload(), getFeedLink(), ilCommonActionDispatcherGUI\getInstanceFromAjaxCall(), infoScreen(), ilLearningProgressBaseGUI\LP_CONTEXT_REPOSITORY, ILIAS\Repository\object(), onMobUpdate(), ilObjectGUI\prepareOutput(), ilMediaCreationGUI\TYPE_AUDIO, ilMediaCreationGUI\TYPE_IMAGE, ilMediaCreationGUI\TYPE_VIDEO, ilObjMediaCast\VIEW_IMG_GALLERY, ilObjMediaCast\VIEW_PODCAST, and ilObjMediaCast\VIEW_VCAST.

+ Here is the call graph for this function:

◆ extractPreviewImageObject()

ilObjMediaCastGUI::extractPreviewImageObject ( )

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

1548 : void
1549 {
1550 $ilCtrl = $this->ctrl;
1551 $add = "";
1552
1553 $this->checkPermission("write");
1554
1555 $this->mcst_item = new ilNewsItem($this->mc_request->getItemId());
1556 $mob = new ilObjMediaObject($this->mcst_item->getMobId());
1557
1558 try {
1559 $sec = $this->mc_request->getSeconds();
1560 if ($sec < 0) {
1561 $sec = 0;
1562 }
1563
1564 $mob->generatePreviewPic(320, 240, $sec);
1565 if ($mob->getVideoPreviewPic() !== "") {
1566 $this->tpl->setOnScreenMessage('info', $this->lng->txt("mcst_image_extracted"), true);
1567 } else {
1568 $this->tpl->setOnScreenMessage('failure', $this->lng->txt("mcst_no_extraction_possible"), true);
1569 }
1570 } catch (ilException $e) {
1571 if (DEVMODE == 1) {
1573 $add = (is_array($ret) && count($ret) > 0)
1574 ? "<br />" . implode("<br />", $ret)
1575 : "";
1576 }
1577 $this->tpl->setOnScreenMessage('failure', $e->getMessage() . $add, true);
1578 }
1579
1580 $ilCtrl->redirect($this, "editCastItem");
1581 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getLastReturnValues()
Get last return values.

References Vendor\Package\$e, ilFFmpeg\getLastReturnValues(), ilObjMediaObject\getVideoPreviewPic(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ finishSingleUpload()

ilObjMediaCastGUI::finishSingleUpload ( int  $mob_id)

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

353 : void
354 {
355 foreach ($this->object->getSortedItemsArray() as $item) {
356 if ($mob_id == $item["mob_id"]) {
357 $this->ctrl->setParameter($this, "item_id", $item["id"]);
358 $this->ctrl->redirect($this, "editCastItem");
359 }
360 }
361 $this->ctrl->redirect($this, "listItems");
362 }

References ILIAS\Repository\ctrl(), and ILIAS\Repository\object().

Referenced by executeCommand().

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

◆ getCastItemValues()

ilObjMediaCastGUI::getCastItemValues ( )

Get cast item values into form.

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

496 : void
497 {
499
500 // get mob
501 $this->mcst_item = new ilNewsItem(
502 $this->mc_request->getItemId()
503 );
504 $mob = new ilObjMediaObject($this->mcst_item->getMobId());
505
506 // preview
507 $ppic = $mob->getVideoPreviewPic();
508 if ($ppic != "") {
509 $i = $this->form_gui->getItemByPostVar("preview_pic");
510 $i->setImage($ppic);
511 }
512
513
514 $values = array();
515 $mediaItems = $this->getMediaItems(
516 $this->mc_request->getItemId()
517 );
518 if (count($mediaItems) > 0) {
519 foreach ($mediaItems as $med) {
520 if (!isset($values["title"])) {
521 // first item, so set title, description, ...
522 $values["title"] = $this->mcst_item->getTitle();
523 $values["description"] = $this->mcst_item->getContent();
524 $values["visibility"] = $this->mcst_item->getVisibility();
525 $length = explode(":", $this->mcst_item->getPlaytime());
526 $values["duration"] = array("hh" => $length[0], "mm" => $length[1], "ss" => $length[2]);
527 }
528
529 $values["value_" . $med->getPurpose()] = (strlen($med->getLocation()) > 100) ? "..." . substr($med->getLocation(), strlen($med->getLocation()) - 100) : $med->getLocation();
530 $values["label_value_" . $med->getPurpose()] = (strlen($med->getLocation()) > 100) ? "..." . substr($med->getLocation(), strlen($med->getLocation()) - 100) : $med->getLocation();
531 $values["mimetype_" . $med->getPurpose()] = $med->getFormat();
532 }
533 }
534 foreach (ilObjMediaCast::$purposes as $purpose) {
535 if (!isset($values["value_" . $purpose])) {
536 $values["label_value_" . $purpose] = $lng->txt("none");
537 $values["value_" . $purpose] = $lng->txt("none");
538 }
539 }
540 $this->form_gui->setValuesByArray($values);
541 }
static array $purposes

References $i, ilObjectGUI\$lng, ilObjMediaCast\$purposes, getMediaItems(), and ilLanguage\txt().

Referenced by editCastItemObject().

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

◆ getDuration()

ilObjMediaCastGUI::getDuration ( ilMediaItem  $media_item)
private

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

632 : string
633 {
634 $duration = isset($this->form_gui)
635 ? $this->form_gui->getInput("duration")
636 : array("hh" => 0, "mm" => 0, "ss" => 0);
637
638 $duration_str = str_pad($duration["hh"], 2, "0", STR_PAD_LEFT) . ":" .
639 str_pad($duration["mm"], 2, "0", STR_PAD_LEFT) . ":" .
640 str_pad($duration["ss"], 2, "0", STR_PAD_LEFT);
641
642 if ($duration["hh"] == 0 && $duration["mm"] == 0 && $duration["ss"] == 0) {
643 $media_item->determineDuration();
644 $d = $media_item->getDuration();
645 if ($d > 0) {
646 $duration_str = $this->object->getPlaytimeForSeconds($d);
647 }
648 }
649
650 return $duration_str;
651 }
for( $i=6;$i< 13;$i++) for($i=1; $i< 13; $i++) $d
Definition: date.php:296

References $d, ilMediaItem\determineDuration(), and ilMediaItem\getDuration().

Referenced by saveCastItemObject().

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

◆ getFeedLink()

ilObjMediaCastGUI::getFeedLink ( )

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

280 : string
281 {
282 $public_feed = ilBlockSetting::_lookup(
283 "news",
284 "public_feed",
285 0,
286 $this->object->getId()
287 );
288 $url = "";
289 // rss icon/link
290 if ($public_feed) {
291 $news_set = new ilSetting("news");
292 $enable_internal_rss = $news_set->get("enable_rss_for_internal");
293 if ($enable_internal_rss) {
294 $url = ILIAS_HTTP_PATH . "/feed.php?client_id=" . rawurlencode(CLIENT_ID) . "&" . "ref_id=" . $this->requested_ref_id;
295 }
296 }
297 return $url;
298 }
static _lookup(string $a_type, string $a_setting, int $a_user=0, int $a_block_id=0)
Lookup setting from database.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const CLIENT_ID
Definition: constants.php:41
$url

References ilObjectGUI\$requested_ref_id, $url, ilBlockSetting\_lookup(), CLIENT_ID, and ILIAS\Repository\object().

Referenced by executeCommand().

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

◆ getMediaItem()

ilObjMediaCastGUI::getMediaItem ( int  $id)
protected

Get MediaItem for id and updates local variable mcst_item.

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

1386 : ilMediaItem
1387 {
1388 $this->mcst_item = new ilNewsItem($id);
1389 // create dummy object in db (we need an id)
1390 $mob = new ilObjMediaObject($this->mcst_item->getMobId());
1391 return $mob->getMediaItem("Standard");
1392 }

References $id, and ilObjMediaObject\getMediaItem().

+ Here is the call graph for this function:

◆ getMediaItems()

ilObjMediaCastGUI::getMediaItems ( int  $id)
protected

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

1394 : array
1395 {
1396 $this->mcst_item = new ilNewsItem($id);
1397 // create dummy object in db (we need an id)
1398 $mob = new ilObjMediaObject($this->mcst_item->getMobId());
1399 return $mob->getMediaItems();
1400 }

References $id, and ilObjMediaObject\getMediaItems().

Referenced by getCastItemValues().

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

◆ handleAutoplayTriggerObject()

ilObjMediaCastGUI::handleAutoplayTriggerObject ( )
protected

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

1648 : void
1649 {
1650 $this->user->writePref(
1651 "mcst_autoplay",
1652 $this->mc_request->getAutoplay()
1653 );
1654 exit;
1655 }

References exit, and ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ handlePlayerCompletedEventObject()

ilObjMediaCastGUI::handlePlayerCompletedEventObject ( )
protected

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

1600 : void
1601 {
1602 $mob_id = $this->mc_request->getMobId();
1603 if ($mob_id > 0) {
1605 $this->object->handleLPUpdate($ilUser->getId(), $mob_id);
1606 }
1607 exit;
1608 }

References $ilUser, and exit.

◆ handlePlayerEventObject()

ilObjMediaCastGUI::handlePlayerEventObject ( )

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

1583 : void
1584 {
1585 if ($this->mc_request->getEvent() === "play") {
1586 $player = explode("_", $this->mc_request->getPlayer());
1587 $news_id = (int) $player[1];
1588 $item = new ilNewsItem($news_id);
1589 $item->increasePlayCounter();
1590
1591 $mob_id = $item->getMobId();
1592 if ($mob_id) {
1594 $this->object->handleLPUpdate($ilUser->getId(), $mob_id);
1595 }
1596 }
1597 exit;
1598 }

References $ilUser, exit, and ILIAS\Repository\int().

+ Here is the call graph for this function:

◆ infoScreen()

ilObjMediaCastGUI::infoScreen ( )

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

958 : void
959 {
960 $ilTabs = $this->tabs;
961
962 $ilTabs->activateTab("id_info");
963
964 if (!$this->checkPermissionBool("read")) {
965 $this->checkPermission("visible");
966 }
967
968 $info = new ilInfoScreenGUI($this);
969
970 $info->enablePrivateNotes();
971
972 // general information
973 $this->lng->loadLanguageModule("meta");
974 $this->lng->loadLanguageModule("mcst");
975 $med_items = $this->object->getItemsArray();
976 $info->addSection($this->lng->txt("meta_general"));
977 $info->addProperty(
978 $this->lng->txt("mcst_nr_items"),
979 count($med_items)
980 );
981
982 if (count($med_items) > 0) {
983 $cur = current($med_items);
984 $last = ilDatePresentation::formatDate(new ilDateTime($cur["creation_date"], IL_CAL_DATETIME));
985 } else {
986 $last = "-";
987 }
988
989 $info->addProperty($this->lng->txt("mcst_last_submission"), $last);
990
991 // forward the command
992 $this->ctrl->forwardCommand($info);
993 }
const IL_CAL_DATETIME
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false)
@classDescription Date and time handling
Class ilInfoScreenGUI.
activateTab(string $a_id)

References ILIAS\Repository\ctrl(), ilDatePresentation\formatDate(), IL_CAL_DATETIME, and ILIAS\Repository\lng().

Referenced by executeCommand().

+ 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.

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

948 : void
949 {
950 if (!$this->checkPermissionBool("read")) {
951 $this->checkPermission("visible");
952 }
953 $this->ctrl->setCmd("showSummary");
954 $this->ctrl->setCmdClass("ilinfoscreengui");
955 $this->infoScreen();
956 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ initAddCastItemForm()

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

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

377 : void
378 {
380 $ilCtrl = $this->ctrl;
381 $ilTabs = $this->tabs;
382
383 $this->checkPermission("write");
384 $ilTabs->activateTab("edit_content");
385
386 $lng->loadLanguageModule("mcst");
387
388 $news_set = new ilSetting("news");
389 $enable_internal_rss = $news_set->get("enable_rss_for_internal");
390
391 $this->form_gui = new ilPropertyFormGUI();
392 $this->form_gui->setMultipart(true);
393
394 // Property Title
395 $text_input = new ilTextInputGUI($lng->txt("title"), "title");
396 $text_input->setMaxLength(200);
397 $this->form_gui->addItem($text_input);
398
399 // Property Content
400 $text_area = new ilTextAreaInputGUI($lng->txt("description"), "description");
401 $text_area->setRequired(false);
402 $this->form_gui->addItem($text_area);
403
404 // Property Visibility
405 if ($enable_internal_rss) {
406 $radio_group = new ilRadioGroupInputGUI($lng->txt("access_scope"), "visibility");
407 $radio_option = new ilRadioOption($lng->txt("access_users"), "users");
408 $radio_group->addOption($radio_option);
409 $radio_option = new ilRadioOption($lng->txt("access_public"), "public");
410 $radio_group->addOption($radio_option);
411 $radio_group->setInfo($lng->txt("mcst_visibility_info"));
412 $radio_group->setRequired(true);
413 $radio_group->setValue($this->object->getDefaultAccess() == 0 ? "users" : "public");
414 $this->form_gui->addItem($radio_group);
415 }
416
417 // Duration
418 $dur = new ilDurationInputGUI($lng->txt("mcst_duration"), "duration");
419 $dur->setInfo($lng->txt("mcst_duration_info"));
420 $dur->setShowDays(false);
421 $dur->setShowHours(true);
422 $dur->setShowSeconds(true);
423 $this->form_gui->addItem($dur);
424
425 foreach (ilObjMediaCast::$purposes as $purpose) {
426 if ($purpose == "VideoAlternative" &&
427 $a_mode == "create") {
428 continue;
429 }
430
431 $section = new ilFormSectionHeaderGUI();
432 $section->setTitle($lng->txt("mcst_" . strtolower($purpose) . "_title"));
433 $this->form_gui->addItem($section);
434 if ($a_mode != "create") {
435 $value = new ilHiddenInputGUI("value_" . $purpose);
436 $label = new ilNonEditableValueGUI($lng->txt("value"));
437 $label->setPostVar("label_value_" . $purpose);
438 $label->setInfo($lng->txt("mcst_current_value_info"));
439 $this->form_gui->addItem($label);
440 $this->form_gui->addItem($value);
441 }
442 $file = new ilFileInputGUI($lng->txt("file"), "file_" . $purpose);
443 $file->setSuffixes($this->mc_manager->getSuffixesForViewMode(
444 $this->object->getViewMode()
445 ));
446 $this->form_gui->addItem($file);
447 $text_input = new ilRegExpInputGUI($lng->txt("url"), "url_" . $purpose);
448 $text_input->setPattern("/https?\:\/\/.+/i");
449 $text_input->setInfo($lng->txt("mcst_reference_info"));
450 $this->form_gui->addItem($text_input);
451 if ($purpose != "Standard") {
452 $clearCheckBox = new ilCheckboxInputGUI();
453 $clearCheckBox->setPostVar("delete_" . $purpose);
454 $clearCheckBox->setTitle($lng->txt("mcst_clear_purpose_title"));
455 $this->form_gui->addItem($clearCheckBox);
456 } else {
457
458 //
459 $ne = new ilNonEditableValueGUI($lng->txt("mcst_mimetype"), "mimetype_" . $purpose);
460 $this->form_gui->addItem($ne);
461
462 // mime type selection
463 /*
464 $mimeTypeSelection = new ilSelectInputGUI();
465 $mimeTypeSelection->setPostVar("mimetype_" . $purpose);
466 $mimeTypeSelection->setTitle($lng->txt("mcst_mimetype"));
467 $mimeTypeSelection->setInfo($lng->txt("mcst_mimetype_info"));
468 $options = array("" => $lng->txt("mcst_automatic_detection"));
469 $options = array_merge($options, $this->mimeTypes);
470 $mimeTypeSelection->setOptions($options);
471 $this->form_gui->addItem($mimeTypeSelection);*/
472
473 // preview picure
474 $pp = new ilImageFileInputGUI($lng->txt("mcst_preview_picture"), "preview_pic");
475 $pp->setSuffixes(array("png", "jpeg", "jpg"));
476 $pp->setInfo($lng->txt("mcst_preview_picture_info") . " mp4, mp3, png, jp(e)g, gif");
477 $this->form_gui->addItem($pp);
478 }
479 }
480
481 // save/cancel button
482 if ($a_mode == "create") {
483 $this->form_gui->setTitle($lng->txt("mcst_add_new_item"));
484 $this->form_gui->addCommandButton("saveCastItem", $lng->txt("save"));
485 } else {
486 $this->form_gui->setTitle($lng->txt("mcst_edit_item"));
487 $this->form_gui->addCommandButton("updateCastItem", $lng->txt("save"));
488 }
489 $this->form_gui->addCommandButton("listItems", $lng->txt("cancel"));
490 $this->form_gui->setFormAction($ilCtrl->getFormAction($this, "saveCastItem"));
491 }
This class represents a checkbox property in a property form.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class represents a file property in a property form.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class represents a property form user interface.
This class represents a property in a property form.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class represents a text area property in a property form.

References ilObjectGUI\$ctrl, ilObjectGUI\$lng, ilObjMediaCast\$purposes, $tabs, ilObjectGUI\checkPermission(), ilLanguage\loadLanguageModule(), ILIAS\Repository\object(), and ilLanguage\txt().

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

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

◆ initCreationForms()

ilObjMediaCastGUI::initCreationForms ( string  $new_type)
protected

Init creation forms.

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

Returns
array<int, ilPropertyFormGUI>

Reimplemented from ilObjectGUI.

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

217 : array
218 {
219 $forms = array(self::CFORM_NEW => $this->initCreateForm($new_type),
220 self::CFORM_IMPORT => $this->initImportForm($new_type),
221 self::CFORM_CLONE => $this->fillCloneTemplate(null, $new_type));
222
223 return $forms;
224 }
initImportForm(string $new_type)
fillCloneTemplate(?string $tpl_name, string $type)
Fill object clone template This method can be called from any object GUI class that wants to offer ob...
initCreateForm(string $new_type)

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

1107 : void
1108 {
1109 $lng = $this->lng;
1110 $ilCtrl = $this->ctrl;
1111 $obj_service = $this->object_service;
1112
1113 $lng->loadLanguageModule("mcst");
1114
1115 $this->form_gui = new ilPropertyFormGUI();
1116 $this->form_gui->setTitle($lng->txt("mcst_settings"));
1117
1118 // Title
1119 $tit = new ilTextInputGUI($lng->txt("title"), "title");
1120 $tit->setValue($this->object->getTitle());
1121 $tit->setRequired(true);
1122 $this->form_gui->addItem($tit);
1123
1124 // description
1125 $des = new ilTextAreaInputGUI($lng->txt("description"), "description");
1126 $des->setValue($this->object->getLongDescription());
1127 $this->form_gui->addItem($des);
1128
1129 $sh = new ilFormSectionHeaderGUI();
1130 $sh->setTitle($lng->txt("rep_activation_availability"));
1131 $this->form_gui->addItem($sh);
1132
1133 // Online
1134 $online = new ilCheckboxInputGUI($lng->txt("online"), "online");
1135 $online->setChecked($this->object->getOnline());
1136 $this->form_gui->addItem($online);
1137
1138 // presentation
1139 $sh = new ilFormSectionHeaderGUI();
1140 $sh->setTitle($lng->txt("obj_presentation"));
1141 $this->form_gui->addItem($sh);
1142
1143 // tile image
1144 $obj_service->commonSettings()->legacyForm($this->form_gui, $this->object)->addTileImage();
1145
1146 // Sorting
1147 $sort = new ilRadioGroupInputGUI($lng->txt("mcst_ordering"), "order");
1148 $sort->addOption(new ilRadioOption(
1149 $lng->txt("mcst_ordering_title"),
1151 ));
1152 $sort->addOption(new ilRadioOption(
1153 $lng->txt("mcst_ordering_creation_date_asc"),
1155 ));
1156 $sort->addOption(new ilRadioOption(
1157 $lng->txt("mcst_ordering_creation_date_desc"),
1159 ));
1160 $sort->addOption(new ilRadioOption(
1161 $lng->txt("mcst_ordering_manual"),
1163 ));
1164 $sort->setValue($this->object->getOrder());
1165 $this->form_gui->addItem($sort);
1166
1167 // view mode
1168 $si = new ilRadioGroupInputGUI($this->lng->txt("mcst_viewmode"), "viewmode");
1169 /*$si->addOption(new ilRadioOption(
1170 $lng->txt("mcst_list"),
1171 ilObjMediaCast::VIEW_LIST
1172 ));
1173 $si->addOption(new ilRadioOption(
1174 $lng->txt("mcst_gallery"),
1175 ilObjMediaCast::VIEW_GALLERY
1176 ));*/
1177 $si->addOption(new ilRadioOption(
1178 $lng->txt("mcst_img_gallery"),
1180 ));
1181 $si->addOption(new ilRadioOption(
1182 $lng->txt("mcst_podcast"),
1184 ));
1185 $si->addOption($vc_opt = new ilRadioOption(
1186 $lng->txt("mcst_video_cast"),
1188 ));
1189
1190 // $si->setOptions($options);
1191 $si->setValue($this->object->getViewMode());
1192 $this->form_gui->addItem($si);
1193
1194 // autoplay
1195 $options = array(
1196 ilObjMediaCast::AUTOPLAY_NO => $lng->txt("mcst_no_autoplay"),
1197 ilObjMediaCast::AUTOPLAY_ACT => $lng->txt("mcst_autoplay_active"),
1198 ilObjMediaCast::AUTOPLAY_INACT => $lng->txt("mcst_autoplay_inactive")
1199 );
1200 $si = new ilSelectInputGUI($lng->txt("mcst_autoplay"), "autoplaymode");
1201 $si->setInfo($lng->txt("mcst_autoplay_info"));
1202 $si->setOptions($options);
1203 $si->setValue($this->object->getAutoplayMode());
1204 $vc_opt->addSubItem($si);
1205
1206 // number of initial videos
1207 $ti = new ilNumberInputGUI($lng->txt("mcst_nr_videos"), "nr_videos");
1208 $ti->setValue(max(1, $this->object->getNumberInitialVideos()));
1209 $ti->setMinValue(1);
1210 $ti->setSize(2);
1211 $vc_opt->addSubItem($ti);
1212
1213 // Downloadable
1214 $downloadable = new ilCheckboxInputGUI($lng->txt("mcst_downloadable"), "downloadable");
1215 $downloadable->setChecked($this->object->getDownloadable());
1216 $downloadable->setInfo($lng->txt("mcst_downloadable_info"));
1217 $this->form_gui->addItem($downloadable);
1218
1219 $news_set = new ilSetting("news");
1220 $enable_internal_rss = $news_set->get("enable_rss_for_internal");
1221
1222 //Default Visibility
1223 if ($enable_internal_rss) {
1224 // webfeed
1225 $sh = new ilFormSectionHeaderGUI();
1226 $sh->setTitle($lng->txt("mcst_webfeed"));
1227 $this->form_gui->addItem($sh);
1228
1229 $radio_group = new ilRadioGroupInputGUI($lng->txt("news_default_visibility"), "defaultaccess");
1230 $radio_option = new ilRadioOption($lng->txt("news_visibility_users"), "0");
1231 $radio_option->setInfo($lng->txt("news_news_item_def_visibility_users_info"));
1232 $radio_group->addOption($radio_option);
1233 $radio_option = new ilRadioOption($lng->txt("news_visibility_public"), "1");
1234 $radio_option->setInfo($lng->txt("news_news_item_def_visibility_public_info"));
1235 $radio_group->addOption($radio_option);
1236 $radio_group->setRequired(false);
1237 $radio_group->setValue($this->object->getDefaultAccess());
1238 #$ch->addSubItem($radio_group);
1239 $this->form_gui->addItem($radio_group);
1240
1241 //Extra Feed
1242 $public_feed = ilBlockSetting::_lookup("news", "public_feed", 0, $this->object->getId());
1243 $ch = new ilCheckboxInputGUI($lng->txt("news_public_feed"), "extra_feed");
1244 $ch->setInfo($lng->txt("news_public_feed_info"));
1245 $ch->setChecked((bool) $public_feed);
1246 $this->form_gui->addItem($ch);
1247
1248 // keep minimal x number of items
1249 $ni = new ilNumberInputGUI($this->lng->txt("news_keep_minimal_x_items"), "keep_rss_min");
1250 $ni->setMaxValue(100);
1251 $ni->setMinValue(0);
1252 $ni->setMaxLength(3);
1253 $ni->setSize(3);
1254 $ni->setInfo($this->lng->txt("news_keep_minimal_x_items_info") . " (" .
1255 ilNewsItem::_lookupRSSPeriod() . " " . (ilNewsItem::_lookupRSSPeriod() == 1 ? $lng->txt("day") : $lng->txt("days")) . ")");
1256 $ni->setValue((int) ilBlockSetting::_lookup("news", "keep_rss_min", 0, $this->object->getId()));
1257 $ch->addSubItem($ni);
1258
1259 // Include Files in Pubic Items
1260 $incl_files = new ilCheckboxInputGUI($lng->txt("mcst_incl_files_in_rss"), "public_files");
1261 $incl_files->setChecked($this->object->getPublicFiles());
1262 $incl_files->setInfo($lng->txt("mcst_incl_files_in_rss_info"));
1263 #$ch->addSubItem($incl_files);
1264 $this->form_gui->addItem($incl_files);
1265 }
1266
1267 if (ilLearningProgressAccess::checkAccess($this->object->getRefId())) {
1268 $sh = new ilFormSectionHeaderGUI();
1269 $sh->setTitle($lng->txt("learning_progress"));
1270 $this->form_gui->addItem($sh);
1271
1272 // Include new items automatically in learning progress
1273 $auto_lp = new ilCheckboxInputGUI($lng->txt("mcst_new_items_det_lp"), "auto_det_lp");
1274 $auto_lp->setChecked($this->object->getNewItemsInLearningProgress());
1275 $auto_lp->setInfo($lng->txt("mcst_new_items_det_lp_info"));
1276 $this->form_gui->addItem($auto_lp);
1277 }
1278
1279
1280 // Form action and save button
1281 $this->form_gui->addCommandButton("saveSettings", $lng->txt("save"));
1282 $this->form_gui->setFormAction($ilCtrl->getFormAction($this, "saveSettings"));
1283 }
static checkAccess(int $a_ref_id, bool $a_allow_only_read=true)
check access to learning progress
static _lookupRSSPeriod()
This class represents a number property in a property form.
ilObjectService $object_service
This class represents a selection list property in a property form.

References $lng, ilBlockSetting\_lookup(), ilNewsItem\_lookupRSSPeriod(), ilObjMediaCast\AUTOPLAY_ACT, ilObjMediaCast\AUTOPLAY_INACT, ilObjMediaCast\AUTOPLAY_NO, ilLearningProgressAccess\checkAccess(), ILIAS\Repository\lng(), ILIAS\Repository\object(), ilObjMediaCast\ORDER_CREATION_DATE_ASC, ilObjMediaCast\ORDER_CREATION_DATE_DESC, ilObjMediaCast\ORDER_MANUAL, ilObjMediaCast\ORDER_TITLE, ilObjMediaCast\VIEW_IMG_GALLERY, ilObjMediaCast\VIEW_PODCAST, and ilObjMediaCast\VIEW_VCAST.

+ Here is the call graph for this function:

◆ isAudio()

static ilObjMediaCastGUI::isAudio ( string  $extension)
staticprotected

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

1378 : bool
1379 {
1380 return strpos($extension, "audio") !== false;
1381 }

◆ listItemsObject()

ilObjMediaCastGUI::listItemsObject ( bool  $a_presentation_mode = false)

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

233 : void
234 {
237 $ilAccess = $this->access;
238 $ilToolbar = $this->toolbar;
239
240 $this->checkPermission("read");
241
242 if ($a_presentation_mode) {
243 $this->tpl->setOnScreenMessage('info', $this->lng->txt("mcst_view_abandoned"));
244 return;
245 }
246
247 if ($a_presentation_mode) {
248 $this->addContentSubTabs("content");
249 } else {
250 $this->addContentSubTabs("manage");
251 }
252
253 $med_items = $this->object->getSortedItemsArray();
254
255 if ($a_presentation_mode) {
256 $table_gui = new ilMediaCastTableGUI($this, "showContent", false, true);
257 } else {
258 $table_gui = new ilMediaCastTableGUI($this, "listItems");
259 }
260
261 $table_gui->setData($med_items);
262
263 if ($ilAccess->checkAccess("write", "", $this->requested_ref_id) && !$a_presentation_mode) {
264 if (in_array($this->object->getViewMode(), [
268 ], true)) {
269 $ilToolbar->addButton($lng->txt("add"), $this->ctrl->getLinkTargetByClass("ilMediaCreationGUI", ""));
270 } else {
271 $ilToolbar->addButton($lng->txt("add"), $this->ctrl->getLinkTarget($this, "addCastItem"));
272 }
273
274 $table_gui->addMultiCommand("confirmDeletionItems", $lng->txt("delete"));
275 $table_gui->setSelectAllCheckbox("item_id");
276 }
277 $tpl->setContent($table_gui->getHTML());
278 }

References ilObjectGUI\$access, ilObjectGUI\$lng, ilObjectGUI\$toolbar, ilObjectGUI\$tpl, addContentSubTabs(), ilObjectGUI\checkPermission(), ILIAS\Repository\lng(), ILIAS\Repository\object(), ilGlobalTemplateInterface\setContent(), ilLanguage\txt(), ilObjMediaCast\VIEW_IMG_GALLERY, ilObjMediaCast\VIEW_PODCAST, and ilObjMediaCast\VIEW_VCAST.

+ Here is the call graph for this function:

◆ onMobUpdate()

ilObjMediaCastGUI::onMobUpdate ( int  $mob_id)
protected

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

364 : void
365 {
366 foreach ($this->object->getSortedItemsArray() as $item) {
367 if ($mob_id == $item["mob_id"]) {
368 $mob = new ilObjMediaObject($item["mob_id"]);
369 $mc_item = new ilNewsItem($item["id"]);
370 $mc_item->setTitle($mob->getTitle());
371 $mc_item->setContent($mob->getLongDescription());
372 $mc_item->update();
373 }
374 }
375 }

References ILIAS\Repository\object().

Referenced by executeCommand().

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

◆ populateFormFromPost()

ilObjMediaCastGUI::populateFormFromPost ( )
private

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

1402 : void
1403 {
1404 $tpl = $this->tpl;
1405 $this->form_gui->setValuesByPost();
1406
1407 //issue: we have to display the current settings
1408 // problem: POST does not contain values of disabled text fields
1409 // solution: use hidden field and label to display-> here we need to synchronize the labels
1410 // with the values from the hidden fields.
1411 foreach (ilObjMediaCast::$purposes as $purpose) {
1412 if ($this->form_gui->getInput("value_" . $purpose)) {
1413 $input = $this->form_gui->getItemByPostVar("label_value_" . $purpose);
1414 $input->setValue($this->form_gui->getInput("value_" . $purpose));
1415 }
1416 }
1417
1418 $this->form_gui->setValuesByPost();
1419 $tpl->setContent($this->form_gui->getHTML());
1420 }

References ilObjMediaCast\$purposes, and $tpl.

Referenced by saveCastItemObject().

+ Here is the caller graph for this function:

◆ saveCastItemObject()

ilObjMediaCastGUI::saveCastItemObject ( )

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

543 : void
544 {
545 return;
547 $ilCtrl = $this->ctrl;
550 $ilTabs = $this->tabs;
551
552 $this->checkPermission("write");
553 $ilTabs->activateTab("edit_content");
554
555 $this->initAddCastItemForm();
556
557 if (!$this->form_gui->checkInput() ||
558 ($this->form_gui->getInput("url_Standard") == "" && !$_FILES['file_Standard']['tmp_name'])) {
559 $this->tpl->setOnScreenMessage('failure', $lng->txt("mcst_input_either_file_or_url"));
560 $this->populateFormFromPost();
561 } else {
562 // create dummy object in db (we need an id)
563 $mob = new ilObjMediaObject();
564 $mob->create();
565
566 //handle standard purpose
567 $file = $this->createMediaItemForPurpose($mob, "Standard");
568
569 // set title and description
570 // set title to basename of file if left empty
571 $title = $this->form_gui->getInput("title") != "" ? $this->form_gui->getInput("title") : basename($file);
572 $description = $this->form_gui->getInput("description");
573 $mob->setTitle($title);
574 $mob->setDescription($description);
575
576 // save preview pic
577 $prevpic = $this->form_gui->getInput("preview_pic");
578 if ($prevpic["size"] > 0) {
579 $mob->uploadVideoPreviewPic($prevpic);
580 }
581
582 // determine duration for standard purpose
583 $duration = $this->getDuration($file);
584
585 // handle other purposes
586 foreach ($this->additionalPurposes as $purpose) {
587 // check if some purpose has been uploaded
588 $file_gui = $this->form_gui->getInput("file_" . $purpose);
589 $url_gui = $this->form_gui->getInput("url_" . $purpose);
590 if ($url_gui || $file_gui["size"] > 0) {
591 $this->createMediaItemForPurpose($mob, $purpose);
592 }
593 }
594
595 $mob->update();
596
597 if ($prevpic["size"] == 0) {
598 // re-read media object
599 $mob = new ilObjMediaObject($mob->getId());
600 $mob->generatePreviewPic(320, 240);
601 }
602
603 //
604 // @todo: save usage
605 //
606
607 $news_set = new ilSetting("news");
608 $enable_internal_rss = $news_set->get("enable_rss_for_internal");
609
610 // create new media cast item
611 $mc_item = new ilNewsItem();
612 $mc_item->setMobId($mob->getId());
613 $mc_item->setContentType(NEWS_AUDIO);
614 $mc_item->setContextObjId($this->object->getId());
615 $mc_item->setContextObjType($this->object->getType());
616 $mc_item->setUserId($ilUser->getId());
617 $mc_item->setPlaytime($duration);
618 $mc_item->setTitle($title);
619 $mc_item->setContent($description);
620 $mc_item->setLimitation(false);
621 if ($enable_internal_rss) {
622 $mc_item->setVisibility($this->form_gui->getInput("visibility"));
623 } else {
624 $mc_item->setVisibility("users");
625 }
626 $mc_item->create();
627
628 $ilCtrl->redirect($this, "listItems");
629 }
630 }
const NEWS_AUDIO
getDuration(ilMediaItem $media_item)
createMediaItemForPurpose(ilObjMediaObject $mob, string $purpose)
Handle media item for given purpose.

References ilObjectGUI\$ctrl, $ilUser, ilObjectGUI\$lng, $tabs, ilObjectGUI\$tpl, ilObjectGUI\$user, ilObjectGUI\checkPermission(), createMediaItemForPurpose(), getDuration(), initAddCastItemForm(), NEWS_AUDIO, ILIAS\Repository\object(), populateFormFromPost(), and ilLanguage\txt().

+ Here is the call graph for this function:

◆ saveOrderObject()

ilObjMediaCastGUI::saveOrderObject ( )

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

1456 : void
1457 {
1458 $lng = $this->lng;
1459
1460 $ids = $this->mc_request->getItemIds();
1461 asort($ids);
1462
1463 $items = array();
1464 foreach (array_keys($ids) as $id) {
1465 $items[] = $id;
1466 }
1467 $this->object->saveOrder($items);
1468
1469 $this->tpl->setOnScreenMessage('success', $lng->txt("settings_saved"), true);
1470 $this->ctrl->redirect($this, "editOrder");
1471 }

References $id, $lng, and ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ saveSettingsObject()

ilObjMediaCastGUI::saveSettingsObject ( )

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

1285 : void
1286 {
1287 $ilCtrl = $this->ctrl;
1288 $ilTabs = $this->tabs;
1289 $obj_service = $this->object_service;
1290
1291 $this->checkPermission("write");
1292 $ilTabs->activateTab("id_settings");
1293
1294 $this->initSettingsForm();
1295 if ($this->form_gui->checkInput()) {
1296 $news_set = new ilSetting("news");
1297 $enable_internal_rss = $news_set->get("enable_rss_for_internal");
1298
1299 $this->object->setTitle($this->form_gui->getInput("title"));
1300 $this->object->setDescription($this->form_gui->getInput("description"));
1301 $this->object->setOnline($this->form_gui->getInput("online"));
1302 $this->object->setDownloadable($this->form_gui->getInput("downloadable"));
1303 $this->object->setOrder($this->form_gui->getInput("order"));
1304 $this->object->setViewMode($this->form_gui->getInput("viewmode"));
1305 $this->object->setAutoplayMode((int) $this->form_gui->getInput("autoplaymode"));
1306 $this->object->setNumberInitialVideos((int) $this->form_gui->getInput("nr_videos"));
1307 $this->object->setNewItemsInLearningProgress((int) $this->form_gui->getInput("auto_det_lp"));
1308
1309 // tile image
1310 $obj_service->commonSettings()->legacyForm($this->form_gui, $this->object)->saveTileImage();
1311
1312 if ($enable_internal_rss) {
1313 $this->object->setPublicFiles($this->form_gui->getInput("public_files"));
1314 $this->object->setDefaultAccess($this->form_gui->getInput("defaultaccess"));
1315 }
1316 $this->object->update();
1317
1318 if ($enable_internal_rss) {
1320 "news",
1321 "public_feed",
1322 $this->form_gui->getInput("extra_feed"),
1323 0,
1324 $this->object->getId()
1325 );
1326
1328 "news",
1329 "keep_rss_min",
1330 $this->form_gui->getInput("keep_rss_min"),
1331 0,
1332 $this->object->getId()
1333 );
1334 }
1335
1336 $this->tpl->setOnScreenMessage('success', $this->lng->txt("msg_obj_modified"), true);
1337 $ilCtrl->redirect($this, "editSettings");
1338 } else {
1339 $this->form_gui->setValuesByPost();
1340 $this->tpl->setContent($this->form_gui->getHTML());
1341 }
1342 }
static _write(string $a_type, string $a_setting, string $a_value, int $a_user=0, int $a_block_id=0)
Write setting to database.

References ilBlockSetting\_write(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ setTabs()

ilObjMediaCastGUI::setTabs ( )
protected

set admin tabs

Reimplemented from ilObjectGUI.

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

995 : void
996 {
997 $ilAccess = $this->access;
998 $ilTabs = $this->tabs;
1000 $ilHelp = $this->help;
1001
1002 $ilHelp->setScreenIdComponent("mcst");
1003
1004 // list items
1005 if ($ilAccess->checkAccess('read', "", $this->object->getRefId())) {
1006 $ilTabs->addTab(
1007 "content",
1008 $lng->txt("content"),
1009 $this->ctrl->getLinkTarget($this, "showContent")
1010 );
1011 }
1012
1013 // info screen
1014 if ($ilAccess->checkAccess('visible', "", $this->object->getRefId()) ||
1015 $ilAccess->checkAccess('read', "", $this->object->getRefId())) {
1016 $ilTabs->addTab(
1017 "id_info",
1018 $lng->txt("info_short"),
1019 $this->ctrl->getLinkTargetByClass("ilinfoscreengui", "showSummary")
1020 );
1021 }
1022
1023 // settings
1024 if ($ilAccess->checkAccess('write', "", $this->object->getRefId())) {
1025 $ilTabs->addTab(
1026 "id_settings",
1027 $lng->txt("settings"),
1028 $this->ctrl->getLinkTarget($this, "editSettings")
1029 );
1030 }
1031
1032 if (ilLearningProgressAccess::checkAccess($this->object->getRefId())) {
1033 $ilTabs->addTab(
1034 'learning_progress',
1035 $lng->txt('learning_progress'),
1036 $this->ctrl->getLinkTargetByClass(array(__CLASS__, 'illearningprogressgui'), '')
1037 );
1038 }
1039
1040 // export
1041 if ($ilAccess->checkAccess("write", "", $this->object->getRefId())) {
1042 $ilTabs->addTab(
1043 "export",
1044 $lng->txt("export"),
1045 $this->ctrl->getLinkTargetByClass("ilexportgui", "")
1046 );
1047 }
1048
1049 // edit permissions
1050 if ($ilAccess->checkAccess('edit_permission', "", $this->object->getRefId())) {
1051 $ilTabs->addTab(
1052 "id_permissions",
1053 $lng->txt("perm_settings"),
1054 $this->ctrl->getLinkTargetByClass("ilpermissiongui", "perm")
1055 );
1056 }
1057 }
setScreenIdComponent(string $a_comp)

References $lng, ilLearningProgressAccess\checkAccess(), and ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ showContentObject()

ilObjMediaCastGUI::showContentObject ( )

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

1477 : void
1478 {
1479 $tpl = $this->tpl;
1481 $ilTabs = $this->tabs;
1482
1483 // need read events for parent for LP statistics
1485 "mcst",
1486 $this->object->getRefId(),
1487 $this->object->getId(),
1488 $ilUser->getId()
1489 );
1490
1491 // trigger LP update
1492 ilLPStatusWrapper::_updateStatus($this->object->getId(), $ilUser->getId());
1493
1494 if ($this->object->getViewMode() == ilObjMediaCast::VIEW_GALLERY) {
1495 $this->showGallery();
1496 } elseif ($this->object->getViewMode() == ilObjMediaCast::VIEW_IMG_GALLERY) {
1497 $view = new \McstImageGalleryGUI($this->object, $this->tpl, $this->getFeedLink());
1498 $view->setCompletedCallback($this->ctrl->getLinkTarget(
1499 $this,
1500 "handlePlayerCompletedEvent",
1501 "",
1502 true,
1503 false
1504 ));
1505 $this->tabs->activateTab("content");
1506 $this->addContentSubTabs("content");
1507 $tpl->setContent($this->ctrl->getHTML($view));
1508 } elseif ($this->object->getViewMode() == ilObjMediaCast::VIEW_PODCAST) {
1509 $view = new \McstPodcastGUI($this->object, $this->tpl, $this->getFeedLink());
1510 $this->tabs->activateTab("content");
1511 $this->addContentSubTabs("content");
1512 $tpl->setContent($this->ctrl->getHTML($view));
1513 } elseif ($this->object->getViewMode() == ilObjMediaCast::VIEW_VCAST) {
1514 $ilTabs->activateTab("content");
1515 $this->addContentSubTabs("content");
1516 $view = new \ILIAS\MediaCast\Presentation\VideoViewGUI($this->object, $tpl, $this->getFeedLink());
1517 $view->setCompletedCallback($this->ctrl->getLinkTarget(
1518 $this,
1519 "handlePlayerCompletedEvent",
1520 "",
1521 true,
1522 false
1523 ));
1524 $view->setAutoplayCallback($this->ctrl->getLinkTarget(
1525 $this,
1526 "handleAutoplayTrigger",
1527 "",
1528 true,
1529 false
1530 ));
1531 $view->show();
1532 } else {
1533 $this->listItemsObject(true);
1534 }
1535
1536 $tpl->setPermanentLink($this->object->getType(), $this->object->getRefId());
1537 }
static _recordReadEvent(string $a_type, int $a_ref_id, int $obj_id, int $usr_id, bool $isCatchupWriteEvents=true, $a_ext_rc=null, $a_ext_time=null)
static _updateStatus(int $a_obj_id, int $a_usr_id, ?object $a_obj=null, bool $a_percentage=false, bool $a_force_raise=false)
setPermanentLink(string $a_type, ?int $a_id, string $a_append="", string $a_target="", string $a_title="")
Generates and sets a permanent ilias link.

References $ilUser, $tpl, ilChangeEvent\_recordReadEvent(), ilLPStatusWrapper\_updateStatus(), ILIAS\Repository\ctrl(), ILIAS\Repository\object(), ILIAS\Repository\tabs(), ilObjMediaCast\VIEW_GALLERY, ilObjMediaCast\VIEW_IMG_GALLERY, ilObjMediaCast\VIEW_PODCAST, and ilObjMediaCast\VIEW_VCAST.

+ Here is the call graph for this function:

◆ showGallery()

ilObjMediaCastGUI::showGallery ( )

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

1539 : void
1540 {
1541 $tpl = $this->tpl;
1542 $ilTabs = $this->tabs;
1543 $ilCtrl = $this->ctrl;
1544
1545 $this->tpl->setOnScreenMessage('info', $this->lng->txt("mcst_view_abandoned"));
1546 }

References $tpl, and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ updateCastItemObject()

ilObjMediaCastGUI::updateCastItemObject ( )

Update cast item.

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

743 : void
744 {
745 $ilCtrl = $this->ctrl;
747 $ilLog = $this->log;
748 $title = "";
749 $description = "";
750 $file = null;
751
752 $this->checkPermission("write");
753
754 $this->initAddCastItemForm("edit");
755
756 if ($this->form_gui->checkInput()) {
757 // create new media cast item
758 $mc_item = new ilNewsItem(
759 $this->mc_request->getItemId()
760 );
761 $mob_id = $mc_item->getMobId();
762
763 // create dummy object in db (we need an id)
764 $mob = new ilObjMediaObject($mob_id);
765
766
767 foreach (ilObjMediaCast::$purposes as $purpose) {
768 if ($this->form_gui->getInput("delete_" . $purpose)) {
769 $mob->removeMediaItem($purpose);
770 $ilLog->write("Mcst: deleting purpose $purpose");
771 continue;
772 }
773 $media_item = $mob->getMediaItem($purpose);
774 $url_gui = $this->form_gui->getInput("url_" . $purpose);
775 $file_gui = $this->form_gui->getInput("file_" . $purpose);
776
777 if ($media_item == null) {
778 if ($purpose != "Standard" &&
779 ($url_gui || $file_gui["size"] > 0)) {
780 // check if we added an additional purpose when updating
781 // either by url or by file
782 $file = $this->createMediaItemForPurpose($mob, $purpose);
783 }
784 } else {
785 $file = $this->updateMediaItem($mob, $media_item);
786 }
787
788 if ($purpose == "Standard") {
789 $duration = $this->getDuration($media_item);
790 $title = $this->form_gui->getInput("title") != "" ? $this->form_gui->getInput("title") : basename($file);
791 $description = $this->form_gui->getInput("description");
792
793 $mob->setTitle($title);
794 $mob->setDescription($description);
795
796 $prevpic = $this->form_gui->getInput("preview_pic");
797 if ($prevpic["size"] > 0) {
798 $mob->uploadVideoPreviewPic($prevpic);
799 } else {
800 $prevpici = $this->form_gui->getItemByPostVar("preview_pic");
801 if ($prevpici->getDeletionFlag()) {
802 $mob->removeAdditionalFile($mob->getVideoPreviewPic(true));
803 }
804 }
805 }
806 }
807
808 // set real meta and object data
809 $mob->update();
810
811 //
812 // @todo: save usage
813 //
814
815 $news_set = new ilSetting("news");
816 $enable_internal_rss = $news_set->get("enable_rss_for_internal");
817
818 $mc_item->setUserId($ilUser->getId());
819 if (isset($duration)) {
820 $mc_item->setPlaytime($duration);
821 $dur_arr = explode(":", $duration);
822 $seconds = ((int) $dur_arr[0] * 60 * 60) + ((int) $dur_arr[1] * 60) + ((int) $dur_arr[2]);
823 $st_med = $mob->getMediaItem("Standard");
824 $st_med->setDuration($seconds);
825 $st_med->update();
826 }
827 $mc_item->setTitle($title);
828 $mc_item->setContent($description);
829 if ($enable_internal_rss) {
830 $mc_item->setVisibility($this->form_gui->getInput("visibility"));
831 }
832 $mc_item->update();
833
834 $ilCtrl->redirect($this, "listItems");
835 } else {
836 $this->populateFormFromPost();
837 }
838 }

References $ilUser, $log, ilObjMediaCast\$purposes, ilObjMediaObject\getMediaItem(), ilObjMediaObject\getVideoPreviewPic(), ILIAS\Repository\int(), ilObjMediaObject\removeAdditionalFile(), ilObjMediaObject\removeMediaItem(), ilObject\setDescription(), ilObject\setTitle(), ilObjMediaObject\update(), and ilObjMediaObject\uploadVideoPreviewPic().

+ Here is the call graph for this function:

◆ updateMediaItem()

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

Update media item from form.

Exceptions
FileNotFoundException
IOException
ilException
ilMediaObjectsException

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

676 : string {
677 $locationType = "";
678 $location = "";
679 $file = "";
680 $purpose = $mediaItem->getPurpose();
681 $locationType = $mediaItem->getLocationType();
682 $url_gui = $this->form_gui->getInput("url_" . $purpose);
683 $file_gui = $this->form_gui->getInput("file_" . $purpose);
684 if ($url_gui) {
685 // http
686 $file = $this->form_gui->getInput("url_" . $purpose);
687 $title = basename($file);
688 $location = $this->form_gui->getInput("url_" . $purpose);
689 $locationType = "Reference";
690 } elseif ($file_gui["size"] > 0) {
691 // lokal
692 // determine and create mob directory, move uploaded file to directory
693 $mob_dir = ilObjMediaObject::_getDirectory($mob->getId());
694 if (!is_dir($mob_dir)) {
695 $mob->createDirectory();
696 } else {
697 $dir = LegacyPathHelper::createRelativePath($mob_dir);
698 $old_files = $this->filesystem->finder()->in([$dir])->exclude([$dir . '/mob_vpreview.png'])->files();
699 foreach ($old_files as $file) {
700 $this->filesystem->delete($file->getPath());
701 }
702 }
703
704 $file_name = ilFileUtils::getASCIIFilename($_FILES['file_' . $purpose]['name']);
705 $file_name = str_replace(" ", "_", $file_name);
706
707 $file = $mob_dir . "/" . $file_name;
708 $title = $file_name;
709 $locationType = "LocalFile";
710 $location = $title;
711 ilFileUtils::moveUploadedFile($_FILES['file_' . $purpose]['tmp_name'], $file_name, $file);
713 }
714
715 // check if not automatic mimetype detection
716 $format = ilObjMediaObject::getMimeType($mediaItem->getLocation(), ($locationType === "Reference"));
717 $mediaItem->setFormat($format);
718
719 if ($file != "") {
720 // get mime type, if not already set!
721 if ($format === "") {
722 $format = ilObjMediaObject::getMimeType($file, ($locationType === "Reference"));
723 }
724
725 // set real meta and object data
726 $mediaItem->setFormat($format);
727 $mediaItem->setLocation($location);
728 $mediaItem->setLocationType($locationType);
729 $mediaItem->setHAlign("Left");
730 $mediaItem->setHeight(self::isAudio($format) ? 0 : 180);
731 }
732
733 if (($purpose === "Standard") && isset($title)) {
734 $mob->setTitle($title);
735 }
736
737 return $file;
738 }
$location
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: buildRTE.php:22
static getASCIIFilename(string $a_filename)
static renameExecutables(string $a_dir)
static moveUploadedFile(string $a_file, string $a_name, string $a_target, bool $a_raise_errors=true, string $a_mode="move_uploaded")
move uploaded file
setLocationType(string $a_type)
setLocation(string $a_location)
setHeight(string $a_height)
setFormat(string $a_format)
setHAlign(string $a_halign)
set horizontal align
static getMimeType(string $a_file, bool $a_external=false)
get mime type for file
createDirectory()
Create file directory of media object.
setTitle(string $title)
$format
Definition: metadata.php:235

References $location.

Field Documentation

◆ $additionalPurposes

array ilObjMediaCastGUI::$additionalPurposes = []
private

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

◆ $filesystem

FileSystem ilObjMediaCastGUI::$filesystem
protected

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

◆ $form_gui

ilPropertyFormGUI ilObjMediaCastGUI::$form_gui
protected

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

◆ $help

ilHelpGUI ilObjMediaCastGUI::$help
protected

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

◆ $log

ilLogger ilObjMediaCastGUI::$log
protected

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

◆ $mc_manager

ILIAS MediaCast MediaCastManager ilObjMediaCastGUI::$mc_manager
protected

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

◆ $mc_request

StandardGUIRequest ilObjMediaCastGUI::$mc_request
protected

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

◆ $mcst_item

ilNewsItem ilObjMediaCastGUI::$mcst_item
protected

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

◆ $mimeTypes

array ilObjMediaCastGUI::$mimeTypes = []
private

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

◆ $purposeSuffixes

array ilObjMediaCastGUI::$purposeSuffixes = []
private

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

◆ $tabs

ilTabsGUI ilObjMediaCastGUI::$tabs
protected

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