ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilObjMediaCastGUI Class Reference
+ Inheritance diagram for ilObjMediaCastGUI:
+ Collaboration diagram for ilObjMediaCastGUI:

Public Member Functions

 __construct ( $a_data, int $a_id, bool $a_call_by_reference, bool $a_prepare_output=true)
 
 executeCommand ()
 
 listItemsObject (bool $a_presentation_mode=false)
 
 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 ()
 
 initSettingsForm ()
 Init Settings Form. More...
 
 saveSettingsObject ()
 
 saveOrderObject ()
 
 showContentObject ()
 
 showGallery ()
 
 extractPreviewImageObject ()
 
 handlePlayerEventObject ()
 
- Public Member Functions inherited from ilObjectGUI
 __construct ($data, int $id=0, bool $call_by_reference=true, bool $prepare_output=true)
 
 getRefId ()
 
 setAdminMode (string $mode)
 
 getAdminMode ()
 
 getObject ()
 
 executeCommand ()
 
 withReferences ()
 determines whether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode (bool $mode=true)
 If true, a creation screen is displayed the current [ref_id] 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)
 
 redirectAfterCreation ()
 Redirect after creation, see https://docu.ilias.de/goto_docu_wiki_wpage_5035_1357.html Should be overwritten and redirect to settings screen. More...
 
 addToDeskObject ()
 
 removeFromDeskObject ()
 
- Public Member Functions inherited from ILIAS\Object\ImplementsCreationCallback
 callCreationCallback (\ilObject $object, \ilObjectDefinition $obj_definition, int $requested_crtcb)
 

Static Public Member Functions

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

Protected Member Functions

 initCreationForms (string $new_type)
 
 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 ()
 
- 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...
 
 initCreationForms (string $new_type)
 Init creation forms. More...
 
 getCreationFormsHTML (array $forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm (string $new_type)
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 addAdoptContentLinkToToolbar ()
 
 addAvailabilityPeriodButtonToToolbar (ilToolbarGUI $toolbar)
 
 afterSave (ilObject $new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 initImportForm (string $new_type)
 
 importFileObject (int $parent_id=null)
 
 afterImport (ilObject $new_object)
 Post (successful) object import hook. More...
 
 setFormAction (string $cmd, string $form_action)
 
 getReturnLocation (string $cmd, string $default_location="")
 Get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation (string $cmd, string $location)
 set specific return location for command More...
 
 getTargetFrame (string $cmd, string $default_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame (string $cmd, string $target_frame)
 Set specific target frame for command. More...
 
 showPossibleSubObjects ()
 show possible sub objects (pull down menu) More...
 
 getTabs ()
 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...
 

Static Protected Member Functions

static isAudio (string $extension)
 

Protected Attributes

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
 
Factory $refinery
 
ilFavouritesManager $favourites
 
ilObjectCustomIconFactory $custom_icon_factory
 
UIFactory $ui_factory
 
UIRenderer $ui_renderer
 
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 ALLOWED_TAGS_IN_TITLE_AND_DESCRIPTION
 
const ADMIN_MODE_NONE = ""
 
const ADMIN_MODE_SETTINGS = "settings"
 
const ADMIN_MODE_REPOSITORY = "repository"
 
const UPLOAD_TYPE_LOCAL = 1
 
const UPLOAD_TYPE_UPLOAD_DIRECTORY = 2
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

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

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

References $DIC, ilObjectGUI\$lng, ilObjectGUI\$settings, ILIAS\MetaData\Repository\Validation\Data\__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().

56  {
57  global $DIC;
58 
59  $this->ctrl = $DIC->ctrl();
60  $this->lng = $DIC->language();
61  $this->user = $DIC->user();
62  $this->tabs = $DIC->tabs();
63  $this->tpl = $DIC["tpl"];
64  $this->access = $DIC->access();
65  $this->toolbar = $DIC->toolbar();
66  $this->filesystem = $DIC->filesystem()->web();
67  $this->log = $DIC["ilLog"];
68  $this->help = $DIC["ilHelp"];
69  $this->locator = $DIC["ilLocator"];
70  $ilCtrl = $DIC->ctrl();
71  $lng = $DIC->language();
72  $this->mc_request = $DIC->mediaCast()
73  ->internal()
74  ->gui()
75  ->standardRequest();
76 
77  $this->type = "mcst";
78  parent::__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
79  $lng->loadLanguageModule("mcst");
80  $lng->loadLanguageModule("news");
81  $lng->loadLanguageModule("rep");
82 
83  $ilCtrl->saveParameter($this, "item_id");
84 
86 
87  if ($this->object) {
88  $this->mc_manager = $DIC->mediaCast()->internal()
89  ->domain()->mediaCast($this->object);
90  }
91  $this->gui = $DIC->mediaCast()->internal()->gui();
92  $this->media_type = $DIC->mediaObjects()->internal()->domain()->mediaType();
93  $this->video_gui = $DIC->mediaObjects()->internal()->gui()->video();
94  }
loadLanguageModule(string $a_module)
Load language module.
global $DIC
Definition: feed.php:28
ilLanguage $lng
__construct(VocabulariesInterface $vocabularies)
ilSetting $settings
+ Here is the call graph for this function:

Member Function Documentation

◆ _goto()

static ilObjMediaCastGUI::_goto ( string  $a_target)
static

Definition at line 1416 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().

1416  : void
1417  {
1418  global $DIC;
1419  $main_tpl = $DIC->ui()->mainTemplate();
1420 
1421  $ilAccess = $DIC->access();
1422  $lng = $DIC->language();
1423  $ctrl = $DIC->ctrl();
1424 
1425  if ($ilAccess->checkAccess("read", "", $a_target)) {
1426  $ctrl->setParameterByClass("ilobjmediacastgui", "ref_id", $a_target);
1427  $ctrl->redirectByClass(["ilmediacasthandlergui", "ilobjmediacastgui"], "showContent");
1428  } elseif ($ilAccess->checkAccess("visible", "", $a_target)) {
1429  ilObjectGUI::_gotoRepositoryNode($a_target, "infoScreen");
1430  } elseif ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID)) {
1431  $main_tpl->setOnScreenMessage('failure', sprintf(
1432  $lng->txt("msg_no_perm_read_item"),
1434  ));
1436  }
1437 
1438  throw new ilPermissionException($lng->txt("msg_no_perm_read"));
1439  }
redirectByClass( $a_class, string $a_cmd=null, string $a_anchor=null, bool $is_async=false)
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)
static _lookupObjId(int $ref_id)
global $DIC
Definition: feed.php:28
ilLanguage $lng
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupTitle(int $obj_id)
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 324 of file class.ilObjMediaCastGUI.php.

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

324  : void
325  {
326  $tpl = $this->tpl;
327 
328  $this->checkPermission("write");
329 
330  $this->initAddCastItemForm();
331  $tpl->setContent($this->form_gui->getHTML());
332  }
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.
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 1107 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().

1109  : void {
1110  $ilTabs = $this->tabs;
1111  $ilAccess = $this->access;
1112  $lng = $this->lng;
1113 
1114  $ilTabs->addSubTab(
1115  "content",
1116  $lng->txt("view"),
1117  $this->ctrl->getLinkTarget($this, "showContent")
1118  );
1119 
1120  if ($ilAccess->checkAccess("write", "", $this->requested_ref_id)) {
1121  $ilTabs->addSubTab(
1122  "manage",
1123  $lng->txt("mcst_manage"),
1124  $this->ctrl->getLinkTarget($this, "listItems")
1125  );
1126 
1127  if ($this->object->getOrder() == ilObjMediaCast::ORDER_MANUAL) {
1128  $ilTabs->addSubTab(
1129  "sorting",
1130  $lng->txt("mcst_ordering"),
1131  $this->ctrl->getLinkTarget($this, "editOrder")
1132  );
1133  }
1134  }
1135 
1136  $ilTabs->activateSubTab($a_active);
1137  $ilTabs->activateTab("content");
1138  }
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 1407 of file class.ilObjMediaCastGUI.php.

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

1407  : void
1408  {
1409  $ilLocator = $this->locator;
1410 
1411  if (is_object($this->object)) {
1412  $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this, "showContent"), "", $this->requested_ref_id);
1413  }
1414  }
addItem(string $a_title, string $a_link, string $a_frame="", int $a_ref_id=0, ?string $type=null)
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 1659 of file class.ilObjMediaCastGUI.php.

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

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

1664  : void {
1665  $ctrl = $this->ctrl;
1666  $user = $this->user;
1667 
1668  $item_ids = [];
1669  foreach ($mob_ids as $mob_id) {
1670  $item_ids[] = $this->object->addMobToCast($mob_id, $user->getId(), $long_desc, $extract);
1671  }
1672 
1673  if ($redirect) {
1674  if (count($item_ids) === 1) {
1675  $ctrl->setParameter($this, "item_id", $item_ids[0]);
1676  $ctrl->redirect($this, "editCastItem");
1677  }
1678  $ctrl->redirect($this, "listItems");
1679  }
1680  }
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 1682 of file class.ilObjMediaCastGUI.php.

References addMobsToCast().

Referenced by executeCommand().

1682  : void
1683  {
1684  $this->addMobsToCast($mob_ids, "", true, true);
1685  }
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 221 of file class.ilObjMediaCastGUI.php.

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

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

◆ afterUpload()

ilObjMediaCastGUI::afterUpload (   $mob_ids)
protected

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

References addMobsToCast().

Referenced by executeCommand().

1649  : void
1650  {
1651  $this->addMobsToCast($mob_ids, "", false);
1652  }
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 1654 of file class.ilObjMediaCastGUI.php.

References addMobsToCast().

Referenced by executeCommand().

1654  : void
1655  {
1656  $this->addMobsToCast([$mob_id], $long_desc);
1657  }
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 888 of file class.ilObjMediaCastGUI.php.

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

888  : void
889  {
890  $ilCtrl = $this->ctrl;
891  $lng = $this->lng;
892  $tpl = $this->tpl;
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  }
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)
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
ilLanguage $lng
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.
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 864 of file class.ilObjMediaCastGUI.php.

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

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

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

Referenced by saveCastItemObject(), and updateCastItemObject().

647  : string {
648  $mediaItem = new ilMediaItem();
649  $mob->addMediaItem($mediaItem);
650  $mediaItem->setPurpose($purpose);
651  return $this->updateMediaItem($mob, $mediaItem);
652  }
addMediaItem(ilMediaItem $a_item)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
updateMediaItem(ilObjMediaObject $mob, ilMediaItem $mediaItem)
Update media item from form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deleteItemsObject()

ilObjMediaCastGUI::deleteItemsObject ( )

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

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

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

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

964  : void
965  {
966  $ilCtrl = $this->ctrl;
967  $lng = $this->lng;
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  }
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 947 of file class.ilObjMediaCastGUI.php.

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

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, "listItems");
960  }
961  exit;
962  }
exit
Definition: login.php:29
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:

◆ editCastItemObject()

ilObjMediaCastGUI::editCastItemObject ( )

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

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

334  : void
335  {
336  $item_id = $this->mc_request->getItemId();
337  $this->ctrl->setParameterByClass(self::class, "item_id", $item_id);
338 
339  $tpl = $this->tpl;
340  $ilToolbar = $this->toolbar;
341  $ilCtrl = $this->ctrl;
342 
343  $this->checkPermission("write");
344 
345  $this->mcst_item = new ilNewsItem(
346  $this->mc_request->getItemId()
347  );
348 
349  // conversion toolbar
350  $this->video_gui->addPreviewExtractionToToolbar(
351  $this->mcst_item->getMobId(),
352  self::class
353  );
354 
355  $this->initAddCastItemForm("edit");
356  $this->getCastItemValues($item_id);
357  $tpl->setContent($this->form_gui->getHTML());
358  }
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.
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:

◆ editOrderObject()

ilObjMediaCastGUI::editOrderObject ( )
protected

Definition at line 1485 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, ilGlobalTemplateInterface\setContent(), and ilLanguage\txt().

1485  : void
1486  {
1487  $ilTabs = $this->tabs;
1488  $lng = $this->lng;
1489  $tpl = $this->tpl;
1490 
1491  $this->checkPermission("write");
1492  $ilTabs->activateTab("edit_content");
1493 
1494  $this->addContentSubTabs("sorting");
1495 
1496  // sort by order setting
1497  switch ($this->object->getOrder()) {
1501  $this->listItemsObject();
1502  return;
1503 
1505  // sub-tabs
1506  break;
1507  }
1508 
1509  $table_gui = new ilMediaCastTableGUI($this, "editOrder", true);
1510 
1511  $table_gui->setTitle($lng->txt("mcst_media_cast"));
1512  $table_gui->setData($this->object->getSortedItemsArray());
1513 
1514  $table_gui->addCommandButton("saveOrder", $lng->txt("mcst_save_order"));
1515 
1516  $tpl->setContent($table_gui->getHTML());
1517  }
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)
ilLanguage $lng
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.
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 1140 of file class.ilObjMediaCastGUI.php.

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

1140  : void
1141  {
1142  $tpl = $this->tpl;
1143  $ilTabs = $this->tabs;
1144 
1145  $this->checkPermission("write");
1146  $ilTabs->activateTab("id_settings");
1147 
1148  $this->initSettingsForm();
1149  $tpl->setContent($this->form_gui->getHTML());
1150  }
initSettingsForm()
Init Settings Form.
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
+ Here is the call graph for this function:

◆ executeCommand()

ilObjMediaCastGUI::executeCommand ( )

Definition at line 96 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.

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

◆ extractPreviewImageObject()

ilObjMediaCastGUI::extractPreviewImageObject ( )

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

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

1611  : void
1612  {
1613  $ilCtrl = $this->ctrl;
1614  $this->checkPermission("write");
1615  $this->mcst_item = new ilNewsItem($this->mc_request->getItemId());
1616  $this->video_gui->handleExtractionRequest(
1617  $this->mcst_item->getMobId()
1618  );
1619  $ilCtrl->redirect($this, "editCastItem");
1620  }
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 360 of file class.ilObjMediaCastGUI.php.

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

Referenced by executeCommand().

360  : void
361  {
362  foreach ($this->object->getSortedItemsArray() as $item) {
363  if ($mob_id == $item["mob_id"]) {
364  $this->ctrl->setParameter($this, "item_id", $item["id"]);
365  $this->ctrl->redirect($this, "editCastItem");
366  }
367  }
368  $this->ctrl->redirect($this, "listItems");
369  }
+ 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 495 of file class.ilObjMediaCastGUI.php.

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

Referenced by editCastItemObject().

495  : void
496  {
497  $lng = $this->lng;
498 
499  // get mob
500  $this->mcst_item = new ilNewsItem(
501  $item_id
502  );
503  $mob = new ilObjMediaObject($this->mcst_item->getMobId());
504 
505  $values = array();
506  $mediaItems = $this->getMediaItems(
507  $this->mc_request->getItemId()
508  );
509  if (count($mediaItems) > 0) {
510  foreach ($mediaItems as $med) {
511  if (!isset($values["title"])) {
512  // first item, so set title, description, ...
513  $values["title"] = $this->mcst_item->getTitle();
514  $values["description"] = $this->mcst_item->getContent();
515  $values["visibility"] = $this->mcst_item->getVisibility();
516  $length = explode(":", $this->mcst_item->getPlaytime());
517  $values["duration"] = array("hh" => $length[0], "mm" => $length[1], "ss" => $length[2]);
518  }
519 
520  $values["value_" . $med->getPurpose()] = (strlen($med->getLocation()) > 100) ? "..." . substr($med->getLocation(), strlen($med->getLocation()) - 100) : $med->getLocation();
521  $values["label_value_" . $med->getPurpose()] = (strlen($med->getLocation()) > 100) ? "..." . substr($med->getLocation(), strlen($med->getLocation()) - 100) : $med->getLocation();
522  $values["mimetype_" . $med->getPurpose()] = $med->getFormat();
523  }
524  }
525  foreach (ilObjMediaCast::$purposes as $purpose) {
526  if (!isset($values["value_" . $purpose])) {
527  $values["label_value_" . $purpose] = $lng->txt("none");
528  $values["value_" . $purpose] = $lng->txt("none");
529  }
530  }
531  $this->form_gui->setValuesByArray($values);
532  }
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 1696 of file class.ilObjMediaCastGUI.php.

References ILIAS\Repository\object().

Referenced by executeCommand(), and showCommentsObject().

1696  : ilCommentGUI
1697  {
1698  return $this->gui->comments()->commentGUI(
1699  $this->object->getRefId(),
1700  $this->mc_request->getItemId()
1701  );
1702  }
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 620 of file class.ilObjMediaCastGUI.php.

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

Referenced by saveCastItemObject(), and updateCastItemObject().

620  : string
621  {
622  $duration = isset($this->form_gui)
623  ? $this->form_gui->getInput("duration")
624  : array("hh" => 0, "mm" => 0, "ss" => 0);
625 
626  $duration_str = str_pad($duration["hh"], 2, "0", STR_PAD_LEFT) . ":" .
627  str_pad($duration["mm"], 2, "0", STR_PAD_LEFT) . ":" .
628  str_pad($duration["ss"], 2, "0", STR_PAD_LEFT);
629 
630  if ($duration["hh"] == 0 && $duration["mm"] == 0 && $duration["ss"] == 0) {
631  $media_item->determineDuration();
632  $d = $media_item->getDuration();
633  if ($d > 0) {
634  $duration_str = $this->object->getPlaytimeForSeconds($d);
635  }
636  }
637 
638  return $duration_str;
639  }
$duration
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getFeedLink()

ilObjMediaCastGUI::getFeedLink ( )

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

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

Referenced by executeCommand(), and showContentObject().

301  : string
302  {
303  $public_feed = ilBlockSetting::_lookup(
304  "news",
305  "public_feed",
306  0,
307  $this->object->getId()
308  );
309  $url = "";
310  // rss icon/link
311  if ($public_feed) {
312  $news_set = new ilSetting("news");
313  $enable_internal_rss = $news_set->get("enable_rss_for_internal");
314  if ($enable_internal_rss) {
315  $url = ILIAS_HTTP_PATH . "/feed.php?client_id=" . rawurlencode(CLIENT_ID) . "&" . "ref_id=" . $this->requested_ref_id;
316  }
317  }
318  return $url;
319  }
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
$url
Definition: ltiregstart.php:35
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getManageTableGUI()

ilObjMediaCastGUI::getManageTableGUI ( )
protected

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

Referenced by listItemsObject(), and tableCommandObject().

297  {
298  return $this->gui->getMediaCastManageTableGUI($this, "tableCommand");
299  }
+ 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 1449 of file class.ilObjMediaCastGUI.php.

References ilObjMediaObject\getMediaItem().

1449  : ilMediaItem
1450  {
1451  $this->mcst_item = new ilNewsItem($id);
1452  // create dummy object in db (we need an id)
1453  $mob = new ilObjMediaObject($this->mcst_item->getMobId());
1454  return $mob->getMediaItem("Standard");
1455  }
getMediaItem(string $a_purpose)
get item for media purpose
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.
+ Here is the call graph for this function:

◆ getMediaItems()

ilObjMediaCastGUI::getMediaItems ( int  $id)
protected

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

References ilObjMediaObject\getMediaItems().

Referenced by getCastItemValues().

1457  : array
1458  {
1459  $this->mcst_item = new ilNewsItem($id);
1460  // create dummy object in db (we need an id)
1461  $mob = new ilObjMediaObject($this->mcst_item->getMobId());
1462  return $mob->getMediaItems();
1463  }
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 1687 of file class.ilObjMediaCastGUI.php.

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

1687  : void
1688  {
1689  $this->user->writePref(
1690  "mcst_autoplay",
1691  $this->mc_request->getAutoplay()
1692  );
1693  exit;
1694  }
exit
Definition: login.php:29
+ Here is the call graph for this function:

◆ handlePlayerCompletedEventObject()

ilObjMediaCastGUI::handlePlayerCompletedEventObject ( )
protected

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

References ilObjectGUI\$user, and exit.

1639  : void
1640  {
1641  $mob_id = $this->mc_request->getMobId();
1642  if ($mob_id > 0) {
1643  $ilUser = $this->user;
1644  $this->object->handleLPUpdate($ilUser->getId(), $mob_id);
1645  }
1646  exit;
1647  }
exit
Definition: login.php:29

◆ handlePlayerEventObject()

ilObjMediaCastGUI::handlePlayerEventObject ( )

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

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

1622  : void
1623  {
1624  if ($this->mc_request->getEvent() === "play") {
1625  $player = explode("_", $this->mc_request->getPlayer());
1626  $news_id = (int) $player[1];
1627  $item = new ilNewsItem($news_id);
1628  $item->increasePlayCounter();
1629 
1630  $mob_id = $item->getMobId();
1631  if ($mob_id) {
1632  $ilUser = $this->user;
1633  $this->object->handleLPUpdate($ilUser->getId(), $mob_id);
1634  }
1635  }
1636  exit;
1637  }
exit
Definition: login.php:29
A news item can be created by different sources.
+ Here is the call graph for this function:

◆ infoScreen()

ilObjMediaCastGUI::infoScreen ( )

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

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

Referenced by executeCommand(), and infoScreenObject().

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

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

996  : void
997  {
998  if (!$this->checkPermissionBool("read")) {
999  $this->checkPermission("visible");
1000  }
1001  $this->ctrl->setCmd("showSummary");
1002  $this->ctrl->setCmdClass("ilinfoscreengui");
1003  $this->infoScreen();
1004  }
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 384 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().

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

◆ initCreationForms()

ilObjMediaCastGUI::initCreationForms ( string  $new_type)
protected

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

References ilObjectGUI\initCreateForm(), and ilObjectGUI\initImportForm().

213  : array
214  {
215  $forms = array(self::CFORM_NEW => $this->initCreateForm($new_type),
216  self::CFORM_IMPORT => $this->initImportForm($new_type));
217 
218  return $forms;
219  }
initImportForm(string $new_type)
initCreateForm(string $new_type)
+ Here is the call graph for this function:

◆ initSettingsForm()

ilObjMediaCastGUI::initSettingsForm ( )

Init Settings Form.

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

References $comments, ilObjectGUI\$ctrl, ilObjectGUI\$lng, ilObjectGUI\$object_service, ilBlockSetting\_lookup(), ilNewsItem\_lookupRSSPeriod(), ilRadioGroupInputGUI\addOption(), ilObjMediaCast\AUTOPLAY_ACT, ilObjMediaCast\AUTOPLAY_INACT, ilObjMediaCast\AUTOPLAY_NO, ilLearningProgressAccess\checkAccess(), ILIAS\Repository\lng(), ilLanguage\loadLanguageModule(), ILIAS\Repository\object(), ilObjMediaCast\ORDER_CREATION_DATE_ASC, ilObjMediaCast\ORDER_CREATION_DATE_DESC, ilObjMediaCast\ORDER_MANUAL, ilObjMediaCast\ORDER_TITLE, ilFormPropertyGUI\setInfo(), ILIAS\Repository\settings(), ilTextAreaInputGUI\setValue(), ilLanguage\txt(), ilObjMediaCast\VIEW_IMG_GALLERY, ilObjMediaCast\VIEW_PODCAST, and ilObjMediaCast\VIEW_VCAST.

Referenced by editSettingsObject(), and saveSettingsObject().

1155  : void
1156  {
1157  $lng = $this->lng;
1158  $ilCtrl = $this->ctrl;
1159  $obj_service = $this->object_service;
1160 
1161  $lng->loadLanguageModule("mcst");
1162 
1163  $this->form_gui = new ilPropertyFormGUI();
1164  $this->form_gui->setTitle($lng->txt("mcst_settings"));
1165 
1166  // Title
1167  $tit = new ilTextInputGUI($lng->txt("title"), "title");
1168  $tit->setValue($this->object->getTitle());
1169  $tit->setRequired(true);
1170  $this->form_gui->addItem($tit);
1171 
1172  // description
1173  $des = new ilTextAreaInputGUI($lng->txt("description"), "description");
1174  $des->setValue($this->object->getLongDescription());
1175  $this->form_gui->addItem($des);
1176 
1177  $sh = new ilFormSectionHeaderGUI();
1178  $sh->setTitle($lng->txt("rep_activation_availability"));
1179  $this->form_gui->addItem($sh);
1180 
1181  // Online
1182  $online = new ilCheckboxInputGUI($lng->txt("online"), "online");
1183  $online->setChecked($this->object->getOnline());
1184  $this->form_gui->addItem($online);
1185 
1186  // presentation
1187  $sh = new ilFormSectionHeaderGUI();
1188  $sh->setTitle($lng->txt("obj_presentation"));
1189  $this->form_gui->addItem($sh);
1190 
1191  // tile image
1192  $obj_service->commonSettings()->legacyForm($this->form_gui, $this->object)->addTileImage();
1193 
1194  // Sorting
1195  $sort = new ilRadioGroupInputGUI($lng->txt("mcst_ordering"), "order");
1196  $sort->addOption(new ilRadioOption(
1197  $lng->txt("mcst_ordering_title"),
1199  ));
1200  $sort->addOption(new ilRadioOption(
1201  $lng->txt("mcst_ordering_creation_date_asc"),
1203  ));
1204  $sort->addOption(new ilRadioOption(
1205  $lng->txt("mcst_ordering_creation_date_desc"),
1207  ));
1208  $sort->addOption(new ilRadioOption(
1209  $lng->txt("mcst_ordering_manual"),
1211  ));
1212  $sort->setValue($this->object->getOrder());
1213  $this->form_gui->addItem($sort);
1214 
1215  // view mode
1216  $si = new ilRadioGroupInputGUI($this->lng->txt("mcst_viewmode"), "viewmode");
1217  /*$si->addOption(new ilRadioOption(
1218  $lng->txt("mcst_list"),
1219  ilObjMediaCast::VIEW_LIST
1220  ));
1221  $si->addOption(new ilRadioOption(
1222  $lng->txt("mcst_gallery"),
1223  ilObjMediaCast::VIEW_GALLERY
1224  ));*/
1225  $si->addOption(new ilRadioOption(
1226  $lng->txt("mcst_img_gallery"),
1228  ));
1229  $si->addOption(new ilRadioOption(
1230  $lng->txt("mcst_podcast"),
1232  ));
1233  $si->addOption($vc_opt = new ilRadioOption(
1234  $lng->txt("mcst_video_cast"),
1236  ));
1237 
1238  // $si->setOptions($options);
1239  $si->setValue($this->object->getViewMode());
1240  $this->form_gui->addItem($si);
1241 
1242  // autoplay
1243  $options = array(
1244  ilObjMediaCast::AUTOPLAY_NO => $lng->txt("mcst_no_autoplay"),
1245  ilObjMediaCast::AUTOPLAY_ACT => $lng->txt("mcst_autoplay_active"),
1246  ilObjMediaCast::AUTOPLAY_INACT => $lng->txt("mcst_autoplay_inactive")
1247  );
1248  $si = new ilSelectInputGUI($lng->txt("mcst_autoplay"), "autoplaymode");
1249  $si->setInfo($lng->txt("mcst_autoplay_info"));
1250  $si->setOptions($options);
1251  $si->setValue($this->object->getAutoplayMode());
1252  $vc_opt->addSubItem($si);
1253 
1254  // number of initial videos
1255  $ti = new ilNumberInputGUI($lng->txt("mcst_nr_videos"), "nr_videos");
1256  $ti->setValue(max(1, $this->object->getNumberInitialVideos()));
1257  $ti->setMinValue(1);
1258  $ti->setSize(2);
1259  $vc_opt->addSubItem($ti);
1260 
1261  // Downloadable
1262  $downloadable = new ilCheckboxInputGUI($lng->txt("mcst_downloadable"), "downloadable");
1263  $downloadable->setChecked($this->object->getDownloadable());
1264  $downloadable->setInfo($lng->txt("mcst_downloadable_info"));
1265  $this->form_gui->addItem($downloadable);
1266 
1267  $news_set = new ilSetting("news");
1268  $enable_internal_rss = $news_set->get("enable_rss_for_internal");
1269 
1270  //Default Visibility
1271  if ($enable_internal_rss) {
1272  // webfeed
1273  $sh = new ilFormSectionHeaderGUI();
1274  $sh->setTitle($lng->txt("mcst_webfeed"));
1275  $this->form_gui->addItem($sh);
1276 
1277  $radio_group = new ilRadioGroupInputGUI($lng->txt("news_default_visibility"), "defaultaccess");
1278  $radio_option = new ilRadioOption($lng->txt("news_visibility_users"), "0");
1279  $radio_option->setInfo($lng->txt("news_news_item_def_visibility_users_info"));
1280  $radio_group->addOption($radio_option);
1281  $radio_option = new ilRadioOption($lng->txt("news_visibility_public"), "1");
1282  $radio_option->setInfo($lng->txt("news_news_item_def_visibility_public_info"));
1283  $radio_group->addOption($radio_option);
1284  $radio_group->setRequired(false);
1285  $radio_group->setValue($this->object->getDefaultAccess());
1286  #$ch->addSubItem($radio_group);
1287  $this->form_gui->addItem($radio_group);
1288 
1289  //Extra Feed
1290  $public_feed = ilBlockSetting::_lookup("news", "public_feed", 0, $this->object->getId());
1291  $ch = new ilCheckboxInputGUI($lng->txt("news_public_feed"), "extra_feed");
1292  $ch->setInfo($lng->txt("news_public_feed_info"));
1293  $ch->setChecked((bool) $public_feed);
1294  $this->form_gui->addItem($ch);
1295 
1296  // keep minimal x number of items
1297  $ni = new ilNumberInputGUI($this->lng->txt("news_keep_minimal_x_items"), "keep_rss_min");
1298  $ni->setMaxValue(100);
1299  $ni->setMinValue(0);
1300  $ni->setMaxLength(3);
1301  $ni->setSize(3);
1302  $ni->setInfo($this->lng->txt("news_keep_minimal_x_items_info") . " (" .
1303  ilNewsItem::_lookupRSSPeriod() . " " . (ilNewsItem::_lookupRSSPeriod() == 1 ? $lng->txt("day") : $lng->txt("days")) . ")");
1304  $ni->setValue((int) ilBlockSetting::_lookup("news", "keep_rss_min", 0, $this->object->getId()));
1305  $ch->addSubItem($ni);
1306 
1307  // Include Files in Pubic Items
1308  $incl_files = new ilCheckboxInputGUI($lng->txt("mcst_incl_files_in_rss"), "public_files");
1309  $incl_files->setChecked($this->object->getPublicFiles());
1310  $incl_files->setInfo($lng->txt("mcst_incl_files_in_rss_info"));
1311  #$ch->addSubItem($incl_files);
1312  $this->form_gui->addItem($incl_files);
1313  }
1314 
1315  if (ilLearningProgressAccess::checkAccess($this->object->getRefId())) {
1316  $sh = new ilFormSectionHeaderGUI();
1317  $sh->setTitle($lng->txt("learning_progress"));
1318  $this->form_gui->addItem($sh);
1319 
1320  // Include new items automatically in learning progress
1321  $auto_lp = new ilCheckboxInputGUI($lng->txt("mcst_new_items_det_lp"), "auto_det_lp");
1322  $auto_lp->setChecked($this->object->getNewItemsInLearningProgress());
1323  $auto_lp->setInfo($lng->txt("mcst_new_items_det_lp_info"));
1324  $this->form_gui->addItem($auto_lp);
1325  }
1326 
1327  // additional features
1328  $feat = new ilFormSectionHeaderGUI();
1329  $feat->setTitle($this->lng->txt('obj_features'));
1330  $this->form_gui->addItem($feat);
1331 
1332  if (!$this->settings->get('disable_comments')) {
1333  $this->lng->loadLanguageModule("notes");
1334  $comments = new ilCheckboxInputGUI($lng->txt("notes_comments"), "comments");
1335  $comments->setChecked($this->object->getComments());
1336  $this->form_gui->addItem($comments);
1337  }
1338 
1339  // Form action and save button
1340  $this->form_gui->addCommandButton("saveSettings", $lng->txt("save"));
1341  $this->form_gui->setFormAction($ilCtrl->getFormAction($this, "saveSettings"));
1342  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupRSSPeriod()
This class represents a selection list property in a property form.
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...
addOption(ilRadioOption $a_option)
loadLanguageModule(string $a_module)
Load language module.
static checkAccess(int $a_ref_id, bool $a_allow_only_read=true)
check access to learning progress
ilLanguage $lng
This class represents a property in a property form.
static _lookup(string $a_type, string $a_setting, int $a_user=0, int $a_block_id=0)
Lookup setting from database.
$comments
ilObjectService $object_service
This class represents a text area property in a property form.
+ 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 1441 of file class.ilObjMediaCastGUI.php.

1441  : bool
1442  {
1443  return strpos($extension, "audio") !== false;
1444  }

◆ listItemsObject()

ilObjMediaCastGUI::listItemsObject ( bool  $a_presentation_mode = false)

Definition at line 228 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(), ilGlobalTemplateInterface\setContent(), ilLanguage\txt(), ilObjMediaCast\VIEW_IMG_GALLERY, ilObjMediaCast\VIEW_PODCAST, and ilObjMediaCast\VIEW_VCAST.

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

228  : void
229  {
230  $tpl = $this->tpl;
231  $lng = $this->lng;
232  $ilAccess = $this->access;
233  $ilToolbar = $this->toolbar;
234 
235  $this->checkPermission("write");
236 
237  if ($a_presentation_mode) {
238  $this->tpl->setOnScreenMessage('info', $this->lng->txt("mcst_view_abandoned"));
239  return;
240  }
241 
242  if ($a_presentation_mode) {
243  $this->addContentSubTabs("content");
244  } else {
245  $this->addContentSubTabs("manage");
246  }
247 
248  $med_items = $this->object->getSortedItemsArray();
249 
250  if ($a_presentation_mode) {
251  $table_gui = new ilMediaCastTableGUI($this, "showContent", false, true);
252  } else {
253  $table_gui = new ilMediaCastTableGUI($this, "listItems");
254  }
255 
256  $table_gui->setData($med_items);
257 
258  if ($ilAccess->checkAccess("write", "", $this->requested_ref_id) && !$a_presentation_mode) {
259  if (in_array($this->object->getViewMode(), [
263  ], true)) {
264  $ilToolbar->addButton($lng->txt("add"), $this->ctrl->getLinkTargetByClass("ilMediaCreationGUI", ""));
265  } else {
266  $ilToolbar->addButton($lng->txt("add"), $this->ctrl->getLinkTarget($this, "addCastItem"));
267  }
268 
269  $table_gui->addMultiCommand("confirmDeletionItems", $lng->txt("delete"));
270  $table_gui->setSelectAllCheckbox("item_id");
271  }
272 
273  $new_table = $this->getManageTableGUI();
274 
275  $script = <<<EOT
276 <script>
277  window.addEventListener('load', (event) => {
278  $(document).on('hidden.bs.modal', (e) => {
279  $('.modal-body').html('');
280  });
281  $(document).on('shown.bs.modal', (e) => {
282  window.dispatchEvent(new Event('resize'));
283  });
284  });
285 </script>
286 EOT;
287  $tpl->setContent($this->gui->ui()->renderer()->render($new_table->get()) . $script);
288  }
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
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.
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 371 of file class.ilObjMediaCastGUI.php.

References ILIAS\Repository\object().

Referenced by executeCommand().

371  : void
372  {
373  foreach ($this->object->getSortedItemsArray() as $item) {
374  if ($mob_id == $item["mob_id"]) {
375  $mob = new ilObjMediaObject($item["mob_id"]);
376  $mc_item = new ilNewsItem($item["id"]);
377  $mc_item->setTitle($mob->getTitle());
378  $mc_item->setContent($mob->getLongDescription());
379  $mc_item->update();
380  }
381  }
382  }
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 1465 of file class.ilObjMediaCastGUI.php.

References ilObjMediaCast\$purposes, ilObjectGUI\$tpl, and ilGlobalTemplateInterface\setContent().

Referenced by saveCastItemObject(), and updateCastItemObject().

1465  : void
1466  {
1467  $tpl = $this->tpl;
1468  $this->form_gui->setValuesByPost();
1469 
1470  //issue: we have to display the current settings
1471  // problem: POST does not contain values of disabled text fields
1472  // solution: use hidden field and label to display-> here we need to synchronize the labels
1473  // with the values from the hidden fields.
1474  foreach (ilObjMediaCast::$purposes as $purpose) {
1475  if ($this->form_gui->getInput("value_" . $purpose)) {
1476  $input = $this->form_gui->getItemByPostVar("label_value_" . $purpose);
1477  $input->setValue($this->form_gui->getInput("value_" . $purpose));
1478  }
1479  }
1480 
1481  $this->form_gui->setValuesByPost();
1482  $tpl->setContent($this->form_gui->getHTML());
1483  }
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.
static array $purposes
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveCastItemObject()

ilObjMediaCastGUI::saveCastItemObject ( )

Definition at line 534 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().

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

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

1519  : void
1520  {
1521  $lng = $this->lng;
1522 
1523  $ids = $this->mc_request->getItemIds();
1524  asort($ids);
1525 
1526  $items = array();
1527  foreach (array_keys($ids) as $id) {
1528  $items[] = $id;
1529  }
1530  $this->object->saveOrder($items);
1531 
1532  $this->tpl->setOnScreenMessage('success', $lng->txt("settings_saved"), true);
1533  $this->ctrl->redirect($this, "editOrder");
1534  }
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:

◆ saveSettingsObject()

ilObjMediaCastGUI::saveSettingsObject ( )

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

References ilObjectGUI\$ctrl, ilObjectGUI\$object_service, $tabs, ilBlockSetting\_write(), ilObjectGUI\checkPermission(), initSettingsForm(), ILIAS\Repository\lng(), and ILIAS\Repository\settings().

1344  : void
1345  {
1346  $ilCtrl = $this->ctrl;
1347  $ilTabs = $this->tabs;
1348  $obj_service = $this->object_service;
1349 
1350  $this->checkPermission("write");
1351  $ilTabs->activateTab("id_settings");
1352 
1353  $this->initSettingsForm();
1354  if ($this->form_gui->checkInput()) {
1355  $news_set = new ilSetting("news");
1356  $enable_internal_rss = $news_set->get("enable_rss_for_internal");
1357 
1358  $this->object->setTitle($this->form_gui->getInput("title"));
1359  $this->object->setDescription($this->form_gui->getInput("description"));
1360  $this->object->setOnline($this->form_gui->getInput("online"));
1361  $this->object->setDownloadable($this->form_gui->getInput("downloadable"));
1362  $this->object->setOrder($this->form_gui->getInput("order"));
1363  $this->object->setViewMode($this->form_gui->getInput("viewmode"));
1364  $this->object->setAutoplayMode((int) $this->form_gui->getInput("autoplaymode"));
1365  $this->object->setNumberInitialVideos((int) $this->form_gui->getInput("nr_videos"));
1366  $this->object->setNewItemsInLearningProgress((int) $this->form_gui->getInput("auto_det_lp"));
1367 
1368  if (!$this->settings->get('disable_comments')) {
1369  $this->object->setComments($this->form_gui->getInput("comments"));
1370  }
1371 
1372  // tile image
1373  $obj_service->commonSettings()->legacyForm($this->form_gui, $this->object)->saveTileImage();
1374 
1375  if ($enable_internal_rss) {
1376  $this->object->setPublicFiles($this->form_gui->getInput("public_files"));
1377  $this->object->setDefaultAccess($this->form_gui->getInput("defaultaccess"));
1378  }
1379  $this->object->update();
1380 
1381  if ($enable_internal_rss) {
1383  "news",
1384  "public_feed",
1385  $this->form_gui->getInput("extra_feed"),
1386  0,
1387  $this->object->getId()
1388  );
1389 
1391  "news",
1392  "keep_rss_min",
1393  $this->form_gui->getInput("keep_rss_min"),
1394  0,
1395  $this->object->getId()
1396  );
1397  }
1398 
1399  $this->tpl->setOnScreenMessage('success', $this->lng->txt("msg_obj_modified"), true);
1400  $ilCtrl->redirect($this, "editSettings");
1401  } else {
1402  $this->form_gui->setValuesByPost();
1403  $this->tpl->setContent($this->form_gui->getHTML());
1404  }
1405  }
initSettingsForm()
Init Settings Form.
static _write(string $a_type, string $a_setting, string $a_value, int $a_user=0, int $a_block_id=0)
Write setting to database.
ilObjectService $object_service
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
+ Here is the call graph for this function:

◆ setTabs()

ilObjMediaCastGUI::setTabs ( )
protected

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

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

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

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

823  : void
824  {
825  $f = $this->gui->ui()->factory();
826  $item_id = $this->mc_request->getItemId();
827  $news = new ilNewsItem($item_id);
828  $mob = new ilObjMediaObject($news->getMobId());
829  $med = $mob->getMediaItem("Standard");
830  $comp = null;
831  if ($med) {
832  if ($med->getLocationType() === "Reference") {
833  $file = $med->getLocation();
834  if (in_array($med->getFormat(), ["video/vimeo", "video/youtube"])) {
835  if (!is_int(strpos($file, "?"))) {
836  $file .= "?controls=0";
837  } else {
838  $file .= "&controls=0";
839  }
840  }
841  } else {
843  ilObjMediaObject::_getURL($mob->getId()) . "/" . $med->getLocation()
844  );
845  }
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  }
getMediaItem(string $a_purpose)
get item for media purpose
A news item can be created by different sources.
static signFile(string $path_to_file)
static _getURL(int $a_mob_id)
get directory for files of media object
+ Here is the call graph for this function:

◆ showCommentsObject()

ilObjMediaCastGUI::showCommentsObject ( )
protected

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

References exit, and getCommentGUI().

1704  : void
1705  {
1706  echo $this->getCommentGUI()->getListHTML() . "<script>ilNotes.init(null);</script>";
1707  exit;
1708  }
exit
Definition: login.php:29
+ Here is the call graph for this function:

◆ showContentObject()

ilObjMediaCastGUI::showContentObject ( )

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

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

1540  : void
1541  {
1542  $tpl = $this->tpl;
1543  $ilUser = $this->user;
1544  $ilTabs = $this->tabs;
1545 
1546  // need read events for parent for LP statistics
1548  "mcst",
1549  $this->object->getRefId(),
1550  $this->object->getId(),
1551  $ilUser->getId()
1552  );
1553 
1554  // trigger LP update
1555  ilLPStatusWrapper::_updateStatus($this->object->getId(), $ilUser->getId());
1556 
1557  if ($this->object->getViewMode() == ilObjMediaCast::VIEW_GALLERY) {
1558  $this->showGallery();
1559  } elseif ($this->object->getViewMode() == ilObjMediaCast::VIEW_IMG_GALLERY) {
1560  $view = new \McstImageGalleryGUI($this->object, $this->tpl, $this->getFeedLink());
1561  $view->setCompletedCallback($this->ctrl->getLinkTarget(
1562  $this,
1563  "handlePlayerCompletedEvent",
1564  "",
1565  true,
1566  false
1567  ));
1568  $this->tabs->activateTab("content");
1569  $this->addContentSubTabs("content");
1570  $tpl->setContent($this->ctrl->getHTML($view));
1571  } elseif ($this->object->getViewMode() == ilObjMediaCast::VIEW_PODCAST) {
1572  $view = new \McstPodcastGUI($this->object, $this->tpl, $this->getFeedLink());
1573  $this->tabs->activateTab("content");
1574  $this->addContentSubTabs("content");
1575  $tpl->setContent($this->ctrl->getHTML($view));
1576  } elseif ($this->object->getViewMode() == ilObjMediaCast::VIEW_VCAST) {
1577  $ilTabs->activateTab("content");
1578  $this->addContentSubTabs("content");
1579  $view = new \ILIAS\MediaCast\Presentation\VideoViewGUI($this->object, $tpl, $this->getFeedLink());
1580  $view->setCompletedCallback($this->ctrl->getLinkTarget(
1581  $this,
1582  "handlePlayerCompletedEvent",
1583  "",
1584  true,
1585  false
1586  ));
1587  $view->setAutoplayCallback($this->ctrl->getLinkTarget(
1588  $this,
1589  "handleAutoplayTrigger",
1590  "",
1591  true,
1592  false
1593  ));
1594  $view->show();
1595  } else {
1596  $this->listItemsObject(true);
1597  }
1598 
1599  $tpl->setPermanentLink($this->object->getType(), $this->object->getRefId());
1600  }
listItemsObject(bool $a_presentation_mode=false)
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.
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 1602 of file class.ilObjMediaCastGUI.php.

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

Referenced by showContentObject().

1602  : void
1603  {
1604  $tpl = $this->tpl;
1605  $ilTabs = $this->tabs;
1606  $ilCtrl = $this->ctrl;
1607 
1608  $this->tpl->setOnScreenMessage('info', $this->lng->txt("mcst_view_abandoned"));
1609  }
ilGlobalTemplateInterface $tpl
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ tableCommandObject()

ilObjMediaCastGUI::tableCommandObject ( )

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

References getManageTableGUI().

290  : void
291  {
292  $new_table = $this->getManageTableGUI();
293  $new_table->handleCommand();
294  }
+ Here is the call graph for this function:

◆ updateCastItemObject()

ilObjMediaCastGUI::updateCastItemObject ( )

Update cast item.

Definition at line 732 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(), populateFormFromPost(), updateMediaItem(), and ilObjMediaCast\VIEW_IMG_GALLERY.

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

664  : string {
665  $locationType = "";
666  $location = "";
667  $file = "";
668  $purpose = $mediaItem->getPurpose();
669  $locationType = $mediaItem->getLocationType();
670  $url_gui = $this->form_gui->getInput("url_" . $purpose);
671  $file_gui = $this->form_gui->getInput("file_" . $purpose);
672  if ($url_gui) {
673  // http
674  $file = $this->form_gui->getInput("url_" . $purpose);
675  $title = basename($file);
676  $location = $this->form_gui->getInput("url_" . $purpose);
677  $locationType = "Reference";
678  } elseif ($file_gui["size"] > 0) {
679  // lokal
680  // determine and create mob directory, move uploaded file to directory
681  $mob_dir = ilObjMediaObject::_getDirectory($mob->getId());
682  if (!is_dir($mob_dir)) {
683  $mob->createDirectory();
684  } else {
685  $dir = LegacyPathHelper::createRelativePath($mob_dir);
686  $old_files = $this->filesystem->finder()->in([$dir])->exclude([$dir . '/mob_vpreview.png'])->files();
687  foreach ($old_files as $file) {
688  $this->filesystem->delete($file->getPath());
689  }
690  }
691 
692  $file_name = ilFileUtils::getASCIIFilename($_FILES['file_' . $purpose]['name']);
693  $file_name = str_replace(" ", "_", $file_name);
694 
695  $file = $mob_dir . "/" . $file_name;
696  $title = $file_name;
697  $locationType = "LocalFile";
698  $location = $title;
699  ilFileUtils::moveUploadedFile($_FILES['file_' . $purpose]['tmp_name'], $file_name, $file);
701  }
702 
703  // check if not automatic mimetype detection
704  $format = ilObjMediaObject::getMimeType($mediaItem->getLocation(), ($locationType === "Reference"));
705  $mediaItem->setFormat($format);
706 
707  if ($file != "") {
708  // get mime type, if not already set!
709  if ($format === "") {
710  $format = ilObjMediaObject::getMimeType($file, ($locationType === "Reference"));
711  }
712 
713  // set real meta and object data
714  $mediaItem->setFormat($format);
715  $mediaItem->setLocation($location);
716  $mediaItem->setLocationType($locationType);
717  $mediaItem->setHAlign("Left");
718  $mediaItem->setHeight(self::isAudio($format) ? 0 : 180);
719  $mob->generatePreviewPic(320, 240);
720  }
721 
722  if (($purpose === "Standard") && isset($title)) {
723  $mob->setTitle($title);
724  }
725 
726  return $file;
727  }
$location
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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 45 of file class.ilObjMediaCastGUI.php.

◆ $filesystem

FileSystem ilObjMediaCastGUI::$filesystem
protected

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

◆ $form_gui

ilPropertyFormGUI ilObjMediaCastGUI::$form_gui
protected

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

◆ $gui

ILIAS MediaCast InternalGUIService ilObjMediaCastGUI::$gui
protected

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

◆ $help

ilHelpGUI ilObjMediaCastGUI::$help
protected

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

Referenced by setTabs().

◆ $log

ilLogger ilObjMediaCastGUI::$log
protected

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

Referenced by updateCastItemObject().

◆ $mc_manager

ILIAS MediaCast MediaCastManager ilObjMediaCastGUI::$mc_manager
protected

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

◆ $mc_request

StandardGUIRequest ilObjMediaCastGUI::$mc_request
protected

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

◆ $mcst_item

ilNewsItem ilObjMediaCastGUI::$mcst_item
protected

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

◆ $media_type

ILIAS MediaObjects MediaType MediaTypeManager ilObjMediaCastGUI::$media_type
protected

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

◆ $tabs

◆ $video_gui

ilObjMediaCastGUI::$video_gui
protected

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


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