ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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 ()
 
 editObject ()
 
 listItemsObject (bool $a_presentation_mode=false)
 
 tableCommandObject ()
 
 getFeedLink ()
 
 addCastItemObject ()
 Add media cast item. More...
 
 editCastItemObject ()
 
 finishSingleUpload (int $mob_id)
 
 initAddCastItemForm (string $a_mode="create")
 
 getCastItemValues (int $item_id)
 Get cast item values into form. More...
 
 saveCastItemObject ()
 
 updateCastItemObject ()
 Update cast item. More...
 
 showCastItemObject ()
 
 confirmItemDeletionObject ()
 
 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 ()
 
 saveOrderObject ()
 
 showContentObject ()
 
 showGallery ()
 
 extractPreviewImageObject ()
 
 handlePlayerEventObject ()
 
- Public Member Functions inherited from ilObjectGUI
 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] does belong to the parent 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...
 
 cancelObject ()
 cancel action and go back to previous page More...
 
 createObject ()
 create new object form More...
 
 editAvailabilityPeriodObject ()
 
 saveAvailabilityPeriodObject ()
 
 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)
 
 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

 afterSave (ilObject $new_object)
 Post (successful) object creation hook. More...
 
 getManageTableGUI ()
 
 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 ()
 
 getCommentGUI ()
 
 showCommentsObject ()
 
 renderVideoObject ()
 
- Protected Member Functions inherited from ilObjectGUI
 getObjectService ()
 
 assignObject ()
 
 setTitleAndDescription ()
 
 createActionDispatcherGUI ()
 
 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...
 
 getCreationFormsHTML (StandardForm|ilPropertyFormGUI|array $form)
 
 getTitleForCreationFormPage ()
 
 getCreationFormTitle ()
 
 initCreateForm (string $new_type)
 
 didacticTemplatesToForm ()
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 
 retrieveAdditionalDidacticTemplateOptions ()
 
 addAdoptContentLinkToToolbar ()
 
 addImportButtonToToolbar ()
 
 addAvailabilityPeriodButtonToToolbar (ilToolbarGUI $toolbar)
 
 parseDidacticTemplateVar (string $var, string $type)
 
 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...
 
 routeImportCmdObject ()
 
 importFile (string $file_to_import, string $path_to_uploaded_file_in_temp_dir)
 
 deleteUploadedImportFile (string $path_to_uploaded_file_in_temp_dir)
 
 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...
 
 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...
 
 getCreatableObjectTypes ()
 
 buildAddNewItemElements (array $subtypes, string $create_target_class=ilRepositoryGUI::class, ?int $redirect_target_ref_id=null,)
 
 buildGroup (string $create_target_class, array $obj_types_in_group, string $title, array $subtypes)
 

Static Protected Member Functions

static isAudio (string $extension)
 

Protected Attributes

ILIAS MediaObjects Player GUIService $mob_player_gui
 
ILIAS MediaObjects MediaType MediaTypeManager $media_type
 
ILIAS MediaCast InternalGUIService $gui
 
 $video_gui
 
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
 
GlobalHttpState $http
 
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
 
Refinery $refinery
 
ilFavouritesManager $favourites
 
CustomIconFactory $custom_icon_factory
 
UIFactory $ui_factory
 
UIRenderer $ui_renderer
 
Filesystem $temp_file_system
 
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 = []
 

Additional Inherited Members

- Data Fields inherited from ilObjectGUI
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
 
const SUPPORTED_IMPORT_MIME_TYPES = [MimeType::APPLICATION__ZIP, MimeType::APPLICATION__X_ZIP_COMPRESSED]
 

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

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

60 {
61 global $DIC;
62
63 $this->ctrl = $DIC->ctrl();
64 $this->lng = $DIC->language();
65 $this->user = $DIC->user();
66 $this->tabs = $DIC->tabs();
67 $this->tpl = $DIC["tpl"];
68 $this->access = $DIC->access();
69 $this->toolbar = $DIC->toolbar();
70 $this->filesystem = $DIC->filesystem()->web();
71 $this->log = $DIC["ilLog"];
72 $this->help = $DIC["ilHelp"];
73 $this->locator = $DIC["ilLocator"];
74 $ilCtrl = $DIC->ctrl();
75 $lng = $DIC->language();
76 $this->mc_request = $DIC->mediaCast()
77 ->internal()
78 ->gui()
79 ->standardRequest();
80
81 $this->type = "mcst";
82 parent::__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
83 $lng->loadLanguageModule("mcst");
84 $lng->loadLanguageModule("news");
86
87 $ilCtrl->saveParameter($this, "item_id");
88
90
91 if ($this->object) {
92 $this->mc_manager = $DIC->mediaCast()->internal()
93 ->domain()->mediaCast($this->object);
94 }
95 $this->gui = $DIC->mediaCast()->internal()->gui();
96 $this->media_type = $DIC->mediaObjects()->internal()->domain()->mediaType();
97 $this->video_gui = $DIC->mediaObjects()->internal()->gui()->video();
98 $this->mob_player_gui = $DIC->mediaObjects()->internal()->gui()->player();
99 }
loadLanguageModule(string $a_module)
Load language module.
ilSetting $settings
ilLanguage $lng
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26

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

1176 : void
1177 {
1178 global $DIC;
1179 $main_tpl = $DIC->ui()->mainTemplate();
1180
1181 $ilAccess = $DIC->access();
1182 $lng = $DIC->language();
1183 $ctrl = $DIC->ctrl();
1184
1185 if ($ilAccess->checkAccess("read", "", $a_target)) {
1186 $ctrl->setParameterByClass("ilobjmediacastgui", "ref_id", $a_target);
1187 //exit;
1188 $ctrl->redirectByClass(["ilmediacasthandlergui", "ilobjmediacastgui"], "showContent");
1189 } elseif ($ilAccess->checkAccess("visible", "", $a_target)) {
1190 ilObjectGUI::_gotoRepositoryNode($a_target, "infoScreen");
1191 } elseif ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID)) {
1192 $main_tpl->setOnScreenMessage('failure', sprintf(
1193 $lng->txt("msg_no_perm_read_item"),
1195 ));
1197 }
1198
1199 throw new ilPermissionException($lng->txt("msg_no_perm_read"));
1200 }
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)
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 348 of file class.ilObjMediaCastGUI.php.

348 : void
349 {
351
352 $this->checkPermission("write");
353
354 $this->initAddCastItemForm();
355 $tpl->setContent($this->form_gui->getHTML());
356 }
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 ILIAS\UICore\GlobalTemplate\setContent().

+ Here is the call graph for this function:

◆ addContentSubTabs()

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

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

1131 : void {
1132 $ilTabs = $this->tabs;
1133 $ilAccess = $this->access;
1134 $lng = $this->lng;
1135
1136 $ilTabs->addSubTab(
1137 "content",
1138 $lng->txt("view"),
1139 $this->ctrl->getLinkTarget($this, "showContent")
1140 );
1141
1142 if ($ilAccess->checkAccess("write", "", $this->requested_ref_id)) {
1143 $ilTabs->addSubTab(
1144 "manage",
1145 $lng->txt("mcst_manage"),
1146 $this->ctrl->getLinkTarget($this, "listItems")
1147 );
1148
1149 if ($this->object->getOrder() == ilObjMediaCast::ORDER_MANUAL) {
1150 $ilTabs->addSubTab(
1151 "sorting",
1152 $lng->txt("mcst_ordering"),
1153 $this->ctrl->getLinkTarget($this, "editOrder")
1154 );
1155 }
1156 }
1157
1158 $ilTabs->activateSubTab($a_active);
1159 $ilTabs->activateTab("content");
1160 }
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 1167 of file class.ilObjMediaCastGUI.php.

1167 : void
1168 {
1169 $ilLocator = $this->locator;
1170
1171 if (is_object($this->object)) {
1172 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this, "showContent"), "", $this->requested_ref_id);
1173 }
1174 }
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 1420 of file class.ilObjMediaCastGUI.php.

1425 : void {
1428
1429 $item_ids = [];
1430 foreach ($mob_ids as $mob_id) {
1431 $item_ids[] = $this->object->addMobToCast($mob_id, $user->getId(), $long_desc, $extract);
1432 }
1433
1434 if ($redirect) {
1435 if (count($item_ids) === 1) {
1436 $ctrl->setParameter($this, "item_id", $item_ids[0]);
1437 $ctrl->redirect($this, "editCastItem");
1438 }
1439 $ctrl->redirect($this, "listItems");
1440 }
1441 }
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
@inheritDoc
redirect(object $a_gui_obj, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false)
@inheritDoc

◆ afterPoolInsert()

ilObjMediaCastGUI::afterPoolInsert ( array  $mob_ids)
protected

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

1443 : void
1444 {
1445 $this->addMobsToCast($mob_ids, "", true, true);
1446 }
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 245 of file class.ilObjMediaCastGUI.php.

245 : void
246 {
247 // always send a message
248 $this->tpl->setOnScreenMessage('success', $this->lng->txt("object_added"), true);
249 ilUtil::redirect("ilias.php?baseClass=ilMediaCastHandlerGUI&ref_id=" . $new_object->getRefId() . "&cmd=editSettings");
250 }
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 1410 of file class.ilObjMediaCastGUI.php.

1410 : void
1411 {
1412 $this->addMobsToCast($mob_ids, "", false);
1413 }

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ afterUrlSaving()

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

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

1415 : void
1416 {
1417 $this->addMobsToCast([$mob_id], $long_desc);
1418 }

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ confirmDeletionItemsObject()

ilObjMediaCastGUI::confirmDeletionItemsObject ( )

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

899 : void
900 {
901 $ilCtrl = $this->ctrl;
904 $ilTabs = $this->tabs;
905
906 $this->checkPermission("write");
907 $ilTabs->activateTab("edit_content");
908
909 $ids = $this->mc_request->getItemIds();
910 if (count($ids) == 0) {
911 $this->listItemsObject();
912 return;
913 }
914
915 $c_gui = new ilConfirmationGUI();
916
917 // set confirm/cancel commands
918 $c_gui->setFormAction($ilCtrl->getFormAction($this, "deleteItems"));
919 $c_gui->setHeaderText($lng->txt("info_delete_sure"));
920 $c_gui->setCancel($lng->txt("cancel"), "listItems");
921 $c_gui->setConfirm($lng->txt("confirm"), "deleteItems");
922
923 // add items to delete
924 foreach ($ids as $item_id) {
925 $item = new ilNewsItem($item_id);
926 $c_gui->addItem(
927 "item_id[]",
928 $item_id,
929 $item->getTitle(),
930 ilUtil::getImagePath("standard/icon_mcst.svg")
931 );
932 }
933
934 $tpl->setContent($c_gui->getHTML());
935 }
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 $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)

References $lng, and ilUtil\getImagePath().

+ Here is the call graph for this function:

◆ confirmItemDeletionObject()

ilObjMediaCastGUI::confirmItemDeletionObject ( )

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

875 : void
876 {
877 $items = [];
878 $f = $this->gui->ui()->factory();
879 $r = $this->gui->ui()->renderer();
880 $ids = $this->mc_request->getItemIds();
881 if (current($ids) === 'ALL_OBJECTS') {
882 $arr = $this->object->getSortedItemsArray();
883 $ids = array_keys($arr);
884 }
885
886 foreach ($ids as $id) {
887 $item = new ilNewsItem($id);
888 $items[] = $f->modal()->interruptiveItem()->keyValue($id, "", $item->getTitle());
889 }
890 $this->gui->send($r->renderAsync([
891 $f->modal()->interruptive(
892 $this->lng->txt("mcst_confirm_deletion"),
893 $this->lng->txt("info_delete_sure"),
894 $this->ctrl->getFormAction($this, "deleteItems")
895 )->withAffectedItems($items)
896 ]));
897 }

References Vendor\Package\$f, and $id.

◆ createMediaItemForPurpose()

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

Handle media item for given purpose.

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

671 : string {
672 $mediaItem = new ilMediaItem();
673 $mob->addMediaItem($mediaItem);
674 $mediaItem->setPurpose($purpose);
675 return $this->updateMediaItem($mob, $mediaItem);
676 }
Class ilMediaItem Media Item, component of a media object (file or reference)
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 937 of file class.ilObjMediaCastGUI.php.

937 : void
938 {
939 $ilCtrl = $this->ctrl;
940
941 $this->checkPermission("write");
942
943 // delete all selected news items
944 $ids = $this->mc_request->getItemIds();
945 foreach ($ids as $item_id) {
946 $mc_item = new ilNewsItem($item_id);
947 $mc_item->delete();
948 }
949 $this->object->saveOrder(array_map(function ($i) {
950 return $i["id"];
951 }, $this->object->readItems()));
952 $ilCtrl->redirect($this, "listItems");
953 }

◆ determinePlaytimeObject()

ilObjMediaCastGUI::determinePlaytimeObject ( )

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

975 : void
976 {
977 $ilCtrl = $this->ctrl;
979
980 $mc_item = new ilNewsItem($this->mc_request->getItemId());
981 $mob = $mc_item->getMobId();
982 $mob = new ilObjMediaObject($mob);
983 $mob_dir = ilObjMediaObject::_getDirectory($mob->getId());
984 $m_item = $mob->getMediaItem("Standard");
985
986 $success = false;
987
988 $m_item->determineDuration();
989 $dur = $m_item->getDuration();
990 if ($dur > 0) {
991 $mc_item->setPlaytime($this->object->getPlaytimeForSeconds($dur));
992 $mc_item->update();
993 $success = true;
994 $this->tpl->setOnScreenMessage('success', $lng->txt("mcst_set_playtime"), true);
995 }
996
997 if (!$success) {
998 $this->tpl->setOnScreenMessage('failure', $lng->txt("mcst_unable_to_determin_playtime"), true);
999 }
1000
1001 $ilCtrl->redirect($this, "listItems");
1002 }
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 958 of file class.ilObjMediaCastGUI.php.

958 : void
959 {
960 $ilCtrl = $this->ctrl;
961 $ilUser = $this->user;
962
963 $this->checkPermission("read");
964 $news_item = new ilNewsItem($this->mc_request->getItemId());
965 $this->object->handleLPUpdate($ilUser->getId(), $news_item->getMobId());
966 if (!$news_item->deliverMobFile(
967 "Standard",
968 $this->mc_request->getPresentation()
969 )) {
970 $ilCtrl->redirect($this, "showContent");
971 }
972 exit;
973 }
exit

References exit.

◆ editCastItemObject()

ilObjMediaCastGUI::editCastItemObject ( )

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

358 : void
359 {
360 $item_id = $this->mc_request->getItemId();
361 $this->ctrl->setParameterByClass(self::class, "item_id", $item_id);
362
364 $ilToolbar = $this->toolbar;
365 $ilCtrl = $this->ctrl;
366
367 $this->checkPermission("write");
368
369 $this->mcst_item = new ilNewsItem(
370 $this->mc_request->getItemId()
371 );
372
373 // conversion toolbar
374 $this->video_gui->addPreviewExtractionToToolbar(
375 $this->mcst_item->getMobId(),
376 self::class
377 );
378
379 $this->initAddCastItemForm("edit");
380 $this->getCastItemValues($item_id);
381 $tpl->setContent($this->form_gui->getHTML());
382 }
getCastItemValues(int $item_id)
Get cast item values into form.
ilToolbarGUI $toolbar

References ilObjectGUI\$ctrl, ilObjectGUI\$toolbar, ilObjectGUI\$tpl, ilObjectGUI\checkPermission(), ILIAS\Repository\ctrl(), getCastItemValues(), initAddCastItemForm(), and ILIAS\UICore\GlobalTemplate\setContent().

+ Here is the call graph for this function:

◆ editObject()

ilObjMediaCastGUI::editObject ( )

Reimplemented from ilObjectGUI.

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

235 : void
236 {
237 if (!$this->checkPermissionBool("write")) {
238 $this->error->raiseError($this->lng->txt("msg_no_perm_write"), $this->error->MESSAGE);
239 }
240
241 $this->ctrl->redirectByClass(SettingsGUI::class, "");
242 }
error(string $a_errmsg)
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $ref_id=null)

References ilObjectGUI\checkPermissionBool(), ILIAS\Repository\ctrl(), error(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ editOrderObject()

ilObjMediaCastGUI::editOrderObject ( )
protected

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

1246 : void
1247 {
1248 $ilTabs = $this->tabs;
1249 $lng = $this->lng;
1250 $tpl = $this->tpl;
1251
1252 $this->checkPermission("write");
1253 $ilTabs->activateTab("edit_content");
1254
1255 $this->addContentSubTabs("sorting");
1256
1257 // sort by order setting
1258 switch ($this->object->getOrder()) {
1262 $this->listItemsObject();
1263 return;
1264
1266 // sub-tabs
1267 break;
1268 }
1269
1270 $table_gui = new ilMediaCastTableGUI($this, "editOrder", true);
1271
1272 $table_gui->setTitle($lng->txt("mcst_media_cast"));
1273 $table_gui->setData($this->object->getSortedItemsArray());
1274
1275 $table_gui->addCommandButton("saveOrder", $lng->txt("mcst_save_order"));
1276
1277 $tpl->setContent($table_gui->getHTML());
1278 }
TableGUI class for table NewsForContext.
addContentSubTabs(string $a_active="content")

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

1162 : void
1163 {
1164 $this->editObject();
1165 }

◆ executeCommand()

ilObjMediaCastGUI::executeCommand ( )

Reimplemented from ilObjectGUI.

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

101 : void
102 {
103 $ilUser = $this->user;
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 $this->ctrl->forwardCommand($creation);
141 break;
142
143 case "ilinfoscreengui":
144 if (!$this->checkPermissionBool("read")) {
145 $this->checkPermission("visible");
146 }
147 $this->infoScreen(); // forwards command
148 break;
149
150 case "ilexportgui":
151 // $this->prepareOutput();
152 $ilTabs->activateTab("export");
153 $exp_gui = new ilExportGUI($this);
154 $exp_gui->addFormat("xml");
155 $ret = $this->ctrl->forwardCommand($exp_gui);
156 // $this->tpl->show();
157 break;
158
159 case 'ilpermissiongui':
160 $ilTabs->activateTab("id_permissions");
161 $perm_gui = new ilPermissionGUI($this);
162 $ret = $this->ctrl->forwardCommand($perm_gui);
163 break;
164
165 case 'ilobjectcopygui':
166 $cp = new ilObjectCopyGUI($this);
167 $cp->setType('mcst');
168 $this->ctrl->forwardCommand($cp);
169 break;
170
171 case "ilcommonactiondispatchergui":
173 $this->ctrl->forwardCommand($gui);
174 break;
175
176 case "illearningprogressgui":
177 $ilTabs->activateTab('learning_progress');
178 $new_gui = new ilLearningProgressGUI(
180 $this->object->getRefId(),
181 $this->mc_request->getUserId() ?: $ilUser->getId()
182 );
183 $this->ctrl->forwardCommand($new_gui);
184 $this->tabs_gui->setTabActive('learning_progress');
185 break;
186
187 case "mcstimagegallerygui":
188 $view = new \McstImageGalleryGUI($this->object, $this->tpl, $this->getFeedLink());
189 $this->ctrl->forwardCommand($view);
190 break;
191
192 case "mcstpodcastgui":
193 $view = new \McstPodcastGUI($this->object, $this->tpl, $this->getFeedLink());
194 $this->ctrl->forwardCommand($view);
195 break;
196
197 case strtolower(ilCommentGUI::class):
198 $this->ctrl->forwardCommand($this->getCommentGUI());
199 break;
200
201 case strtolower(ilObjectMetaDataGUI::class):
202 $this->checkPermission("write");
203 $ilTabs->activateTab("meta_data");
204 $gui = new ilObjectMetaDataGUI($this->object);
205 $this->ctrl->forwardCommand($gui);
206 break;
207
208 case strtolower(SettingsGUI::class):
209 $this->checkPermission("write");
210 $ilTabs->activateTab("id_settings");
211 $gui = $this->gui->settings()->settingsGUI(
212 $this->object->getId(),
213 $this->object->getRefId()
214 );
215 $this->ctrl->forwardCommand($gui);
216 break;
217
218 default:
219 if (!$cmd) {
220 $cmd = "infoScreen";
221 }
222 $cmd .= "Object";
223 if ($cmd != "infoScreenObject") {
224 $this->checkPermission("read");
225 } else {
226 $this->checkPermission("visible");
227 }
228 $this->$cmd();
229
230 break;
231 }
232 $this->addHeaderAction();
233 }
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
Export User Interface Class.
Class ilObjUserTrackingGUI.
afterUrlSaving(int $mob_id, string $long_desc)
ILIAS MediaCast InternalGUIService $gui
GUI class for the workflow of copying objects.
addHeaderAction()
Add header action menu.
prepareOutput(bool $show_sub_objects=true)
Class ilObjectMetaDataGUI.

References $gui, $tabs, ilObjectGUI\$user, addContentSubTabs(), ilObjectGUI\addHeaderAction(), afterPoolInsert(), afterUpload(), afterUrlSaving(), ilObjectGUI\checkPermission(), ilObjectGUI\checkPermissionBool(), ILIAS\Repository\ctrl(), finishSingleUpload(), getCommentGUI(), 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 1372 of file class.ilObjMediaCastGUI.php.

1372 : void
1373 {
1374 $ilCtrl = $this->ctrl;
1375 $this->checkPermission("write");
1376 $this->mcst_item = new ilNewsItem($this->mc_request->getItemId());
1377 $this->video_gui->handleExtractionRequest(
1378 $this->mcst_item->getMobId()
1379 );
1380 $ilCtrl->redirect($this, "editCastItem");
1381 }

◆ finishSingleUpload()

ilObjMediaCastGUI::finishSingleUpload ( int  $mob_id)

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

384 : void
385 {
386 foreach ($this->object->getSortedItemsArray() as $item) {
387 if ($mob_id == $item["mob_id"]) {
388 $this->ctrl->setParameter($this, "item_id", $item["id"]);
389 $this->ctrl->redirect($this, "editCastItem");
390 }
391 }
392 $this->ctrl->redirect($this, "listItems");
393 }

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 ( int  $item_id)

Get cast item values into form.

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

519 : void
520 {
522
523 // get mob
524 $this->mcst_item = new ilNewsItem(
525 $item_id
526 );
527 $mob = new ilObjMediaObject($this->mcst_item->getMobId());
528
529 $values = array();
530 $mediaItems = $this->getMediaItems(
531 $this->mc_request->getItemId()
532 );
533 if (count($mediaItems) > 0) {
534 foreach ($mediaItems as $med) {
535 if (!isset($values["title"])) {
536 // first item, so set title, description, ...
537 $values["title"] = $this->mcst_item->getTitle();
538 $values["description"] = $this->mcst_item->getContent();
539 $values["visibility"] = $this->mcst_item->getVisibility();
540 $length = explode(":", $this->mcst_item->getPlaytime());
541 $values["duration"] = array("hh" => $length[0], "mm" => $length[1], "ss" => $length[2]);
542 }
543
544 $values["value_" . $med->getPurpose()] = (strlen($med->getLocation()) > 100) ? "..." . substr($med->getLocation(), strlen($med->getLocation()) - 100) : $med->getLocation();
545 $values["label_value_" . $med->getPurpose()] = (strlen($med->getLocation()) > 100) ? "..." . substr($med->getLocation(), strlen($med->getLocation()) - 100) : $med->getLocation();
546 $values["mimetype_" . $med->getPurpose()] = $med->getFormat();
547 }
548 }
549 foreach (ilObjMediaCast::$purposes as $purpose) {
550 if (!isset($values["value_" . $purpose])) {
551 $values["label_value_" . $purpose] = $lng->txt("none");
552 $values["value_" . $purpose] = $lng->txt("none");
553 }
554 }
555 $this->form_gui->setValuesByArray($values);
556 }
static array $purposes

References 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:

◆ getCommentGUI()

ilObjMediaCastGUI::getCommentGUI ( )
protected

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

1457 : ilCommentGUI
1458 {
1459 return $this->gui->comments()->commentGUI(
1460 $this->object->getRefId(),
1461 $this->mc_request->getItemId()
1462 );
1463 }

References ILIAS\Repository\object().

Referenced by executeCommand().

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

644 : string
645 {
646 $duration = isset($this->form_gui)
647 ? $this->form_gui->getInput("duration")
648 : array("hh" => 0, "mm" => 0, "ss" => 0);
649
650 $duration_str = str_pad($duration["hh"], 2, "0", STR_PAD_LEFT) . ":" .
651 str_pad($duration["mm"], 2, "0", STR_PAD_LEFT) . ":" .
652 str_pad($duration["ss"], 2, "0", STR_PAD_LEFT);
653
654 if ($duration["hh"] == 0 && $duration["mm"] == 0 && $duration["ss"] == 0) {
655 $media_item->determineDuration();
656 $d = $media_item->getDuration();
657 if ($d > 0) {
658 $duration_str = $this->object->getPlaytimeForSeconds($d);
659 }
660 }
661
662 return $duration_str;
663 }
$duration

References Vendor\Package\$d, $duration, 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 325 of file class.ilObjMediaCastGUI.php.

325 : string
326 {
327 $public_feed = ilBlockSetting::_lookup(
328 "news",
329 "public_feed",
330 0,
331 $this->object->getId()
332 );
333 $url = "";
334 // rss icon/link
335 if ($public_feed) {
336 $news_set = new ilSetting("news");
337 $enable_internal_rss = $news_set->get("enable_rss_for_internal");
338 if ($enable_internal_rss) {
339 $url = ILIAS_HTTP_PATH . "/feed.php?client_id=" . rawurlencode(CLIENT_ID) . "&" . "ref_id=" . $this->requested_ref_id;
340 }
341 }
342 return $url;
343 }
static _lookup(string $a_type, string $a_setting, int $a_user=0, int $a_block_id=0)
Lookup setting from database.
ILIAS Setting Class.
const CLIENT_ID
Definition: constants.php:41
$url
Definition: shib_logout.php:68

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:

◆ getManageTableGUI()

ilObjMediaCastGUI::getManageTableGUI ( )
protected

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

321 {
322 return $this->gui->getMediaCastManageTableGUI($this, "tableCommand");
323 }

Referenced by listItemsObject(), and tableCommandObject().

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

1210 : ilMediaItem
1211 {
1212 $this->mcst_item = new ilNewsItem($id);
1213 // create dummy object in db (we need an id)
1214 $mob = new ilObjMediaObject($this->mcst_item->getMobId());
1215 return $mob->getMediaItem("Standard");
1216 }

References $id, and ilObjMediaObject\getMediaItem().

+ Here is the call graph for this function:

◆ getMediaItems()

ilObjMediaCastGUI::getMediaItems ( int  $id)
protected

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

1218 : array
1219 {
1220 $this->mcst_item = new ilNewsItem($id);
1221 // create dummy object in db (we need an id)
1222 $mob = new ilObjMediaObject($this->mcst_item->getMobId());
1223 return $mob->getMediaItems();
1224 }

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

1448 : void
1449 {
1450 $this->user->writePref(
1451 "mcst_autoplay",
1452 $this->mc_request->getAutoplay()
1453 );
1454 exit;
1455 }

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

+ Here is the call graph for this function:

◆ handlePlayerCompletedEventObject()

ilObjMediaCastGUI::handlePlayerCompletedEventObject ( )
protected

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

1400 : void
1401 {
1402 $mob_id = $this->mc_request->getMobId();
1403 if ($mob_id > 0) {
1404 $ilUser = $this->user;
1405 $this->object->handleLPUpdate($ilUser->getId(), $mob_id);
1406 }
1407 exit;
1408 }

References exit.

◆ handlePlayerEventObject()

ilObjMediaCastGUI::handlePlayerEventObject ( )

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

1383 : void
1384 {
1385 if ($this->mc_request->getEvent() === "play") {
1386 $player = explode("_", $this->mc_request->getPlayer());
1387 $news_id = (int) $player[1];
1388 $item = new ilNewsItem($news_id);
1389 $item->increasePlayCounter();
1390
1391 $mob_id = $item->getMobId();
1392 if ($mob_id) {
1393 $ilUser = $this->user;
1394 $this->object->handleLPUpdate($ilUser->getId(), $mob_id);
1395 }
1396 }
1397 exit;
1398 }

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

+ Here is the call graph for this function:

◆ infoScreen()

ilObjMediaCastGUI::infoScreen ( )

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

1015 : void
1016 {
1017 $ilTabs = $this->tabs;
1018
1019 $ilTabs->activateTab("id_info");
1020
1021 if (!$this->checkPermissionBool("read")) {
1022 $this->checkPermission("visible");
1023 }
1024
1025 $info = new ilInfoScreenGUI($this);
1026
1027 $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
1028 $info->enablePrivateNotes();
1029
1030 // general information
1031 $this->lng->loadLanguageModule("meta");
1032 $this->lng->loadLanguageModule("mcst");
1033 $med_items = $this->object->getItemsArray();
1034 $info->addSection($this->lng->txt("meta_general"));
1035 $info->addProperty(
1036 $this->lng->txt("mcst_nr_items"),
1037 count($med_items)
1038 );
1039
1040 if (count($med_items) > 0) {
1041 $cur = current($med_items);
1042 $last = ilDatePresentation::formatDate(new ilDateTime($cur["creation_date"], IL_CAL_DATETIME));
1043 } else {
1044 $last = "-";
1045 }
1046
1047 $info->addProperty($this->lng->txt("mcst_last_submission"), $last);
1048
1049 // forward the command
1050 $this->ctrl->forwardCommand($info);
1051 }
const IL_CAL_DATETIME
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
@classDescription Date and time handling
Class ilInfoScreenGUI.
activateTab(string $a_id)
$info
Definition: entry_point.php:21

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

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

1007 : void
1008 {
1009 if (!$this->checkPermissionBool("read")) {
1010 $this->checkPermission("visible");
1011 }
1012 $this->ctrl->redirectByClass(ilInfoScreenGUI::class, "showSummary");
1013 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ initAddCastItemForm()

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

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

408 : void
409 {
411 $ilCtrl = $this->ctrl;
412 $ilTabs = $this->tabs;
413
414 $this->checkPermission("write");
415 $ilTabs->activateTab("edit_content");
416
417 $lng->loadLanguageModule("mcst");
418
419 $news_set = new ilSetting("news");
420 $enable_internal_rss = $news_set->get("enable_rss_for_internal");
421
422 $this->form_gui = new ilPropertyFormGUI();
423 $this->form_gui->setMultipart(true);
424
425 // Property Title
426 $text_input = new ilTextInputGUI($lng->txt("title"), "title");
427 $text_input->setMaxLength(200);
428 $this->form_gui->addItem($text_input);
429
430 // Property Content
431 $text_area = new ilTextAreaInputGUI($lng->txt("description"), "description");
432 $text_area->setRequired(false);
433 $this->form_gui->addItem($text_area);
434
435 // Property Visibility
436 if ($enable_internal_rss) {
437 $radio_group = new ilRadioGroupInputGUI($lng->txt("access_scope"), "visibility");
438 $radio_option = new ilRadioOption($lng->txt("access_users"), "users");
439 $radio_group->addOption($radio_option);
440 $radio_option = new ilRadioOption($lng->txt("access_public"), "public");
441 $radio_group->addOption($radio_option);
442 $radio_group->setInfo($lng->txt("mcst_visibility_info"));
443 $radio_group->setRequired(true);
444 $radio_group->setValue($this->object->getDefaultAccess() == 0 ? "users" : "public");
445 $this->form_gui->addItem($radio_group);
446 }
447
448 // Duration
449 if ($this->getObject()->getViewMode() !== ilObjMediaCast::VIEW_IMG_GALLERY) {
450 $dur = new ilDurationInputGUI($lng->txt("mcst_duration"), "duration");
451 $dur->setInfo($lng->txt("mcst_duration_info"));
452 $dur->setShowDays(false);
453 $dur->setShowHours(true);
454 $dur->setShowSeconds(true);
455 $this->form_gui->addItem($dur);
456 }
457
458 foreach (ilObjMediaCast::$purposes as $purpose) {
459 if ($purpose == "VideoAlternative" &&
460 $a_mode == "create") {
461 continue;
462 }
463
464 $section = new ilFormSectionHeaderGUI();
465 $section->setTitle($lng->txt("mcst_" . strtolower($purpose) . "_title"));
466 $this->form_gui->addItem($section);
467 if ($a_mode != "create") {
468 $value = new ilHiddenInputGUI("value_" . $purpose);
469 $label = new ilNonEditableValueGUI($lng->txt("value"));
470 $label->setPostVar("label_value_" . $purpose);
471 $label->setInfo($lng->txt("mcst_current_value_info"));
472 $this->form_gui->addItem($label);
473 $this->form_gui->addItem($value);
474 }
475 $file = new ilFileInputGUI($lng->txt("file"), "file_" . $purpose);
476 $file->setSuffixes($this->mc_manager->getSuffixesForViewMode(
477 $this->object->getViewMode()
478 ));
479 $this->form_gui->addItem($file);
480 $text_input = new ilRegExpInputGUI($lng->txt("url"), "url_" . $purpose);
481 $text_input->setPattern("/https?\:\/\/.+/i");
482 $text_input->setInfo($lng->txt("mcst_reference_info"));
483 $this->form_gui->addItem($text_input);
484 if ($purpose != "Standard") {
485 $clearCheckBox = new ilCheckboxInputGUI();
486 $clearCheckBox->setPostVar("delete_" . $purpose);
487 $clearCheckBox->setTitle($lng->txt("mcst_clear_purpose_title"));
488 $this->form_gui->addItem($clearCheckBox);
489 } else {
490 //
491 $ne = new ilNonEditableValueGUI($lng->txt("mcst_mimetype"), "mimetype_" . $purpose);
492 $this->form_gui->addItem($ne);
493
494 // preview picure
495 $mob_id = 0;
496 if ($a_mode !== "create") {
497 $mcst_item = new ilNewsItem($this->mc_request->getItemId());
498 $mob_id = $mcst_item->getMobId();
499 }
500 $this->video_gui->addPreviewInput($this->form_gui, $mob_id);
501 }
502 }
503
504 // save/cancel button
505 if ($a_mode == "create") {
506 $this->form_gui->setTitle($lng->txt("mcst_add_new_item"));
507 $this->form_gui->addCommandButton("saveCastItem", $lng->txt("save"));
508 } else {
509 $this->form_gui->setTitle($lng->txt("mcst_edit_item"));
510 $this->form_gui->addCommandButton("updateCastItem", $lng->txt("save"));
511 }
512 $this->form_gui->addCommandButton("listItems", $lng->txt("cancel"));
513 $this->form_gui->setFormAction($ilCtrl->getFormAction($this, "saveCastItem"));
514 }
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 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 text area property in a property form.
This class represents a text property in a property form.

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

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

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

◆ isAudio()

static ilObjMediaCastGUI::isAudio ( string  $extension)
staticprotected

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

1202 : bool
1203 {
1204 return strpos($extension, "audio") !== false;
1205 }

◆ listItemsObject()

ilObjMediaCastGUI::listItemsObject ( bool  $a_presentation_mode = false)

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

252 : void
253 {
256 $ilAccess = $this->access;
257 $ilToolbar = $this->toolbar;
258
259 $this->checkPermission("write");
260
261 if ($a_presentation_mode) {
262 $this->tpl->setOnScreenMessage('info', $this->lng->txt("mcst_view_abandoned"));
263 return;
264 }
265
266 if ($a_presentation_mode) {
267 $this->addContentSubTabs("content");
268 } else {
269 $this->addContentSubTabs("manage");
270 }
271
272 $med_items = $this->object->getSortedItemsArray();
273
274 if ($a_presentation_mode) {
275 $table_gui = new ilMediaCastTableGUI($this, "showContent", false, true);
276 } else {
277 $table_gui = new ilMediaCastTableGUI($this, "listItems");
278 }
279
280 $table_gui->setData($med_items);
281
282 if ($ilAccess->checkAccess("write", "", $this->requested_ref_id) && !$a_presentation_mode) {
283 if (in_array($this->object->getViewMode(), [
287 ], true)) {
288 $ilToolbar->addButton($lng->txt("add"), $this->ctrl->getLinkTargetByClass("ilMediaCreationGUI", ""));
289 } else {
290 $ilToolbar->addButton($lng->txt("add"), $this->ctrl->getLinkTarget($this, "addCastItem"));
291 }
292
293 $table_gui->addMultiCommand("confirmDeletionItems", $lng->txt("delete"));
294 $table_gui->setSelectAllCheckbox("item_id");
295 }
296
297 $new_table = $this->getManageTableGUI();
298
299 $script = <<<EOT
300<script>
301 window.addEventListener('load', (event) => {
302 $(document).on('hidden.bs.modal', (e) => {
303 $('.modal-body').html('');
304 });
305 $(document).on('shown.bs.modal', (e) => {
306 window.dispatchEvent(new Event('resize'));
307 });
308 });
309</script>
310EOT;
311 $tpl->setContent($this->gui->ui()->renderer()->render($new_table->get()) . $script);
312 }

References ilObjectGUI\$access, ilObjectGUI\$lng, ilObjectGUI\$toolbar, ilObjectGUI\$tpl, addContentSubTabs(), ilObjectGUI\checkPermission(), ILIAS\Repository\event(), getManageTableGUI(), ILIAS\Repository\lng(), ILIAS\Repository\object(), ILIAS\UICore\GlobalTemplate\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 395 of file class.ilObjMediaCastGUI.php.

395 : void
396 {
397 foreach ($this->object->getSortedItemsArray() as $item) {
398 if ($mob_id == $item["mob_id"]) {
399 $mob = new ilObjMediaObject($item["mob_id"]);
400 $mc_item = new ilNewsItem($item["id"]);
401 $mc_item->setTitle($mob->getTitle());
402 $mc_item->setContent($mob->getLongDescription());
403 $mc_item->update();
404 }
405 }
406 }

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

1226 : void
1227 {
1228 $tpl = $this->tpl;
1229 $this->form_gui->setValuesByPost();
1230
1231 //issue: we have to display the current settings
1232 // problem: POST does not contain values of disabled text fields
1233 // solution: use hidden field and label to display-> here we need to synchronize the labels
1234 // with the values from the hidden fields.
1235 foreach (ilObjMediaCast::$purposes as $purpose) {
1236 if ($this->form_gui->getInput("value_" . $purpose)) {
1237 $input = $this->form_gui->getItemByPostVar("label_value_" . $purpose);
1238 $input->setValue($this->form_gui->getInput("value_" . $purpose));
1239 }
1240 }
1241
1242 $this->form_gui->setValuesByPost();
1243 $tpl->setContent($this->form_gui->getHTML());
1244 }

References ilObjMediaCast\$purposes.

Referenced by saveCastItemObject().

+ Here is the caller graph for this function:

◆ renderVideoObject()

ilObjMediaCastGUI::renderVideoObject ( )
protected

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

1471 : void
1472 {
1473 $mob_id = $this->mc_request->getMobId();
1474 $html = $this->mob_player_gui->wrapper()->renderComponent(new ilObjMediaObject($mob_id));
1475 $this->gui->httpUtil()->sendString($html);
1476 }

◆ saveCastItemObject()

ilObjMediaCastGUI::saveCastItemObject ( )

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

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

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

1280 : void
1281 {
1282 $lng = $this->lng;
1283
1284 $ids = $this->mc_request->getItemIds();
1285 asort($ids);
1286
1287 $items = array();
1288 foreach (array_keys($ids) as $id) {
1289 $items[] = $id;
1290 }
1291 $this->object->saveOrder($items);
1292
1293 $this->tpl->setOnScreenMessage('success', $lng->txt("settings_saved"), true);
1294 $this->ctrl->redirect($this, "editOrder");
1295 }

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

+ Here is the call graph for this function:

◆ setTabs()

ilObjMediaCastGUI::setTabs ( )
protected

set admin tabs

Reimplemented from ilObjectGUI.

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

1053 : void
1054 {
1055 $ilAccess = $this->access;
1056 $ilTabs = $this->tabs;
1057 $lng = $this->lng;
1058 $ilHelp = $this->help;
1059
1060 $ilHelp->setScreenIdComponent("mcst");
1061
1062 // list items
1063 if ($ilAccess->checkAccess('read', "", $this->object->getRefId())) {
1064 $ilTabs->addTab(
1065 "content",
1066 $lng->txt("content"),
1067 $this->ctrl->getLinkTarget($this, "showContent")
1068 );
1069 }
1070
1071 // info screen
1072 if ($ilAccess->checkAccess('visible', "", $this->object->getRefId()) ||
1073 $ilAccess->checkAccess('read', "", $this->object->getRefId())) {
1074 $ilTabs->addTab(
1075 "id_info",
1076 $lng->txt("info_short"),
1077 $this->ctrl->getLinkTargetByClass("ilinfoscreengui", "showSummary")
1078 );
1079 }
1080
1081 // settings
1082 if ($ilAccess->checkAccess('write', "", $this->object->getRefId())) {
1083 $ilTabs->addTab(
1084 "id_settings",
1085 $lng->txt("settings"),
1086 $this->ctrl->getLinkTargetByClass(SettingsGUI::class, "")
1087 );
1088 }
1089
1090 if (ilLearningProgressAccess::checkAccess($this->object->getRefId())) {
1091 $ilTabs->addTab(
1092 'learning_progress',
1093 $lng->txt('learning_progress'),
1094 $this->ctrl->getLinkTargetByClass(array(__CLASS__, 'illearningprogressgui'), '')
1095 );
1096 }
1097
1098 if ($ilAccess->checkAccess("write", "", $this->object->getRefId())) {
1099 $mdgui = new ilObjectMetaDataGUI($this->object);
1100 $mdtab = $mdgui->getTab();
1101 if ($mdtab) {
1102 $this->tabs_gui->addTab(
1103 "meta_data",
1104 $this->lng->txt("meta_data"),
1105 $mdtab
1106 );
1107 }
1108 }
1109
1110 // export
1111 if ($ilAccess->checkAccess("write", "", $this->object->getRefId())) {
1112 $ilTabs->addTab(
1113 "export",
1114 $lng->txt("export"),
1115 $this->ctrl->getLinkTargetByClass("ilexportgui", "")
1116 );
1117 }
1118
1119 // edit permissions
1120 if ($ilAccess->checkAccess('edit_permission', "", $this->object->getRefId())) {
1121 $ilTabs->addTab(
1122 "id_permissions",
1123 $lng->txt("perm_settings"),
1124 $this->ctrl->getLinkTargetByClass("ilpermissiongui", "perm")
1125 );
1126 }
1127 }
setScreenIdComponent(string $a_comp)
static checkAccess(int $a_ref_id, bool $a_allow_only_read=true)
check access to learning progress

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

+ Here is the call graph for this function:

◆ showCastItemObject()

ilObjMediaCastGUI::showCastItemObject ( )

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

847 : void
848 {
849 $f = $this->gui->ui()->factory();
850 $item_id = $this->mc_request->getItemId();
851 $news = new ilNewsItem($item_id);
852 $mob = new ilObjMediaObject($news->getMobId());
853 $med = $mob->getMediaItem("Standard");
854 $comp = null;
855 if ($med) {
856 $file = $mob->getStandardSrc();
857 if ($this->media_type->isAudio($med->getFormat())) {
858 $comp = $f->player()->audio($file, "");
859 } elseif ($this->media_type->isVideo($med->getFormat())) {
860 $comp = $f->player()->video($file);
861 } elseif ($this->media_type->isImage($med->getFormat())) {
862 $comp = $f->image()->responsive($file, $mob->getTitle());
863 }
864
865 }
866 if (is_null($comp)) {
867 $comp = $f->messageBox()->info($this->lng->txt("mcst_item_not_found"));
868 }
869 $this->gui->modal(
870 $this->lng->txt("mcst_preview"),
871 $this->lng->txt("close")
872 )->content([$comp])->send();
873 }

References Vendor\Package\$f, ilObjMediaObject\getMediaItem(), ilObjMediaObject\getStandardSrc(), ilObject\getTitle(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ showCommentsObject()

ilObjMediaCastGUI::showCommentsObject ( )
protected

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

1465 : void
1466 {
1467 echo $this->getCommentGUI()->getListHTML() . "<script>ilNotes.init(null);</script>";
1468 exit;
1469 }

References exit.

◆ showContentObject()

ilObjMediaCastGUI::showContentObject ( )

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

1301 : void
1302 {
1303 $tpl = $this->tpl;
1304 $ilUser = $this->user;
1305 $ilTabs = $this->tabs;
1306
1307 // need read events for parent for LP statistics
1309 "mcst",
1310 $this->object->getRefId(),
1311 $this->object->getId(),
1312 $ilUser->getId()
1313 );
1314
1315 // trigger LP update
1316 ilLPStatusWrapper::_updateStatus($this->object->getId(), $ilUser->getId());
1317
1318 if ($this->object->getViewMode() == ilObjMediaCast::VIEW_GALLERY) {
1319 $this->showGallery();
1320 } elseif ($this->object->getViewMode() == ilObjMediaCast::VIEW_IMG_GALLERY) {
1321 $view = new \McstImageGalleryGUI($this->object, $this->tpl, $this->getFeedLink());
1322 $view->setCompletedCallback($this->ctrl->getLinkTarget(
1323 $this,
1324 "handlePlayerCompletedEvent",
1325 "",
1326 true,
1327 false
1328 ));
1329 $this->tabs->activateTab("content");
1330 $this->addContentSubTabs("content");
1331 $tpl->setContent($this->ctrl->getHTML($view));
1332 } elseif ($this->object->getViewMode() == ilObjMediaCast::VIEW_PODCAST) {
1333 $view = new \McstPodcastGUI($this->object, $this->tpl, $this->getFeedLink());
1334 $this->tabs->activateTab("content");
1335 $this->addContentSubTabs("content");
1336 $tpl->setContent($this->ctrl->getHTML($view));
1337 } elseif ($this->object->getViewMode() == ilObjMediaCast::VIEW_VCAST) {
1338 $ilTabs->activateTab("content");
1339 $this->addContentSubTabs("content");
1340 $view = new \ILIAS\MediaCast\Presentation\VideoViewGUI($this->object, $tpl, $this->getFeedLink());
1341 $view->setCompletedCallback($this->ctrl->getLinkTarget(
1342 $this,
1343 "handlePlayerCompletedEvent",
1344 "",
1345 true,
1346 false
1347 ));
1348 $view->setAutoplayCallback($this->ctrl->getLinkTarget(
1349 $this,
1350 "handleAutoplayTrigger",
1351 "",
1352 true,
1353 false
1354 ));
1355 $view->show();
1356 } else {
1357 $this->listItemsObject(true);
1358 }
1359
1360 $tpl->setPermanentLink($this->object->getType(), $this->object->getRefId());
1361 }
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 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 1363 of file class.ilObjMediaCastGUI.php.

1363 : void
1364 {
1365 $tpl = $this->tpl;
1366 $ilTabs = $this->tabs;
1367 $ilCtrl = $this->ctrl;
1368
1369 $this->tpl->setOnScreenMessage('info', $this->lng->txt("mcst_view_abandoned"));
1370 }

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ tableCommandObject()

ilObjMediaCastGUI::tableCommandObject ( )

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

314 : void
315 {
316 $new_table = $this->getManageTableGUI();
317 $new_table->handleCommand();
318 }

References getManageTableGUI().

+ Here is the call graph for this function:

◆ updateCastItemObject()

ilObjMediaCastGUI::updateCastItemObject ( )

Update cast item.

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

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

References $duration, $log, ilObjMediaCast\$purposes, ilObject\getId(), ilObjMediaObject\getMediaItem(), ILIAS\Repository\int(), ilObjMediaObject\removeMediaItem(), ilObject\setDescription(), ilObject\setTitle(), ilObjMediaObject\update(), and ilObjMediaCast\VIEW_IMG_GALLERY.

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

688 : string {
689 $locationType = "";
690 $location = "";
691 $file = "";
692 $purpose = $mediaItem->getPurpose();
693 $locationType = $mediaItem->getLocationType();
694 $url_gui = $this->form_gui->getInput("url_" . $purpose);
695 $file_gui = $this->form_gui->getInput("file_" . $purpose);
696 if ($url_gui) {
697 // http
698 $file = $this->form_gui->getInput("url_" . $purpose);
699 $title = basename($file);
700 $location = $this->form_gui->getInput("url_" . $purpose);
701 $locationType = "Reference";
702 } elseif ($file_gui["size"] > 0) {
703 // lokal
704 // determine and create mob directory, move uploaded file to directory
705 $mob_dir = ilObjMediaObject::_getDirectory($mob->getId());
706 if (!is_dir($mob_dir)) {
707 $mob->createDirectory();
708 } else {
709 $dir = LegacyPathHelper::createRelativePath($mob_dir);
710 $old_files = $this->filesystem->finder()->in([$dir])->exclude([$dir . '/mob_vpreview.png'])->files();
711 foreach ($old_files as $file) {
712 $this->filesystem->delete($file->getPath());
713 }
714 }
715
716 $file_name = ilFileUtils::getASCIIFilename($_FILES['file_' . $purpose]['name']);
717 $file_name = str_replace(" ", "_", $file_name);
718
719 $file = $mob_dir . "/" . $file_name;
720 $title = $file_name;
721 $locationType = "LocalFile";
722 $location = $title;
723 ilFileUtils::moveUploadedFile($_FILES['file_' . $purpose]['tmp_name'], $file_name, $file);
725 }
726
727 // check if not automatic mimetype detection
728 $format = ilObjMediaObject::getMimeType($mediaItem->getLocation(), ($locationType === "Reference"));
729 $mediaItem->setFormat($format);
730
731 if ($file != "") {
732 // get mime type, if not already set!
733 if ($format === "") {
734 $format = ilObjMediaObject::getMimeType($file, ($locationType === "Reference"));
735 }
736
737 // set real meta and object data
738 $mediaItem->setFormat($format);
739 $mediaItem->setLocation($location);
740 $mediaItem->setLocationType($locationType);
741 $mediaItem->setHAlign("Left");
742 $mediaItem->setHeight(self::isAudio($format) ? 0 : 180);
743 $mob->generatePreviewPic(320, 240);
744 }
745
746 if (($purpose === "Standard") && isset($title)) {
747 $mob->setTitle($title);
748 }
749
750 return $file;
751 }
$location
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)

References $location.

Field Documentation

◆ $additionalPurposes

array ilObjMediaCastGUI::$additionalPurposes = []
private

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

◆ $filesystem

FileSystem ilObjMediaCastGUI::$filesystem
protected

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

◆ $form_gui

ilPropertyFormGUI ilObjMediaCastGUI::$form_gui
protected

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

◆ $gui

ILIAS MediaCast InternalGUIService ilObjMediaCastGUI::$gui
protected

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

Referenced by executeCommand().

◆ $help

ilHelpGUI ilObjMediaCastGUI::$help
protected

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

◆ $log

ilLogger ilObjMediaCastGUI::$log
protected

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

◆ $mc_manager

ILIAS MediaCast MediaCastManager ilObjMediaCastGUI::$mc_manager
protected

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

◆ $mc_request

StandardGUIRequest ilObjMediaCastGUI::$mc_request
protected

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

◆ $mcst_item

ilNewsItem ilObjMediaCastGUI::$mcst_item
protected

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

Referenced by initAddCastItemForm().

◆ $media_type

ILIAS MediaObjects MediaType MediaTypeManager ilObjMediaCastGUI::$media_type
protected

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

◆ $mob_player_gui

ILIAS MediaObjects Player GUIService ilObjMediaCastGUI::$mob_player_gui
protected

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

◆ $tabs

ilTabsGUI ilObjMediaCastGUI::$tabs
protected

◆ $video_gui

ilObjMediaCastGUI::$video_gui
protected

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


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