ILIAS  trunk Revision v12.0_alpha-1221-g4e438232683
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)
 
 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 MediaObjectManager $mob_manager
 
ILIAS MediaObjects Player GUIService $mob_player_gui
 
ILIAS MediaObjects MediaType MediaTypeManager $media_type
 
ILIAS MediaCast InternalGUIService $gui
 
ILIAS MediaObjects Video GUIService $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 56 of file class.ilObjMediaCastGUI.php.

61 {
62 global $DIC;
63
64 $this->ctrl = $DIC->ctrl();
65 $this->lng = $DIC->language();
66 $this->user = $DIC->user();
67 $this->tabs = $DIC->tabs();
68 $this->tpl = $DIC["tpl"];
69 $this->access = $DIC->access();
70 $this->toolbar = $DIC->toolbar();
71 $this->filesystem = $DIC->filesystem()->web();
72 $this->log = $DIC["ilLog"];
73 $this->help = $DIC["ilHelp"];
74 $this->locator = $DIC["ilLocator"];
75 $ilCtrl = $DIC->ctrl();
76 $lng = $DIC->language();
77 $this->mc_request = $DIC->mediaCast()
78 ->internal()
79 ->gui()
80 ->standardRequest();
81
82 $this->type = "mcst";
83 parent::__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
84 $lng->loadLanguageModule("mcst");
85 $lng->loadLanguageModule("news");
87
88 $ilCtrl->saveParameter($this, "item_id");
89
91
92 if ($this->object) {
93 $this->mc_manager = $DIC->mediaCast()->internal()
94 ->domain()->mediaCast($this->object);
95 }
96 $this->gui = $DIC->mediaCast()->internal()->gui();
97 $this->media_type = $DIC->mediaObjects()->internal()->domain()->mediaType();
98 $this->video_gui = $DIC->mediaObjects()->internal()->gui()->video();
99 $this->mob_player_gui = $DIC->mediaObjects()->internal()->gui()->player();
100 $this->mob_manager = $DIC->mediaObjects()->internal()->domain()->mediaObject();
101 }
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 1165 of file class.ilObjMediaCastGUI.php.

1165 : void
1166 {
1167 global $DIC;
1168 $main_tpl = $DIC->ui()->mainTemplate();
1169
1170 $ilAccess = $DIC->access();
1171 $lng = $DIC->language();
1172 $ctrl = $DIC->ctrl();
1173
1174 if ($ilAccess->checkAccess("read", "", $a_target)) {
1175 $ctrl->setParameterByClass("ilobjmediacastgui", "ref_id", $a_target);
1176 //exit;
1177 $ctrl->redirectByClass(["ilmediacasthandlergui", "ilobjmediacastgui"], "showContent");
1178 } elseif ($ilAccess->checkAccess("visible", "", $a_target)) {
1179 ilObjectGUI::_gotoRepositoryNode($a_target, "infoScreen");
1180 } elseif ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID)) {
1181 $main_tpl->setOnScreenMessage('failure', sprintf(
1182 $lng->txt("msg_no_perm_read_item"),
1184 ));
1186 }
1187
1188 throw new ilPermissionException($lng->txt("msg_no_perm_read"));
1189 }
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 350 of file class.ilObjMediaCastGUI.php.

350 : void
351 {
353
354 $this->checkPermission("write");
355
356 $this->initAddCastItemForm();
357 $tpl->setContent($this->form_gui->getHTML());
358 }
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 1118 of file class.ilObjMediaCastGUI.php.

1120 : void {
1121 $ilTabs = $this->tabs;
1122 $ilAccess = $this->access;
1123 $lng = $this->lng;
1124
1125 $ilTabs->addSubTab(
1126 "content",
1127 $lng->txt("view"),
1128 $this->ctrl->getLinkTarget($this, "showContent")
1129 );
1130
1131 if ($ilAccess->checkAccess("write", "", $this->requested_ref_id)) {
1132 $ilTabs->addSubTab(
1133 "manage",
1134 $lng->txt("mcst_manage"),
1135 $this->ctrl->getLinkTarget($this, "listItems")
1136 );
1137
1138 if ($this->object->getOrder() == ilObjMediaCast::ORDER_MANUAL) {
1139 $ilTabs->addSubTab(
1140 "sorting",
1141 $lng->txt("mcst_ordering"),
1142 $this->ctrl->getLinkTarget($this, "editOrder")
1143 );
1144 }
1145 }
1146
1147 $ilTabs->activateSubTab($a_active);
1148 $ilTabs->activateTab("content");
1149 }
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 1156 of file class.ilObjMediaCastGUI.php.

1156 : void
1157 {
1158 $ilLocator = $this->locator;
1159
1160 if (is_object($this->object)) {
1161 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this, "showContent"), "", $this->requested_ref_id);
1162 }
1163 }
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 1402 of file class.ilObjMediaCastGUI.php.

1407 : void {
1410
1411 $item_ids = [];
1412 foreach ($mob_ids as $mob_id) {
1413 $item_ids[] = $this->object->addMobToCast($mob_id, $user->getId(), $long_desc, $extract);
1414 }
1415
1416 if ($redirect) {
1417 if (count($item_ids) === 1) {
1418 $ctrl->setParameter($this, "item_id", $item_ids[0]);
1419 $ctrl->redirect($this, "editCastItem");
1420 }
1421 $ctrl->redirect($this, "listItems");
1422 }
1423 }
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 1425 of file class.ilObjMediaCastGUI.php.

1425 : void
1426 {
1427 $this->addMobsToCast($mob_ids, "", true, true);
1428 }
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 247 of file class.ilObjMediaCastGUI.php.

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

1392 : void
1393 {
1394 $this->addMobsToCast($mob_ids, "", false);
1395 }

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ afterUrlSaving()

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

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

1397 : void
1398 {
1399 $this->addMobsToCast([$mob_id], $long_desc);
1400 }

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ confirmDeletionItemsObject()

ilObjMediaCastGUI::confirmDeletionItemsObject ( )

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

888 : void
889 {
890 $ilCtrl = $this->ctrl;
893 $ilTabs = $this->tabs;
894
895 $this->checkPermission("write");
896 $ilTabs->activateTab("edit_content");
897
898 $ids = $this->mc_request->getItemIds();
899 if (count($ids) == 0) {
900 $this->listItemsObject();
901 return;
902 }
903
904 $c_gui = new ilConfirmationGUI();
905
906 // set confirm/cancel commands
907 $c_gui->setFormAction($ilCtrl->getFormAction($this, "deleteItems"));
908 $c_gui->setHeaderText($lng->txt("info_delete_sure"));
909 $c_gui->setCancel($lng->txt("cancel"), "listItems");
910 $c_gui->setConfirm($lng->txt("confirm"), "deleteItems");
911
912 // add items to delete
913 foreach ($ids as $item_id) {
914 $item = new ilNewsItem($item_id);
915 $c_gui->addItem(
916 "item_id[]",
917 $item_id,
918 $item->getTitle(),
919 ilUtil::getImagePath("standard/icon_mcst.svg")
920 );
921 }
922
923 $tpl->setContent($c_gui->getHTML());
924 }
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 864 of file class.ilObjMediaCastGUI.php.

864 : void
865 {
866 $items = [];
867 $f = $this->gui->ui()->factory();
868 $r = $this->gui->ui()->renderer();
869 $ids = $this->mc_request->getItemIds();
870 if (current($ids) === 'ALL_OBJECTS') {
871 $arr = $this->object->getSortedItemsArray();
872 $ids = array_keys($arr);
873 }
874
875 foreach ($ids as $id) {
876 $item = new ilNewsItem($id);
877 $items[] = $f->modal()->interruptiveItem()->keyValue($id, "", $item->getTitle());
878 }
879 $this->gui->send($r->renderAsync([
880 $f->modal()->interruptive(
881 $this->lng->txt("mcst_confirm_deletion"),
882 $this->lng->txt("info_delete_sure"),
883 $this->ctrl->getFormAction($this, "deleteItems")
884 )->withAffectedItems($items)
885 ]));
886 }

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

◆ createMediaItemForPurpose()

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

Handle media item for given purpose.

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

673 : string {
674 $mediaItem = new ilMediaItem();
675 $mob->addMediaItem($mediaItem);
676 $mediaItem->setPurpose($purpose);
677 return $this->updateMediaItem($mob, $mediaItem);
678 }
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 926 of file class.ilObjMediaCastGUI.php.

926 : void
927 {
928 $ilCtrl = $this->ctrl;
929
930 $this->checkPermission("write");
931
932 // delete all selected news items
933 $ids = $this->mc_request->getItemIds();
934 foreach ($ids as $item_id) {
935 $mc_item = new ilNewsItem($item_id);
936 $mc_item->delete();
937 }
938 $this->object->saveOrder(array_map(function ($i) {
939 return $i["id"];
940 }, $this->object->readItems()));
941 $ilCtrl->redirect($this, "listItems");
942 }

◆ determinePlaytimeObject()

ilObjMediaCastGUI::determinePlaytimeObject ( )

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

964 : void
965 {
966 $ilCtrl = $this->ctrl;
968
969 $mc_item = new ilNewsItem($this->mc_request->getItemId());
970 $mob = $mc_item->getMobId();
971 $mob = new ilObjMediaObject($mob);
972 $mob_dir = ilObjMediaObject::_getDirectory($mob->getId());
973 $m_item = $mob->getMediaItem("Standard");
974
975 $success = false;
976
977 $m_item->determineDuration();
978 $dur = $m_item->getDuration();
979 if ($dur > 0) {
980 $mc_item->setPlaytime($this->object->getPlaytimeForSeconds($dur));
981 $mc_item->update();
982 $success = true;
983 $this->tpl->setOnScreenMessage('success', $lng->txt("mcst_set_playtime"), true);
984 }
985
986 if (!$success) {
987 $this->tpl->setOnScreenMessage('failure', $lng->txt("mcst_unable_to_determin_playtime"), true);
988 }
989
990 $ilCtrl->redirect($this, "listItems");
991 }
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 947 of file class.ilObjMediaCastGUI.php.

947 : void
948 {
949 $ilCtrl = $this->ctrl;
950 $ilUser = $this->user;
951
952 $this->checkPermission("read");
953 $news_item = new ilNewsItem($this->mc_request->getItemId());
954 $this->object->handleLPUpdate($ilUser->getId(), $news_item->getMobId());
955 if (!$news_item->deliverMobFile(
956 "Standard",
957 $this->mc_request->getPresentation()
958 )) {
959 $ilCtrl->redirect($this, "showContent");
960 }
961 exit;
962 }
exit

References exit.

◆ editCastItemObject()

ilObjMediaCastGUI::editCastItemObject ( )

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

360 : void
361 {
362 $item_id = $this->mc_request->getItemId();
363 $this->ctrl->setParameterByClass(self::class, "item_id", $item_id);
364
366 $ilToolbar = $this->toolbar;
367 $ilCtrl = $this->ctrl;
368
369 $this->checkPermission("write");
370
371 $this->mcst_item = new ilNewsItem(
372 $this->mc_request->getItemId()
373 );
374
375 // conversion toolbar
376 $this->video_gui->addPreviewExtractionToToolbar(
377 $this->mcst_item->getMobId(),
378 self::class
379 );
380
381 $this->initAddCastItemForm("edit");
382 $this->getCastItemValues($item_id);
383 $tpl->setContent($this->form_gui->getHTML());
384 }
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 237 of file class.ilObjMediaCastGUI.php.

237 : void
238 {
239 if (!$this->checkPermissionBool("write")) {
240 $this->error->raiseError($this->lng->txt("msg_no_perm_write"), $this->error->MESSAGE);
241 }
242
243 $this->ctrl->redirectByClass(SettingsGUI::class, "");
244 }
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 1235 of file class.ilObjMediaCastGUI.php.

1235 : void
1236 {
1237 $ilTabs = $this->tabs;
1238 $lng = $this->lng;
1239 $tpl = $this->tpl;
1240
1241 $this->checkPermission("write");
1242 $ilTabs->activateTab("edit_content");
1243
1244 $this->addContentSubTabs("sorting");
1245
1246 // sort by order setting
1247 switch ($this->object->getOrder()) {
1251 $this->listItemsObject();
1252 return;
1253
1255 // sub-tabs
1256 break;
1257 }
1258
1259 $table_gui = new ilMediaCastTableGUI($this, "editOrder", true);
1260
1261 $table_gui->setTitle($lng->txt("mcst_media_cast"));
1262 $table_gui->setData($this->object->getSortedItemsArray());
1263
1264 $table_gui->addCommandButton("saveOrder", $lng->txt("mcst_save_order"));
1265
1266 $tpl->setContent($table_gui->getHTML());
1267 }
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 1151 of file class.ilObjMediaCastGUI.php.

1151 : void
1152 {
1153 $this->editObject();
1154 }

◆ executeCommand()

ilObjMediaCastGUI::executeCommand ( )

Reimplemented from ilObjectGUI.

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

103 : void
104 {
105 $ilUser = $this->user;
106 $ilTabs = $this->tabs;
107
108 $next_class = $this->ctrl->getNextClass($this);
109 $cmd = $this->ctrl->getCmd();
110 $this->prepareOutput();
111
112 switch ($next_class) {
113 case "ilmediacreationgui":
114 $this->checkPermission('write');
115
116 $this->ctrl->setReturn($this, "listItems");
117 $ilTabs->activateTab("content");
118 $this->addContentSubTabs("manage");
119 $med_type = [];
120 switch ($this->object->getViewMode()) {
122 $med_type = [ilMediaCreationGUI::TYPE_VIDEO];
123 break;
125 $med_type = [ilMediaCreationGUI::TYPE_IMAGE];
126 break;
128 $med_type = [ilMediaCreationGUI::TYPE_AUDIO];
129 break;
130 }
131 $creation = new ilMediaCreationGUI($med_type, function ($mob_id) {
132 $this->afterUpload($mob_id);
133 }, function ($mob_id, $long_desc) {
134 $this->afterUrlSaving($mob_id, $long_desc);
135 }, function ($mob_ids) {
136 $this->afterPoolInsert($mob_ids);
137 }, function ($mob_id) {
138 $this->finishSingleUpload($mob_id);
139 }, function ($mob_id) {
140 $this->onMobUpdate($mob_id);
141 });
142 $this->ctrl->forwardCommand($creation);
143 break;
144
145 case "ilinfoscreengui":
146 if (!$this->checkPermissionBool("read")) {
147 $this->checkPermission("visible");
148 }
149 $this->infoScreen(); // forwards command
150 break;
151
152 case "ilexportgui":
153 // $this->prepareOutput();
154 $ilTabs->activateTab("export");
155 $exp_gui = new ilExportGUI($this);
156 $exp_gui->addFormat("xml");
157 $ret = $this->ctrl->forwardCommand($exp_gui);
158 // $this->tpl->show();
159 break;
160
161 case 'ilpermissiongui':
162 $ilTabs->activateTab("id_permissions");
163 $perm_gui = new ilPermissionGUI($this);
164 $ret = $this->ctrl->forwardCommand($perm_gui);
165 break;
166
167 case 'ilobjectcopygui':
168 $cp = new ilObjectCopyGUI($this);
169 $cp->setType('mcst');
170 $this->ctrl->forwardCommand($cp);
171 break;
172
173 case "ilcommonactiondispatchergui":
175 $this->ctrl->forwardCommand($gui);
176 break;
177
178 case "illearningprogressgui":
179 $ilTabs->activateTab('learning_progress');
180 $new_gui = new ilLearningProgressGUI(
182 $this->object->getRefId(),
183 $this->mc_request->getUserId() ?: $ilUser->getId()
184 );
185 $this->ctrl->forwardCommand($new_gui);
186 $this->tabs_gui->setTabActive('learning_progress');
187 break;
188
189 case "mcstimagegallerygui":
190 $view = new \McstImageGalleryGUI($this->object, $this->tpl, $this->getFeedLink());
191 $this->ctrl->forwardCommand($view);
192 break;
193
194 case "mcstpodcastgui":
195 $view = new \McstPodcastGUI($this->object, $this->tpl, $this->getFeedLink());
196 $this->ctrl->forwardCommand($view);
197 break;
198
199 case strtolower(ilCommentGUI::class):
200 $this->ctrl->forwardCommand($this->getCommentGUI());
201 break;
202
203 case strtolower(ilObjectMetaDataGUI::class):
204 $this->checkPermission("write");
205 $ilTabs->activateTab("meta_data");
206 $gui = new ilObjectMetaDataGUI($this->object);
207 $this->ctrl->forwardCommand($gui);
208 break;
209
210 case strtolower(SettingsGUI::class):
211 $this->checkPermission("write");
212 $ilTabs->activateTab("id_settings");
213 $gui = $this->gui->settings()->settingsGUI(
214 $this->object->getId(),
215 $this->object->getRefId()
216 );
217 $this->ctrl->forwardCommand($gui);
218 break;
219
220 default:
221 if (!$cmd) {
222 $cmd = "infoScreen";
223 }
224 $cmd .= "Object";
225 if ($cmd != "infoScreenObject") {
226 $this->checkPermission("read");
227 } else {
228 $this->checkPermission("visible");
229 }
230 $this->$cmd();
231
232 break;
233 }
234 $this->addHeaderAction();
235 }
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 1354 of file class.ilObjMediaCastGUI.php.

1354 : void
1355 {
1356 $ilCtrl = $this->ctrl;
1357 $this->checkPermission("write");
1358 $this->mcst_item = new ilNewsItem($this->mc_request->getItemId());
1359 $this->video_gui->handleExtractionRequest(
1360 $this->mcst_item->getMobId()
1361 );
1362 $ilCtrl->redirect($this, "editCastItem");
1363 }

◆ finishSingleUpload()

ilObjMediaCastGUI::finishSingleUpload ( int  $mob_id)

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

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

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

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

1430 : ilCommentGUI
1431 {
1432 return $this->gui->comments()->commentGUI(
1433 $this->object->getRefId(),
1434 $this->mc_request->getItemId()
1435 );
1436 }

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

646 : string
647 {
648 $duration = isset($this->form_gui)
649 ? $this->form_gui->getInput("duration")
650 : array("hh" => 0, "mm" => 0, "ss" => 0);
651
652 $duration_str = str_pad($duration["hh"], 2, "0", STR_PAD_LEFT) . ":" .
653 str_pad($duration["mm"], 2, "0", STR_PAD_LEFT) . ":" .
654 str_pad($duration["ss"], 2, "0", STR_PAD_LEFT);
655
656 if ($duration["hh"] == 0 && $duration["mm"] == 0 && $duration["ss"] == 0) {
657 $media_item->determineDuration();
658 $d = $media_item->getDuration();
659 if ($d > 0) {
660 $duration_str = $this->object->getPlaytimeForSeconds($d);
661 }
662 }
663
664 return $duration_str;
665 }
$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 327 of file class.ilObjMediaCastGUI.php.

327 : string
328 {
329 $public_feed = ilBlockSetting::_lookup(
330 "news",
331 "public_feed",
332 0,
333 $this->object->getId()
334 );
335 $url = "";
336 // rss icon/link
337 if ($public_feed) {
338 $news_set = new ilSetting("news");
339 $enable_internal_rss = $news_set->get("enable_rss_for_internal");
340 if ($enable_internal_rss) {
341 $url = ILIAS_HTTP_PATH . "/feed.php?client_id=" . rawurlencode(CLIENT_ID) . "&" . "ref_id=" . $this->requested_ref_id;
342 }
343 }
344 return $url;
345 }
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:70

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

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

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

1199 : ilMediaItem
1200 {
1201 $this->mcst_item = new ilNewsItem($id);
1202 // create dummy object in db (we need an id)
1203 $mob = new ilObjMediaObject($this->mcst_item->getMobId());
1204 return $mob->getMediaItem("Standard");
1205 }

References $id, and ilObjMediaObject\getMediaItem().

+ Here is the call graph for this function:

◆ getMediaItems()

ilObjMediaCastGUI::getMediaItems ( int  $id)
protected

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

1207 : array
1208 {
1209 $this->mcst_item = new ilNewsItem($id);
1210 // create dummy object in db (we need an id)
1211 $mob = new ilObjMediaObject($this->mcst_item->getMobId());
1212 return $mob->getMediaItems();
1213 }

References $id, and ilObjMediaObject\getMediaItems().

Referenced by getCastItemValues().

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

◆ handlePlayerCompletedEventObject()

ilObjMediaCastGUI::handlePlayerCompletedEventObject ( )
protected

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

1382 : void
1383 {
1384 $mob_id = $this->mc_request->getMobId();
1385 if ($mob_id > 0) {
1386 $ilUser = $this->user;
1387 $this->object->handleLPUpdate($ilUser->getId(), $mob_id);
1388 }
1389 exit;
1390 }

References exit.

◆ handlePlayerEventObject()

ilObjMediaCastGUI::handlePlayerEventObject ( )

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

1365 : void
1366 {
1367 if ($this->mc_request->getEvent() === "play") {
1368 $player = explode("_", $this->mc_request->getPlayer());
1369 $news_id = (int) $player[1];
1370 $item = new ilNewsItem($news_id);
1371 $item->increasePlayCounter();
1372
1373 $mob_id = $item->getMobId();
1374 if ($mob_id) {
1375 $ilUser = $this->user;
1376 $this->object->handleLPUpdate($ilUser->getId(), $mob_id);
1377 }
1378 }
1379 exit;
1380 }

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

+ Here is the call graph for this function:

◆ infoScreen()

ilObjMediaCastGUI::infoScreen ( )

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

1004 : void
1005 {
1006 $ilTabs = $this->tabs;
1007
1008 $ilTabs->activateTab("id_info");
1009
1010 if (!$this->checkPermissionBool("read")) {
1011 $this->checkPermission("visible");
1012 }
1013
1014 $info = new ilInfoScreenGUI($this);
1015
1016 $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
1017 $info->enablePrivateNotes();
1018
1019 // general information
1020 $this->lng->loadLanguageModule("meta");
1021 $this->lng->loadLanguageModule("mcst");
1022 $med_items = $this->object->getItemsArray();
1023 $info->addSection($this->lng->txt("meta_general"));
1024 $info->addProperty(
1025 $this->lng->txt("mcst_nr_items"),
1026 count($med_items)
1027 );
1028
1029 if (count($med_items) > 0) {
1030 $cur = current($med_items);
1031 $last = ilDatePresentation::formatDate(new ilDateTime($cur["creation_date"], IL_CAL_DATETIME));
1032 } else {
1033 $last = "-";
1034 }
1035
1036 $info->addProperty($this->lng->txt("mcst_last_submission"), $last);
1037
1038 // forward the command
1039 $this->ctrl->forwardCommand($info);
1040 }
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 996 of file class.ilObjMediaCastGUI.php.

996 : void
997 {
998 if (!$this->checkPermissionBool("read")) {
999 $this->checkPermission("visible");
1000 }
1001 $this->ctrl->redirectByClass(ilInfoScreenGUI::class, "showSummary");
1002 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ initAddCastItemForm()

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

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

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

1191 : bool
1192 {
1193 return strpos($extension, "audio") !== false;
1194 }

◆ listItemsObject()

ilObjMediaCastGUI::listItemsObject ( bool  $a_presentation_mode = false)

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

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

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

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

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

1215 : void
1216 {
1217 $tpl = $this->tpl;
1218 $this->form_gui->setValuesByPost();
1219
1220 //issue: we have to display the current settings
1221 // problem: POST does not contain values of disabled text fields
1222 // solution: use hidden field and label to display-> here we need to synchronize the labels
1223 // with the values from the hidden fields.
1224 foreach (ilObjMediaCast::$purposes as $purpose) {
1225 if ($this->form_gui->getInput("value_" . $purpose)) {
1226 $input = $this->form_gui->getItemByPostVar("label_value_" . $purpose);
1227 $input->setValue($this->form_gui->getInput("value_" . $purpose));
1228 }
1229 }
1230
1231 $this->form_gui->setValuesByPost();
1232 $tpl->setContent($this->form_gui->getHTML());
1233 }

References ilObjMediaCast\$purposes.

Referenced by saveCastItemObject().

+ Here is the caller graph for this function:

◆ renderVideoObject()

ilObjMediaCastGUI::renderVideoObject ( )
protected

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

1444 : void
1445 {
1446 $mob_id = $this->mc_request->getMobId();
1447 $html = $this->mob_player_gui->wrapper()->renderComponent(new ilObjMediaObject($mob_id));
1448 $this->gui->httpUtil()->sendString($html);
1449 }

◆ saveCastItemObject()

ilObjMediaCastGUI::saveCastItemObject ( )

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

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

1269 : void
1270 {
1271 $lng = $this->lng;
1272
1273 $ids = $this->mc_request->getItemIds();
1274 asort($ids);
1275
1276 $items = array();
1277 foreach (array_keys($ids) as $id) {
1278 $items[] = $id;
1279 }
1280 $this->object->saveOrder($items);
1281
1282 $this->tpl->setOnScreenMessage('success', $lng->txt("settings_saved"), true);
1283 $this->ctrl->redirect($this, "editOrder");
1284 }

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

1042 : void
1043 {
1044 $ilAccess = $this->access;
1045 $ilTabs = $this->tabs;
1046 $lng = $this->lng;
1047 $ilHelp = $this->help;
1048
1049 $ilHelp->setScreenIdComponent("mcst");
1050
1051 // list items
1052 if ($ilAccess->checkAccess('read', "", $this->object->getRefId())) {
1053 $ilTabs->addTab(
1054 "content",
1055 $lng->txt("content"),
1056 $this->ctrl->getLinkTarget($this, "showContent")
1057 );
1058 }
1059
1060 // info screen
1061 if ($ilAccess->checkAccess('visible', "", $this->object->getRefId()) ||
1062 $ilAccess->checkAccess('read', "", $this->object->getRefId())) {
1063 $ilTabs->addTab(
1064 "id_info",
1065 $lng->txt("info_short"),
1066 $this->ctrl->getLinkTargetByClass("ilinfoscreengui", "showSummary")
1067 );
1068 }
1069
1070 // settings
1071 if ($ilAccess->checkAccess('write', "", $this->object->getRefId())) {
1072 $ilTabs->addTab(
1073 "id_settings",
1074 $lng->txt("settings"),
1075 $this->ctrl->getLinkTargetByClass(SettingsGUI::class, "")
1076 );
1077 }
1078
1079 if (ilLearningProgressAccess::checkAccess($this->object->getRefId())) {
1080 $ilTabs->addTab(
1081 'learning_progress',
1082 $lng->txt('learning_progress'),
1083 $this->ctrl->getLinkTargetByClass(array(__CLASS__, 'illearningprogressgui'), '')
1084 );
1085 }
1086
1087 if ($ilAccess->checkAccess("write", "", $this->object->getRefId())) {
1088 $mdgui = new ilObjectMetaDataGUI($this->object);
1089 $mdtab = $mdgui->getTab();
1090 if ($mdtab) {
1091 $this->tabs_gui->addTab(
1092 "meta_data",
1093 $this->lng->txt("meta_data"),
1094 $mdtab
1095 );
1096 }
1097 }
1098
1099 // export
1100 if ($ilAccess->checkAccess("write", "", $this->object->getRefId())) {
1101 $ilTabs->addTab(
1102 "export",
1103 $lng->txt("export"),
1104 $this->ctrl->getLinkTargetByClass("ilexportgui", "")
1105 );
1106 }
1107
1108 // edit permissions
1109 if ($ilAccess->checkAccess('edit_permission', "", $this->object->getRefId())) {
1110 $ilTabs->addTab(
1111 "id_permissions",
1112 $lng->txt("perm_settings"),
1113 $this->ctrl->getLinkTargetByClass("ilpermissiongui", "perm")
1114 );
1115 }
1116 }
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 836 of file class.ilObjMediaCastGUI.php.

836 : void
837 {
838 $f = $this->gui->ui()->factory();
839 $item_id = $this->mc_request->getItemId();
840 $news = new ilNewsItem($item_id);
841 $mob = new ilObjMediaObject($news->getMobId());
842 $med = $mob->getMediaItem("Standard");
843 $comp = null;
844 if ($med) {
845 $file = $mob->getStandardSrc();
846 if ($this->media_type->isAudio($med->getFormat())) {
847 $comp = $f->player()->audio($file, "");
848 } elseif ($this->media_type->isVideo($med->getFormat())) {
849 $comp = $f->player()->video($file);
850 } elseif ($this->media_type->isImage($med->getFormat())) {
851 $comp = $f->image()->responsive($file, $mob->getTitle());
852 }
853
854 }
855 if (is_null($comp)) {
856 $comp = $f->messageBox()->info($this->lng->txt("mcst_item_not_found"));
857 }
858 $this->gui->modal(
859 $this->lng->txt("mcst_preview"),
860 $this->lng->txt("close")
861 )->content([$comp])->send();
862 }

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

1438 : void
1439 {
1440 echo $this->getCommentGUI()->getListHTML() . "<script>ilNotes.init(null);</script>";
1441 exit;
1442 }

References exit.

◆ showContentObject()

ilObjMediaCastGUI::showContentObject ( )

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

1290 : void
1291 {
1292 $tpl = $this->tpl;
1293 $ilUser = $this->user;
1294 $ilTabs = $this->tabs;
1295
1296 // need read events for parent for LP statistics
1298 "mcst",
1299 $this->object->getRefId(),
1300 $this->object->getId(),
1301 $ilUser->getId()
1302 );
1303
1304 // trigger LP update
1305 ilLPStatusWrapper::_updateStatus($this->object->getId(), $ilUser->getId());
1306
1307 if ($this->object->getViewMode() == ilObjMediaCast::VIEW_GALLERY) {
1308 $this->showGallery();
1309 } elseif ($this->object->getViewMode() == ilObjMediaCast::VIEW_IMG_GALLERY) {
1310 $view = new \McstImageGalleryGUI($this->object, $this->tpl, $this->getFeedLink());
1311 $view->setCompletedCallback($this->ctrl->getLinkTarget(
1312 $this,
1313 "handlePlayerCompletedEvent",
1314 "",
1315 true,
1316 false
1317 ));
1318 $this->tabs->activateTab("content");
1319 $this->addContentSubTabs("content");
1320 $tpl->setContent($this->ctrl->getHTML($view));
1321 } elseif ($this->object->getViewMode() == ilObjMediaCast::VIEW_PODCAST) {
1322 $view = new \McstPodcastGUI($this->object, $this->tpl, $this->getFeedLink());
1323 $this->tabs->activateTab("content");
1324 $this->addContentSubTabs("content");
1325 $tpl->setContent($this->ctrl->getHTML($view));
1326 } elseif ($this->object->getViewMode() == ilObjMediaCast::VIEW_VCAST) {
1327 $ilTabs->activateTab("content");
1328 $this->addContentSubTabs("content");
1329 $view = new \ILIAS\MediaCast\Presentation\VideoViewGUI($this->object, $tpl, $this->getFeedLink());
1330 $view->setCompletedCallback($this->ctrl->getLinkTarget(
1331 $this,
1332 "handlePlayerCompletedEvent",
1333 "",
1334 true,
1335 false
1336 ));
1337 $view->show();
1338 } else {
1339 $this->listItemsObject(true);
1340 }
1341
1342 $tpl->setPermanentLink($this->object->getType(), $this->object->getRefId());
1343 }
static _recordReadEvent(string $a_type, int $a_ref_id, int $obj_id, int $usr_id, $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 1345 of file class.ilObjMediaCastGUI.php.

1345 : void
1346 {
1347 $tpl = $this->tpl;
1348 $ilTabs = $this->tabs;
1349 $ilCtrl = $this->ctrl;
1350
1351 $this->tpl->setOnScreenMessage('info', $this->lng->txt("mcst_view_abandoned"));
1352 }

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ tableCommandObject()

ilObjMediaCastGUI::tableCommandObject ( )

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

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

References getManageTableGUI().

+ Here is the call graph for this function:

◆ updateCastItemObject()

ilObjMediaCastGUI::updateCastItemObject ( )

Update cast item.

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

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

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

690 : string {
691 $locationType = "";
692 $location = "";
693 $file = "";
694 $purpose = $mediaItem->getPurpose();
695 $locationType = $mediaItem->getLocationType();
696 $url_gui = $this->form_gui->getInput("url_" . $purpose);
697 $file_gui = $this->form_gui->getInput("file_" . $purpose);
698 if ($url_gui) {
699 // http
700 $file = $this->form_gui->getInput("url_" . $purpose);
701 $title = basename($file);
702 $location = $this->form_gui->getInput("url_" . $purpose);
703 $locationType = "Reference";
704 $mediaItem->setLocation($location);
705 $mediaItem->setLocationType($locationType);
706
707 // check if not automatic mimetype detection
708 $format = ilObjMediaObject::getMimeType($mediaItem->getLocation(), ($locationType === "Reference"));
709 $mediaItem->setFormat($format);
710 if ($format === "") {
711 $format = ilObjMediaObject::getMimeType($file, ($locationType === "Reference"));
712 }
713
714 // set real meta and object data
715 $mediaItem->setFormat($format);
716 $mediaItem->setHAlign("Left");
717 $mediaItem->setHeight(self::isAudio($format) ? 0 : 180);
718 $mob->generatePreviewPic(320, 240);
719
720 } elseif ($file_gui["size"] > 0) {
721
722 $file_name = ilFileUtils::getASCIIFilename($_FILES['file_' . $purpose]['name']);
723 $file_name = str_replace(" ", "_", $file_name);
724 $mob->removeMediaItem("Standard");
725 $this->mob_manager->addFileFromLegacyUpload($mob->getId(), $_FILES['file_' . $purpose]['tmp_name']);
726 $media_item = $mob->addMediaItemFromLegacyUpload(
727 "Standard",
728 $_FILES['file_' . $purpose]['tmp_name'],
729 $file_name
730 );
731 $title = $file_name;
732 }
733
734
735 if (($purpose === "Standard") && isset($title)) {
736 $mob->setTitle($title);
737 }
738
739 return $file;
740 }
$location
Definition: buildRTE.php:22
static getASCIIFilename(string $a_filename)
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
addMediaItemFromLegacyUpload(string $purpose, string $tmp_name, string $name, int $resize_width=0, int $resize_height=0, bool $constrain_proportions=true, bool $deduce_size=false)
removeMediaItem(string $a_purpose)
setTitle(string $title)

References $location, ilMediaItem\getLocation(), ilObjMediaObject\getMimeType(), ilMediaItem\setFormat(), ilMediaItem\setHAlign(), ilMediaItem\setHeight(), ilMediaItem\setLocation(), and ilMediaItem\setLocationType().

+ Here is the call graph for this function:

Field Documentation

◆ $additionalPurposes

array ilObjMediaCastGUI::$additionalPurposes = []
private

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

◆ $filesystem

FileSystem ilObjMediaCastGUI::$filesystem
protected

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

◆ $form_gui

ilPropertyFormGUI ilObjMediaCastGUI::$form_gui
protected

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

◆ $gui

ILIAS MediaCast InternalGUIService ilObjMediaCastGUI::$gui
protected

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

Referenced by executeCommand().

◆ $help

ilHelpGUI ilObjMediaCastGUI::$help
protected

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

◆ $log

ilLogger ilObjMediaCastGUI::$log
protected

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

◆ $mc_manager

ILIAS MediaCast MediaCastManager ilObjMediaCastGUI::$mc_manager
protected

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

◆ $mc_request

StandardGUIRequest ilObjMediaCastGUI::$mc_request
protected

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

◆ $mcst_item

ilNewsItem ilObjMediaCastGUI::$mcst_item
protected

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

Referenced by initAddCastItemForm().

◆ $media_type

ILIAS MediaObjects MediaType MediaTypeManager ilObjMediaCastGUI::$media_type
protected

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

◆ $mob_manager

ILIAS MediaObjects MediaObjectManager ilObjMediaCastGUI::$mob_manager
protected

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

◆ $mob_player_gui

ILIAS MediaObjects Player GUIService ilObjMediaCastGUI::$mob_player_gui
protected

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

◆ $tabs

ilTabsGUI ilObjMediaCastGUI::$tabs
protected

◆ $video_gui

ILIAS MediaObjects Video GUIService ilObjMediaCastGUI::$video_gui
protected

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


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