ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilObjMediaCastGUI Class Reference
+ Inheritance diagram for ilObjMediaCastGUI:
+ Collaboration diagram for ilObjMediaCastGUI:

Public Member Functions

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

Static Public Member Functions

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

Protected Member Functions

 initCreationForms (string $new_type)
 
 afterSave (ilObject $new_object)
 
 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 ()
 
- Protected Member Functions inherited from ilObjectGUI
 getObjectService ()
 
 assignObject ()
 
 setTitleAndDescription ()
 
 initHeaderAction (?string $sub_type=null, ?int $sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction (?ilObjectListGUI $list_gui=null)
 Insert header action into main template. More...
 
 addHeaderAction ()
 Add header action menu. More...
 
 redrawHeaderActionObject ()
 Ajax call: redraw action header only. More...
 
 setTabs ()
 set admin tabs More...
 
 setAdminTabs ()
 set admin tabs More...
 
 setLocator ()
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator (bool $omit=true)
 
 addAdminLocatorItems (bool $do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 initCreationForms (string $new_type)
 Init creation forms. More...
 
 getCreationFormsHTML (array $forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm (string $new_type)
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 afterSave (ilObject $new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 initImportForm (string $new_type)
 
 importFileObject (int $parent_id=null)
 
 afterImport (ilObject $new_object)
 Post (successful) object import hook. More...
 
 setFormAction (string $cmd, string $form_action)
 
 getReturnLocation (string $cmd, string $default_location="")
 Get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation (string $cmd, string $location)
 set specific return location for command More...
 
 getTargetFrame (string $cmd, string $default_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame (string $cmd, string $target_frame)
 Set specific target frame for command. More...
 
 showPossibleSubObjects ()
 show possible sub objects (pull down menu) More...
 
 getTabs ()
 overwrite in derived GUI class of your object type More...
 
 redirectToRefId (int $ref_id, string $cmd="")
 redirects to (repository) view per ref id usually to a container and usually used at the end of a save/import method where the object gui type (of the new object) doesn't match with the type of the current ["ref_id"] value of the request More...
 
 fillCloneTemplate (?string $tpl_name, string $type)
 Fill object clone template This method can be called from any object GUI class that wants to offer object cloning. More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 checkPermission (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 checkPermissionBool (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 showCustomIconsEditing ( $input_colspan=1, ilPropertyFormGUI $form=null, $as_section=true)
 show edit section of custom icons for container More...
 

Static Protected Member Functions

static isAudio (string $extension)
 

Protected Attributes

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

Private Member Functions

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

Private Attributes

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

Additional Inherited Members

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

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

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

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

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

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

Member Function Documentation

◆ _goto()

static ilObjMediaCastGUI::_goto ( string  $a_target)
static

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

1351  : void
1352  {
1353  global $DIC;
1354  $main_tpl = $DIC->ui()->mainTemplate();
1355 
1356  $ilAccess = $DIC->access();
1357  $lng = $DIC->language();
1358  $ctrl = $DIC->ctrl();
1359 
1360  if ($ilAccess->checkAccess("read", "", $a_target)) {
1361  $ctrl->setParameterByClass("ilobjmediacastgui", "ref_id", $a_target);
1362  $ctrl->redirectByClass(["ilmediacasthandlergui", "ilobjmediacastgui"], "showContent");
1363  } elseif ($ilAccess->checkAccess("visible", "", $a_target)) {
1364  ilObjectGUI::_gotoRepositoryNode($a_target, "infoScreen");
1365  } elseif ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID)) {
1366  $main_tpl->setOnScreenMessage('failure', sprintf(
1367  $lng->txt("msg_no_perm_read_item"),
1369  ));
1371  }
1372 
1373  throw new ilPermissionException($lng->txt("msg_no_perm_read"));
1374  }
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 301 of file class.ilObjMediaCastGUI.php.

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

301  : void
302  {
303  $tpl = $this->tpl;
304 
305  $this->checkPermission("write");
306 
307  $this->initAddCastItemForm();
308  $tpl->setContent($this->form_gui->getHTML());
309  }
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 1057 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().

1059  : void {
1060  $ilTabs = $this->tabs;
1061  $ilAccess = $this->access;
1062  $lng = $this->lng;
1063 
1064  $ilTabs->addSubTab(
1065  "content",
1066  $lng->txt("view"),
1067  $this->ctrl->getLinkTarget($this, "showContent")
1068  );
1069 
1070  if ($ilAccess->checkAccess("write", "", $this->requested_ref_id)) {
1071  $ilTabs->addSubTab(
1072  "manage",
1073  $lng->txt("mcst_manage"),
1074  $this->ctrl->getLinkTarget($this, "listItems")
1075  );
1076 
1077  if ($this->object->getOrder() == ilObjMediaCast::ORDER_MANUAL) {
1078  $ilTabs->addSubTab(
1079  "sorting",
1080  $lng->txt("mcst_ordering"),
1081  $this->ctrl->getLinkTarget($this, "editOrder")
1082  );
1083  }
1084  }
1085 
1086  $ilTabs->activateSubTab($a_active);
1087  $ilTabs->activateTab("content");
1088  }
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 1342 of file class.ilObjMediaCastGUI.php.

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

1342  : void
1343  {
1344  $ilLocator = $this->locator;
1345 
1346  if (is_object($this->object)) {
1347  $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this, "listItems"), "", $this->requested_ref_id);
1348  }
1349  }
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 1618 of file class.ilObjMediaCastGUI.php.

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

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

1623  : void {
1624  $ctrl = $this->ctrl;
1625  $user = $this->user;
1626 
1627  $item_ids = [];
1628  foreach ($mob_ids as $mob_id) {
1629  $item_ids[] = $this->object->addMobToCast($mob_id, $user->getId(), $long_desc, $extract);
1630  }
1631 
1632  if ($redirect) {
1633  if (count($item_ids) === 1) {
1634  $ctrl->setParameter($this, "item_id", $item_ids[0]);
1635  $ctrl->redirect($this, "editCastItem");
1636  }
1637  $ctrl->redirect($this, "listItems");
1638  }
1639  }
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 1641 of file class.ilObjMediaCastGUI.php.

References addMobsToCast().

Referenced by executeCommand().

1641  : void
1642  {
1643  $this->addMobsToCast($mob_ids, "", true, true);
1644  }
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 224 of file class.ilObjMediaCastGUI.php.

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

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

◆ afterUpload()

ilObjMediaCastGUI::afterUpload (   $mob_ids)
protected

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

References addMobsToCast().

Referenced by executeCommand().

1608  : void
1609  {
1610  $this->addMobsToCast($mob_ids, "", false);
1611  }
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 1613 of file class.ilObjMediaCastGUI.php.

References addMobsToCast().

Referenced by executeCommand().

1613  : void
1614  {
1615  $this->addMobsToCast([$mob_id], $long_desc);
1616  }
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 838 of file class.ilObjMediaCastGUI.php.

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

838  : void
839  {
840  $ilCtrl = $this->ctrl;
841  $lng = $this->lng;
842  $tpl = $this->tpl;
843  $ilTabs = $this->tabs;
844 
845  $this->checkPermission("write");
846  $ilTabs->activateTab("edit_content");
847 
848  $ids = $this->mc_request->getItemIds();
849  if (count($ids) == 0) {
850  $this->listItemsObject();
851  return;
852  }
853 
854  $c_gui = new ilConfirmationGUI();
855 
856  // set confirm/cancel commands
857  $c_gui->setFormAction($ilCtrl->getFormAction($this, "deleteItems"));
858  $c_gui->setHeaderText($lng->txt("info_delete_sure"));
859  $c_gui->setCancel($lng->txt("cancel"), "listItems");
860  $c_gui->setConfirm($lng->txt("confirm"), "deleteItems");
861 
862  // add items to delete
863  foreach ($ids as $item_id) {
864  $item = new ilNewsItem($item_id);
865  $c_gui->addItem(
866  "item_id[]",
867  $item_id,
868  $item->getTitle(),
869  ilUtil::getImagePath("icon_mcst.svg")
870  );
871  }
872 
873  $tpl->setContent($c_gui->getHTML());
874  }
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)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ createMediaItemForPurpose()

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

Handle media item for given purpose.

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

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

Referenced by saveCastItemObject(), and updateCastItemObject().

657  : string {
658  $mediaItem = new ilMediaItem();
659  $mob->addMediaItem($mediaItem);
660  $mediaItem->setPurpose($purpose);
661  return $this->updateMediaItem($mob, $mediaItem);
662  }
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 876 of file class.ilObjMediaCastGUI.php.

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

876  : void
877  {
878  $ilCtrl = $this->ctrl;
879 
880  $this->checkPermission("write");
881 
882  // delete all selected news items
883  $ids = $this->mc_request->getItemIds();
884  foreach ($ids as $item_id) {
885  $mc_item = new ilNewsItem($item_id);
886  $mc_item->delete();
887  }
888  $this->object->saveOrder(array_map(function($i) {
889  return $i["id"];
890  }, $this->object->readItems()));
891  $ilCtrl->redirect($this, "listItems");
892  }
A news item can be created by different sources.
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
$i
Definition: metadata.php:41
+ Here is the call graph for this function:

◆ determinePlaytimeObject()

ilObjMediaCastGUI::determinePlaytimeObject ( )

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

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

914  : void
915  {
916  $ilCtrl = $this->ctrl;
917  $lng = $this->lng;
918 
919  $mc_item = new ilNewsItem($this->mc_request->getItemId());
920  $mob = $mc_item->getMobId();
921  $mob = new ilObjMediaObject($mob);
922  $mob_dir = ilObjMediaObject::_getDirectory($mob->getId());
923  $m_item = $mob->getMediaItem("Standard");
924 
925  $success = false;
926 
927  $m_item->determineDuration();
928  $dur = $m_item->getDuration();
929  if ($dur > 0) {
930  $mc_item->setPlaytime($this->object->getPlaytimeForSeconds($dur));
931  $mc_item->update();
932  $success = true;
933  $this->tpl->setOnScreenMessage('success', $lng->txt("mcst_set_playtime"), true);
934  }
935 
936  if (!$success) {
937  $this->tpl->setOnScreenMessage('failure', $lng->txt("mcst_unable_to_determin_playtime"), true);
938  }
939 
940  $ilCtrl->redirect($this, "listItems");
941  }
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 897 of file class.ilObjMediaCastGUI.php.

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

897  : void
898  {
899  $ilCtrl = $this->ctrl;
901 
902  $this->checkPermission("read");
903  $news_item = new ilNewsItem($this->mc_request->getItemId());
904  $this->object->handleLPUpdate($ilUser->getId(), $news_item->getMobId());
905  if (!$news_item->deliverMobFile(
906  $this->mc_request->getPurpose(),
907  $this->mc_request->getPresentation()
908  )) {
909  $ilCtrl->redirect($this, "listItems");
910  }
911  exit;
912  }
exit
Definition: login.php:28
A news item can be created by different sources.
$ilUser
Definition: imgupload.php:34
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 311 of file class.ilObjMediaCastGUI.php.

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

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

1420  : void
1421  {
1422  $ilTabs = $this->tabs;
1423  $lng = $this->lng;
1424  $tpl = $this->tpl;
1425 
1426  $this->checkPermission("write");
1427  $ilTabs->activateTab("edit_content");
1428 
1429  $this->addContentSubTabs("sorting");
1430 
1431  // sort by order setting
1432  switch ($this->object->getOrder()) {
1436  $this->listItemsObject();
1437  return;
1438 
1440  // sub-tabs
1441  break;
1442  }
1443 
1444  $table_gui = new ilMediaCastTableGUI($this, "editOrder", true);
1445 
1446  $table_gui->setTitle($lng->txt("mcst_media_cast"));
1447  $table_gui->setData($this->object->getSortedItemsArray());
1448 
1449  $table_gui->addCommandButton("saveOrder", $lng->txt("mcst_save_order"));
1450 
1451  $tpl->setContent($table_gui->getHTML());
1452  }
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 1090 of file class.ilObjMediaCastGUI.php.

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

1090  : void
1091  {
1092  $tpl = $this->tpl;
1093  $ilTabs = $this->tabs;
1094 
1095  $this->checkPermission("write");
1096  $ilTabs->activateTab("id_settings");
1097 
1098  $this->initSettingsForm();
1099  $tpl->setContent($this->form_gui->getHTML());
1100  }
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 101 of file class.ilObjMediaCastGUI.php.

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

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

References ilObjectGUI\$ctrl, Vendor\Package\$e, ilObjectGUI\checkPermission(), ilFFmpeg\getLastReturnValues(), and ILIAS\Repository\lng().

1546  : void
1547  {
1548  $ilCtrl = $this->ctrl;
1549  $add = "";
1550 
1551  $this->checkPermission("write");
1552 
1553  $this->mcst_item = new ilNewsItem($this->mc_request->getItemId());
1554  $mob = new ilObjMediaObject($this->mcst_item->getMobId());
1555 
1556  try {
1557  $sec = $this->mc_request->getSeconds();
1558  if ($sec < 0) {
1559  $sec = 0;
1560  }
1561 
1562  $mob->generatePreviewPic(320, 240, $sec);
1563  if ($mob->getVideoPreviewPic() !== "") {
1564  $this->tpl->setOnScreenMessage('info', $this->lng->txt("mcst_image_extracted"), true);
1565  } else {
1566  $this->tpl->setOnScreenMessage('failure', $this->lng->txt("mcst_no_extraction_possible"), true);
1567  }
1568  } catch (ilException $e) {
1569  if (DEVMODE == 1) {
1571  $add = (is_array($ret) && count($ret) > 0)
1572  ? "<br />" . implode("<br />", $ret)
1573  : "";
1574  }
1575  $this->tpl->setOnScreenMessage('failure', $e->getMessage() . $add, true);
1576  }
1577 
1578  $ilCtrl->redirect($this, "editCastItem");
1579  }
static getLastReturnValues()
Get last return values.
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 351 of file class.ilObjMediaCastGUI.php.

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

Referenced by executeCommand().

351  : void
352  {
353  foreach ($this->object->getSortedItemsArray() as $item) {
354  if ($mob_id == $item["mob_id"]) {
355  $this->ctrl->setParameter($this, "item_id", $item["id"]);
356  $this->ctrl->redirect($this, "editCastItem");
357  }
358  }
359  $this->ctrl->redirect($this, "listItems");
360  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getCastItemValues()

ilObjMediaCastGUI::getCastItemValues ( )

Get cast item values into form.

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

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

Referenced by editCastItemObject().

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

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

Referenced by saveCastItemObject(), and updateCastItemObject().

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

◆ getFeedLink()

ilObjMediaCastGUI::getFeedLink ( )

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

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

Referenced by executeCommand(), and showContentObject().

278  : string
279  {
280  $public_feed = ilBlockSetting::_lookup(
281  "news",
282  "public_feed",
283  0,
284  $this->object->getId()
285  );
286  $url = "";
287  // rss icon/link
288  if ($public_feed) {
289  $news_set = new ilSetting("news");
290  $enable_internal_rss = $news_set->get("enable_rss_for_internal");
291  if ($enable_internal_rss) {
292  $url = ILIAS_HTTP_PATH . "/feed.php?client_id=" . rawurlencode(CLIENT_ID) . "&" . "ref_id=" . $this->requested_ref_id;
293  }
294  }
295  return $url;
296  }
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
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMediaItem()

ilObjMediaCastGUI::getMediaItem ( int  $id)
protected

Get MediaItem for id and updates local variable mcst_item.

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

References ilObjMediaObject\getMediaItem().

1384  : ilMediaItem
1385  {
1386  $this->mcst_item = new ilNewsItem($id);
1387  // create dummy object in db (we need an id)
1388  $mob = new ilObjMediaObject($this->mcst_item->getMobId());
1389  return $mob->getMediaItem("Standard");
1390  }
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 1392 of file class.ilObjMediaCastGUI.php.

References ilObjMediaObject\getMediaItems().

Referenced by getCastItemValues().

1392  : array
1393  {
1394  $this->mcst_item = new ilNewsItem($id);
1395  // create dummy object in db (we need an id)
1396  $mob = new ilObjMediaObject($this->mcst_item->getMobId());
1397  return $mob->getMediaItems();
1398  }
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 1646 of file class.ilObjMediaCastGUI.php.

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

1646  : void
1647  {
1648  $this->user->writePref(
1649  "mcst_autoplay",
1650  $this->mc_request->getAutoplay()
1651  );
1652  exit;
1653  }
exit
Definition: login.php:28
+ Here is the call graph for this function:

◆ handlePlayerCompletedEventObject()

ilObjMediaCastGUI::handlePlayerCompletedEventObject ( )
protected

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

References $ilUser, ilObjectGUI\$user, and exit.

1598  : void
1599  {
1600  $mob_id = $this->mc_request->getMobId();
1601  if ($mob_id > 0) {
1602  $ilUser = $this->user;
1603  $this->object->handleLPUpdate($ilUser->getId(), $mob_id);
1604  }
1605  exit;
1606  }
exit
Definition: login.php:28
$ilUser
Definition: imgupload.php:34

◆ handlePlayerEventObject()

ilObjMediaCastGUI::handlePlayerEventObject ( )

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

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

1581  : void
1582  {
1583  if ($this->mc_request->getEvent() === "play") {
1584  $player = explode("_", $this->mc_request->getPlayer());
1585  $news_id = (int) $player[1];
1586  $item = new ilNewsItem($news_id);
1587  $item->increasePlayCounter();
1588 
1589  $mob_id = $item->getMobId();
1590  if ($mob_id) {
1591  $ilUser = $this->user;
1592  $this->object->handleLPUpdate($ilUser->getId(), $mob_id);
1593  }
1594  }
1595  exit;
1596  }
exit
Definition: login.php:28
A news item can be created by different sources.
$ilUser
Definition: imgupload.php:34
+ Here is the call graph for this function:

◆ infoScreen()

ilObjMediaCastGUI::infoScreen ( )

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

956  : void
957  {
958  $ilTabs = $this->tabs;
959 
960  $ilTabs->activateTab("id_info");
961 
962  if (!$this->checkPermissionBool("read")) {
963  $this->checkPermission("visible");
964  }
965 
966  $info = new ilInfoScreenGUI($this);
967 
968  $info->enablePrivateNotes();
969 
970  // general information
971  $this->lng->loadLanguageModule("meta");
972  $this->lng->loadLanguageModule("mcst");
973  $med_items = $this->object->getItemsArray();
974  $info->addSection($this->lng->txt("meta_general"));
975  $info->addProperty(
976  $this->lng->txt("mcst_nr_items"),
977  count($med_items)
978  );
979 
980  if (count($med_items) > 0) {
981  $cur = current($med_items);
982  $last = ilDatePresentation::formatDate(new ilDateTime($cur["creation_date"], IL_CAL_DATETIME));
983  } else {
984  $last = "-";
985  }
986 
987  $info->addProperty($this->lng->txt("mcst_last_submission"), $last);
988 
989  // forward the command
990  $this->ctrl->forwardCommand($info);
991  }
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 946 of file class.ilObjMediaCastGUI.php.

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

946  : void
947  {
948  if (!$this->checkPermissionBool("read")) {
949  $this->checkPermission("visible");
950  }
951  $this->ctrl->setCmd("showSummary");
952  $this->ctrl->setCmdClass("ilinfoscreengui");
953  $this->infoScreen();
954  }
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 375 of file class.ilObjMediaCastGUI.php.

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

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

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

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

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

◆ initSettingsForm()

ilObjMediaCastGUI::initSettingsForm ( )

Init Settings Form.

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

References 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, ilCheckboxInputGUI\setChecked(), ilFormPropertyGUI\setInfo(), ilNumberInputGUI\setMaxValue(), ilNumberInputGUI\setValue(), ilTextAreaInputGUI\setValue(), ilLanguage\txt(), ilObjMediaCast\VIEW_IMG_GALLERY, ilObjMediaCast\VIEW_PODCAST, and ilObjMediaCast\VIEW_VCAST.

Referenced by editSettingsObject(), and saveSettingsObject().

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

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

◆ listItemsObject()

ilObjMediaCastGUI::listItemsObject ( bool  $a_presentation_mode = false)

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

References ilObjectGUI\$access, ilObjectGUI\$lng, ilObjectGUI\$toolbar, ilObjectGUI\$tpl, addContentSubTabs(), ilObjectGUI\checkPermission(), ILIAS\Repository\ctrl(), 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().

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

References ILIAS\Repository\object().

Referenced by executeCommand().

362  : void
363  {
364  foreach ($this->object->getSortedItemsArray() as $item) {
365  if ($mob_id == $item["mob_id"]) {
366  $mob = new ilObjMediaObject($item["mob_id"]);
367  $mc_item = new ilNewsItem($item["id"]);
368  $mc_item->setTitle($mob->getTitle());
369  $mc_item->setContent($mob->getLongDescription());
370  $mc_item->update();
371  }
372  }
373  }
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 1400 of file class.ilObjMediaCastGUI.php.

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

Referenced by saveCastItemObject(), and updateCastItemObject().

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

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

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

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

1454  : void
1455  {
1456  $lng = $this->lng;
1457 
1458  $ids = $this->mc_request->getItemIds();
1459  asort($ids);
1460 
1461  $items = array();
1462  foreach (array_keys($ids) as $id) {
1463  $items[] = $id;
1464  }
1465  $this->object->saveOrder($items);
1466 
1467  $this->tpl->setOnScreenMessage('success', $lng->txt("settings_saved"), true);
1468  $this->ctrl->redirect($this, "editOrder");
1469  }
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 1283 of file class.ilObjMediaCastGUI.php.

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

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

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

◆ showContentObject()

ilObjMediaCastGUI::showContentObject ( )

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

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

1475  : void
1476  {
1477  $tpl = $this->tpl;
1478  $ilUser = $this->user;
1479  $ilTabs = $this->tabs;
1480 
1481  // need read events for parent for LP statistics
1483  "mcst",
1484  $this->object->getRefId(),
1485  $this->object->getId(),
1486  $ilUser->getId()
1487  );
1488 
1489  // trigger LP update
1490  ilLPStatusWrapper::_updateStatus($this->object->getId(), $ilUser->getId());
1491 
1492  if ($this->object->getViewMode() == ilObjMediaCast::VIEW_GALLERY) {
1493  $this->showGallery();
1494  } elseif ($this->object->getViewMode() == ilObjMediaCast::VIEW_IMG_GALLERY) {
1495  $view = new \McstImageGalleryGUI($this->object, $this->tpl, $this->getFeedLink());
1496  $view->setCompletedCallback($this->ctrl->getLinkTarget(
1497  $this,
1498  "handlePlayerCompletedEvent",
1499  "",
1500  true,
1501  false
1502  ));
1503  $this->tabs->activateTab("content");
1504  $this->addContentSubTabs("content");
1505  $tpl->setContent($this->ctrl->getHTML($view));
1506  } elseif ($this->object->getViewMode() == ilObjMediaCast::VIEW_PODCAST) {
1507  $view = new \McstPodcastGUI($this->object, $this->tpl, $this->getFeedLink());
1508  $this->tabs->activateTab("content");
1509  $this->addContentSubTabs("content");
1510  $tpl->setContent($this->ctrl->getHTML($view));
1511  } elseif ($this->object->getViewMode() == ilObjMediaCast::VIEW_VCAST) {
1512  $ilTabs->activateTab("content");
1513  $this->addContentSubTabs("content");
1514  $view = new \ILIAS\MediaCast\Presentation\VideoViewGUI($this->object, $tpl, $this->getFeedLink());
1515  $view->setCompletedCallback($this->ctrl->getLinkTarget(
1516  $this,
1517  "handlePlayerCompletedEvent",
1518  "",
1519  true,
1520  false
1521  ));
1522  $view->setAutoplayCallback($this->ctrl->getLinkTarget(
1523  $this,
1524  "handleAutoplayTrigger",
1525  "",
1526  true,
1527  false
1528  ));
1529  $view->show();
1530  } else {
1531  $this->listItemsObject(true);
1532  }
1533 
1534  $tpl->setPermanentLink($this->object->getType(), $this->object->getRefId());
1535  }
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.
$ilUser
Definition: imgupload.php:34
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 1537 of file class.ilObjMediaCastGUI.php.

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

Referenced by showContentObject().

1537  : void
1538  {
1539  $tpl = $this->tpl;
1540  $ilTabs = $this->tabs;
1541  $ilCtrl = $this->ctrl;
1542 
1543  $this->tpl->setOnScreenMessage('info', $this->lng->txt("mcst_view_abandoned"));
1544  }
ilGlobalTemplateInterface $tpl
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateCastItemObject()

ilObjMediaCastGUI::updateCastItemObject ( )

Update cast item.

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

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

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

References $format, $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().

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

◆ $filesystem

FileSystem ilObjMediaCastGUI::$filesystem
protected

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

◆ $form_gui

ilPropertyFormGUI ilObjMediaCastGUI::$form_gui
protected

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

◆ $help

ilHelpGUI ilObjMediaCastGUI::$help
protected

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

Referenced by setTabs().

◆ $log

ilLogger ilObjMediaCastGUI::$log
protected

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

Referenced by updateCastItemObject().

◆ $mc_manager

ILIAS MediaCast MediaCastManager ilObjMediaCastGUI::$mc_manager
protected

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

◆ $mc_request

StandardGUIRequest ilObjMediaCastGUI::$mc_request
protected

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

◆ $mcst_item

ilNewsItem ilObjMediaCastGUI::$mcst_item
protected

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

◆ $mimeTypes

array ilObjMediaCastGUI::$mimeTypes = []
private

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

◆ $purposeSuffixes

array ilObjMediaCastGUI::$purposeSuffixes = []
private

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

◆ $tabs


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