ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
ilObjMediaPoolGUI Class Reference

User Interface class for media pool objects. More...

+ Inheritance diagram for ilObjMediaPoolGUI:
+ Collaboration diagram for ilObjMediaPoolGUI:

Public Member Functions

 __construct (int $a_id=0, int $a_id_type=self::REPOSITORY_NODE_ID, int $a_parent_node_id=0)
 
 getType ()
 Functions that must be overwritten. More...
 
 executeCommand ()
 
 createMediaObject ()
 
 edit ()
 
 listMedia ()
 list media objects More...
 
 allMedia ()
 list all media objects More...
 
 applyFilter ()
 Apply filter. More...
 
 resetFilter ()
 
 getTemplate ()
 Get standard template. More...
 
 getParentFolderId ()
 Get folder parent ID. More...
 
 showPage ()
 Show page. More...
 
 showPreview ()
 Show content snippet. More...
 
 showFullscreen ()
 show media fullscreen More...
 
 confirmRemove (?array $ids=null)
 confirm remove of mobs More...
 
 openClipboard ()
 paste from clipboard More...
 
 insertFromClipboard ()
 insert media object from clipboard More...
 
 cancelRemove ()
 cancel deletion of media objects/folders More...
 
 remove (?array $ids=null)
 
 copyToClipboard (?array $ids=null)
 copy media objects to clipboard More...
 
 createFolderForm ()
 
 editFolder ()
 
 getFolderValues ()
 Get current values for folder from. More...
 
 saveFolder ()
 Save folder form. More...
 
 updateFolder ()
 
 initFolderForm (string $a_mode="edit")
 
 cancelFolderUpdate ()
 
 cancelSave ()
 
 setContentSubTabs (string $a_active)
 Set sub tabs for content tab. More...
 
 setSettingsSubTabs (string $a_active)
 
 infoScreenObject ()
 this one is called from the info button in the repository More...
 
 infoScreen ()
 show information screen More...
 
 export ()
 
 performBulkUpload ()
 Save bulk upload form. More...
 
 initMediaBulkForm (int $a_id, string $a_title)
 Init media bulk form. More...
 
 finishSingleUpload (int $mob_id)
 
- Public Member Functions inherited from ilObject2GUI
 __construct (int $id=0, int $id_type=self::REPOSITORY_NODE_ID, int $parent_node_id=0)
 
 executeCommand ()
 execute command More...
 
 getIdType ()
 
 delete ()
 Display delete confirmation form (repository/workspace switch) More...
 
 confirmedDelete ()
 Delete objects (repository/workspace switch) More...
 
 getHTML ()
 
 withReferences ()
 Final/Private declaration of unchanged parent methods. More...
 
 setCreationMode (bool $mode=true)
 If true, a creation screen is displayed the current [ref_id] does belong to the parent class The mode is determined in ilRepositoryGUI. More...
 
 getCreationMode ()
 
 prepareOutput (bool $show_sub_objects=true)
 
 isVisible (int $ref_id, string $type)
 
 setColumnSettings (ilColumnGUI $column_gui)
 
 view ()
 view object content (repository/workspace switch) More...
 
 getType ()
 Functions that must be overwritten. More...
 
 create ()
 CRUD. More...
 
 save ()
 
 edit ()
 
 update ()
 
 cancel ()
 
 putObjectInTree (ilObject $obj, ?int $parent_node_id=null)
 Add object to tree at given position. More...
 
- Public Member Functions inherited from ilObjectGUI
 getRefId ()
 
 setAdminMode (string $mode)
 
 getAdminMode ()
 
 getObject ()
 
 executeCommand ()
 
 withReferences ()
 determines whether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode (bool $mode=true)
 If true, a creation screen is displayed the current [ref_id] does belong to the parent class The mode is determined in ilRepositoryGUI. More...
 
 getCreationMode ()
 
 prepareOutput (bool $show_sub_objects=true)
 
 getAdminTabs ()
 administration tabs show only permissions and trash folder More...
 
 getHTML ()
 
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled More...
 
 cancelObject ()
 cancel action and go back to previous page More...
 
 createObject ()
 create new object form More...
 
 editAvailabilityPeriodObject ()
 
 saveAvailabilityPeriodObject ()
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 
 getDidacticTemplateVar (string $type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $obj, ?int $parent_node_id=null)
 Add object to tree at given position. More...
 
 editObject ()
 
 addExternalEditFormCustom (ilPropertyFormGUI $form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction (string $cmd, string $default_form_action="")
 Get form action for command (command is method name without "Object", e.g. More...
 
 isVisible (int $ref_id, string $type)
 
 viewObject ()
 viewObject container presentation for "administration -> repository, trash, permissions" More...
 
 deleteObject (bool $error=false)
 Display deletion confirmation screen. More...
 
 setColumnSettings (ilColumnGUI $column_gui)
 
 addToDeskObject ()
 
 removeFromDeskObject ()
 
- Public Member Functions inherited from ILIAS\Object\ImplementsCreationCallback
 callCreationCallback (\ilObject $object, \ilObjectDefinition $obj_definition, int $requested_crtcb)
 

Static Public Member Functions

static _goto (string $a_target)
 
static getPreviewModalHTML (int $a_mpool_ref_id, ilGlobalTemplateInterface $a_tpl)
 Get preview modal html. More...
 
- Static Public Member Functions inherited from ilObject2GUI
static handleAfterSaveCallback (ilObject $obj, ?int $callback_ref_id)
 After creation callback. More...
 
- 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)
 

Data Fields

bool $output_prepared
 
- Data Fields inherited from ilObject2GUI
const OBJECT_ID = 0
 
const REPOSITORY_NODE_ID = 1
 
const WORKSPACE_NODE_ID = 2
 
const REPOSITORY_OBJECT_ID = 3
 
const WORKSPACE_OBJECT_ID = 4
 
const PORTFOLIO_OBJECT_ID = 5
 
- Data Fields inherited from ilObjectGUI
const ADMIN_MODE_NONE = ""
 
const ADMIN_MODE_SETTINGS = "settings"
 
const ADMIN_MODE_REPOSITORY = "repository"
 
const UPLOAD_TYPE_LOCAL = 1
 
const UPLOAD_TYPE_UPLOAD_DIRECTORY = 2
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 
const SUPPORTED_IMPORT_MIME_TYPES = [MimeType::APPLICATION__ZIP, MimeType::APPLICATION__X_ZIP_COMPRESSED]
 

Protected Member Functions

 afterConstructor ()
 
 returnFromItem ()
 Return from item editing. More...
 
 afterSave (ilObject $new_object)
 Post (successful) object creation hook. More...
 
 toggleExplorerNodeState ()
 
 showMedia ()
 show media object More...
 
 getMediaPoolPageGUI ($mep_item_id, $old_nr=0)
 
 addLocatorItems ()
 add locator items for media pool More...
 
 setTabs ()
 create tabs (repository/workspace switch) More...
 
 bulkUpload ()
 
 getBulkUploadForm ()
 
 handleUploadResult (FileUpload $upload, UploadResult $result)
 
 editTitlesAndDescriptions ()
 
 saveTitlesAndDescriptions ()
 
 move (?array $ids=null)
 
 paste ()
 
 afterUpload ($mob_ids)
 
 afterUrlSaving (int $mob_id, string $long_desc)
 
 addMobsToPool (array $mob_ids, string $long_desc="", bool $redirect=true, bool $extract=false)
 
 afterPoolInsert (array $mob_ids)
 
 onMobUpdate (int $mob_id)
 
- Protected Member Functions inherited from ilObject2GUI
 afterConstructor ()
 Do anything that should be done after constructor in here. More...
 
 assignObject ()
 create object instance as internal property (repository/workspace switch) More...
 
 getAccessHandler ()
 
 setLocator ()
 set Locator More...
 
 deleteConfirmedObjects ()
 Delete objects (workspace specific) This should probably be moved elsewhere as done with RepUtil. More...
 
 setTitleAndDescription ()
 
 omitLocator (bool $omit=true)
 
 getTargetFrame (string $cmd, string $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...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 checkPermission (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 showPossibleSubObjects ()
 show possible sub objects (pull down menu) 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...
 
 addAdminLocatorItems (bool $do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 setTabs ()
 create tabs (repository/workspace switch) More...
 
 getReturnLocation (string $cmd, string $location="")
 Deprecated functions. More...
 
 setReturnLocation (string $cmd, string $location)
 set specific return location for command More...
 
 showActions ()
 
 getTabs ()
 @abstract overwrite in derived GUI class of your object type More...
 
 addLocatorItems ()
 Functions to be overwritten. More...
 
 checkPermissionBool (string $perm, string $cmd="", string $type="", ?int $node_id=null)
 
 initHeaderAction (?string $sub_type=null, ?int $sub_id=null)
 Add header action menu. More...
 
 redrawHeaderAction ()
 Updating icons after ajax call. More...
 
- Protected Member Functions inherited from ilObjectGUI
 getObjectService ()
 
 assignObject ()
 
 setTitleAndDescription ()
 
 createActionDispatcherGUI ()
 
 initHeaderAction (?string $sub_type=null, ?int $sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction (?ilObjectListGUI $list_gui=null)
 Insert header action into main template. More...
 
 addHeaderAction ()
 Add header action menu. More...
 
 redrawHeaderActionObject ()
 Ajax call: redraw action header only. More...
 
 setTabs ()
 set admin tabs More...
 
 setAdminTabs ()
 set admin tabs More...
 
 setLocator ()
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator (bool $omit=true)
 
 addAdminLocatorItems (bool $do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 getCreationFormsHTML (StandardForm|ilPropertyFormGUI|array $form)
 
 getTitleForCreationFormPage ()
 
 getCreationFormTitle ()
 
 initCreateForm (string $new_type)
 
 didacticTemplatesToForm ()
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 
 retrieveAdditionalDidacticTemplateOptions ()
 
 addAdoptContentLinkToToolbar ()
 
 addImportButtonToToolbar ()
 
 addAvailabilityPeriodButtonToToolbar (ilToolbarGUI $toolbar)
 
 parseDidacticTemplateVar (string $var, string $type)
 
 afterSave (ilObject $new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 routeImportCmdObject ()
 
 importFile (string $file_to_import, string $path_to_uploaded_file_in_temp_dir)
 
 deleteUploadedImportFile (string $path_to_uploaded_file_in_temp_dir)
 
 afterImport (ilObject $new_object)
 Post (successful) object import hook. More...
 
 setFormAction (string $cmd, string $form_action)
 
 getReturnLocation (string $cmd, string $default_location="")
 Get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation (string $cmd, string $location)
 set specific return location for command More...
 
 getTargetFrame (string $cmd, string $default_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame (string $cmd, string $target_frame)
 Set specific target frame for command. More...
 
 showPossibleSubObjects ()
 show possible sub objects (pull down menu) More...
 
 getTabs ()
 @abstract overwrite in derived GUI class of your object type More...
 
 redirectToRefId (int $ref_id, string $cmd="")
 redirects to (repository) view per ref id usually to a container and usually used at the end of a save/import method where the object gui type (of the new object) doesn't match with the type of the current ["ref_id"] value of the request More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 checkPermission (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 checkPermissionBool (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 getCreatableObjectTypes ()
 
 buildAddNewItemElements (array $subtypes, string $create_target_class=ilRepositoryGUI::class, ?int $redirect_target_ref_id=null,)
 
 buildGroup (string $create_target_class, array $obj_types_in_group, string $title, array $subtypes)
 

Protected Attributes

ILIAS MediaPool InternalDomainService $domain
 
ILIAS COPage Xsl XslManager $xsl
 
FormAdapterGUI $bulk_upload_form = null
 
InternalGUIService $gui
 
ilPropertyFormGUI $form
 
string $mode
 
int $mep_item_id = 0
 
StandardGUIRequest $mep_request
 
ilTabsGUI $tabs
 
ilHelpGUI $help
 
ilGlobalTemplateInterface $main_tpl
 
FileUpload $upload
 
ilLogger $mep_log
 
ilDBInterface $db
 
- Protected Attributes inherited from ilObject2GUI
ilObjectDefinition $obj_definition
 
ilGlobalTemplateInterface $tpl
 
ilCtrl $ctrl
 
ilLanguage $lng
 
ilTabsGUI $tabs_gui
 
ilFavouritesManager $favourites
 
ilErrorHandling $error
 
ilLocatorGUI $locator
 
ilObjUser $user
 
ilAccessHandler $access
 
ilToolbarGUI $toolbar
 
Factory $refinery
 
ilRbacAdmin $rbac_admin
 
ilRbacSystem $rbac_system
 
ilRbacReview $rbac_review
 
int $request_ref_id
 
int $id_type
 
int $parent_id
 
string $type
 
string $html
 
int $object_id
 
int $node_id = null
 
array $creation_forms = []
 
 $access_handler
 
- Protected Attributes inherited from ilObjectGUI
ILIAS Notes Service $notes_service
 
GlobalHttpState $http
 
ServerRequestInterface $request
 
ilLocatorGUI $locator
 
ilObjUser $user
 
ilAccessHandler $access
 
ilSetting $settings
 
ilToolbarGUI $toolbar
 
ilRbacAdmin $rbac_admin
 
ilRbacSystem $rbac_system
 
ilRbacReview $rbac_review
 
ilObjectService $object_service
 
ilObjectDefinition $obj_definition
 
ilGlobalTemplateInterface $tpl
 
ilTree $tree
 
ilCtrl $ctrl
 
ilErrorHandling $error
 
ilLanguage $lng
 
ilTabsGUI $tabs_gui
 
ILIAS $ilias
 
ArrayBasedRequestWrapper $post_wrapper
 
RequestWrapper $request_wrapper
 
Refinery $refinery
 
ilFavouritesManager $favourites
 
CustomIconFactory $custom_icon_factory
 
UIFactory $ui_factory
 
UIRenderer $ui_renderer
 
Filesystem $temp_file_system
 
ilObject $object = null
 
bool $creation_mode = false
 
 $data
 
int $id
 
bool $call_by_reference = false
 
bool $prepare_output
 
int $ref_id
 
int $obj_id
 
int $maxcount
 
array $form_action = []
 
array $return_location = []
 
array $target_frame = []
 
string $tmp_import_dir
 
string $sub_objects = ""
 
bool $omit_locator = false
 
string $type = ""
 
string $admin_mode = self::ADMIN_MODE_NONE
 
int $requested_ref_id = 0
 
int $requested_crtptrefid = 0
 
int $requested_crtcb = 0
 
string $requested_new_type = ""
 
string $link_params
 
string $html = ""
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilObjMediaPoolGUI::__construct ( int  $a_id = 0,
int  $a_id_type = self::REPOSITORY_NODE_ID,
int  $a_parent_node_id = 0 
)

Reimplemented from ilObject2GUI.

Definition at line 60 of file class.ilObjMediaPoolGUI.php.

64 {
65 global $DIC;
66
67 $this->mep_request = $DIC->mediaPool()
68 ->internal()
69 ->gui()
70 ->standardRequest();
71 $this->mep_item_id = $this->mep_request->getItemId();
72
73 parent::__construct($a_id, $a_id_type, $a_parent_node_id);
74
75 $this->tabs = $DIC->tabs();
76 $this->locator = $DIC["ilLocator"];
77 $this->help = $DIC["ilHelp"];
78
79 $this->main_tpl = $DIC->ui()->mainTemplate();
80
81 $this->upload = $DIC->upload();
82
83 $this->mep_log = ilLoggerFactory::getLogger("mep");
84
85 $this->db = $DIC->database();
86
87 $this->mode = ($this->mep_request->getMode() !== "")
88 ? $this->mep_request->getMode()
89 : "listMedia";
90 $this->gui = $DIC->mediaPool()->internal()->gui();
91 $this->domain = $DIC->mediaPool()->internal()->domain();
92 $this->xsl = $DIC->copage()->internal()->domain()->xsl();
93 }
static getLogger(string $a_component_id)
Get component logger.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), ilLoggerFactory\getLogger(), ILIAS\Repository\help(), ILIAS\Repository\locator(), ILIAS\Repository\tabs(), and ILIAS\Repository\upload().

+ Here is the call graph for this function:

Member Function Documentation

◆ _goto()

static ilObjMediaPoolGUI::_goto ( string  $a_target)
static

Definition at line 1245 of file class.ilObjMediaPoolGUI.php.

1245 : void
1246 {
1247 global $DIC;
1248 $main_tpl = $DIC->ui()->mainTemplate();
1249
1250 $ilAccess = $DIC->access();
1251 $lng = $DIC->language();
1252 $ctrl = $DIC->ctrl();
1253
1254 $subitem_id = "";
1255 $targets = explode('_', $a_target);
1256 $ref_id = $targets[0];
1257 if (count((array) $targets) > 1) {
1258 $subitem_id = $targets[1];
1259 }
1260
1261 $ctrl->setParameterByClass("ilMediaPoolPresentationGUI", "ref_id", $ref_id);
1262 if ($ilAccess->checkAccess("read", "", $ref_id)) {
1263 $ctrl->setParameterByClass("ilMediaPoolPresentationGUI", "mepitem_id", $subitem_id);
1264 $ctrl->redirectByClass("ilMediaPoolPresentationGUI", "");
1265 } elseif ($ilAccess->checkAccess("visible", "", $ref_id)) {
1266 $ctrl->redirectByClass("ilMediaPoolPresentationGUI", "infoScreen");
1267 } elseif ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID)) {
1268 $main_tpl->setOnScreenMessage('failure', sprintf(
1269 $lng->txt("msg_no_perm_read_item"),
1271 ), true);
1273 }
1274
1275 throw new ilPermissionException($lng->txt("msg_no_perm_read"));
1276 }
redirectByClass( $a_class, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false)
@inheritDoc
setParameterByClass(string $a_class, string $a_parameter, $a_value)
@inheritDoc
txt(string|LanguageIdentifier $a_topic, ?int $n=null)
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
ilGlobalTemplateInterface $main_tpl
static _gotoRepositoryRoot(bool $raise_error=false)
Goto repository root.
static _lookupObjId(int $ref_id)
static _lookupTitle(int $obj_id)
const ROOT_FOLDER_ID
Definition: constants.php:32
setOnScreenMessage(string $type, string $a_txt, bool $a_keep=false)
Set a message to be displayed to the user.

References $DIC, $lng, ilObjectGUI\_gotoRepositoryRoot(), ilObject\_lookupObjId(), ilObject\_lookupTitle(), ROOT_FOLDER_ID, and ILIAS\UICore\GlobalTemplate\setOnScreenMessage().

+ Here is the call graph for this function:

◆ addLocatorItems()

ilObjMediaPoolGUI::addLocatorItems ( )
protected

add locator items for media pool

Reimplemented from ilObject2GUI.

Definition at line 949 of file class.ilObjMediaPoolGUI.php.

949 : void
950 {
951 $ilLocator = $this->locator;
952 $ilAccess = $this->access;
953 if (!$this->getCreationMode() && $this->ctrl->getCmd() !== "explorer") {
954 $tree = $this->object->getTree();
956 $path = $tree->getPathFull($obj_id);
957 foreach ($path as $node) {
958 if ($node["child"] == $tree->getRootId()) {
959 $this->ctrl->setParameter($this, "mepitem_id", "");
960 $link = "";
961 if ($ilAccess->checkAccess("read", "", $this->object->getRefId())) {
962 $link = $this->ctrl->getLinkTarget($this, "listMedia");
963 } elseif ($ilAccess->checkAccess("visible", "", $this->object->getRefId())) {
964 $link = $this->ctrl->getLinkTarget($this, "infoScreen");
965 }
966 $title = $this->object->getTitle();
967 $this->ctrl->setParameter($this, "mepitem_id", $this->mep_item_id);
968 $ilLocator->addItem($title, $link, "", $this->requested_ref_id);
969 }
970 }
971 }
972 }
ilAccessHandler $access
ilLocatorGUI $locator
getPathFull(int $a_endnode_id, int $a_startnode_id=0)
get path from a given startnode to a given endnode if startnode is not given the rootnode is startnod...

References ilObject2GUI\$access, ilObject2GUI\$locator, $mep_item_id, ilObjectGUI\$obj_id, ilObjectGUI\$tree, ILIAS\Repository\ctrl(), ilObject2GUI\getCreationMode(), ilTree\getPathFull(), and ilTree\getRootId().

+ Here is the call graph for this function:

◆ addMobsToPool()

ilObjMediaPoolGUI::addMobsToPool ( array  $mob_ids,
string  $long_desc = "",
bool  $redirect = true,
bool  $extract = false 
)
protected

Definition at line 1637 of file class.ilObjMediaPoolGUI.php.

1642 : void {
1645
1646 $item_ids = [];
1647 foreach ($mob_ids as $mob_id) {
1648 $object = new ilObjMediaObject($mob_id);
1649 if (!is_null($object)) {
1650 $mep_item = new ilMediaPoolItem();
1651 $mep_item->setTitle($object->getTitle());
1652 $mep_item->setType("mob");
1653 $mep_item->setForeignId($object->getId());
1654 $mep_item->create();
1655
1656 $parent = $this->mep_item_id;
1657 $tree = $this->object->getTree();
1658 $tree->insertNode($mep_item->getId(), $parent);
1659 }
1660 }
1661
1662 if ($redirect) {
1663 $ctrl->redirect($this, "listMedia");
1664 }
1665 }
redirect(object $a_gui_obj, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false)
@inheritDoc
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
insertNode(int $a_node_id, int $a_parent_id, int $a_pos=self::POS_LAST_NODE, bool $a_reset_deletion_date=false)
insert new node with node_id under parent node with parent_id

◆ afterConstructor()

ilObjMediaPoolGUI::afterConstructor ( )
protected
Exceptions
ilCtrlException

Reimplemented from ilObject2GUI.

Definition at line 105 of file class.ilObjMediaPoolGUI.php.

105 : void
106 {
108 if ($this->mep_item_id == 0 && !$this->getCreationMode()) {
109 $tree = $this->object->getTree();
110 $this->mep_item_id = $tree->readRootId();
111 }
112
113 $lng->loadLanguageModule("mep");
114
115 if ($this->ctrl->getCmd() === "explorer") {
116 $this->ctrl->saveParameter($this, array("ref_id"));
117 } else {
118 $this->ctrl->saveParameter($this, array("ref_id", "mepitem_id"));
119 }
120 $this->ctrl->saveParameter($this, array("mep_mode"));
121
122 $lng->loadLanguageModule("content");
123 }
loadLanguageModule(string $a_module)
Load language module.

References ilObject2GUI\$lng, ilObjectGUI\$tree, ILIAS\Repository\ctrl(), ilObject2GUI\getCreationMode(), ilLanguage\loadLanguageModule(), and ilTree\readRootId().

+ Here is the call graph for this function:

◆ afterPoolInsert()

ilObjMediaPoolGUI::afterPoolInsert ( array  $mob_ids)
protected

Definition at line 1667 of file class.ilObjMediaPoolGUI.php.

1667 : void
1668 {
1669 $this->addMobsToPool($mob_ids, "", true, true);
1670 }
addMobsToPool(array $mob_ids, string $long_desc="", bool $redirect=true, bool $extract=false)

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ afterSave()

ilObjMediaPoolGUI::afterSave ( ilObject  $new_object)
protected

Post (successful) object creation hook.

Reimplemented from ilObjectGUI.

Definition at line 501 of file class.ilObjMediaPoolGUI.php.

501 : void
502 {
503 // always send a message
504 $this->main_tpl->setOnScreenMessage('success', $this->lng->txt("object_added"), true);
505
506 //ilUtil::redirect($this->getReturnLocation("save","adm_object.php?".$this->link_params));
507 ilUtil::redirect("ilias.php?baseClass=ilMediaPoolPresentationGUI&ref_id=" . $new_object->getRefId() . "&cmd=listMedia");
508 }
static redirect(string $a_script)

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

+ Here is the call graph for this function:

◆ afterUpload()

ilObjMediaPoolGUI::afterUpload (   $mob_ids)
protected

Definition at line 1627 of file class.ilObjMediaPoolGUI.php.

1627 : void
1628 {
1629 $this->addMobsToPool($mob_ids, "", false);
1630 }

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ afterUrlSaving()

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

Definition at line 1632 of file class.ilObjMediaPoolGUI.php.

1632 : void
1633 {
1634 $this->addMobsToPool([$mob_id], $long_desc);
1635 }

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ allMedia()

ilObjMediaPoolGUI::allMedia ( )

list all media objects

Definition at line 595 of file class.ilObjMediaPoolGUI.php.

595 : void
596 {
598 $ilTabs = $this->tabs;
599 $ilCtrl = $this->ctrl;
600 $ilUser = $this->user;
601
602 $ilCtrl->setParameter($this, "mep_mode", "allMedia");
603
604 $this->checkPermission("read");
605 $ilTabs->setTabActive("content");
606 $this->setContentSubTabs("mep_all_mobs");
607
608 $filter_title = $this->mep_request->getForceFilter() > 0
609 ? ilMediaPoolItem::lookupTitle($this->mep_request->getForceFilter())
610 : null;
611 $table_builder = $this->gui->mediaPoolTableBuilder(
612 $this->getMediaPool(),
613 "mepitem_id",
614 "edit",
615 true,
616 "applyFilter",
617 "resetFilter",
618 "",
619 $this,
620 "allMedia",
621 $filter_title
622 );
623 if ($table_builder->getTable()->handleCommand()) {
624 return;
625 }
626 $tpl->setContent($table_builder->render());
627 }
static lookupTitle(int $a_id)
setContentSubTabs(string $a_active)
Set sub tabs for content tab.
ilGlobalTemplateInterface $tpl
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
setContent(string $a_html)
Sets content for standard template.

References ilObject2GUI\$ctrl, $tabs, ilObject2GUI\$tpl, ilObject2GUI\$user, ilObject2GUI\checkPermission(), ilMediaPoolItem\lookupTitle(), ILIAS\UICore\GlobalTemplate\setContent(), and setContentSubTabs().

Referenced by applyFilter(), and resetFilter().

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

◆ applyFilter()

ilObjMediaPoolGUI::applyFilter ( )

Apply filter.

Definition at line 632 of file class.ilObjMediaPoolGUI.php.

632 : void
633 {
634 $this->allMedia();
635 }
allMedia()
list all media objects

References allMedia().

+ Here is the call graph for this function:

◆ bulkUpload()

ilObjMediaPoolGUI::bulkUpload ( )
protected

Definition at line 1380 of file class.ilObjMediaPoolGUI.php.

1380 : void
1381 {
1382 $this->checkPermission("write");
1383
1385
1386 $form = $this->getBulkUploadForm();
1387 $main_tpl->setContent($form->render());
1388 }

References ILIAS\UICore\GlobalTemplate\setContent().

+ Here is the call graph for this function:

◆ cancelFolderUpdate()

ilObjMediaPoolGUI::cancelFolderUpdate ( )

Definition at line 1091 of file class.ilObjMediaPoolGUI.php.

1091 : void
1092 {
1093 $ilCtrl = $this->ctrl;
1094 $ilCtrl->setParameter(
1095 $this,
1096 "mepitem_id",
1097 $this->object->getTree()->getParentId($this->mep_item_id)
1098 );
1099 $ilCtrl->redirect($this, "listMedia");
1100 }
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
@inheritDoc

References ilObject2GUI\$ctrl, ILIAS\Repository\object(), and ilCtrl\setParameter().

+ Here is the call graph for this function:

◆ cancelRemove()

ilObjMediaPoolGUI::cancelRemove ( )

cancel deletion of media objects/folders

Definition at line 891 of file class.ilObjMediaPoolGUI.php.

891 : void
892 {
893 $this->ctrl->redirect($this, $this->mode);
894 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ cancelSave()

ilObjMediaPoolGUI::cancelSave ( )

Definition at line 1102 of file class.ilObjMediaPoolGUI.php.

1102 : void
1103 {
1104 $ilCtrl = $this->ctrl;
1105 $ilCtrl->redirect($this, "listMedia");
1106 }

References ilObject2GUI\$ctrl, and ilCtrl\redirect().

+ Here is the call graph for this function:

◆ confirmRemove()

ilObjMediaPoolGUI::confirmRemove ( ?array  $ids = null)

confirm remove of mobs

Definition at line 796 of file class.ilObjMediaPoolGUI.php.

796 : void
797 {
798 $ilCtrl = $this->ctrl;
800
801 $this->checkPermission("write");
802
803 $ids ??= $this->mep_request->getItemIds();
804 if (count($ids) === 0) {
805 $this->main_tpl->setOnScreenMessage('failure', $this->lng->txt("no_checkbox"), true);
806 $ilCtrl->redirect($this, "");
807 }
808
809 // display confirmation message
810 $cgui = new ilConfirmationGUI();
811 $cgui->setFormAction($this->ctrl->getFormAction($this));
812 $cgui->setHeaderText($this->lng->txt("info_remove_sure"));
813 $cgui->setCancel($this->lng->txt("cancel"), "cancelRemove");
814 $cgui->setConfirm($this->lng->txt("confirm"), "remove");
815
816 foreach ($ids as $obj_id) {
819
820 // check whether page can be removed
821 $add = "";
822 if ($type === "pg") {
823 $usages = ilPageContentUsage::getUsages("incl", $obj_id, false);
824 if (count($usages) > 0) {
825 $this->main_tpl->setOnScreenMessage('failure', sprintf($lng->txt("mep_content_snippet_in_use"), $title), true);
826 $ilCtrl->redirect($this, "listMedia");
827 } else {
828 // check whether the snippet is used in older versions of pages
829 $usages = ilPageContentUsage::getUsages("incl", $obj_id, true);
830 if (count($usages) > 0) {
831 $add = "<div class='small'>" . $lng->txt("mep_content_snippet_used_in_older_versions") . "</div>";
832 }
833 }
834 }
835
836 $caption =
837 " " . $title . $add;
838
839 $cgui->addItem("id[]", $obj_id, $caption);
840 }
841
842 $this->tpl->setContent($cgui->getHTML());
843 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static lookupType(int $a_id)
static getUsages(string $a_pc_type, int $a_pc_id, bool $a_incl_hist=true)
Get usages.

References ilObject2GUI\$ctrl, ilObject2GUI\$lng, ilObjectGUI\$obj_id, ilObject2GUI\$type, ilObject2GUI\checkPermission(), ILIAS\Repository\ctrl(), ilPageContentUsage\getUsages(), ILIAS\Repository\lng(), ilMediaPoolItem\lookupTitle(), ilMediaPoolItem\lookupType(), and ilLanguage\txt().

+ Here is the call graph for this function:

◆ copyToClipboard()

ilObjMediaPoolGUI::copyToClipboard ( ?array  $ids = null)

copy media objects to clipboard

Definition at line 913 of file class.ilObjMediaPoolGUI.php.

913 : void
914 {
915 $ilUser = $this->user;
916
917 $this->checkPermission("write");
918
919 $ids ??= $this->mep_request->getItemIds();
920 if (count($ids) === 0) {
921 $this->main_tpl->setOnScreenMessage('failure', $this->lng->txt("no_checkbox"), true);
922 $this->ctrl->redirect($this, $this->mode);
923 }
924
925 foreach ($ids as $obj_id) {
927 if ($type === "fold") {
928 $this->main_tpl->setOnScreenMessage('failure', $this->lng->txt("cont_cant_copy_folders"), true);
929 $this->ctrl->redirect($this, $this->mode);
930 }
931 }
932 foreach ($ids as $obj_id) {
935 if ($type === "mob") {
936 $ilUser->addObjectToClipboard($fid, "mob", "");
937 }
938 if ($type === "pg") {
939 $ilUser->addObjectToClipboard($obj_id, "incl", "");
940 }
941 }
942 $this->main_tpl->setOnScreenMessage('success', $this->lng->txt("copied_to_clipboard"), true);
943 $this->ctrl->redirect($this, $this->mode);
944 }
static lookupForeignId(int $a_id)

References ilObjectGUI\$obj_id, ilObject2GUI\$type, ilObject2GUI\$user, ilObject2GUI\checkPermission(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ilMediaPoolItem\lookupForeignId(), and ilMediaPoolItem\lookupType().

+ Here is the call graph for this function:

◆ createFolderForm()

ilObjMediaPoolGUI::createFolderForm ( )

Definition at line 978 of file class.ilObjMediaPoolGUI.php.

978 : void
979 {
981
982 $this->checkPermission("write");
983
984 $this->initFolderForm("create");
985 $tpl->setContent($this->form->getHTML());
986 }
initFolderForm(string $a_mode="edit")
form(?array $class_path, string $cmd, string $submit_caption="")

References ilObject2GUI\$tpl, ilObject2GUI\checkPermission(), ILIAS\Repository\form(), initFolderForm(), and ILIAS\UICore\GlobalTemplate\setContent().

+ Here is the call graph for this function:

◆ createMediaObject()

ilObjMediaPoolGUI::createMediaObject ( )

Definition at line 496 of file class.ilObjMediaPoolGUI.php.

496 : void
497 {
498 $this->ctrl->redirectByClass("ilobjmediaobjectgui", "create");
499 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ edit()

ilObjMediaPoolGUI::edit ( )

Reimplemented from ilObject2GUI.

Definition at line 510 of file class.ilObjMediaPoolGUI.php.

510 : void
511 {
512 $this->ctrl->redirectByClass(SettingsGUI::class);
513 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ editFolder()

ilObjMediaPoolGUI::editFolder ( )

Definition at line 988 of file class.ilObjMediaPoolGUI.php.

988 : void
989 {
991
992 $this->checkPermission("write");
993
994 $this->initFolderForm();
995 $this->getFolderValues();
996 $tpl->setContent($this->form->getHTML());
997 }
getFolderValues()
Get current values for folder from.

References ilObject2GUI\$tpl, ilObject2GUI\checkPermission(), ILIAS\Repository\form(), getFolderValues(), initFolderForm(), and ILIAS\UICore\GlobalTemplate\setContent().

+ Here is the call graph for this function:

◆ editTitlesAndDescriptions()

ilObjMediaPoolGUI::editTitlesAndDescriptions ( )
protected

Definition at line 1506 of file class.ilObjMediaPoolGUI.php.

1506 : void
1507 {
1509 $lng = $this->lng;
1510
1511 $this->checkPermission("write");
1512 $ctrl->saveParameter($this, "mep_hash");
1513
1515
1517 $this->mep_request->getUploadHash()
1518 );
1519
1520 $tb = new ilToolbarGUI();
1521 $tb->setFormAction($ctrl->getFormAction($this));
1522 $tb->addFormButton($lng->txt("save"), "saveTitlesAndDescriptions");
1523 $tb->setOpenFormTag(true);
1524 $tb->setCloseFormTag(false);
1525 $tb->setId("tb_top");
1526
1527 $html = $tb->getHTML();
1528 foreach ($media_items as $mi) {
1529 $acc = new ilAccordionGUI();
1530 $acc->setBehaviour(ilAccordionGUI::ALL_CLOSED);
1531 $acc->setId("acc_" . $mi["mob_id"]);
1532
1533 $mob = new ilObjMediaObject($mi["mob_id"]);
1534 $form = $this->initMediaBulkForm($mi["mob_id"], $mob->getTitle());
1535 $acc->addItem($mob->getTitle(), $form->getHTML());
1536
1537 $html .= $acc->getHTML();
1538 }
1539
1540 $html .= $tb->getHTML();
1541 $tb->setOpenFormTag(false);
1542 $tb->setCloseFormTag(true);
1543 $tb->setId("tb_bottom");
1544
1546 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getFormAction(object $a_gui_obj, ?string $a_fallback_cmd=null, ?string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
@inheritDoc
saveParameter(object $a_gui_obj, $a_parameter)
@inheritDoc
static getMediaItemsForUploadHash(string $a_hash)
Get media items for upload hash.
initMediaBulkForm(int $a_id, string $a_title)
Init media bulk form.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References $lng, ilAccordionGUI\ALL_CLOSED, ilPropertyFormGUI\getHTML(), ilMediaItem\getMediaItemsForUploadHash(), and ILIAS\UICore\GlobalTemplate\setContent().

+ Here is the call graph for this function:

◆ executeCommand()

ilObjMediaPoolGUI::executeCommand ( )
Exceptions
ilCtrlException
ilObjectException
ilPermissionException

Reimplemented from ilObject2GUI.

Definition at line 135 of file class.ilObjMediaPoolGUI.php.

135 : void
136 {
137 $ilTabs = $this->tabs;
139 $ilAccess = $this->access;
141 $ilCtrl = $this->ctrl;
142
143 $tree = null;
144 if ($this->object) {
145 $tree = $this->object->getTree();
146 }
147
148 $next_class = $this->ctrl->getNextClass($this);
149 $cmd = $this->ctrl->getCmd();
150 $new_type = $this->mep_request->getNewType();
151
152
153
154 if ($new_type !== "" && ($cmd !== "confirmRemove" && $cmd !== "copyToClipboard"
155 && $cmd !== "pasteFromClipboard")) {
156 $this->tpl->setPermanentLink("mep", $this->ref_id);
157 $this->setCreationMode(true);
158 }
159
160 if ($cmd === "create") {
161 switch ($this->mep_request->getNewType()) {
162 case "mob":
163 $this->ctrl->redirectByClass("ilobjmediaobjectgui", "create");
164 break;
165
166 case "fold":
167 $this->ctrl->redirectByClass("ilobjfoldergui", "create");
168 break;
169 }
170 }
171
172 switch ($next_class) {
173 case 'ilobjectmetadatagui':
174 $this->checkPermission("write");
175
176 $this->prepareOutput();
177 $this->addHeaderAction();
178
179 $this->tabs_gui->activateTab('meta_data');
180 $md_gui = new ilObjectMetaDataGUI($this->object, ['mob', "mpg"]);
181 $this->ctrl->forwardCommand($md_gui);
182 $this->tpl->printToStdout();
183 break;
184
185 case strtolower(ilRepoStandardUploadHandlerGUI::class):
186 $this->checkPermission("write");
187 $form = $this->getBulkUploadForm();
188 $gui = $form->getRepoStandardUploadHandlerGUI("media_files");
189 $this->ctrl->forwardCommand($gui);
190 break;
191
192 case 'ilmediapoolpagegui':
193 $this->checkPermission("write");
194 $this->prepareOutput();
195 //$this->addHeaderAction();
196 $ilTabs->clearTargets();
197 $ilCtrl->setReturn($this, "returnFromItem");
198 $mep_page_gui = new ilMediaPoolPageGUI(
199 $this->mep_item_id,
200 $this->mep_request->getOldNr()
201 );
202 $mep_page_gui->setPoolGUI($this);
203 $mep_page_gui->setAdvMdRecordObject($this->object->getRefId(), "mep", "mpg");
204
205 if (!$ilAccess->checkAccess("write", "", $this->object->getRefId())) {
206 $mep_page_gui->setEnableEditing(false);
207 }
208 $ret = $this->ctrl->forwardCommand($mep_page_gui);
209 if ($ret != "") {
210 $tpl->setContent($ret);
211 }
212 $this->tpl->printToStdout();
213 break;
214
215 case "ilobjmediaobjectgui":
216 $this->checkPermission("write");
217 if ($cmd === "create" || $cmd === "save" || $cmd === "cancel") {
218 $ret_obj = $this->mep_item_id;
219 $ilObjMediaObjectGUI = new ilObjMediaObjectGUI("", 0, false, false);
220 $ilObjMediaObjectGUI->setWidthPreset((int) $this->getMediaPool()->getDefaultWidth());
221 $ilObjMediaObjectGUI->setHeightPreset((int) $this->getMediaPool()->getDefaultHeight());
222 } else {
223 $ret_obj = $tree->getParentId($this->mep_item_id);
224 $ilObjMediaObjectGUI = new ilObjMediaObjectGUI("", ilMediaPoolItem::lookupForeignId($this->mep_item_id), false, false);
225 $this->ctrl->setParameter($this, "mepitem_id", $this->getParentFolderId());
226 $ilTabs->setBackTarget(
227 $lng->txt("back"),
228 $this->ctrl->getLinkTarget(
229 $this,
230 $this->mode
231 )
232 );
233 }
234 if ($this->ctrl->getCmdClass() === "ilinternallinkgui") {
235 $this->ctrl->setReturn($this, "explorer");
236 } else {
237 $this->ctrl->setParameter($this, "mepitem_id", $ret_obj);
238 $this->ctrl->setReturn(
239 $this,
240 $this->mode
241 );
242 $this->ctrl->setParameter($this, "mepitem_id", $this->mep_item_id);
243 }
244 $this->getTemplate();
245 $ilObjMediaObjectGUI->setTabs();
246 $this->setLocator();
247
248 // set adv metadata record dobject
249 $ilObjMediaObjectGUI->setAdvMdRecordObject($this->object->getRefId(), "mep", "mob");
250
251 $ret = $this->ctrl->forwardCommand($ilObjMediaObjectGUI);
252 if ($cmd === "save") {
253 $object = $ilObjMediaObjectGUI->getObject();
254 if (!is_null($object)) {
255 $mep_item = new ilMediaPoolItem();
256 $mep_item->setTitle($object->getTitle());
257 $mep_item->setType("mob");
258 $mep_item->setForeignId($object->getId());
259 $mep_item->create();
260
261 $parent = $this->mep_item_id;
262 $tree->insertNode($mep_item->getId(), $parent);
264 "ilias.php?baseClass=ilMediaPoolPresentationGUI&cmd=listMedia&ref_id=" .
265 $this->requested_ref_id . "&mepitem_id=" . $this->mep_item_id
266 );
267 }
268 }
269 $this->tpl->printToStdout();
270 break;
271
272 case "ilmediacreationgui":
273 $this->checkPermission("write");
274 $this->prepareOutput();
275 $this->ctrl->setReturn($this, "listMedia");
276 //$ilTabs->activateTab("content");
277 //$this->addContentSubTabs("manage");
278 $med_type = [];
279 $creation = new ilMediaCreationGUI([ilMediaCreationGUI::TYPE_ALL], function ($mob_id) {
280 $this->afterUpload($mob_id);
281 }, function ($mob_id, $long_desc) {
282 $this->afterUrlSaving($mob_id, $long_desc);
283 }, function ($mob_ids) {
284 $this->afterPoolInsert($mob_ids);
285 }, function ($mob_id) {
286 $this->finishSingleUpload($mob_id);
287 }, function ($mob_id) {
288 $this->onMobUpdate($mob_id);
289 });
290 $this->ctrl->forwardCommand($creation);
291 $this->tpl->printToStdout();
292 break;
293
294
295 case "ilobjfoldergui":
296 $this->checkPermission("write");
297 $this->addHeaderAction();
298 $folder_gui = new ilObjFolderGUI("", 0, false, false);
299 $this->ctrl->setReturn($this, "listMedia");
300 $cmd .= "Object";
301 switch ($cmd) {
302 case "createObject":
303 $this->prepareOutput();
304 $folder_gui = new ilObjFolderGUI("", 0, false, false);
305 $folder_gui->setFormAction(
306 "save",
307 $this->ctrl->getFormActionByClass("ilobjfoldergui")
308 );
309 $folder_gui->createObject();
310 $this->tpl->printToStdout();
311 break;
312
313 case "saveObject":
314 $parent = $this->mep_item_id;
315 $folder_gui->setFolderTree($tree);
316 $folder_gui->saveObject();
317 break;
318
319 case "editObject":
320 $this->prepareOutput();
321 $folder_gui = new ilObjFolderGUI(
322 "",
323 ilMediaPoolItem::lookupForeignId($this->mep_item_id),
324 false,
325 false
326 );
327 $this->ctrl->setParameter($this, "foldereditmode", "1");
328 $folder_gui->setFormAction("update", $this->ctrl->getFormActionByClass("ilobjfoldergui"));
329 $folder_gui->editObject();
330 $this->tpl->printToStdout();
331 break;
332
333 case "updateObject":
334 $folder_gui = new ilObjFolderGUI(
335 "",
336 ilMediaPoolItem::lookupForeignId($this->mep_item_id),
337 false,
338 false
339 );
340 $this->ctrl->setParameter($this, "mepitem_id", $this->getParentFolderId());
341 $this->ctrl->setReturn($this, "listMedia");
342 $folder_gui->updateObject(); // this returns to parent
343 break;
344
345 case "cancelObject":
346 if ($this->mep_request->getFolderEditMode()) {
347 $this->ctrl->setParameter($this, "mepitem_id", $this->getParentFolderId());
348 }
349 $this->ctrl->redirect($this, "listMedia");
350 break;
351 }
352 break;
353
354 case "ileditclipboardgui":
355 $this->prepareOutput();
356 $this->addHeaderAction();
357 $this->ctrl->setReturn($this, $this->mode);
358 $clip_gui = new ilEditClipboardGUI();
359 $clip_gui->setMultipleSelections(true);
360 $clip_gui->setInsertButtonTitle($lng->txt("mep_copy_to_mep"));
361 $ilTabs->setTabActive("clipboard");
362 $this->ctrl->forwardCommand($clip_gui);
363 $this->tpl->printToStdout();
364 break;
365
366 case 'ilinfoscreengui':
367 $this->prepareOutput();
368 $this->addHeaderAction();
369 $this->infoScreen();
370 $this->tpl->printToStdout();
371 break;
372
373 case 'ilpermissiongui':
374 $this->checkPermission("edit_permission");
375 $this->prepareOutput();
376 $this->addHeaderAction();
377 $perm_gui = new ilPermissionGUI($this);
378 $ilTabs->activateTab("perm_settings");
379 $this->ctrl->forwardCommand($perm_gui);
380 $this->tpl->printToStdout();
381 break;
382
383 case "ilexportgui":
384 $this->checkPermission("write");
385 $this->prepareOutput();
386 $this->addHeaderAction();
387 $ilTabs->activateTab("export");
388 $exp_gui = new ilExportGUI($this);
389 $this->ctrl->forwardCommand($exp_gui);
390 $this->tpl->printToStdout();
391 break;
392
393 case "ilcommonactiondispatchergui":
394 $this->prepareOutput();
396 $this->ctrl->forwardCommand($gui);
397 break;
398
399 case strtolower(TranslationGUI::class):
400 $this->prepareOutput();
401 $this->addHeaderAction();
402 //$this->setTabs("settings");
403 $ilTabs->activateTab("settings");
404 $this->setSettingsSubTabs("obj_multilinguality");
405 $transgui = new TranslationGUI(
406 $this->getObject(),
407 $this->lng,
408 $this->access,
409 $this->user,
410 $this->ctrl,
411 $this->tpl,
412 $this->ui_factory,
413 $this->ui_renderer,
414 $this->http,
415 $this->refinery,
416 $this->toolbar
417 );
418 $transgui->forceContentTranslation();
419 $this->ctrl->forwardCommand($transgui);
420 $this->tpl->printToStdout();
421 break;
422
423 case "ilmediapoolimportgui":
424 $this->prepareOutput();
425 $this->addHeaderAction();
426 $this->checkPermission("write");
427 $ilTabs->activateTab("import");
428 $gui = new ilMediaPoolImportGUI($this->getMediaPool());
429 $this->ctrl->forwardCommand($gui);
430 $this->tpl->printToStdout();
431 break;
432
433 case "ilmobmultisrtuploadgui":
434 $this->checkPermission("write");
435 $this->prepareOutput();
436 $this->addHeaderAction();
437 $this->setContentSubTabs("srt_files");
438 $gui = new ilMobMultiSrtUploadGUI(new ilMepMultiSrt($this->getMediaPool()));
439 $this->ctrl->forwardCommand($gui);
440 $this->tpl->printToStdout();
441 break;
442
443 case strtolower(ilObjectMetaDataGUI::class):
444 $this->checkPermission("write");
445 $this->prepareOutput();
446 $this->addHeaderAction();
447 $ilTabs->activateTab("meta_data");
448 $gui = new ilObjectMetaDataGUI($this->object);
449 $this->ctrl->forwardCommand($gui);
450 break;
451
452 case strtolower(SettingsGUI::class):
453 $this->checkPermission("write");
454 $this->prepareOutput();
455 $this->addHeaderAction();
456 $this->setSettingsSubTabs("settings");
457 $ilTabs->activateTab("settings");
458 $gui = $this->gui->settings()->settingsGUI(
459 $this->object->getId()
460 );
461 $this->ctrl->forwardCommand($gui);
462 $this->tpl->printToStdout();
463 break;
464
465 default:
466 $this->prepareOutput();
467 $this->addHeaderAction();
468 $cmd = $this->ctrl->getCmd("listMedia") ?: "listMedia";
469 $this->$cmd();
470 if (!$this->getCreationMode()) {
471 $this->tpl->printToStdout();
472 }
473 break;
474 }
475 }
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Export User Interface Class.
Import related features for media pools (currently used for translation imports)
Class ilMediaPoolPage GUI class.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Upload SRT files to a set of media objects.
Class ilObjFolderGUI.
Editing User Interface for MediaObjects within LMs (see ILIAS DTD)
getTemplate()
Get standard template.
setSettingsSubTabs(string $a_active)
getParentFolderId()
Get folder parent ID.
infoScreen()
show information screen
afterUrlSaving(int $mob_id, string $long_desc)
InternalGUIService $gui
setCreationMode(bool $mode=true)
If true, a creation screen is displayed the current [ref_id] does belong to the parent class The mode...
setLocator()
set Locator
prepareOutput(bool $show_sub_objects=true)
addHeaderAction()
Add header action menu.
Class ilObjectMetaDataGUI.
getParentId(int $a_node_id)
get parent id of given node
static http()
Fetches the global http state from ILIAS.

References ilObject2GUI\$access, ilObject2GUI\$ctrl, $form, $gui, ilObject2GUI\$lng, $mep_item_id, ilObjectGUI\$object, $tabs, ilObject2GUI\$tpl, ilObjectGUI\$tree, ILIAS\Repository\access(), ilObjectGUI\addHeaderAction(), afterPoolInsert(), afterUpload(), afterUrlSaving(), ilObject2GUI\checkPermission(), ILIAS\Repository\ctrl(), finishSingleUpload(), getBulkUploadForm(), ilObject2GUI\getCreationMode(), ilObject\getId(), ilCommonActionDispatcherGUI\getInstanceFromAjaxCall(), ilObjectGUI\getObject(), getParentFolderId(), ilTree\getParentId(), getTemplate(), ilObject\getTitle(), ILIAS\FileDelivery\http(), infoScreen(), ilTree\insertNode(), ILIAS\Repository\lng(), ilMediaPoolItem\lookupForeignId(), ILIAS\Repository\object(), onMobUpdate(), ilObject2GUI\prepareOutput(), ilUtil\redirect(), ILIAS\Repository\refinery(), ILIAS\UICore\GlobalTemplate\setContent(), setContentSubTabs(), ilObject2GUI\setCreationMode(), ilObject2GUI\setLocator(), setSettingsSubTabs(), ILIAS\MediaPool\InternalGUIService\settings(), ILIAS\Repository\toolbar(), ilLanguage\txt(), ilMediaCreationGUI\TYPE_ALL, and ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ export()

ilObjMediaPoolGUI::export ( )

Definition at line 1364 of file class.ilObjMediaPoolGUI.php.

1364 : void
1365 {
1366 $ot = $this->object->getObjectProperties()->getPropertyTranslations();
1367 $opt = "";
1368 if ($ot->getContentTranslationActivated()) {
1369 $format = explode("_", $this->mep_request->getExportFormat());
1370 $opt = ilUtil::stripSlashes($format[1]);
1371 }
1372
1373 $this->object->exportXML($opt);
1374 }
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")

References ilUtil\stripSlashes().

+ Here is the call graph for this function:

◆ finishSingleUpload()

ilObjMediaPoolGUI::finishSingleUpload ( int  $mob_id)

Definition at line 1672 of file class.ilObjMediaPoolGUI.php.

1672 : void
1673 {
1674 $this->ctrl->redirect($this, "listMedia");
1675 }

References ILIAS\Repository\ctrl().

Referenced by executeCommand().

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

◆ getBulkUploadForm()

ilObjMediaPoolGUI::getBulkUploadForm ( )
protected

Definition at line 1390 of file class.ilObjMediaPoolGUI.php.

1391 {
1392 if (is_null($this->bulk_upload_form)) {
1393 $mep_hash = uniqid();
1394 $this->ctrl->setParameter($this, "mep_hash", $mep_hash);
1395 $this->bulk_upload_form = $this->gui
1396 ->form([self::class], 'performBulkUpload')
1397 ->section("props", $this->lng->txt('mep_bulk_upload'))
1398 ->file(
1399 "media_files",
1400 $this->lng->txt("mep_media_files"),
1401 \Closure::fromCallable([$this, 'handleUploadResult']),
1402 "mep_id",
1403 "",
1404 20
1405 );
1406 // ->meta()->text()->meta()->textarea()
1407 }
1409 }
FormAdapterGUI $bulk_upload_form

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

Referenced by executeCommand().

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

◆ getFolderValues()

ilObjMediaPoolGUI::getFolderValues ( )

Get current values for folder from.

Definition at line 1002 of file class.ilObjMediaPoolGUI.php.

1002 : void
1003 {
1004 $values = array();
1005
1006 $values["title"] = ilMediaPoolItem::lookupTitle($this->mep_item_id);
1007
1008 $this->form->setValuesByArray($values);
1009 }

References ILIAS\Repository\form(), and ilMediaPoolItem\lookupTitle().

Referenced by editFolder().

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

◆ getMediaPoolPageGUI()

ilObjMediaPoolGUI::getMediaPoolPageGUI (   $mep_item_id,
  $old_nr = 0 
)
protected

Definition at line 755 of file class.ilObjMediaPoolGUI.php.

756 {
757 $page_gui = new ilMediaPoolPageGUI($mep_item_id, $old_nr);
758 $page_gui->setPoolGUI($this);
759
760 return $page_gui;
761 }

References $mep_item_id.

Referenced by showPage().

+ Here is the caller graph for this function:

◆ getParentFolderId()

ilObjMediaPoolGUI::getParentFolderId ( )

Get folder parent ID.

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

654 : ?int
655 {
656 if ($this->mep_item_id == 0) {
657 return null;
658 }
659 $par_id = $this->object->getPoolTree()->getParentId($this->mep_item_id);
660 if ($par_id != $this->object->getPoolTree()->getRootId()) {
661 return (int) $par_id;
662 }
663
664 return null;
665 }

References ILIAS\Repository\object().

Referenced by executeCommand().

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

◆ getPreviewModalHTML()

static ilObjMediaPoolGUI::getPreviewModalHTML ( int  $a_mpool_ref_id,
ilGlobalTemplateInterface  $a_tpl 
)
static

Get preview modal html.

Definition at line 1321 of file class.ilObjMediaPoolGUI.php.

1324 : string {
1325 global $DIC;
1326
1327 $tpl = $DIC["tpl"];
1328 $ilCtrl = $DIC->ctrl();
1329 $lng = $DIC->language();
1330 $internal_gui = $DIC->mediaPool()
1331 ->internal()
1332 ->gui();
1333 $request = $internal_gui
1334 ->standardRequest();
1335
1337
1338 $tpl->addJavaScript("assets/js/ilMediaPool.js");
1339
1340 $ilCtrl->setParameterByClass("ilobjmediapoolgui", "mepitem_id", "");
1341 $ilCtrl->setParameterByClass("ilobjmediapoolgui", "ref_id", $a_mpool_ref_id);
1342 $tpl->addOnloadCode("il.MediaPool.setPreviewUrl('" . $ilCtrl->getLinkTargetByClass(array("ilmediapoolpresentationgui", "ilobjmediapoolgui"), "showPreview", "", false, false) . "');");
1343 $ilCtrl->setParameterByClass("ilobjmediapoolgui", "mepitem_id", $request->getItemId());
1344 $ilCtrl->setParameterByClass(
1345 "ilobjmediapoolgui",
1346 "ref_id",
1347 $request->getRefId()
1348 );
1349
1350 $modal = $internal_gui->ui()->factory()->modal()->roundtrip(
1351 $lng->txt("preview"),
1352 $internal_gui->ui()->factory()->legacy()->content("<iframe id='ilMepPreviewContent'></iframe>")
1353 );
1354 $html = $internal_gui->ui()->renderer()->render($modal);
1355 $html = str_replace(
1356 "<iframe id='ilMepPreviewContent'",
1357 "<iframe data-signal='" . $modal->getShowSignal()->getId() . "' id='ilMepPreviewContent'",
1358 $html
1359 );
1360
1361 return $html;
1362 }
static includePresentationJS(?ilGlobalTemplateInterface $a_tpl=null)
Include media object presentation JS.
ServerRequestInterface $request
addJavaScript(string $a_js_file, bool $a_add_version_parameter=true, int $a_batch=2)
Add a javascript file that should be included in the header.

◆ getTemplate()

ilObjMediaPoolGUI::getTemplate ( )

Get standard template.

Definition at line 645 of file class.ilObjMediaPoolGUI.php.

645 : void
646 {
647 $this->tpl->loadStandardTemplate();
648 }

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ getType()

ilObjMediaPoolGUI::getType ( )
final

Functions that must be overwritten.

Reimplemented from ilObject2GUI.

Definition at line 125 of file class.ilObjMediaPoolGUI.php.

125 : string
126 {
127 return "mep";
128 }

◆ handleUploadResult()

ilObjMediaPoolGUI::handleUploadResult ( FileUpload  $upload,
UploadResult  $result 
)
protected

Definition at line 1411 of file class.ilObjMediaPoolGUI.php.

1415 $title = $result->getName();
1416
1417 $mob = new ilObjMediaObject();
1418 $mob->setTitle($title);
1419 $mob->setDescription("");
1420 $mob->create();
1421
1422 $media_item = $mob->addMediaItemFromUpload(
1423 "Standard",
1424 $result,
1425 $this->mep_request->getUploadHash()
1426 );
1427
1428 $mob->update();
1429
1430 /*
1431 $mob->createDirectory();
1432 $media_item = new ilMediaItem();
1433 $mob->addMediaItem($media_item);
1434 $media_item->setPurpose("Standard");
1435
1436 $mob_dir = ilObjMediaObject::_getRelativeDirectory($mob->getId());
1437 $file_name = ilObjMediaObject::fixFilename($title);
1438 $file = $mob_dir . "/" . $file_name;
1439
1440 $upload->moveOneFileTo(
1441 $result,
1442 $mob_dir,
1443 Location::WEB,
1444 $file_name,
1445 true
1446 );*/
1447
1448 // duration
1449 $med_item = $mob->getMediaItem("Standard");
1450 $med_item->determineDuration();
1451 $med_item->update();
1452
1453
1454 $mep_item = new ilMediaPoolItem();
1455 $mep_item->setTitle($title);
1456 $mep_item->setType("mob");
1457 $mep_item->setForeignId($mob->getId());
1458 $mep_item->create();
1459
1460 $tree = $this->object->getTree();
1461 $parent = $this->mep_item_id;
1462 $tree->insertNode($mep_item->getId(), $parent);
1463
1464 // get mime type
1465 /*
1466 $format = ilObjMediaObject::getMimeType($file);
1467 $location = $file_name;
1468
1469 // set real meta and object data
1470 $media_item->setFormat($format);
1471 $media_item->setLocation($location);
1472 $media_item->setLocationType("LocalFile");
1473 $media_item->setUploadHash($this->mep_request->getUploadHash());
1474 $mob->update();*/
1475
1476 $item_ids[] = $mob->getId();
1477
1478 /*
1479 $mob = new ilObjMediaObject($mob->getId());
1480 $mob->generatePreviewPic(320, 240);*/
1481
1482 // duration
1483 /*
1484 $med_item = $mob->getMediaItem("Standard");
1485 $med_item->determineDuration();
1486 $med_item->update();*/
1487
1488 return new BasicHandlerResult(
1489 "mep_id",
1490 HandlerResult::STATUS_OK,
1491 $med_item->getId(),
1492 ''
1493 );
1494 }

◆ infoScreen()

ilObjMediaPoolGUI::infoScreen ( )

show information screen

Exceptions
ilCtrlException
ilPermissionException

Definition at line 1291 of file class.ilObjMediaPoolGUI.php.

1291 : void
1292 {
1293 $this->tabs->activateTab("info_short");
1294 $ilAccess = $this->access;
1295
1296 if (!$ilAccess->checkAccess("visible", "", $this->ref_id) &&
1297 !$ilAccess->checkAccess("read", "", $this->ref_id) &&
1298 !$ilAccess->checkAccess("write", "", $this->ref_id)) {
1299 throw new ilPermissionException($this->lng->txt("msg_no_perm_read"));
1300 }
1301
1302 if ($this->ctrl->getCmd() === "infoScreen") {
1303 $this->ctrl->redirectByClass(ilInfoScreenGUI::class, "showSummary");
1304 }
1305
1306 $info = new ilInfoScreenGUI($this);
1307
1308 $info->enablePrivateNotes();
1309
1310
1311 // standard meta data
1312 $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
1313
1314 // forward the command
1315 $this->ctrl->forwardCommand($info);
1316 }
Class ilInfoScreenGUI.
$info
Definition: entry_point.php:21

References $info, ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ILIAS\Repository\object(), and ILIAS\Repository\tabs().

Referenced by executeCommand().

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

◆ infoScreenObject()

ilObjMediaPoolGUI::infoScreenObject ( )

this one is called from the info button in the repository

Definition at line 1281 of file class.ilObjMediaPoolGUI.php.

1281 : void
1282 {
1283 $this->ctrl->redirectByClass(ilInfoScreenGUI::class, "showSummary");
1284 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ initFolderForm()

ilObjMediaPoolGUI::initFolderForm ( string  $a_mode = "edit")
Parameters
string$a_mode"edit" | "create"
Exceptions
ilCtrlException

Definition at line 1064 of file class.ilObjMediaPoolGUI.php.

1064 : void
1065 {
1066 $lng = $this->lng;
1067 $ilCtrl = $this->ctrl;
1068
1069 $this->form = new ilPropertyFormGUI();
1070
1071 // desc
1072 $ti = new ilTextInputGUI($lng->txt("title"), "title");
1073 $ti->setMaxLength(128);
1074 $ti->setRequired(true);
1075 $this->form->addItem($ti);
1076
1077 // save and cancel commands
1078 if ($a_mode === "create") {
1079 $this->form->addCommandButton("saveFolder", $lng->txt("save"));
1080 $this->form->addCommandButton("cancelSave", $lng->txt("cancel"));
1081 $this->form->setTitle($lng->txt("mep_new_folder"));
1082 } else {
1083 $this->form->addCommandButton("updateFolder", $lng->txt("save"));
1084 $this->form->addCommandButton("cancelFolderUpdate", $lng->txt("cancel"));
1085 $this->form->setTitle($lng->txt("mep_edit_folder"));
1086 }
1087
1088 $this->form->setFormAction($ilCtrl->getFormAction($this));
1089 }
This class represents a property form user interface.
This class represents a text property in a property form.

References ilObject2GUI\$ctrl, ilObject2GUI\$lng, ILIAS\Repository\form(), and ilLanguage\txt().

Referenced by createFolderForm(), editFolder(), saveFolder(), and updateFolder().

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

◆ initMediaBulkForm()

ilObjMediaPoolGUI::initMediaBulkForm ( int  $a_id,
string  $a_title 
)

Init media bulk form.

Definition at line 1551 of file class.ilObjMediaPoolGUI.php.

1555 $lng = $this->lng;
1556
1557 $form = new ilPropertyFormGUI();
1558 $form->setOpenTag(false);
1559 $form->setCloseTag(false);
1560
1561 // title
1562 $ti = new ilTextInputGUI($lng->txt("title"), "title_" . $a_id);
1563 $ti->setValue($a_title);
1564 $form->addItem($ti);
1565
1566 // description
1567 $ti = new ilTextAreaInputGUI($lng->txt("description"), "description_" . $a_id);
1568 $form->addItem($ti);
1569
1570 return $form;
1571 }
setCloseTag(bool $a_val)
setOpenTag(bool $a_open)
This class represents a text area property in a property form.

◆ insertFromClipboard()

ilObjMediaPoolGUI::insertFromClipboard ( )

insert media object from clipboard

Definition at line 872 of file class.ilObjMediaPoolGUI.php.

872 : void
873 {
874 $this->checkPermission("write");
875
876 $this->domain->mediapool($this->object->getId())
877 ->copySelectedFromEditClipboard($this->mep_item_id);
878
879 /*
880 if (count($not_inserted) > 0) {
881 $this->main_tpl->setOnScreenMessage('info', $this->lng->txt("mep_not_insert_already_exist") . "<br>" .
882 implode("<br>", $not_inserted), true);
883 }*/
884 $this->ctrl->redirect($this, $this->mode);
885 }

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

+ Here is the call graph for this function:

◆ listMedia()

ilObjMediaPoolGUI::listMedia ( )

list media objects

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

519 : void
520 {
521 $ilAccess = $this->access;
523 $ilTabs = $this->tabs;
524 $ilCtrl = $this->ctrl;
525 $ilToolbar = $this->toolbar;
527
528 $ilCtrl->setParameter($this, "mep_mode", "listMedia");
529
530 $this->checkPermission("read");
531
532 $ilTabs->setTabActive("content");
533 $this->setContentSubTabs("content");
534
535 if ($ilAccess->checkAccess("write", "", $this->object->getRefId())) {
536 $ilToolbar->addButton(
537 $lng->txt("mep_create_mob"),
538 $ilCtrl->getLinkTargetByClass("ilMediaCreationGUI", "")
539 );
540
541 $mset = new ilSetting("mobs");
542 if ($mset->get("mep_activate_pages")) {
543 $ilToolbar->addButton(
544 $lng->txt("mep_create_content_snippet"),
545 $ilCtrl->getLinkTargetByClass(["ilobjmediapoolgui", "ilmediapoolpagegui"], "createMediaPoolPage")
546 );
547 }
548
549 $ilToolbar->addButton(
550 $lng->txt("mep_create_folder"),
551 $ilCtrl->getLinkTarget($this, "createFolderForm")
552 );
553
554 $ilToolbar->addButton(
555 $lng->txt("mep_bulk_upload"),
556 $ilCtrl->getLinkTarget($this, "bulkUpload")
557 );
558
559 $move_ids = ilSession::get("mep_move_ids");
560 if (is_array($move_ids) && count($move_ids) > 0) {
561 $ilToolbar->addSeparator();
562 $ilToolbar->addButton(
563 $lng->txt("paste"),
564 $ilCtrl->getLinkTarget($this, "paste")
565 );
566 }
567 }
568
569 $table_builder = $this->gui->mediaPoolTableBuilder(
570 $this->getMediaPool(),
571 "mepitem_id",
572 "edit",
573 false,
574 null,
575 null,
576 "",
577 $this,
578 "listMedia"
579 );
580 if ($table_builder->getTable()->handleCommand()) {
581 return;
582 }
583 $tpl->setContent($table_builder->render());
584 }
ilToolbarGUI $toolbar
static get(string $a_var)
ILIAS Setting Class.

References ilObject2GUI\$access, ilObject2GUI\$ctrl, ilObject2GUI\$lng, $tabs, ilObject2GUI\$toolbar, ilObject2GUI\$tpl, ilObject2GUI\checkPermission(), ilSession\get(), ILIAS\UICore\GlobalTemplate\setContent(), setContentSubTabs(), and ilLanguage\txt().

Referenced by returnFromItem().

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

◆ move()

ilObjMediaPoolGUI::move ( ?array  $ids = null)
protected

Definition at line 1599 of file class.ilObjMediaPoolGUI.php.

1599 : void
1600 {
1601 ilSession::set("mep_move_ids", $ids ?? $this->mep_request->getItemIds());
1602 $this->main_tpl->setOnScreenMessage('info', $this->lng->txt("mep_move_select_insert"), true);
1603 $this->ctrl->redirect($this, "listMedia");
1604 }
static set(string $a_var, $a_val)
Set a value.

References ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and ilSession\set().

+ Here is the call graph for this function:

◆ onMobUpdate()

ilObjMediaPoolGUI::onMobUpdate ( int  $mob_id)
protected

Definition at line 1677 of file class.ilObjMediaPoolGUI.php.

1677 : void
1678 {
1679 }

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ openClipboard()

ilObjMediaPoolGUI::openClipboard ( )

paste from clipboard

Definition at line 848 of file class.ilObjMediaPoolGUI.php.

848 : void
849 {
850 $ilCtrl = $this->ctrl;
851
852 $this->checkPermission("write");
853
854 $ilCtrl->setParameterByClass(
855 "ileditclipboardgui",
856 "returnCommand",
857 rawurlencode($ilCtrl->getLinkTarget(
858 $this,
859 "insertFromClipboard",
860 "",
861 false,
862 false
863 ))
864 );
865 $ilCtrl->redirectByClass("ilEditClipboardGUI", "getObject");
866 }

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

+ Here is the call graph for this function:

◆ paste()

ilObjMediaPoolGUI::paste ( )
protected

Definition at line 1606 of file class.ilObjMediaPoolGUI.php.

1606 : void
1607 {
1608 $target_folder_id = $this->mep_request->getItemId();
1609 $target_tree = $this->domain->tree($this->object->getId());
1610 if (ilMediaPoolItem::lookupType($target_folder_id) !== "fold") {
1611 $target_folder_id = $target_tree->readRootId();
1612 }
1613
1614 try {
1615 $this->domain->mediapool($this->object->getId())->pasteFromClipboard($target_folder_id);
1616 } catch (Exception $e) {
1617 $this->main_tpl->setOnScreenMessage(
1618 'failure',
1619 $this->lng->txt("mep_target_in_source_not_allowed") . " " . $e->getMessage(),
1620 true
1621 );
1622 }
1623
1624 $this->ctrl->redirect($this, "listMedia");
1625 }

References Vendor\Package\$e, ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ilMediaPoolItem\lookupType(), and ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ performBulkUpload()

ilObjMediaPoolGUI::performBulkUpload ( )

Save bulk upload form.

Definition at line 1499 of file class.ilObjMediaPoolGUI.php.

1499 : void
1500 {
1501 $this->checkPermission("write");
1502 $this->ctrl->setParameter($this, "mep_hash", $this->mep_request->getUploadHash());
1503 $this->ctrl->redirect($this, "editTitlesAndDescriptions");
1504 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ remove()

ilObjMediaPoolGUI::remove ( ?array  $ids = null)

Definition at line 896 of file class.ilObjMediaPoolGUI.php.

896 : void
897 {
898 $this->checkPermission("write");
899
900 $ids ??= $this->mep_request->getItemIds();
901 foreach ($ids as $obj_id) {
902 $this->object->deleteChild($obj_id);
903 }
904
905 $this->main_tpl->setOnScreenMessage('success', $this->lng->txt("cont_obj_removed"), true);
906 $this->ctrl->redirect($this, $this->mode);
907 }

References ilObjectGUI\$obj_id, ilObject2GUI\checkPermission(), ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ resetFilter()

ilObjMediaPoolGUI::resetFilter ( )

Definition at line 637 of file class.ilObjMediaPoolGUI.php.

637 : void
638 {
639 $this->allMedia();
640 }

References allMedia().

+ Here is the call graph for this function:

◆ returnFromItem()

ilObjMediaPoolGUI::returnFromItem ( )
protected

Return from item editing.

Definition at line 480 of file class.ilObjMediaPoolGUI.php.

480 : void
481 {
483
484 $type = ilMediaPoolItem::lookupType($this->mep_item_id);
485 if ($type !== "fold") {
486 $tree = $this->object->getTree();
487 $fold_id = $tree->getParentId($this->mep_item_id);
488 if ($fold_id > 0) {
489 $ctrl->setParameter($this, "mepitem_id", $fold_id);
490 $ctrl->redirect($this, "listMedia");
491 }
492 }
493 $this->listMedia();
494 }
listMedia()
list media objects

References ilObject2GUI\$ctrl, ilObjectGUI\$tree, ilObject2GUI\$type, ilTree\getParentId(), listMedia(), ilMediaPoolItem\lookupType(), ilCtrl\redirect(), and ilCtrl\setParameter().

+ Here is the call graph for this function:

◆ saveFolder()

ilObjMediaPoolGUI::saveFolder ( )

Save folder form.

Definition at line 1014 of file class.ilObjMediaPoolGUI.php.

1014 : void
1015 {
1016 $tpl = $this->tpl;
1017 $lng = $this->lng;
1018 $ilCtrl = $this->ctrl;
1019
1020 $this->checkPermission("write");
1021
1022 $this->initFolderForm("create");
1023 if ($this->form->checkInput()) {
1024 if ($this->object->createFolder($this->form->getInput("title"), $this->mep_item_id)) {
1025 $this->main_tpl->setOnScreenMessage('success', $lng->txt("mep_folder_created"), true);
1026 }
1027 $ilCtrl->redirect($this, "listMedia");
1028 }
1029
1030 $this->form->setValuesByPost();
1031 $tpl->setContent($this->form->getHTML());
1032 }

References ilObject2GUI\$ctrl, ilObject2GUI\$lng, ilObject2GUI\$tpl, ilObject2GUI\checkPermission(), ILIAS\Repository\form(), initFolderForm(), ILIAS\Repository\object(), ILIAS\UICore\GlobalTemplate\setContent(), and ilLanguage\txt().

+ Here is the call graph for this function:

◆ saveTitlesAndDescriptions()

ilObjMediaPoolGUI::saveTitlesAndDescriptions ( )
protected

Definition at line 1573 of file class.ilObjMediaPoolGUI.php.

1573 : void
1574 {
1575 $lng = $this->lng;
1577
1578 $this->checkPermission("write");
1580 $this->mep_request->getUploadHash()
1581 );
1582
1583 foreach ($media_items as $mi) {
1584 $mob = new ilObjMediaObject($mi["mob_id"]);
1585 $form = $this->initMediaBulkForm($mi["mob_id"], $mob->getTitle());
1586 $form->checkInput();
1587 $title = $form->getInput("title_" . $mi["mob_id"]);
1588 $desc = $form->getInput("description_" . $mi["mob_id"]);
1589 if (trim($title) !== "") {
1590 $mob->setTitle($title);
1591 }
1592 $mob->setDescription($desc);
1593 $mob->update();
1594 }
1595 $this->main_tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
1596 $ctrl->redirect($this, "listMedia");
1597 }
getInput(string $a_post_var, bool $ensureValidation=true)
Returns the input of an item, if item provides getInput method and as fallback the value of the HTTP-...

References $lng, ilPropertyFormGUI\checkInput(), ilPropertyFormGUI\getInput(), and ilMediaItem\getMediaItemsForUploadHash().

+ Here is the call graph for this function:

◆ setContentSubTabs()

ilObjMediaPoolGUI::setContentSubTabs ( string  $a_active)

Set sub tabs for content tab.

Definition at line 1115 of file class.ilObjMediaPoolGUI.php.

1117 : void {
1118 $ilAccess = $this->access;
1119 $ilTabs = $this->tabs;
1120 $ilCtrl = $this->ctrl;
1121
1122 $ilTabs->addSubTab("content", $this->lng->txt("objs_fold"), $this->ctrl->getLinkTarget($this, ""));
1123
1124 $ilCtrl->setParameter($this, "mepitem_id", "");
1125 $ilTabs->addSubTab("mep_all_mobs", $this->lng->txt("mep_all_mobs"), $this->ctrl->getLinkTarget($this, "allMedia"));
1126 $ilCtrl->setParameter($this, "mepitem_id", $this->mep_item_id);
1127
1128 if ($ilAccess->checkAccess('write', '', $this->ref_id)) {
1129 $ilTabs->addSubTab(
1130 "srt_files",
1131 $this->lng->txt("mep_media_subtitles"),
1132 $ilCtrl->getLinkTargetByClass("ilmobmultisrtuploadgui", "")
1133 );
1134 }
1135
1136 $ilTabs->activateSubTab($a_active);
1137 }

References ILIAS\Repository\lng().

Referenced by allMedia(), executeCommand(), and listMedia().

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

◆ setSettingsSubTabs()

ilObjMediaPoolGUI::setSettingsSubTabs ( string  $a_active)

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

1220 : void {
1221 $ilTabs = $this->tabs;
1222 $lng = $this->lng;
1223 $ilAccess = $this->access;
1224
1225 if ($ilAccess->checkAccess("write", "", $this->object->getRefId())) {
1226 $ilTabs->addSubTab(
1227 "settings",
1228 $lng->txt("settings"),
1229 $this->ctrl->getLinkTarget($this, "edit")
1230 );
1231
1232 $mset = new ilSetting("mobs");
1233 if ($mset->get("mep_activate_pages")) {
1234 $ilTabs->addSubTabTarget(
1235 "obj_multilinguality",
1236 $this->ctrl->getLinkTargetByClass(TranslationGUI::class, "")
1237 );
1238 }
1239 }
1240
1241 $ilTabs->setSubTabActive($a_active);
1242 }

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

Referenced by executeCommand().

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

◆ setTabs()

ilObjMediaPoolGUI::setTabs ( )
protected

create tabs (repository/workspace switch)

this had to be moved here because of the context-specific permission tab

Reimplemented from ilObject2GUI.

Definition at line 1139 of file class.ilObjMediaPoolGUI.php.

1139 : void
1140 {
1141 $ilAccess = $this->access;
1142 $ilTabs = $this->tabs;
1143 $ilHelp = $this->help;
1144
1145 $ilHelp->setScreenIdComponent("mep");
1146
1147 if ($ilAccess->checkAccess('read', '', $this->ref_id) ||
1148 $ilAccess->checkAccess('write', '', $this->ref_id)) {
1149 $ilTabs->addTab("content", $this->lng->txt("mep_content"), $this->ctrl->getLinkTarget($this, ""));
1150 }
1151
1152 // info tab
1153 if ($ilAccess->checkAccess('visible', '', $this->ref_id) ||
1154 $ilAccess->checkAccess('read', '', $this->ref_id) ||
1155 $ilAccess->checkAccess('write', '', $this->ref_id)) {
1156 $ilTabs->addTab(
1157 "info_short",
1158 $this->lng->txt("info_short"),
1159 $this->ctrl->getLinkTargetByClass(
1160 array("ilobjmediapoolgui", "ilinfoscreengui"),
1161 "showSummary"
1162 )
1163 );
1164 }
1165
1166 if ($ilAccess->checkAccess("write", "", $this->object->getRefId())) {
1167 $ilTabs->addTab(
1168 "settings",
1169 $this->lng->txt("settings"),
1170 $this->ctrl->getLinkTargetByClass(SettingsGUI::class)
1171 );
1172 }
1173 if ($ilAccess->checkAccess("write", "", $this->object->getRefId())) {
1174 $ilTabs->addTab(
1175 "clipboard",
1176 $this->lng->txt("clipboard"),
1177 $this->ctrl->getLinkTarget($this, "openClipboard")
1178 );
1179 }
1180
1181 // properties
1182 if ($ilAccess->checkAccess("write", "", $this->object->getRefId())) {
1183 // meta data
1184 $mdgui = new ilObjectMetaDataGUI($this->object, ['mob', "mpg"]);
1185 $mdtab = $mdgui->getTab();
1186 if ($mdtab) {
1187 $ilTabs->addTab(
1188 "meta_data",
1189 $this->lng->txt("meta_data"),
1190 $mdtab
1191 );
1192 }
1193 }
1194
1195 if ($ilAccess->checkAccess("write", "", $this->object->getRefId())) {
1196 $ilTabs->addTab(
1197 "export",
1198 $this->lng->txt("export"),
1199 $this->ctrl->getLinkTargetByClass("ilexportgui", "")
1200 );
1201
1202 $ilTabs->addTab(
1203 "import",
1204 $this->lng->txt("import"),
1205 $this->ctrl->getLinkTargetByClass("ilmediapoolimportgui", "")
1206 );
1207 }
1208
1209 if ($ilAccess->checkAccess("edit_permission", "", $this->object->getRefId())) {
1210 $ilTabs->addTab(
1211 "perm_settings",
1212 $this->lng->txt("perm_settings"),
1213 $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm")
1214 );
1215 }
1216 }
setScreenIdComponent(string $a_comp)

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ showFullscreen()

ilObjMediaPoolGUI::showFullscreen ( )

show media fullscreen

Definition at line 788 of file class.ilObjMediaPoolGUI.php.

788 : void
789 {
790 $this->showMedia();
791 }
showMedia()
show media object

References showMedia().

+ Here is the call graph for this function:

◆ showMedia()

ilObjMediaPoolGUI::showMedia ( )
protected

show media object

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

670 : void
671 {
672 $this->checkPermission("read");
673 $link_xml = "";
674 $pg_frame = "";
675
676 $item = new ilMediaPoolItem($this->mep_item_id);
677 $mob_id = $item->getForeignId();
678
679 $this->tpl = new ilGlobalTemplate("tpl.fullscreen.html", true, true, "components/ILIAS/COPage");
680 $this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
681 $this->tpl->setVariable(
682 "LOCATION_CONTENT_STYLESHEET",
684 );
685
686
688 $media_obj = new ilObjMediaObject($mob_id);
689 $media_item = $media_obj->getMediaItem("Standard");
690
691 if ($this->ctrl->getCmd() === "showPreview" && $media_item->getFormat() === "text/html") {
692 $this->tpl->addInlineCss(
693 "figure.ilc_media_cont_MediaContainer { height: 100%; }"
694 );
695 }
696
697 $this->tpl->setVariable("TITLE", " - " . $media_obj->getTitle());
698
699 $xml = "<dummy>";
700 // todo: we get always the first alias now (problem if mob is used multiple
701 // times in page)
702 $xml .= $media_obj->getXML(IL_MODE_ALIAS);
703 $xml .= $media_obj->getXML(IL_MODE_OUTPUT);
704 $xml .= $link_xml;
705 $xml .= "</dummy>";
706 $wb_path = ilFileUtils::getWebspaceDir("output") . "/";
707
708 $mode = ($this->ctrl->getCmd() !== "showPreview")
709 ? "fullscreen"
710 : "media";
711 $enlarge_path = ilUtil::getImagePath("media/enlarge.svg", false, "output");
712 $fullscreen_link =
713 $this->ctrl->getLinkTarget($this, "showFullscreen", "", false, false);
714 $params = array('mode' => $mode, 'enlarge_path' => $enlarge_path,
715 'link_params' => "ref_id=" . $this->requested_ref_id,'fullscreen_link' => $fullscreen_link,
716 'enable_html_mob' => ilObjMediaObject::isTypeAllowed("html") ? "y" : "n",
717 'ref_id' => $this->requested_ref_id, 'pg_frame' => $pg_frame, 'webspace_path' => $wb_path);
718 $output = $this->xsl->process($xml, $params);
719
720 // unmask user html
721 $this->tpl->setVariable("MEDIA_CONTENT", $output);
722 }
const IL_MODE_ALIAS
const IL_MODE_OUTPUT
static getWebspaceDir(string $mode="filesystem")
get webspace directory
special template class to simplify handling of ITX/PEAR
static isTypeAllowed(string $a_type)
static getContentStylePath(int $a_style_id, bool $add_random=true, bool $add_token=true)
get content style path static (to avoid full reading)
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
static getStyleSheetLocation(string $mode="output", string $a_css_name="")
get full style sheet file name (path inclusive) of current user

References $mode, ilObject2GUI\checkPermission(), ILIAS\Repository\ctrl(), ilObjStyleSheet\getContentStylePath(), ilUtil\getImagePath(), ilUtil\getStyleSheetLocation(), ilFileUtils\getWebspaceDir(), IL_MODE_ALIAS, IL_MODE_OUTPUT, ilObjMediaObjectGUI\includePresentationJS(), and ilObjMediaObject\isTypeAllowed().

Referenced by showFullscreen(), and showPreview().

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

◆ showPage()

ilObjMediaPoolGUI::showPage ( )

Show page.

Parameters

return

Definition at line 730 of file class.ilObjMediaPoolGUI.php.

730 : void
731 {
732 //$tpl = new \ilGlobalPageTemplate($DIC->globalScreen(), $DIC->ui(), $DIC->http());
733 $tpl = new ilGlobalTemplate("tpl.fullscreen.html", true, true, "components/ILIAS/COPage");
734
738
739 // get page object
740 $page_gui = $this->getMediaPoolPageGUI($this->mep_item_id);
741 $page_gui->setTemplate($tpl);
742
743 $page_gui->setTemplateOutput(false);
744 $page_gui->setHeader("");
745 $ret = $page_gui->showPage(true);
746
747 //$tpl->setBodyClass("ilMediaPoolPagePreviewBody");
748 $tpl->setVariable("MEDIA_CONTENT", "<div>" . $ret . "</div>");
749
750
752 exit;
753 }
getMediaPoolPageGUI($mep_item_id, $old_nr=0)
setVariable(string $variable, $value='')
Sets the given variable to the given value.
addCss(string $a_css_file, string $media="screen")
Add a css file that should be included in the header.
printToStdout(string $part=self::DEFAULT_BLOCK, bool $has_tabs=true, bool $skip_main_menu=false)
exit
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References ilObject2GUI\$tpl, ILIAS\UICore\GlobalTemplate\addCss(), exit, ilObjStyleSheet\getContentStylePath(), getMediaPoolPageGUI(), ilUtil\getStyleSheetLocation(), ilObjStyleSheet\getSyntaxStylePath(), ILIAS\UICore\GlobalTemplate\printToStdout(), and ILIAS\UICore\GlobalTemplate\setVariable().

Referenced by showPreview().

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

◆ showPreview()

ilObjMediaPoolGUI::showPreview ( )

Show content snippet.

Definition at line 767 of file class.ilObjMediaPoolGUI.php.

767 : void
768 {
769 $this->checkPermission("read");
770
771 $item = new ilMediaPoolItem($this->mep_item_id);
772
773 switch ($item->getType()) {
774 case "mob":
775 $this->showMedia();
776 break;
777
778 case "pg":
779 $this->showPage();
780 break;
781 }
782 }

References ilObject2GUI\checkPermission(), showMedia(), and showPage().

+ Here is the call graph for this function:

◆ toggleExplorerNodeState()

ilObjMediaPoolGUI::toggleExplorerNodeState ( )
protected

Definition at line 586 of file class.ilObjMediaPoolGUI.php.

586 : void
587 {
588 $exp = new ilMediaPoolExplorerGUI($this, "listMedia", $this->getMediaPool());
589 $exp->toggleExplorerNodeState();
590 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ updateFolder()

ilObjMediaPoolGUI::updateFolder ( )

Definition at line 1034 of file class.ilObjMediaPoolGUI.php.

1034 : void
1035 {
1036 $lng = $this->lng;
1037 $ilCtrl = $this->ctrl;
1038 $tpl = $this->tpl;
1039
1040 $this->checkPermission("write");
1041
1042 $this->initFolderForm("edit");
1043 if ($this->form->checkInput()) {
1044 $item = new ilMediaPoolItem($this->mep_item_id);
1045 $item->setTitle($this->form->getInput("title"));
1046 $item->update();
1047 $this->main_tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
1048 $ilCtrl->setParameter(
1049 $this,
1050 "mepitem_id",
1051 $this->object->getTree()->getParentId($this->mep_item_id)
1052 );
1053 $ilCtrl->redirect($this, "listMedia");
1054 }
1055
1056 $this->form->setValuesByPost();
1057 $tpl->setContent($this->form->getHTML());
1058 }

References ilObject2GUI\$ctrl, ilObject2GUI\$lng, ilObject2GUI\$tpl, ilObject2GUI\checkPermission(), ILIAS\Repository\form(), initFolderForm(), ILIAS\Repository\object(), ILIAS\UICore\GlobalTemplate\setContent(), and ilLanguage\txt().

+ Here is the call graph for this function:

Field Documentation

◆ $bulk_upload_form

FormAdapterGUI ilObjMediaPoolGUI::$bulk_upload_form = null
protected

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

◆ $db

ilDBInterface ilObjMediaPoolGUI::$db
protected

Definition at line 57 of file class.ilObjMediaPoolGUI.php.

◆ $domain

ILIAS MediaPool InternalDomainService ilObjMediaPoolGUI::$domain
protected

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

◆ $form

ilPropertyFormGUI ilObjMediaPoolGUI::$form
protected

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

Referenced by executeCommand().

◆ $gui

InternalGUIService ilObjMediaPoolGUI::$gui
protected

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

Referenced by executeCommand().

◆ $help

ilHelpGUI ilObjMediaPoolGUI::$help
protected

Definition at line 53 of file class.ilObjMediaPoolGUI.php.

◆ $main_tpl

ilGlobalTemplateInterface ilObjMediaPoolGUI::$main_tpl
protected

Definition at line 54 of file class.ilObjMediaPoolGUI.php.

◆ $mep_item_id

int ilObjMediaPoolGUI::$mep_item_id = 0
protected

◆ $mep_log

ilLogger ilObjMediaPoolGUI::$mep_log
protected

Definition at line 56 of file class.ilObjMediaPoolGUI.php.

◆ $mep_request

StandardGUIRequest ilObjMediaPoolGUI::$mep_request
protected

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

◆ $mode

string ilObjMediaPoolGUI::$mode
protected

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

Referenced by showMedia().

◆ $output_prepared

bool ilObjMediaPoolGUI::$output_prepared

Definition at line 58 of file class.ilObjMediaPoolGUI.php.

◆ $tabs

ilTabsGUI ilObjMediaPoolGUI::$tabs
protected

Definition at line 52 of file class.ilObjMediaPoolGUI.php.

Referenced by allMedia(), executeCommand(), and listMedia().

◆ $upload

FileUpload ilObjMediaPoolGUI::$upload
protected

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

◆ $xsl

ILIAS COPage Xsl XslManager ilObjMediaPoolGUI::$xsl
protected

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


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