ILIAS  trunk Revision v11.0_alpha-1866-gfa368f7776e
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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)
 
 getManageTableGUI ()
 
 onMobUpdate (int $mob_id)
 
 setTabs ()
 
 addLocatorItems ()
 
 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 ()
 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
 
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
 
ilObjectCustomIconFactory $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.

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().

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");
85  $lng->loadLanguageModule("rep");
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.
ilLanguage $lng
global $DIC
Definition: shib_login.php:22
__construct(Container $dic, ilPlugin $plugin)
ilSetting $settings
+ Here is the call graph for this function:

Member Function Documentation

◆ _goto()

static ilObjMediaCastGUI::_goto ( string  $a_target)
static

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

References ilObjectGUI\$ctrl, $DIC, ilObjectGUI\$lng, ilObjectGUI\_gotoRepositoryNode(), ilObjectGUI\_gotoRepositoryRoot(), ilObject\_lookupObjId(), ilObject\_lookupTitle(), ilCtrl\redirectByClass(), ROOT_FOLDER_ID, ilCtrl\setParameterByClass(), and ilLanguage\txt().

1174  : void
1175  {
1176  global $DIC;
1177  $main_tpl = $DIC->ui()->mainTemplate();
1178 
1179  $ilAccess = $DIC->access();
1180  $lng = $DIC->language();
1181  $ctrl = $DIC->ctrl();
1182 
1183  if ($ilAccess->checkAccess("read", "", $a_target)) {
1184  $ctrl->setParameterByClass("ilobjmediacastgui", "ref_id", $a_target);
1185  //exit;
1186  $ctrl->redirectByClass(["ilmediacasthandlergui", "ilobjmediacastgui"], "showContent");
1187  } elseif ($ilAccess->checkAccess("visible", "", $a_target)) {
1188  ilObjectGUI::_gotoRepositoryNode($a_target, "infoScreen");
1189  } elseif ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID)) {
1190  $main_tpl->setOnScreenMessage('failure', sprintf(
1191  $lng->txt("msg_no_perm_read_item"),
1193  ));
1195  }
1196 
1197  throw new ilPermissionException($lng->txt("msg_no_perm_read"));
1198  }
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...
const ROOT_FOLDER_ID
Definition: constants.php:32
static _gotoRepositoryNode(int $ref_id, string $cmd="")
setParameterByClass(string $a_class, string $a_parameter, $a_value)
redirectByClass( $a_class, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false)
static _lookupObjId(int $ref_id)
ilLanguage $lng
static _lookupTitle(int $obj_id)
global $DIC
Definition: shib_login.php:22
static _gotoRepositoryRoot(bool $raise_error=false)
Goto repository root.
+ Here is the call graph for this function:

◆ addCastItemObject()

ilObjMediaCastGUI::addCastItemObject ( )

Add media cast item.

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

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

346  : void
347  {
348  $tpl = $this->tpl;
349 
350  $this->checkPermission("write");
351 
352  $this->initAddCastItemForm();
353  $tpl->setContent($this->form_gui->getHTML());
354  }
setContent(string $a_html)
Sets content for standard template.
ilGlobalTemplateInterface $tpl
initAddCastItemForm(string $a_mode="create")
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
+ Here is the call graph for this function:

◆ addContentSubTabs()

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

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

References ilObjectGUI\$access, ilObjectGUI\$lng, $tabs, ILIAS\Repository\ctrl(), ILIAS\Repository\object(), ilObjMediaCast\ORDER_MANUAL, and ilLanguage\txt().

Referenced by editOrderObject(), executeCommand(), listItemsObject(), and showContentObject().

1129  : void {
1130  $ilTabs = $this->tabs;
1131  $ilAccess = $this->access;
1132  $lng = $this->lng;
1133 
1134  $ilTabs->addSubTab(
1135  "content",
1136  $lng->txt("view"),
1137  $this->ctrl->getLinkTarget($this, "showContent")
1138  );
1139 
1140  if ($ilAccess->checkAccess("write", "", $this->requested_ref_id)) {
1141  $ilTabs->addSubTab(
1142  "manage",
1143  $lng->txt("mcst_manage"),
1144  $this->ctrl->getLinkTarget($this, "listItems")
1145  );
1146 
1147  if ($this->object->getOrder() == ilObjMediaCast::ORDER_MANUAL) {
1148  $ilTabs->addSubTab(
1149  "sorting",
1150  $lng->txt("mcst_ordering"),
1151  $this->ctrl->getLinkTarget($this, "editOrder")
1152  );
1153  }
1154  }
1155 
1156  $ilTabs->activateSubTab($a_active);
1157  $ilTabs->activateTab("content");
1158  }
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...
ilLanguage $lng
ilAccessHandler $access
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addLocatorItems()

ilObjMediaCastGUI::addLocatorItems ( )
protected

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

References ilObjectGUI\$locator, ilObjectGUI\$requested_ref_id, ILIAS\Repository\ctrl(), and ILIAS\Repository\object().

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

References ilObjectGUI\$ctrl, ilObjectGUI\$user, ilObject\getId(), ilCtrl\redirect(), and ilCtrl\setParameter().

Referenced by afterPoolInsert(), afterUpload(), and afterUrlSaving().

1423  : void {
1424  $ctrl = $this->ctrl;
1425  $user = $this->user;
1426 
1427  $item_ids = [];
1428  foreach ($mob_ids as $mob_id) {
1429  $item_ids[] = $this->object->addMobToCast($mob_id, $user->getId(), $long_desc, $extract);
1430  }
1431 
1432  if ($redirect) {
1433  if (count($item_ids) === 1) {
1434  $ctrl->setParameter($this, "item_id", $item_ids[0]);
1435  $ctrl->redirect($this, "editCastItem");
1436  }
1437  $ctrl->redirect($this, "listItems");
1438  }
1439  }
redirect(object $a_gui_obj, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false)
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ afterPoolInsert()

ilObjMediaCastGUI::afterPoolInsert ( array  $mob_ids)
protected

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

References addMobsToCast().

Referenced by executeCommand().

1441  : void
1442  {
1443  $this->addMobsToCast($mob_ids, "", true, true);
1444  }
addMobsToCast(array $mob_ids, string $long_desc="", bool $redirect=true, bool $extract=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ afterSave()

ilObjMediaCastGUI::afterSave ( ilObject  $new_object)
protected

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

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

243  : void
244  {
245  // always send a message
246  $this->tpl->setOnScreenMessage('success', $this->lng->txt("object_added"), true);
247  ilUtil::redirect("ilias.php?baseClass=ilMediaCastHandlerGUI&ref_id=" . $new_object->getRefId() . "&cmd=editSettings");
248  }
static redirect(string $a_script)
+ Here is the call graph for this function:

◆ afterUpload()

ilObjMediaCastGUI::afterUpload (   $mob_ids)
protected

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

References addMobsToCast().

Referenced by executeCommand().

1408  : void
1409  {
1410  $this->addMobsToCast($mob_ids, "", false);
1411  }
addMobsToCast(array $mob_ids, string $long_desc="", bool $redirect=true, bool $extract=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ afterUrlSaving()

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

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

References addMobsToCast().

Referenced by executeCommand().

1413  : void
1414  {
1415  $this->addMobsToCast([$mob_id], $long_desc);
1416  }
addMobsToCast(array $mob_ids, string $long_desc="", bool $redirect=true, bool $extract=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ confirmDeletionItemsObject()

ilObjMediaCastGUI::confirmDeletionItemsObject ( )

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

References ilObjectGUI\$ctrl, ilObjectGUI\$lng, $tabs, ilObjectGUI\$tpl, ilObjectGUI\checkPermission(), ilUtil\getImagePath(), listItemsObject(), ILIAS\UICore\GlobalTemplate\setContent(), and ilLanguage\txt().

897  : void
898  {
899  $ilCtrl = $this->ctrl;
900  $lng = $this->lng;
901  $tpl = $this->tpl;
902  $ilTabs = $this->tabs;
903 
904  $this->checkPermission("write");
905  $ilTabs->activateTab("edit_content");
906 
907  $ids = $this->mc_request->getItemIds();
908  if (count($ids) == 0) {
909  $this->listItemsObject();
910  return;
911  }
912 
913  $c_gui = new ilConfirmationGUI();
914 
915  // set confirm/cancel commands
916  $c_gui->setFormAction($ilCtrl->getFormAction($this, "deleteItems"));
917  $c_gui->setHeaderText($lng->txt("info_delete_sure"));
918  $c_gui->setCancel($lng->txt("cancel"), "listItems");
919  $c_gui->setConfirm($lng->txt("confirm"), "deleteItems");
920 
921  // add items to delete
922  foreach ($ids as $item_id) {
923  $item = new ilNewsItem($item_id);
924  $c_gui->addItem(
925  "item_id[]",
926  $item_id,
927  $item->getTitle(),
928  ilUtil::getImagePath("standard/icon_mcst.svg")
929  );
930  }
931 
932  $tpl->setContent($c_gui->getHTML());
933  }
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...
listItemsObject(bool $a_presentation_mode=false)
setContent(string $a_html)
Sets content for standard template.
ilLanguage $lng
ilGlobalTemplateInterface $tpl
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
A news item can be created by different sources.
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
+ Here is the call graph for this function:

◆ confirmItemDeletionObject()

ilObjMediaCastGUI::confirmItemDeletionObject ( )

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

References Vendor\Package\$f, ilObjectGUI\$id, $r, ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

873  : void
874  {
875  $items = [];
876  $f = $this->gui->ui()->factory();
877  $r = $this->gui->ui()->renderer();
878  $ids = $this->mc_request->getItemIds();
879  if (current($ids) === 'ALL_OBJECTS') {
880  $arr = $this->object->getSortedItemsArray();
881  $ids = array_keys($arr);
882  }
883 
884  foreach ($ids as $id) {
885  $item = new ilNewsItem($id);
886  $items[] = $f->modal()->interruptiveItem()->keyValue($id, "", $item->getTitle());
887  }
888  $this->gui->send($r->renderAsync([
889  $f->modal()->interruptive(
890  $this->lng->txt("mcst_confirm_deletion"),
891  $this->lng->txt("info_delete_sure"),
892  $this->ctrl->getFormAction($this, "deleteItems")
893  )->withAffectedItems($items)
894  ]));
895  }
A news item can be created by different sources.
$r
+ Here is the call graph for this function:

◆ createMediaItemForPurpose()

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

Handle media item for given purpose.

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

References ilObjMediaObject\addMediaItem(), and updateMediaItem().

Referenced by saveCastItemObject(), and updateCastItemObject().

669  : string {
670  $mediaItem = new ilMediaItem();
671  $mob->addMediaItem($mediaItem);
672  $mediaItem->setPurpose($purpose);
673  return $this->updateMediaItem($mob, $mediaItem);
674  }
addMediaItem(ilMediaItem $a_item)
Class ilMediaItem Media Item, component of a media object (file or reference)
updateMediaItem(ilObjMediaObject $mob, ilMediaItem $mediaItem)
Update media item from form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deleteItemsObject()

ilObjMediaCastGUI::deleteItemsObject ( )

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

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

935  : void
936  {
937  $ilCtrl = $this->ctrl;
938 
939  $this->checkPermission("write");
940 
941  // delete all selected news items
942  $ids = $this->mc_request->getItemIds();
943  foreach ($ids as $item_id) {
944  $mc_item = new ilNewsItem($item_id);
945  $mc_item->delete();
946  }
947  $this->object->saveOrder(array_map(function ($i) {
948  return $i["id"];
949  }, $this->object->readItems()));
950  $ilCtrl->redirect($this, "listItems");
951  }
A news item can be created by different sources.
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
+ Here is the call graph for this function:

◆ determinePlaytimeObject()

ilObjMediaCastGUI::determinePlaytimeObject ( )

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

References ilObjectGUI\$ctrl, ilObjectGUI\$lng, ilObjMediaObject\_getDirectory(), ilNewsItem\getId(), ilNewsItem\getMobId(), ILIAS\Repository\object(), ilNewsItem\setPlaytime(), and ilLanguage\txt().

973  : void
974  {
975  $ilCtrl = $this->ctrl;
976  $lng = $this->lng;
977 
978  $mc_item = new ilNewsItem($this->mc_request->getItemId());
979  $mob = $mc_item->getMobId();
980  $mob = new ilObjMediaObject($mob);
981  $mob_dir = ilObjMediaObject::_getDirectory($mob->getId());
982  $m_item = $mob->getMediaItem("Standard");
983 
984  $success = false;
985 
986  $m_item->determineDuration();
987  $dur = $m_item->getDuration();
988  if ($dur > 0) {
989  $mc_item->setPlaytime($this->object->getPlaytimeForSeconds($dur));
990  $mc_item->update();
991  $success = true;
992  $this->tpl->setOnScreenMessage('success', $lng->txt("mcst_set_playtime"), true);
993  }
994 
995  if (!$success) {
996  $this->tpl->setOnScreenMessage('failure', $lng->txt("mcst_unable_to_determin_playtime"), true);
997  }
998 
999  $ilCtrl->redirect($this, "listItems");
1000  }
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...
setPlaytime(string $a_playtime)
ilLanguage $lng
static _getDirectory(int $a_mob_id)
Get absolute directory.
A news item can be created by different sources.
+ Here is the call graph for this function:

◆ downloadItemObject()

ilObjMediaCastGUI::downloadItemObject ( )

Download news media item.

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

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

956  : void
957  {
958  $ilCtrl = $this->ctrl;
959  $ilUser = $this->user;
960 
961  $this->checkPermission("read");
962  $news_item = new ilNewsItem($this->mc_request->getItemId());
963  $this->object->handleLPUpdate($ilUser->getId(), $news_item->getMobId());
964  if (!$news_item->deliverMobFile(
965  "Standard",
966  $this->mc_request->getPresentation()
967  )) {
968  $ilCtrl->redirect($this, "showContent");
969  }
970  exit;
971  }
A news item can be created by different sources.
exit
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
+ Here is the call graph for this function:

◆ editCastItemObject()

ilObjMediaCastGUI::editCastItemObject ( )

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

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

356  : void
357  {
358  $item_id = $this->mc_request->getItemId();
359  $this->ctrl->setParameterByClass(self::class, "item_id", $item_id);
360 
361  $tpl = $this->tpl;
362  $ilToolbar = $this->toolbar;
363  $ilCtrl = $this->ctrl;
364 
365  $this->checkPermission("write");
366 
367  $this->mcst_item = new ilNewsItem(
368  $this->mc_request->getItemId()
369  );
370 
371  // conversion toolbar
372  $this->video_gui->addPreviewExtractionToToolbar(
373  $this->mcst_item->getMobId(),
374  self::class
375  );
376 
377  $this->initAddCastItemForm("edit");
378  $this->getCastItemValues($item_id);
379  $tpl->setContent($this->form_gui->getHTML());
380  }
setContent(string $a_html)
Sets content for standard template.
ilGlobalTemplateInterface $tpl
ilToolbarGUI $toolbar
initAddCastItemForm(string $a_mode="create")
getCastItemValues(int $item_id)
Get cast item values into form.
A news item can be created by different sources.
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
+ Here is the call graph for this function:

◆ editObject()

ilObjMediaCastGUI::editObject ( )

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

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

Referenced by editSettingsObject().

233  : void
234  {
235  if (!$this->checkPermissionBool("write")) {
236  $this->error->raiseError($this->lng->txt("msg_no_perm_write"), $this->error->MESSAGE);
237  }
238 
239  $this->ctrl->redirectByClass(SettingsGUI::class, "");
240  }
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ editOrderObject()

ilObjMediaCastGUI::editOrderObject ( )
protected

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

References ilObjectGUI\$lng, $tabs, ilObjectGUI\$tpl, addContentSubTabs(), ilObjectGUI\checkPermission(), listItemsObject(), ILIAS\Repository\object(), ilObjMediaCast\ORDER_CREATION_DATE_ASC, ilObjMediaCast\ORDER_CREATION_DATE_DESC, ilObjMediaCast\ORDER_MANUAL, ilObjMediaCast\ORDER_TITLE, ILIAS\UICore\GlobalTemplate\setContent(), and ilLanguage\txt().

1244  : void
1245  {
1246  $ilTabs = $this->tabs;
1247  $lng = $this->lng;
1248  $tpl = $this->tpl;
1249 
1250  $this->checkPermission("write");
1251  $ilTabs->activateTab("edit_content");
1252 
1253  $this->addContentSubTabs("sorting");
1254 
1255  // sort by order setting
1256  switch ($this->object->getOrder()) {
1260  $this->listItemsObject();
1261  return;
1262 
1264  // sub-tabs
1265  break;
1266  }
1267 
1268  $table_gui = new ilMediaCastTableGUI($this, "editOrder", true);
1269 
1270  $table_gui->setTitle($lng->txt("mcst_media_cast"));
1271  $table_gui->setData($this->object->getSortedItemsArray());
1272 
1273  $table_gui->addCommandButton("saveOrder", $lng->txt("mcst_save_order"));
1274 
1275  $tpl->setContent($table_gui->getHTML());
1276  }
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...
listItemsObject(bool $a_presentation_mode=false)
setContent(string $a_html)
Sets content for standard template.
ilLanguage $lng
ilGlobalTemplateInterface $tpl
addContentSubTabs(string $a_active="content")
TableGUI class for table NewsForContext.
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
+ Here is the call graph for this function:

◆ editSettingsObject()

ilObjMediaCastGUI::editSettingsObject ( )

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

References editObject().

1160  : void
1161  {
1162  $this->editObject();
1163  }
+ Here is the call graph for this function:

◆ executeCommand()

ilObjMediaCastGUI::executeCommand ( )

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

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

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->ctrl->setReturn($this, "listItems");
113  $ilTabs->activateTab("content");
114  $this->addContentSubTabs("manage");
115  $med_type = [];
116  switch ($this->object->getViewMode()) {
118  $med_type = [ilMediaCreationGUI::TYPE_VIDEO];
119  break;
121  $med_type = [ilMediaCreationGUI::TYPE_IMAGE];
122  break;
124  $med_type = [ilMediaCreationGUI::TYPE_AUDIO];
125  break;
126  }
127  $creation = new ilMediaCreationGUI($med_type, function ($mob_id) {
128  $this->afterUpload($mob_id);
129  }, function ($mob_id, $long_desc) {
130  $this->afterUrlSaving($mob_id, $long_desc);
131  }, function ($mob_ids) {
132  $this->afterPoolInsert($mob_ids);
133  }, function ($mob_id) {
134  $this->finishSingleUpload($mob_id);
135  }, function ($mob_id) {
136  $this->onMobUpdate($mob_id);
137  });
138  $this->ctrl->forwardCommand($creation);
139  break;
140 
141  case "ilinfoscreengui":
142  if (!$this->checkPermissionBool("read")) {
143  $this->checkPermission("visible");
144  }
145  $this->infoScreen(); // forwards command
146  break;
147 
148  case "ilexportgui":
149  // $this->prepareOutput();
150  $ilTabs->activateTab("export");
151  $exp_gui = new ilExportGUI($this);
152  $exp_gui->addFormat("xml");
153  $ret = $this->ctrl->forwardCommand($exp_gui);
154  // $this->tpl->show();
155  break;
156 
157  case 'ilpermissiongui':
158  $ilTabs->activateTab("id_permissions");
159  $perm_gui = new ilPermissionGUI($this);
160  $ret = $this->ctrl->forwardCommand($perm_gui);
161  break;
162 
163  case 'ilobjectcopygui':
164  $cp = new ilObjectCopyGUI($this);
165  $cp->setType('mcst');
166  $this->ctrl->forwardCommand($cp);
167  break;
168 
169  case "ilcommonactiondispatchergui":
171  $this->ctrl->forwardCommand($gui);
172  break;
173 
174  case "illearningprogressgui":
175  $ilTabs->activateTab('learning_progress');
176  $new_gui = new ilLearningProgressGUI(
178  $this->object->getRefId(),
179  $this->mc_request->getUserId() ?: $ilUser->getId()
180  );
181  $this->ctrl->forwardCommand($new_gui);
182  $this->tabs_gui->setTabActive('learning_progress');
183  break;
184 
185  case "mcstimagegallerygui":
186  $view = new \McstImageGalleryGUI($this->object, $this->tpl, $this->getFeedLink());
187  $this->ctrl->forwardCommand($view);
188  break;
189 
190  case "mcstpodcastgui":
191  $view = new \McstPodcastGUI($this->object, $this->tpl, $this->getFeedLink());
192  $this->ctrl->forwardCommand($view);
193  break;
194 
195  case strtolower(ilCommentGUI::class):
196  $this->ctrl->forwardCommand($this->getCommentGUI());
197  break;
198 
199  case strtolower(ilObjectMetaDataGUI::class):
200  $this->checkPermission("write");
201  $ilTabs->activateTab("meta_data");
202  $gui = new ilObjectMetaDataGUI($this->object);
203  $this->ctrl->forwardCommand($gui);
204  break;
205 
206  case strtolower(SettingsGUI::class):
207  $this->checkPermission("write");
208  $ilTabs->activateTab("id_settings");
209  $gui = $this->gui->settings()->settingsGUI(
210  $this->object->getId(),
211  $this->object->getRefId()
212  );
213  $this->ctrl->forwardCommand($gui);
214  break;
215 
216  default:
217  if (!$cmd) {
218  $cmd = "infoScreen";
219  }
220  $cmd .= "Object";
221  if ($cmd != "infoScreenObject") {
222  $this->checkPermission("read");
223  } else {
224  $this->checkPermission("visible");
225  }
226  $this->$cmd();
227 
228  break;
229  }
230  $this->addHeaderAction();
231  }
Class ilObjectMetaDataGUI.
GUI class for the workflow of copying objects.
prepareOutput(bool $show_sub_objects=true)
afterUrlSaving(int $mob_id, string $long_desc)
addContentSubTabs(string $a_active="content")
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
ILIAS MediaCast InternalGUIService $gui
addHeaderAction()
Add header action menu.
Class ilObjUserTrackingGUI.
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
+ Here is the call graph for this function:

◆ extractPreviewImageObject()

ilObjMediaCastGUI::extractPreviewImageObject ( )

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

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

1370  : void
1371  {
1372  $ilCtrl = $this->ctrl;
1373  $this->checkPermission("write");
1374  $this->mcst_item = new ilNewsItem($this->mc_request->getItemId());
1375  $this->video_gui->handleExtractionRequest(
1376  $this->mcst_item->getMobId()
1377  );
1378  $ilCtrl->redirect($this, "editCastItem");
1379  }
A news item can be created by different sources.
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
+ Here is the call graph for this function:

◆ finishSingleUpload()

ilObjMediaCastGUI::finishSingleUpload ( int  $mob_id)

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

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

Referenced by executeCommand().

382  : void
383  {
384  foreach ($this->object->getSortedItemsArray() as $item) {
385  if ($mob_id == $item["mob_id"]) {
386  $this->ctrl->setParameter($this, "item_id", $item["id"]);
387  $this->ctrl->redirect($this, "editCastItem");
388  }
389  }
390  $this->ctrl->redirect($this, "listItems");
391  }
+ 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 517 of file class.ilObjMediaCastGUI.php.

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

Referenced by editCastItemObject().

517  : void
518  {
519  $lng = $this->lng;
520 
521  // get mob
522  $this->mcst_item = new ilNewsItem(
523  $item_id
524  );
525  $mob = new ilObjMediaObject($this->mcst_item->getMobId());
526 
527  $values = array();
528  $mediaItems = $this->getMediaItems(
529  $this->mc_request->getItemId()
530  );
531  if (count($mediaItems) > 0) {
532  foreach ($mediaItems as $med) {
533  if (!isset($values["title"])) {
534  // first item, so set title, description, ...
535  $values["title"] = $this->mcst_item->getTitle();
536  $values["description"] = $this->mcst_item->getContent();
537  $values["visibility"] = $this->mcst_item->getVisibility();
538  $length = explode(":", $this->mcst_item->getPlaytime());
539  $values["duration"] = array("hh" => $length[0], "mm" => $length[1], "ss" => $length[2]);
540  }
541 
542  $values["value_" . $med->getPurpose()] = (strlen($med->getLocation()) > 100) ? "..." . substr($med->getLocation(), strlen($med->getLocation()) - 100) : $med->getLocation();
543  $values["label_value_" . $med->getPurpose()] = (strlen($med->getLocation()) > 100) ? "..." . substr($med->getLocation(), strlen($med->getLocation()) - 100) : $med->getLocation();
544  $values["mimetype_" . $med->getPurpose()] = $med->getFormat();
545  }
546  }
547  foreach (ilObjMediaCast::$purposes as $purpose) {
548  if (!isset($values["value_" . $purpose])) {
549  $values["label_value_" . $purpose] = $lng->txt("none");
550  $values["value_" . $purpose] = $lng->txt("none");
551  }
552  }
553  $this->form_gui->setValuesByArray($values);
554  }
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...
ilLanguage $lng
static array $purposes
A news item can be created by different sources.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getCommentGUI()

ilObjMediaCastGUI::getCommentGUI ( )
protected

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

References ILIAS\Repository\object().

Referenced by executeCommand(), and showCommentsObject().

1455  : ilCommentGUI
1456  {
1457  return $this->gui->comments()->commentGUI(
1458  $this->object->getRefId(),
1459  $this->mc_request->getItemId()
1460  );
1461  }
Comment GUI.
+ 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 642 of file class.ilObjMediaCastGUI.php.

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

Referenced by saveCastItemObject(), and updateCastItemObject().

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

◆ getFeedLink()

ilObjMediaCastGUI::getFeedLink ( )

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

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

Referenced by executeCommand(), and showContentObject().

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

◆ getManageTableGUI()

ilObjMediaCastGUI::getManageTableGUI ( )
protected

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

Referenced by listItemsObject(), and tableCommandObject().

319  {
320  return $this->gui->getMediaCastManageTableGUI($this, "tableCommand");
321  }
+ 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 1208 of file class.ilObjMediaCastGUI.php.

References ilObjMediaObject\getMediaItem().

1208  : ilMediaItem
1209  {
1210  $this->mcst_item = new ilNewsItem($id);
1211  // create dummy object in db (we need an id)
1212  $mob = new ilObjMediaObject($this->mcst_item->getMobId());
1213  return $mob->getMediaItem("Standard");
1214  }
getMediaItem(string $a_purpose)
get item for media purpose
Class ilMediaItem Media Item, component of a media object (file or reference)
A news item can be created by different sources.
+ Here is the call graph for this function:

◆ getMediaItems()

ilObjMediaCastGUI::getMediaItems ( int  $id)
protected

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

References ilObjMediaObject\getMediaItems().

Referenced by getCastItemValues().

1216  : array
1217  {
1218  $this->mcst_item = new ilNewsItem($id);
1219  // create dummy object in db (we need an id)
1220  $mob = new ilObjMediaObject($this->mcst_item->getMobId());
1221  return $mob->getMediaItems();
1222  }
A news item can be created by different sources.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ handleAutoplayTriggerObject()

ilObjMediaCastGUI::handleAutoplayTriggerObject ( )
protected

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

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

1446  : void
1447  {
1448  $this->user->writePref(
1449  "mcst_autoplay",
1450  $this->mc_request->getAutoplay()
1451  );
1452  exit;
1453  }
exit
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ handlePlayerCompletedEventObject()

ilObjMediaCastGUI::handlePlayerCompletedEventObject ( )
protected

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

References ilObjectGUI\$user, and exit.

1398  : void
1399  {
1400  $mob_id = $this->mc_request->getMobId();
1401  if ($mob_id > 0) {
1402  $ilUser = $this->user;
1403  $this->object->handleLPUpdate($ilUser->getId(), $mob_id);
1404  }
1405  exit;
1406  }
exit
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ handlePlayerEventObject()

ilObjMediaCastGUI::handlePlayerEventObject ( )

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

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

1381  : void
1382  {
1383  if ($this->mc_request->getEvent() === "play") {
1384  $player = explode("_", $this->mc_request->getPlayer());
1385  $news_id = (int) $player[1];
1386  $item = new ilNewsItem($news_id);
1387  $item->increasePlayCounter();
1388 
1389  $mob_id = $item->getMobId();
1390  if ($mob_id) {
1391  $ilUser = $this->user;
1392  $this->object->handleLPUpdate($ilUser->getId(), $mob_id);
1393  }
1394  }
1395  exit;
1396  }
A news item can be created by different sources.
exit
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ infoScreen()

ilObjMediaCastGUI::infoScreen ( )

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

References $tabs, ilTabsGUI\activateTab(), ilObjectGUI\checkPermission(), ilObjectGUI\checkPermissionBool(), ILIAS\Repository\ctrl(), ilDatePresentation\formatDate(), IL_CAL_DATETIME, ILIAS\Repository\lng(), and ILIAS\Repository\object().

Referenced by executeCommand().

1013  : void
1014  {
1015  $ilTabs = $this->tabs;
1016 
1017  $ilTabs->activateTab("id_info");
1018 
1019  if (!$this->checkPermissionBool("read")) {
1020  $this->checkPermission("visible");
1021  }
1022 
1023  $info = new ilInfoScreenGUI($this);
1024 
1025  $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
1026  $info->enablePrivateNotes();
1027 
1028  // general information
1029  $this->lng->loadLanguageModule("meta");
1030  $this->lng->loadLanguageModule("mcst");
1031  $med_items = $this->object->getItemsArray();
1032  $info->addSection($this->lng->txt("meta_general"));
1033  $info->addProperty(
1034  $this->lng->txt("mcst_nr_items"),
1035  count($med_items)
1036  );
1037 
1038  if (count($med_items) > 0) {
1039  $cur = current($med_items);
1040  $last = ilDatePresentation::formatDate(new ilDateTime($cur["creation_date"], IL_CAL_DATETIME));
1041  } else {
1042  $last = "-";
1043  }
1044 
1045  $info->addProperty($this->lng->txt("mcst_last_submission"), $last);
1046 
1047  // forward the command
1048  $this->ctrl->forwardCommand($info);
1049  }
const IL_CAL_DATETIME
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
activateTab(string $a_id)
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
+ 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 1005 of file class.ilObjMediaCastGUI.php.

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

1005  : void
1006  {
1007  if (!$this->checkPermissionBool("read")) {
1008  $this->checkPermission("visible");
1009  }
1010  $this->ctrl->redirectByClass(ilInfoScreenGUI::class, "showSummary");
1011  }
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
+ Here is the call graph for this function:

◆ initAddCastItemForm()

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

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

References ilObjectGUI\$ctrl, ilObjectGUI\$lng, ilObjMediaCast\$purposes, $tabs, ilObjectGUI\checkPermission(), ilNewsItem\getMobId(), ilObjectGUI\getObject(), ilLanguage\loadLanguageModule(), ILIAS\Repository\object(), ilRadioOption\setInfo(), ilFormPropertyGUI\setInfo(), ilRegExpInputGUI\setPattern(), ilFormPropertyGUI\setRequired(), ilFileInputGUI\setSuffixes(), ilLanguage\txt(), and ilObjMediaCast\VIEW_IMG_GALLERY.

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

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

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

◆ listItemsObject()

ilObjMediaCastGUI::listItemsObject ( bool  $a_presentation_mode = false)

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

References ilObjectGUI\$access, ilObjectGUI\$lng, ilObjectGUI\$toolbar, ilObjectGUI\$tpl, addContentSubTabs(), ilObjectGUI\checkPermission(), ILIAS\Repository\ctrl(), ILIAS\Repository\event(), getManageTableGUI(), ILIAS\Repository\html(), ILIAS\Repository\lng(), ILIAS\Repository\object(), ILIAS\UICore\GlobalTemplate\setContent(), ilLanguage\txt(), ilObjMediaCast\VIEW_IMG_GALLERY, ilObjMediaCast\VIEW_PODCAST, and ilObjMediaCast\VIEW_VCAST.

Referenced by confirmDeletionItemsObject(), editOrderObject(), and showContentObject().

250  : void
251  {
252  $tpl = $this->tpl;
253  $lng = $this->lng;
254  $ilAccess = $this->access;
255  $ilToolbar = $this->toolbar;
256 
257  $this->checkPermission("write");
258 
259  if ($a_presentation_mode) {
260  $this->tpl->setOnScreenMessage('info', $this->lng->txt("mcst_view_abandoned"));
261  return;
262  }
263 
264  if ($a_presentation_mode) {
265  $this->addContentSubTabs("content");
266  } else {
267  $this->addContentSubTabs("manage");
268  }
269 
270  $med_items = $this->object->getSortedItemsArray();
271 
272  if ($a_presentation_mode) {
273  $table_gui = new ilMediaCastTableGUI($this, "showContent", false, true);
274  } else {
275  $table_gui = new ilMediaCastTableGUI($this, "listItems");
276  }
277 
278  $table_gui->setData($med_items);
279 
280  if ($ilAccess->checkAccess("write", "", $this->requested_ref_id) && !$a_presentation_mode) {
281  if (in_array($this->object->getViewMode(), [
285  ], true)) {
286  $ilToolbar->addButton($lng->txt("add"), $this->ctrl->getLinkTargetByClass("ilMediaCreationGUI", ""));
287  } else {
288  $ilToolbar->addButton($lng->txt("add"), $this->ctrl->getLinkTarget($this, "addCastItem"));
289  }
290 
291  $table_gui->addMultiCommand("confirmDeletionItems", $lng->txt("delete"));
292  $table_gui->setSelectAllCheckbox("item_id");
293  }
294 
295  $new_table = $this->getManageTableGUI();
296 
297  $script = <<<EOT
298 <script>
299  window.addEventListener('load', (event) => {
300  $(document).on('hidden.bs.modal', (e) => {
301  $('.modal-body').html('');
302  });
303  $(document).on('shown.bs.modal', (e) => {
304  window.dispatchEvent(new Event('resize'));
305  });
306  });
307 </script>
308 EOT;
309  $tpl->setContent($this->gui->ui()->renderer()->render($new_table->get()) . $script);
310  }
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...
setContent(string $a_html)
Sets content for standard template.
ilLanguage $lng
ilGlobalTemplateInterface $tpl
addContentSubTabs(string $a_active="content")
ilToolbarGUI $toolbar
ilAccessHandler $access
TableGUI class for table NewsForContext.
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ onMobUpdate()

ilObjMediaCastGUI::onMobUpdate ( int  $mob_id)
protected

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

References ILIAS\Repository\object().

Referenced by executeCommand().

393  : void
394  {
395  foreach ($this->object->getSortedItemsArray() as $item) {
396  if ($mob_id == $item["mob_id"]) {
397  $mob = new ilObjMediaObject($item["mob_id"]);
398  $mc_item = new ilNewsItem($item["id"]);
399  $mc_item->setTitle($mob->getTitle());
400  $mc_item->setContent($mob->getLongDescription());
401  $mc_item->update();
402  }
403  }
404  }
A news item can be created by different sources.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ populateFormFromPost()

ilObjMediaCastGUI::populateFormFromPost ( )
private

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

References ilObjMediaCast\$purposes, ilObjectGUI\$tpl, and ILIAS\UICore\GlobalTemplate\setContent().

Referenced by saveCastItemObject(), and updateCastItemObject().

1224  : void
1225  {
1226  $tpl = $this->tpl;
1227  $this->form_gui->setValuesByPost();
1228 
1229  //issue: we have to display the current settings
1230  // problem: POST does not contain values of disabled text fields
1231  // solution: use hidden field and label to display-> here we need to synchronize the labels
1232  // with the values from the hidden fields.
1233  foreach (ilObjMediaCast::$purposes as $purpose) {
1234  if ($this->form_gui->getInput("value_" . $purpose)) {
1235  $input = $this->form_gui->getItemByPostVar("label_value_" . $purpose);
1236  $input->setValue($this->form_gui->getInput("value_" . $purpose));
1237  }
1238  }
1239 
1240  $this->form_gui->setValuesByPost();
1241  $tpl->setContent($this->form_gui->getHTML());
1242  }
setContent(string $a_html)
Sets content for standard template.
ilGlobalTemplateInterface $tpl
static array $purposes
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderVideoObject()

ilObjMediaCastGUI::renderVideoObject ( )
protected

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

References ilObjectGUI\$html.

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

◆ saveCastItemObject()

ilObjMediaCastGUI::saveCastItemObject ( )

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

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().

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

◆ saveOrderObject()

ilObjMediaCastGUI::saveOrderObject ( )

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

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

1278  : void
1279  {
1280  $lng = $this->lng;
1281 
1282  $ids = $this->mc_request->getItemIds();
1283  asort($ids);
1284 
1285  $items = array();
1286  foreach (array_keys($ids) as $id) {
1287  $items[] = $id;
1288  }
1289  $this->object->saveOrder($items);
1290 
1291  $this->tpl->setOnScreenMessage('success', $lng->txt("settings_saved"), true);
1292  $this->ctrl->redirect($this, "editOrder");
1293  }
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...
ilLanguage $lng
+ Here is the call graph for this function:

◆ setTabs()

ilObjMediaCastGUI::setTabs ( )
protected

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

References ilObjectGUI\$access, $help, ilObjectGUI\$lng, $tabs, ilLearningProgressAccess\checkAccess(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ILIAS\Repository\object(), ilHelpGUI\setScreenIdComponent(), and ilLanguage\txt().

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

◆ showCastItemObject()

ilObjMediaCastGUI::showCastItemObject ( )

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

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

845  : void
846  {
847  $f = $this->gui->ui()->factory();
848  $item_id = $this->mc_request->getItemId();
849  $news = new ilNewsItem($item_id);
850  $mob = new ilObjMediaObject($news->getMobId());
851  $med = $mob->getMediaItem("Standard");
852  $comp = null;
853  if ($med) {
854  $file = $mob->getStandardSrc();
855  if ($this->media_type->isAudio($med->getFormat())) {
856  $comp = $f->player()->audio($file, "");
857  } elseif ($this->media_type->isVideo($med->getFormat())) {
858  $comp = $f->player()->video($file);
859  } elseif ($this->media_type->isImage($med->getFormat())) {
860  $comp = $f->image()->responsive($file, $mob->getTitle());
861  }
862 
863  }
864  if (is_null($comp)) {
865  $comp = $f->messageBox()->info($this->lng->txt("mcst_item_not_found"));
866  }
867  $this->gui->modal(
868  $this->lng->txt("mcst_preview"),
869  $this->lng->txt("close")
870  )->content([$comp])->send();
871  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
getMediaItem(string $a_purpose)
get item for media purpose
A news item can be created by different sources.
+ Here is the call graph for this function:

◆ showCommentsObject()

ilObjMediaCastGUI::showCommentsObject ( )
protected

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

References exit, and getCommentGUI().

1463  : void
1464  {
1465  echo $this->getCommentGUI()->getListHTML() . "<script>ilNotes.init(null);</script>";
1466  exit;
1467  }
exit
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ showContentObject()

ilObjMediaCastGUI::showContentObject ( )

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

References $tabs, ilObjectGUI\$tpl, ilObjectGUI\$user, ilChangeEvent\_recordReadEvent(), ilLPStatusWrapper\_updateStatus(), addContentSubTabs(), ILIAS\Repository\ctrl(), getFeedLink(), listItemsObject(), ILIAS\Repository\object(), ILIAS\UICore\GlobalTemplate\setContent(), ILIAS\UICore\GlobalTemplate\setPermanentLink(), showGallery(), ILIAS\Repository\tabs(), ilObjMediaCast\VIEW_GALLERY, ilObjMediaCast\VIEW_IMG_GALLERY, ilObjMediaCast\VIEW_PODCAST, and ilObjMediaCast\VIEW_VCAST.

1299  : void
1300  {
1301  $tpl = $this->tpl;
1302  $ilUser = $this->user;
1303  $ilTabs = $this->tabs;
1304 
1305  // need read events for parent for LP statistics
1307  "mcst",
1308  $this->object->getRefId(),
1309  $this->object->getId(),
1310  $ilUser->getId()
1311  );
1312 
1313  // trigger LP update
1314  ilLPStatusWrapper::_updateStatus($this->object->getId(), $ilUser->getId());
1315 
1316  if ($this->object->getViewMode() == ilObjMediaCast::VIEW_GALLERY) {
1317  $this->showGallery();
1318  } elseif ($this->object->getViewMode() == ilObjMediaCast::VIEW_IMG_GALLERY) {
1319  $view = new \McstImageGalleryGUI($this->object, $this->tpl, $this->getFeedLink());
1320  $view->setCompletedCallback($this->ctrl->getLinkTarget(
1321  $this,
1322  "handlePlayerCompletedEvent",
1323  "",
1324  true,
1325  false
1326  ));
1327  $this->tabs->activateTab("content");
1328  $this->addContentSubTabs("content");
1329  $tpl->setContent($this->ctrl->getHTML($view));
1330  } elseif ($this->object->getViewMode() == ilObjMediaCast::VIEW_PODCAST) {
1331  $view = new \McstPodcastGUI($this->object, $this->tpl, $this->getFeedLink());
1332  $this->tabs->activateTab("content");
1333  $this->addContentSubTabs("content");
1334  $tpl->setContent($this->ctrl->getHTML($view));
1335  } elseif ($this->object->getViewMode() == ilObjMediaCast::VIEW_VCAST) {
1336  $ilTabs->activateTab("content");
1337  $this->addContentSubTabs("content");
1338  $view = new \ILIAS\MediaCast\Presentation\VideoViewGUI($this->object, $tpl, $this->getFeedLink());
1339  $view->setCompletedCallback($this->ctrl->getLinkTarget(
1340  $this,
1341  "handlePlayerCompletedEvent",
1342  "",
1343  true,
1344  false
1345  ));
1346  $view->setAutoplayCallback($this->ctrl->getLinkTarget(
1347  $this,
1348  "handleAutoplayTrigger",
1349  "",
1350  true,
1351  false
1352  ));
1353  $view->show();
1354  } else {
1355  $this->listItemsObject(true);
1356  }
1357 
1358  $tpl->setPermanentLink($this->object->getType(), $this->object->getRefId());
1359  }
listItemsObject(bool $a_presentation_mode=false)
setContent(string $a_html)
Sets content for standard template.
ilGlobalTemplateInterface $tpl
addContentSubTabs(string $a_active="content")
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)
setPermanentLink(string $a_type, ?int $a_id, string $a_append="", string $a_target="", string $a_title="")
Generates and sets a permanent ilias link.
static _updateStatus(int $a_obj_id, int $a_usr_id, ?object $a_obj=null, bool $a_percentage=false, bool $a_force_raise=false)
+ Here is the call graph for this function:

◆ showGallery()

ilObjMediaCastGUI::showGallery ( )

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

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

Referenced by showContentObject().

1361  : void
1362  {
1363  $tpl = $this->tpl;
1364  $ilTabs = $this->tabs;
1365  $ilCtrl = $this->ctrl;
1366 
1367  $this->tpl->setOnScreenMessage('info', $this->lng->txt("mcst_view_abandoned"));
1368  }
ilGlobalTemplateInterface $tpl
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ tableCommandObject()

ilObjMediaCastGUI::tableCommandObject ( )

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

References getManageTableGUI().

312  : void
313  {
314  $new_table = $this->getManageTableGUI();
315  $new_table->handleCommand();
316  }
+ Here is the call graph for this function:

◆ updateCastItemObject()

ilObjMediaCastGUI::updateCastItemObject ( )

Update cast item.

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

References ilObjectGUI\$ctrl, $duration, $log, ilObjMediaCast\$purposes, ilObjectGUI\$user, ilObjectGUI\checkPermission(), createMediaItemForPurpose(), getDuration(), ilNewsItem\getMobId(), ilObjectGUI\getObject(), initAddCastItemForm(), ILIAS\Repository\int(), null, populateFormFromPost(), updateMediaItem(), and ilObjMediaCast\VIEW_IMG_GALLERY.

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

References $location, ilObjMediaObject\_getDirectory(), ilObjMediaObject\createDirectory(), ILIAS\Repository\filesystem(), ilFileUtils\getASCIIFilename(), ilObject\getId(), ilMediaItem\getLocation(), ilMediaItem\getLocationType(), ilObjMediaObject\getMimeType(), ilMediaItem\getPurpose(), ilFileUtils\moveUploadedFile(), ilFileUtils\renameExecutables(), ilMediaItem\setFormat(), ilMediaItem\setHAlign(), ilMediaItem\setHeight(), ilMediaItem\setLocation(), ilMediaItem\setLocationType(), and ilObject\setTitle().

Referenced by createMediaItemForPurpose(), and updateCastItemObject().

686  : string {
687  $locationType = "";
688  $location = "";
689  $file = "";
690  $purpose = $mediaItem->getPurpose();
691  $locationType = $mediaItem->getLocationType();
692  $url_gui = $this->form_gui->getInput("url_" . $purpose);
693  $file_gui = $this->form_gui->getInput("file_" . $purpose);
694  if ($url_gui) {
695  // http
696  $file = $this->form_gui->getInput("url_" . $purpose);
697  $title = basename($file);
698  $location = $this->form_gui->getInput("url_" . $purpose);
699  $locationType = "Reference";
700  } elseif ($file_gui["size"] > 0) {
701  // lokal
702  // determine and create mob directory, move uploaded file to directory
703  $mob_dir = ilObjMediaObject::_getDirectory($mob->getId());
704  if (!is_dir($mob_dir)) {
705  $mob->createDirectory();
706  } else {
707  $dir = LegacyPathHelper::createRelativePath($mob_dir);
708  $old_files = $this->filesystem->finder()->in([$dir])->exclude([$dir . '/mob_vpreview.png'])->files();
709  foreach ($old_files as $file) {
710  $this->filesystem->delete($file->getPath());
711  }
712  }
713 
714  $file_name = ilFileUtils::getASCIIFilename($_FILES['file_' . $purpose]['name']);
715  $file_name = str_replace(" ", "_", $file_name);
716 
717  $file = $mob_dir . "/" . $file_name;
718  $title = $file_name;
719  $locationType = "LocalFile";
720  $location = $title;
721  ilFileUtils::moveUploadedFile($_FILES['file_' . $purpose]['tmp_name'], $file_name, $file);
723  }
724 
725  // check if not automatic mimetype detection
726  $format = ilObjMediaObject::getMimeType($mediaItem->getLocation(), ($locationType === "Reference"));
727  $mediaItem->setFormat($format);
728 
729  if ($file != "") {
730  // get mime type, if not already set!
731  if ($format === "") {
732  $format = ilObjMediaObject::getMimeType($file, ($locationType === "Reference"));
733  }
734 
735  // set real meta and object data
736  $mediaItem->setFormat($format);
737  $mediaItem->setLocation($location);
738  $mediaItem->setLocationType($locationType);
739  $mediaItem->setHAlign("Left");
740  $mediaItem->setHeight(self::isAudio($format) ? 0 : 180);
741  $mob->generatePreviewPic(320, 240);
742  }
743 
744  if (($purpose === "Standard") && isset($title)) {
745  $mob->setTitle($title);
746  }
747 
748  return $file;
749  }
$location
Definition: buildRTE.php:22
setLocation(string $a_location)
createDirectory()
Create file directory of media object.
setTitle(string $title)
setFormat(string $a_format)
static getASCIIFilename(string $a_filename)
setHAlign(string $a_halign)
set horizontal align
static renameExecutables(string $a_dir)
static _getDirectory(int $a_mob_id)
Get absolute directory.
static getMimeType(string $a_file, bool $a_external=false)
get mime type for file
static moveUploadedFile(string $a_file, string $a_name, string $a_target, bool $a_raise_errors=true, string $a_mode="move_uploaded")
move uploaded file
setHeight(string $a_height)
setLocationType(string $a_type)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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.

◆ $help

ilHelpGUI ilObjMediaCastGUI::$help
protected

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

Referenced by setTabs().

◆ $log

ilLogger ilObjMediaCastGUI::$log
protected

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

Referenced by updateCastItemObject().

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

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

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