ILIAS  release_8 Revision v8.24
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 ()
 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 ()
 
 copyToClipboard ()
 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...
 
 selectUploadDirFiles (?array $a_files=null)
 Select files from upload directory. More...
 
 createMediaFromUploadDir ()
 Create media object from upload directory. More...
 
 export ()
 
 performBulkUpload ()
 Save bulk upload form. More...
 
 initMediaBulkForm (int $a_id, string $a_title)
 Init media bulk form. More...
 
- 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] don't belong to the current 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)
 
 cancelDelete ()
 
 view ()
 view object content (repository/workspace switch) More...
 
 getType ()
 Functions that must be overwritten. More...
 
 create ()
 CRUD. More...
 
 save ()
 
 edit ()
 
 update ()
 
 cancel ()
 
 importFile ()
 
 putObjectInTree (ilObject $obj, int $parent_node_id=null)
 Add object to tree at given position. More...
 
- 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 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 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
 

Protected Member Functions

 afterConstructor ()
 
 returnFromItem ()
 Return from item editing. More...
 
 initCreationForms (string $new_type)
 Init creation forms. More...
 
 afterSave (ilObject $new_object)
 Post (successful) object creation hook. More...
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 updateCustom (ilPropertyFormGUI $form)
 Insert custom update form values into object. More...
 
 toggleExplorerNodeState ()
 
 showMedia ()
 show media object More...
 
 getMediaPoolPageGUI ($mep_item_id, $old_nr=0)
 Get media pool page. More...
 
 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 ()
 
- 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...
 
 fillCloneTemplate (?string $tpl_varname, string $type)
 Fill object clone template This method can be called from any object GUI class that wants to offer object cloning. 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...
 
 initCreationForms (string $new_type)
 Init creation forms. 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...
 
 getPermanentLinkWidget (string $append=null, bool $center=false)
 
- 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 ()
 @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...
 
 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...
 

Protected Attributes

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
 
- Protected Attributes inherited from ilObject2GUI
ilObjectDefinition $obj_definition
 
ilGlobalTemplateInterface $tpl
 
ilCtrl $ctrl
 
ilLanguage $lng
 
ilTabsGUI $tabs_gui
 
ilObjectService $object_service
 
ilFavouritesManager $favourites
 
ilErrorHandling $error
 
ilLocatorGUI $locator
 
ilObjUser $user
 
ilAccessHandler $access
 
ilToolbarGUI $toolbar
 
ArrayBasedRequestWrapper $post_wrapper
 
RequestWrapper $request_wrapper
 
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 = array()
 
 $access_handler
 
- 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 = ""
 

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 53 of file class.ilObjMediaPoolGUI.php.

57 {
58 global $DIC;
59
60 $this->mep_request = $DIC->mediaPool()
61 ->internal()
62 ->gui()
63 ->standardRequest();
64 $this->mep_item_id = $this->mep_request->getItemId();
65
66 parent::__construct($a_id, $a_id_type, $a_parent_node_id);
67
68 $this->tabs = $DIC->tabs();
69 $this->locator = $DIC["ilLocator"];
70 $this->help = $DIC["ilHelp"];
71
72 $this->main_tpl = $DIC->ui()->mainTemplate();
73
74 $this->upload = $DIC->upload();
75
76 $this->mep_log = ilLoggerFactory::getLogger("mep");
77
78
79 $this->mode = ($this->mep_request->getMode() !== "")
80 ? $this->mep_request->getMode()
81 : "listMedia";
82 $this->gui = $DIC->mediaPool()->internal()->gui();
83 }
static getLogger(string $a_component_id)
Get component logger.
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

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 1414 of file class.ilObjMediaPoolGUI.php.

1414 : void
1415 {
1416 global $DIC;
1417 $main_tpl = $DIC->ui()->mainTemplate();
1418
1419 $ilAccess = $DIC->access();
1420 $lng = $DIC->language();
1421 $ctrl = $DIC->ctrl();
1422
1423 $subitem_id = "";
1424 $targets = explode('_', $a_target);
1425 $ref_id = $targets[0];
1426 if (count((array) $targets) > 1) {
1427 $subitem_id = $targets[1];
1428 }
1429
1430 $ctrl->setParameterByClass("ilMediaPoolPresentationGUI", "ref_id", $ref_id);
1431 if ($ilAccess->checkAccess("read", "", $ref_id)) {
1432 $ctrl->setParameterByClass("ilMediaPoolPresentationGUI", "mepitem_id", $subitem_id);
1433 $ctrl->redirectByClass("ilMediaPoolPresentationGUI", "");
1434 } elseif ($ilAccess->checkAccess("visible", "", $ref_id)) {
1435 $ctrl->redirectByClass("ilMediaPoolPresentationGUI", "infoScreen");
1436 } elseif ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID)) {
1437 $main_tpl->setOnScreenMessage('failure', sprintf(
1438 $lng->txt("msg_no_perm_read_item"),
1440 ), true);
1442 }
1443
1444 throw new ilPermissionException($lng->txt("msg_no_perm_read"));
1445 }
redirectByClass( $a_class, string $a_cmd=null, string $a_anchor=null, bool $is_async=false)
@inheritDoc
setParameterByClass(string $a_class, string $a_parameter, $a_value)
@inheritDoc
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
ilGlobalTemplateInterface $main_tpl
static _gotoRepositoryRoot(bool $raise_error=false)
Goto repository root.
static _lookupObjId(int $ref_id)
static _lookupTitle(int $obj_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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, $ref_id, ilObjectGUI\_gotoRepositoryRoot(), ilObject\_lookupObjId(), ilObject\_lookupTitle(), ROOT_FOLDER_ID, and ilGlobalTemplateInterface\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 1107 of file class.ilObjMediaPoolGUI.php.

1107 : void
1108 {
1109 $ilLocator = $this->locator;
1110 $ilAccess = $this->access;
1111 if (!$this->getCreationMode() && $this->ctrl->getCmd() !== "explorer") {
1112 $tree = $this->object->getTree();
1115 foreach ($path as $node) {
1116 if ($node["child"] == $tree->getRootId()) {
1117 $this->ctrl->setParameter($this, "mepitem_id", "");
1118 $link = "";
1119 if ($ilAccess->checkAccess("read", "", $this->object->getRefId())) {
1120 $link = $this->ctrl->getLinkTarget($this, "listMedia");
1121 } elseif ($ilAccess->checkAccess("visible", "", $this->object->getRefId())) {
1122 $link = $this->ctrl->getLinkTarget($this, "infoScreen");
1123 }
1124 $title = $this->object->getTitle();
1125 $this->ctrl->setParameter($this, "mepitem_id", $this->mep_item_id);
1126 $ilLocator->addItem($title, $link, "", $this->requested_ref_id);
1127 }
1128 }
1129 }
1130 }
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...
$path
Definition: ltiservices.php:32

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

+ Here is the call graph for this function:

◆ afterConstructor()

ilObjMediaPoolGUI::afterConstructor ( )
protected
Exceptions
ilCtrlException

Reimplemented from ilObject2GUI.

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

95 : void
96 {
98 if ($this->mep_item_id == 0 && !$this->getCreationMode()) {
99 $tree = $this->object->getTree();
100 $this->mep_item_id = $tree->readRootId();
101 }
102
103 $lng->loadLanguageModule("mep");
104
105 if ($this->ctrl->getCmd() === "explorer") {
106 $this->ctrl->saveParameter($this, array("ref_id"));
107 } else {
108 $this->ctrl->saveParameter($this, array("ref_id", "mepitem_id"));
109 }
110 $this->ctrl->saveParameter($this, array("mep_mode"));
111
112 $lng->loadLanguageModule("content");
113 }
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:

◆ afterSave()

ilObjMediaPoolGUI::afterSave ( ilObject  $new_object)
protected

Post (successful) object creation hook.

Reimplemented from ilObjectGUI.

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

479 : void
480 {
481 // always send a message
482 $this->main_tpl->setOnScreenMessage('success', $this->lng->txt("object_added"), true);
483
484 //ilUtil::redirect($this->getReturnLocation("save","adm_object.php?".$this->link_params));
485 ilUtil::redirect("ilias.php?baseClass=ilMediaPoolPresentationGUI&ref_id=" . $new_object->getRefId() . "&cmd=listMedia");
486 }
static redirect(string $a_script)

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

+ Here is the call graph for this function:

◆ allMedia()

ilObjMediaPoolGUI::allMedia ( )

list all media objects

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

676 : void
677 {
679 $ilTabs = $this->tabs;
680 $ilCtrl = $this->ctrl;
682
683 $ilCtrl->setParameter($this, "mep_mode", "allMedia");
684
685 $this->checkPermission("read");
686 $ilTabs->setTabActive("content");
687 $this->setContentSubTabs("mep_all_mobs");
688
689 $mep_table_gui = new ilMediaPoolTableGUI(
690 $this,
691 "allMedia",
692 $this->getMediaPool(),
693 "mepitem_id",
695 true
696 );
697
698 if ($this->mep_request->getForceFilter() > 0) {
699 $mep_table_gui->setTitleFilter(
700 ilMediaPoolItem::lookupTitle($this->mep_request->getForceFilter())
701 );
702
703 // Read again
704 $mep_table_gui = new ilMediaPoolTableGUI(
705 $this,
706 "allMedia",
707 $this->getMediaPool(),
708 "mepitem_id",
710 true
711 );
712 }
713
714 $tpl->setContent($mep_table_gui->getHTML());
715 }
static lookupTitle(int $a_id)
TableGUI class for recent changes in wiki.
setContentSubTabs(string $a_active)
Set sub tabs for content tab.
ilGlobalTemplateInterface $tpl
checkPermission(string $perm, string $cmd="", string $type="", int $ref_id=null)
$ilUser
Definition: imgupload.php:34
setContent(string $a_html)
Sets content for standard template.

References ilObject2GUI\$ctrl, $ilUser, $tabs, ilObject2GUI\$tpl, ilObject2GUI\$user, ilObject2GUI\checkPermission(), ilMediaPoolTableGUI\IL_MEP_EDIT, ilMediaPoolItem\lookupTitle(), ilGlobalTemplateInterface\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 720 of file class.ilObjMediaPoolGUI.php.

720 : void
721 {
722 $mtab = new ilMediaPoolTableGUI(
723 $this,
724 "allMedia",
725 $this->getMediaPool(),
726 "mepitem_id",
728 true
729 );
730 $mtab->writeFilterToSession();
731 $mtab->resetOffset();
732 $this->allMedia();
733 }
allMedia()
list all media objects

References allMedia(), and ilMediaPoolTableGUI\IL_MEP_EDIT.

+ Here is the call graph for this function:

◆ bulkUpload()

ilObjMediaPoolGUI::bulkUpload ( )
protected

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

1696 : void
1697 {
1698 $this->checkPermission("write");
1699
1701
1702 $form = $this->getBulkUploadForm();
1703 $main_tpl->setContent($form->render());
1704 }

References ilGlobalTemplateInterface\setContent().

+ Here is the call graph for this function:

◆ cancelFolderUpdate()

ilObjMediaPoolGUI::cancelFolderUpdate ( )

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

1249 : void
1250 {
1251 $ilCtrl = $this->ctrl;
1252 $ilCtrl->setParameter(
1253 $this,
1254 "mepitem_id",
1255 $this->object->getTree()->getParentId($this->mep_item_id)
1256 );
1257 $ilCtrl->redirect($this, "listMedia");
1258 }
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 1049 of file class.ilObjMediaPoolGUI.php.

1049 : void
1050 {
1051 $this->ctrl->redirect($this, $this->mode);
1052 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ cancelSave()

ilObjMediaPoolGUI::cancelSave ( )

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

1260 : void
1261 {
1262 $ilCtrl = $this->ctrl;
1263 $ilCtrl->redirect($this, "listMedia");
1264 }
redirect(object $a_gui_obj, string $a_cmd=null, string $a_anchor=null, bool $is_async=false)
@inheritDoc

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

+ Here is the call graph for this function:

◆ confirmRemove()

ilObjMediaPoolGUI::confirmRemove ( )

confirm remove of mobs

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

909 : void
910 {
911 $ilCtrl = $this->ctrl;
913
914 $this->checkPermission("write");
915
916 $ids = $this->mep_request->getItemIds();
917 if (count($ids) === 0) {
918 $this->main_tpl->setOnScreenMessage('failure', $this->lng->txt("no_checkbox"), true);
919 $ilCtrl->redirect($this, "");
920 }
921
922 // display confirmation message
923 $cgui = new ilConfirmationGUI();
924 $cgui->setFormAction($this->ctrl->getFormAction($this));
925 $cgui->setHeaderText($this->lng->txt("info_remove_sure"));
926 $cgui->setCancel($this->lng->txt("cancel"), "cancelRemove");
927 $cgui->setConfirm($this->lng->txt("confirm"), "remove");
928
929 foreach ($ids as $obj_id) {
932
933 // check whether page can be removed
934 $add = "";
935 if ($type === "pg") {
936 $usages = ilPageContentUsage::getUsages("incl", $obj_id, false);
937 if (count($usages) > 0) {
938 $this->main_tpl->setOnScreenMessage('failure', sprintf($lng->txt("mep_content_snippet_in_use"), $title), true);
939 $ilCtrl->redirect($this, "listMedia");
940 } else {
941 // check whether the snippet is used in older versions of pages
942 $usages = ilPageContentUsage::getUsages("incl", $obj_id, true);
943 if (count($usages) > 0) {
944 $add = "<div class='small'>" . $lng->txt("mep_content_snippet_used_in_older_versions") . "</div>";
945 }
946 }
947 }
948
949 $caption =
950 " " . $title . $add;
951
952 $cgui->addItem("id[]", $obj_id, $caption);
953 }
954
955 $this->tpl->setContent($cgui->getHTML());
956 }
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 ( )

copy media objects to clipboard

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

1071 : void
1072 {
1074
1075 $this->checkPermission("write");
1076
1077 $ids = $this->mep_request->getItemIds();
1078 if (count($ids) === 0) {
1079 $this->main_tpl->setOnScreenMessage('failure', $this->lng->txt("no_checkbox"), true);
1080 $this->ctrl->redirect($this, $this->mode);
1081 }
1082
1083 foreach ($ids as $obj_id) {
1085 if ($type === "fold") {
1086 $this->main_tpl->setOnScreenMessage('failure', $this->lng->txt("cont_cant_copy_folders"), true);
1087 $this->ctrl->redirect($this, $this->mode);
1088 }
1089 }
1090 foreach ($ids as $obj_id) {
1093 if ($type === "mob") {
1094 $ilUser->addObjectToClipboard($fid, "mob", "");
1095 }
1096 if ($type === "pg") {
1097 $ilUser->addObjectToClipboard($obj_id, "incl", "");
1098 }
1099 }
1100 $this->main_tpl->setOnScreenMessage('success', $this->lng->txt("copied_to_clipboard"), true);
1101 $this->ctrl->redirect($this, $this->mode);
1102 }
static lookupForeignId(int $a_id)

References $ilUser, 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 1136 of file class.ilObjMediaPoolGUI.php.

1136 : void
1137 {
1138 $tpl = $this->tpl;
1139
1140 $this->checkPermission("write");
1141
1142 $this->initFolderForm("create");
1143 $tpl->setContent($this->form->getHTML());
1144 }
initFolderForm(string $a_mode="edit")
form( $class_path, string $cmd)

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

+ Here is the call graph for this function:

◆ createMediaFromUploadDir()

ilObjMediaPoolGUI::createMediaFromUploadDir ( )

Create media object from upload directory.

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

1547 : void
1548 {
1549 $this->checkPermission("write");
1550
1551 $import_directory_factory = new ilImportDirectoryFactory();
1552 $mob_import_directory = $import_directory_factory->getInstanceForComponent(ilImportDirectoryFactory::TYPE_MOB);
1553 $upload_dir = $mob_import_directory->getAbsolutePath();
1554
1555 $files = $this->mep_request->getFiles();
1556 if ($this->rbac_system->checkAccess("visible", SYSTEM_FOLDER_ID)) {
1557 foreach ($files as $f) {
1558 $f = str_replace("..", "", $f);
1559 $fullpath = $upload_dir . "/" . $f;
1560 $mob = new ilObjMediaObject();
1561 $mob->setTitle(basename($fullpath));
1562 $mob->setDescription("");
1563 $mob->create();
1564
1565 // determine and create mob directory, move uploaded file to directory
1566 //$mob_dir = ilUtil::getWebspaceDir()."/mobs/mm_".$a_mob->getId();
1567 $mob->createDirectory();
1568 $mob_dir = ilObjMediaObject::_getDirectory($mob->getId());
1569
1570 $media_item = new ilMediaItem();
1571 $mob->addMediaItem($media_item);
1572 $media_item->setPurpose("Standard");
1573
1574 $file = $mob_dir . "/" . basename($fullpath);
1575
1576 // virus handling
1577 $vir = ilVirusScanner::virusHandling($fullpath, basename($fullpath));
1578 if (!$vir[0]) {
1579 $this->main_tpl->setOnScreenMessage('failure', $this->lng->txt("file_is_infected") . "<br />" . $vir[1], true);
1580 ilUtil::redirect("ilias.php?baseClass=ilMediaPoolPresentationGUI&cmd=listMedia&ref_id=" .
1581 $this->requested_ref_id . "&mepitem_id=" . $this->mep_item_id);
1582 }
1583
1584 switch ($this->mep_request->getFileAction()) {
1585 case "rename":
1586 rename($fullpath, $file);
1587 break;
1588
1589 case "copy":
1590 copy($fullpath, $file);
1591 break;
1592 }
1593
1594 // get mime type
1596 $location = basename($fullpath);
1597
1598 // set real meta and object data
1599 $media_item->setFormat($format);
1600 $media_item->setLocation($location);
1601 $media_item->setLocationType("LocalFile");
1602
1603 $mob->setDescription($format);
1604
1605 // determine width and height of known image types
1607 $format,
1608 "File",
1609 $mob_dir . "/" . $location,
1610 $media_item->getLocation(),
1611 true,
1612 true,
1613 null,
1614 null
1615 );
1616 $media_item->setWidth($wh["width"]);
1617 $media_item->setHeight($wh["height"]);
1618
1619 $media_item->setHAlign("Left");
1621 $mob->update();
1622
1623
1624 // put it into current folder
1625 $mep_item = new ilMediaPoolItem();
1626 $mep_item->setTitle($mob->getTitle());
1627 $mep_item->setType("mob");
1628 $mep_item->setForeignId($mob->getId());
1629 $mep_item->create();
1630
1631 $tree = $this->object->getTree();
1632 $parent = $this->mep_item_id;
1633 $tree->insertNode($mep_item->getId(), $parent);
1634 }
1635 }
1636 ilUtil::redirect("ilias.php?baseClass=ilMediaPoolPresentationGUI&cmd=listMedia&ref_id=" .
1637 $this->requested_ref_id . "&mepitem_id=" . $this->mep_item_id);
1638 }
$location
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: buildRTE.php:22
static renameExecutables(string $a_dir)
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...
static _determineWidthHeight(string $a_format, string $a_type, string $a_file, string $a_reference, bool $a_constrain_proportions, bool $a_use_original, ?int $a_user_width=null, ?int $a_user_height=null)
static getMimeType(string $a_file, bool $a_external=false)
get mime type for file
static _getDirectory(int $a_mob_id)
Get absolute directory.
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
static virusHandling(string $a_file, string $a_orig_name='', bool $a_clean=true)
const SYSTEM_FOLDER_ID
Definition: constants.php:35
$format
Definition: metadata.php:235

References Vendor\Package\$f, $format, $location, ilObjMediaObject\_determineWidthHeight(), ilObjMediaObject\_getDirectory(), ilObjMediaObject\getMimeType(), ILIAS\Repository\lng(), ilUtil\redirect(), ilFileUtils\renameExecutables(), SYSTEM_FOLDER_ID, ilImportDirectoryFactory\TYPE_MOB, and ilVirusScanner\virusHandling().

+ Here is the call graph for this function:

◆ createMediaObject()

ilObjMediaPoolGUI::createMediaObject ( )

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

466 : void
467 {
468 $this->ctrl->redirectByClass("ilobjmediaobjectgui", "create");
469 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ edit()

ilObjMediaPoolGUI::edit ( )
Exceptions
ilPermissionException

Reimplemented from ilObject2GUI.

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

534 : void
535 {
537 $ilTabs = $this->tabs_gui;
538
539 $this->setSettingsSubTabs("settings");
540
541 if (!$this->checkPermissionBool("write")) {
542 throw new ilPermissionException($this->lng->txt("msg_no_perm_write"));
543 }
544
545 $ilTabs->activateTab("settings");
546
547 $form = $this->initEditForm();
548 $values = $this->getEditFormValues();
549 if ($values) {
550 $form->setValuesByArray($values, true);
551 }
552
554
556 }
setSettingsSubTabs(string $a_active)
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $node_id=null)
addExternalEditFormCustom(ilPropertyFormGUI $form)
setValuesByArray(array $a_values, bool $a_restrict_to_value_keys=false)

References $form, ilObject2GUI\$tabs_gui, ilObject2GUI\$tpl, ilObjectGUI\addExternalEditFormCustom(), ilObject2GUI\checkPermissionBool(), ilObjectGUI\getEditFormValues(), ilPropertyFormGUI\getHTML(), ilObjectGUI\initEditForm(), ILIAS\Repository\lng(), ilGlobalTemplateInterface\setContent(), setSettingsSubTabs(), and ilPropertyFormGUI\setValuesByArray().

+ Here is the call graph for this function:

◆ editFolder()

ilObjMediaPoolGUI::editFolder ( )

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

1146 : void
1147 {
1148 $tpl = $this->tpl;
1149
1150 $this->checkPermission("write");
1151
1152 $this->initFolderForm();
1153 $this->getFolderValues();
1154 $tpl->setContent($this->form->getHTML());
1155 }
getFolderValues()
Get current values for folder from.

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

+ Here is the call graph for this function:

◆ editTitlesAndDescriptions()

ilObjMediaPoolGUI::editTitlesAndDescriptions ( )
protected

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

1804 : void
1805 {
1807 $lng = $this->lng;
1808
1809 $this->checkPermission("write");
1810 $ctrl->saveParameter($this, "mep_hash");
1811
1813
1815 $this->mep_request->getUploadHash()
1816 );
1817
1818 $tb = new ilToolbarGUI();
1819 $tb->setFormAction($ctrl->getFormAction($this));
1820 $tb->addFormButton($lng->txt("save"), "saveTitlesAndDescriptions");
1821 $tb->setOpenFormTag(true);
1822 $tb->setCloseFormTag(false);
1823 $tb->setId("tb_top");
1824
1825 $html = $tb->getHTML();
1826 foreach ($media_items as $mi) {
1827 $acc = new ilAccordionGUI();
1828 $acc->setBehaviour(ilAccordionGUI::ALL_CLOSED);
1829 $acc->setId("acc_" . $mi["mob_id"]);
1830
1831 $mob = new ilObjMediaObject($mi["mob_id"]);
1832 $form = $this->initMediaBulkForm($mi["mob_id"], $mob->getTitle());
1833 $acc->addItem($mob->getTitle(), $form->getHTML());
1834
1835 $html .= $acc->getHTML();
1836 }
1837
1838 $html .= $tb->getHTML();
1839 $tb->setOpenFormTag(false);
1840 $tb->setCloseFormTag(true);
1841 $tb->setId("tb_bottom");
1842
1844 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
saveParameter(object $a_gui_obj, $a_parameter)
@inheritDoc
getFormAction(object $a_gui_obj, string $a_fallback_cmd=null, string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
@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 ilGlobalTemplateInterface\setContent().

+ Here is the call graph for this function:

◆ executeCommand()

ilObjMediaPoolGUI::executeCommand ( )
Exceptions
ilCtrlException
ilObjectException
ilPermissionException

Reimplemented from ilObject2GUI.

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

125 : void
126 {
127 $ilTabs = $this->tabs;
129 $ilAccess = $this->access;
131 $ilCtrl = $this->ctrl;
132
133 $tree = null;
134 if ($this->object) {
135 $tree = $this->object->getTree();
136 }
137
138 $next_class = $this->ctrl->getNextClass($this);
139 $cmd = $this->ctrl->getCmd();
140 $new_type = $this->mep_request->getNewType();
141
142
143
144 if ($new_type !== "" && ($cmd !== "confirmRemove" && $cmd !== "copyToClipboard"
145 && $cmd !== "pasteFromClipboard")) {
146 $this->tpl->setPermanentLink("mep", $this->ref_id);
147 $this->setCreationMode(true);
148 }
149
150 if ($cmd === "create") {
151 switch ($this->mep_request->getNewType()) {
152 case "mob":
153 $this->ctrl->redirectByClass("ilobjmediaobjectgui", "create");
154 break;
155
156 case "fold":
157 $this->ctrl->redirectByClass("ilobjfoldergui", "create");
158 break;
159 }
160 }
161
162 switch ($next_class) {
163 case 'ilobjectmetadatagui':
164 $this->checkPermission("write");
165
166 $this->prepareOutput();
167 $this->addHeaderAction();
168
169 $this->tabs_gui->activateTab('meta_data');
170 $md_gui = new ilObjectMetaDataGUI($this->object, ['mob', "mpg"]);
171 $this->ctrl->forwardCommand($md_gui);
172 $this->tpl->printToStdout();
173 break;
174
175 case strtolower(ilRepoStandardUploadHandlerGUI::class):
176 $this->checkPermission("write");
177 $form = $this->getBulkUploadForm();
178 $gui = $form->getRepoStandardUploadHandlerGUI("media_files");
179 $this->ctrl->forwardCommand($gui);
180 break;
181
182 case 'ilmediapoolpagegui':
183 $this->checkPermission("write");
184 $this->prepareOutput();
185 //$this->addHeaderAction();
186 $ilTabs->clearTargets();
187 $ilCtrl->setReturn($this, "returnFromItem");
188 $mep_page_gui = new ilMediaPoolPageGUI(
189 $this->mep_item_id,
190 $this->mep_request->getOldNr()
191 );
192 $mep_page_gui->setPoolGUI($this);
193 $mep_page_gui->setAdvMdRecordObject($this->object->getRefId(), "mep", "mpg");
194
195 if (!$ilAccess->checkAccess("write", "", $this->object->getRefId())) {
196 $mep_page_gui->setEnableEditing(false);
197 }
198 $ret = $this->ctrl->forwardCommand($mep_page_gui);
199 if ($ret != "") {
200 $tpl->setContent($ret);
201 }
202 $this->tpl->printToStdout();
203 break;
204
205 case "ilobjmediaobjectgui":
206 $this->checkPermission("write");
207 if ($cmd === "create" || $cmd === "save" || $cmd === "cancel") {
208 $ret_obj = $this->mep_item_id;
209 $ilObjMediaObjectGUI = new ilObjMediaObjectGUI("", 0, false, false);
210 $ilObjMediaObjectGUI->setWidthPreset((int) $this->getMediaPool()->getDefaultWidth());
211 $ilObjMediaObjectGUI->setHeightPreset((int) $this->getMediaPool()->getDefaultHeight());
212 } else {
213 $ret_obj = $tree->getParentId($this->mep_item_id);
214 $ilObjMediaObjectGUI = new ilObjMediaObjectGUI("", ilMediaPoolItem::lookupForeignId($this->mep_item_id), false, false);
215 $this->ctrl->setParameter($this, "mepitem_id", $this->getParentFolderId());
216 $ilTabs->setBackTarget(
217 $lng->txt("back"),
218 $this->ctrl->getLinkTarget(
219 $this,
220 $this->mode
221 )
222 );
223 }
224 if ($this->ctrl->getCmdClass() === "ilinternallinkgui") {
225 $this->ctrl->setReturn($this, "explorer");
226 } else {
227 $this->ctrl->setParameter($this, "mepitem_id", $ret_obj);
228 $this->ctrl->setReturn(
229 $this,
230 $this->mode
231 );
232 $this->ctrl->setParameter($this, "mepitem_id", $this->mep_item_id);
233 }
234 $this->getTemplate();
235 $ilObjMediaObjectGUI->setTabs();
236 $this->setLocator();
237
238 // set adv metadata record dobject
239 $ilObjMediaObjectGUI->setAdvMdRecordObject($this->object->getRefId(), "mep", "mob");
240
241 $ret = $this->ctrl->forwardCommand($ilObjMediaObjectGUI);
242 if ($cmd === "save") {
243 $object = $ilObjMediaObjectGUI->getObject();
244 if (!is_null($object)) {
245 $mep_item = new ilMediaPoolItem();
246 $mep_item->setTitle($object->getTitle());
247 $mep_item->setType("mob");
248 $mep_item->setForeignId($object->getId());
249 $mep_item->create();
250
251 $parent = $this->mep_item_id;
252 $tree->insertNode($mep_item->getId(), $parent);
254 "ilias.php?baseClass=ilMediaPoolPresentationGUI&cmd=listMedia&ref_id=" .
255 $this->requested_ref_id . "&mepitem_id=" . $this->mep_item_id
256 );
257 }
258 }
259 $this->tpl->printToStdout();
260 break;
261
262 case "ilobjfoldergui":
263 $this->checkPermission("write");
264 $this->addHeaderAction();
265 $folder_gui = new ilObjFolderGUI("", 0, false, false);
266 $this->ctrl->setReturn($this, "listMedia");
267 $cmd .= "Object";
268 switch ($cmd) {
269 case "createObject":
270 $this->prepareOutput();
271 $folder_gui = new ilObjFolderGUI("", 0, false, false);
272 $folder_gui->setFormAction(
273 "save",
274 $this->ctrl->getFormActionByClass("ilobjfoldergui")
275 );
276 $folder_gui->createObject();
277 $this->tpl->printToStdout();
278 break;
279
280 case "saveObject":
281 $parent = $this->mep_item_id;
282 $folder_gui->setFolderTree($tree);
283 $folder_gui->saveObject();
284 break;
285
286 case "editObject":
287 $this->prepareOutput();
288 $folder_gui = new ilObjFolderGUI(
289 "",
290 ilMediaPoolItem::lookupForeignId($this->mep_item_id),
291 false,
292 false
293 );
294 $this->ctrl->setParameter($this, "foldereditmode", "1");
295 $folder_gui->setFormAction("update", $this->ctrl->getFormActionByClass("ilobjfoldergui"));
296 $folder_gui->editObject();
297 $this->tpl->printToStdout();
298 break;
299
300 case "updateObject":
301 $folder_gui = new ilObjFolderGUI(
302 "",
303 ilMediaPoolItem::lookupForeignId($this->mep_item_id),
304 false,
305 false
306 );
307 $this->ctrl->setParameter($this, "mepitem_id", $this->getParentFolderId());
308 $this->ctrl->setReturn($this, "listMedia");
309 $folder_gui->updateObject(); // this returns to parent
310 break;
311
312 case "cancelObject":
313 if ($this->mep_request->getFolderEditMode()) {
314 $this->ctrl->setParameter($this, "mepitem_id", $this->getParentFolderId());
315 }
316 $this->ctrl->redirect($this, "listMedia");
317 break;
318 }
319 break;
320
321 case "ileditclipboardgui":
322 $this->prepareOutput();
323 $this->addHeaderAction();
324 $this->ctrl->setReturn($this, $this->mode);
325 $clip_gui = new ilEditClipboardGUI();
326 $clip_gui->setMultipleSelections(true);
327 $clip_gui->setInsertButtonTitle($lng->txt("mep_copy_to_mep"));
328 $ilTabs->setTabActive("clipboard");
329 $this->ctrl->forwardCommand($clip_gui);
330 $this->tpl->printToStdout();
331 break;
332
333 case 'ilinfoscreengui':
334 $this->prepareOutput();
335 $this->addHeaderAction();
336 $this->infoScreen();
337 $this->tpl->printToStdout();
338 break;
339
340 case 'ilpermissiongui':
341 $this->checkPermission("edit_permission");
342 $this->prepareOutput();
343 $this->addHeaderAction();
344 $perm_gui = new ilPermissionGUI($this);
345 $ilTabs->activateTab("perm_settings");
346 $this->ctrl->forwardCommand($perm_gui);
347 $this->tpl->printToStdout();
348 break;
349
350 case "ilexportgui":
351 $this->checkPermission("write");
352 $this->prepareOutput();
353 $this->addHeaderAction();
354 $ilTabs->activateTab("export");
355 $exp_gui = new ilExportGUI($this);
356 $exp_gui->addFormat("xml");
357 $ot = ilObjectTranslation::getInstance($this->object->getId());
358 if ($ot->getContentActivated()) {
359 $exp_gui->addFormat("xml_master", "XML (" . $lng->txt("mep_master_language_only") . ")", $this, "export");
360 $exp_gui->addFormat("xml_masternomedia", "XML (" . $lng->txt("mep_master_language_only_no_media") . ")", $this, "export");
361 }
362 $this->ctrl->forwardCommand($exp_gui);
363 $this->tpl->printToStdout();
364 break;
365
366 case "ilfilesystemgui":
367 $this->checkPermission("write");
368 $this->prepareOutput();
369 $this->addHeaderAction();
370 $ilTabs->clearTargets();
371 $ilTabs->setBackTarget(
372 $lng->txt("back"),
373 $ilCtrl->getLinkTarget($this, "listMedia")
374 );
375 $mset = new ilSetting("mobs");
376 $import_directory_factory = new ilImportDirectoryFactory();
377 $mob_import_directory = $import_directory_factory->getInstanceForComponent(ilImportDirectoryFactory::TYPE_MOB);
378 if ($mob_import_directory->exists()) {
379 $fs_gui = new ilFileSystemGUI($mob_import_directory->getAbsolutePath());
380 $fs_gui->setPostDirPath(true);
381 $fs_gui->setTableId("mepud" . $this->object->getId());
382 $fs_gui->setAllowFileCreation(false);
383 $fs_gui->setAllowDirectoryCreation(false);
384 $fs_gui->clearCommands();
385 $fs_gui->addCommand(
386 $this,
387 "selectUploadDirFiles",
388 $this->lng->txt("mep_sel_upload_dir_files"),
389 false,
390 true
391 );
392 $this->ctrl->forwardCommand($fs_gui);
393 }
394 $this->tpl->printToStdout();
395 break;
396
397 case "ilcommonactiondispatchergui":
399 $this->ctrl->forwardCommand($gui);
400 break;
401
402 case 'ilobjecttranslationgui':
403 $this->prepareOutput();
404 $this->addHeaderAction();
405 //$this->setTabs("settings");
406 $ilTabs->activateTab("settings");
407 $this->setSettingsSubTabs("obj_multilinguality");
408 $transgui = new ilObjectTranslationGUI($this);
409 $transgui->setTitleDescrOnlyMode(false);
410 $this->ctrl->forwardCommand($transgui);
411 $this->tpl->printToStdout();
412 break;
413
414 case "ilmediapoolimportgui":
415 $this->prepareOutput();
416 $this->addHeaderAction();
417 $this->checkPermission("write");
418 $ilTabs->activateTab("import");
419 $gui = new ilMediaPoolImportGUI($this->getMediaPool());
420 $this->ctrl->forwardCommand($gui);
421 $this->tpl->printToStdout();
422 break;
423
424 case "ilmobmultisrtuploadgui":
425 $this->checkPermission("write");
426 $this->prepareOutput();
427 $this->addHeaderAction();
428 $this->setContentSubTabs("srt_files");
429 $gui = new ilMobMultiSrtUploadGUI(new ilMepMultiSrt($this->getMediaPool()));
430 $this->ctrl->forwardCommand($gui);
431 $this->tpl->printToStdout();
432 break;
433
434
435 default:
436 $this->prepareOutput();
437 $this->addHeaderAction();
438 $cmd = $this->ctrl->getCmd("listMedia") ?: "listMedia";
439 $this->$cmd();
440 if (!$this->getCreationMode()) {
441 $this->tpl->printToStdout();
442 }
443 break;
444 }
445 }
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...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
File System Explorer GUI class.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilMediaPoolPage GUI class.
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...
Class ilObjFolderGUI.
Editing User Interface for MediaObjects within LMs (see ILIAS DTD)
getTemplate()
Get standard template.
getParentFolderId()
Get folder parent ID.
infoScreen()
show information screen
InternalGUIService $gui
setCreationMode(bool $mode=true)
if true, a creation screen is displayed the current [ref_id] don't belong to the current class!...
setLocator()
set Locator
prepareOutput(bool $show_sub_objects=true)
addHeaderAction()
Add header action menu.
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...
static getInstance(int $obj_id)
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getParentId(int $a_node_id)
get parent id of given node

References ilObject2GUI\$access, ilObject2GUI\$ctrl, $form, $gui, ilObject2GUI\$lng, $mep_item_id, ilObjectGUI\$object, $tabs, ilObject2GUI\$tpl, ilObjectGUI\$tree, ilObjectGUI\addHeaderAction(), ilObject2GUI\checkPermission(), ILIAS\Repository\ctrl(), getBulkUploadForm(), ilObject2GUI\getCreationMode(), ilObject\getId(), ilObjectTranslation\getInstance(), ilCommonActionDispatcherGUI\getInstanceFromAjaxCall(), getParentFolderId(), ilTree\getParentId(), getTemplate(), ilObject\getTitle(), infoScreen(), ilTree\insertNode(), ILIAS\Repository\lng(), ilMediaPoolItem\lookupForeignId(), ILIAS\Repository\object(), ilObject2GUI\prepareOutput(), ilUtil\redirect(), ilGlobalTemplateInterface\setContent(), setContentSubTabs(), ilObject2GUI\setCreationMode(), ilObject2GUI\setLocator(), setSettingsSubTabs(), ilLanguage\txt(), and ilImportDirectoryFactory\TYPE_MOB.

+ Here is the call graph for this function:

◆ export()

ilObjMediaPoolGUI::export ( )

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

1680 : void
1681 {
1682 $ot = ilObjectTranslation::getInstance($this->object->getId());
1683 $opt = "";
1684 if ($ot->getContentActivated()) {
1685 $format = explode("_", $this->mep_request->getExportFormat());
1686 $opt = ilUtil::stripSlashes($format[1]);
1687 }
1688
1689 $this->object->exportXML($opt);
1690 }
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")

References $format, ilObjectTranslation\getInstance(), ILIAS\Repository\object(), and ilUtil\stripSlashes().

+ Here is the call graph for this function:

◆ getBulkUploadForm()

ilObjMediaPoolGUI::getBulkUploadForm ( )
protected

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

1707 {
1708 if (is_null($this->bulk_upload_form)) {
1709 $mep_hash = uniqid();
1710 $this->ctrl->setParameter($this, "mep_hash", $mep_hash);
1711 $this->bulk_upload_form = $this->gui
1712 ->form(self::class, 'performBulkUpload')
1713 ->section("props", $this->lng->txt('mep_bulk_upload'))
1714 ->file(
1715 "media_files",
1716 $this->lng->txt("mep_media_files"),
1717 \Closure::fromCallable([$this, 'handleUploadResult']),
1718 "mep_id",
1719 "",
1720 20
1721 );
1722 // ->meta()->text()->meta()->textarea()
1723 }
1725 }
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:

◆ getEditFormCustomValues()

ilObjMediaPoolGUI::getEditFormCustomValues ( array &  $a_values)
protected

Add values to custom edit fields.

Reimplemented from ilObjectGUI.

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

559 : void
560 {
561 $ot = ilObjectTranslation::getInstance($this->getMediaPool()->getId());
562 if ($ot->getContentActivated()) {
563 $a_values["title"] = $ot->getDefaultTitle();
564 $a_values["desc"] = $ot->getDefaultDescription();
565 }
566 if ($this->getMediaPool()->getDefaultWidth() > 0) {
567 $a_values["default_width"] = $this->object->getDefaultWidth();
568 }
569 if ($this->getMediaPool()->getDefaultHeight() > 0) {
570 $a_values["default_height"] = $this->object->getDefaultHeight();
571 }
572 }

References ILIAS\Survey\Mode\getId(), and ilObjectTranslation\getInstance().

+ Here is the call graph for this function:

◆ getFolderValues()

ilObjMediaPoolGUI::getFolderValues ( )

Get current values for folder from.

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

1160 : void
1161 {
1162 $values = array();
1163
1164 $values["title"] = ilMediaPoolItem::lookupTitle($this->mep_item_id);
1165
1166 $this->form->setValuesByArray($values);
1167 }

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

Get media pool page.

Parameters

return

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

868 {
869 include_once("./Modules/MediaPool/classes/class.ilMediaPoolPageGUI.php");
870 $page_gui = new ilMediaPoolPageGUI($mep_item_id, $old_nr);
871 $page_gui->setPoolGUI($this);
872
873 return $page_gui;
874 }

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 762 of file class.ilObjMediaPoolGUI.php.

762 : ?int
763 {
764 if ($this->mep_item_id == 0) {
765 return null;
766 }
767 $par_id = $this->object->getPoolTree()->getParentId($this->mep_item_id);
768 if ($par_id != $this->object->getPoolTree()->getRootId()) {
769 return (int) $par_id;
770 }
771
772 return null;
773 }

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 1643 of file class.ilObjMediaPoolGUI.php.

1646 : string {
1647 global $DIC;
1648
1649 $tpl = $DIC["tpl"];
1650 $ilCtrl = $DIC->ctrl();
1651 $lng = $DIC->language();
1652 $request = $DIC->mediaPool()
1653 ->internal()
1654 ->gui()
1655 ->standardRequest();
1656
1658
1659 $tpl->addJavaScript("./Modules/MediaPool/js/ilMediaPool.js");
1660
1661 $ilCtrl->setParameterByClass("ilobjmediapoolgui", "mepitem_id", "");
1662 $ilCtrl->setParameterByClass("ilobjmediapoolgui", "ref_id", $a_mpool_ref_id);
1663 $tpl->addOnloadCode("il.MediaPool.setPreviewUrl('" . $ilCtrl->getLinkTargetByClass(array("ilmediapoolpresentationgui", "ilobjmediapoolgui"), "showPreview", "", false, false) . "');");
1664 $ilCtrl->setParameterByClass("ilobjmediapoolgui", "mepitem_id", $request->getItemId());
1665 $ilCtrl->setParameterByClass(
1666 "ilobjmediapoolgui",
1667 "ref_id",
1668 $request->getRefId()
1669 );
1670
1671 $modal = ilModalGUI::getInstance();
1672 $modal->setHeading($lng->txt("preview"));
1673 $modal->setId("ilMepPreview");
1674 $modal->setType(ilModalGUI::TYPE_LARGE);
1675 $modal->setBody("<iframe id='ilMepPreviewContent'></iframe>");
1676
1677 return $modal->getHTML();
1678 }
static getInstance()
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.

Referenced by ilMediaPoolTableGUI\getHTML().

+ Here is the caller graph for this function:

◆ getTemplate()

ilObjMediaPoolGUI::getTemplate ( )

Get standard template.

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

753 : void
754 {
755 $this->tpl->loadStandardTemplate();
756 }

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 115 of file class.ilObjMediaPoolGUI.php.

115 : string
116 {
117 return "mep";
118 }

◆ handleUploadResult()

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

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

1731 $title = $result->getName();
1732
1733 $mob = new ilObjMediaObject();
1734 $mob->setTitle($title);
1735 $mob->setDescription("");
1736 $mob->create();
1737
1738 $mob->createDirectory();
1739 $media_item = new ilMediaItem();
1740 $mob->addMediaItem($media_item);
1741 $media_item->setPurpose("Standard");
1742
1743 $mob_dir = ilObjMediaObject::_getRelativeDirectory($mob->getId());
1744 $file_name = ilObjMediaObject::fixFilename($title);
1745 $file = $mob_dir . "/" . $file_name;
1746
1748 $result,
1749 $mob_dir,
1750 Location::WEB,
1751 $file_name,
1752 true
1753 );
1754
1755 $mep_item = new ilMediaPoolItem();
1756 $mep_item->setTitle($title);
1757 $mep_item->setType("mob");
1758 $mep_item->setForeignId($mob->getId());
1759 $mep_item->create();
1760
1761 $tree = $this->object->getTree();
1762 $parent = $this->mep_item_id;
1763 $tree->insertNode($mep_item->getId(), $parent);
1764
1765 // get mime type
1767 $location = $file_name;
1768
1769 // set real meta and object data
1770 $media_item->setFormat($format);
1771 $media_item->setLocation($location);
1772 $media_item->setLocationType("LocalFile");
1773 $media_item->setUploadHash($this->mep_request->getUploadHash());
1774 $mob->update();
1775
1776 $item_ids[] = $mob->getId();
1777
1778 $mob = new ilObjMediaObject($mob->getId());
1779 $mob->generatePreviewPic(320, 240);
1780
1781 // duration
1782 $med_item = $mob->getMediaItem("Standard");
1783 $med_item->determineDuration();
1784 $med_item->update();
1785
1786 return new BasicHandlerResult(
1787 "mep_id",
1788 HandlerResult::STATUS_OK,
1789 $med_item->getId(),
1790 ''
1791 );
1792 }
static fixFilename(string $a_name)
Fix filename of uploaded file.
static _getRelativeDirectory(int $a_mob_id)
Get relative (to webspace dir) directory.
moveOneFileTo(UploadResult $uploadResult, string $destination, int $location=Location::STORAGE, string $file_name='', bool $override_existing=false)
Moves a single File (the attributes, metadata and upload-status of which are contained in UploadResul...

◆ infoScreen()

ilObjMediaPoolGUI::infoScreen ( )

show information screen

Exceptions
ilCtrlException
ilPermissionException

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

1462 : void
1463 {
1464 $this->tabs->activateTab("info_short");
1465 $ilAccess = $this->access;
1466
1467 if (!$ilAccess->checkAccess("visible", "", $this->ref_id) &&
1468 !$ilAccess->checkAccess("read", "", $this->ref_id) &&
1469 !$ilAccess->checkAccess("write", "", $this->ref_id)) {
1470 throw new ilPermissionException($this->lng->txt("msg_no_perm_read"));
1471 }
1472
1473 if ($this->ctrl->getCmd() === "infoScreen") {
1474 $this->ctrl->setCmd("showSummary");
1475 $this->ctrl->setCmdClass("ilinfoscreengui");
1476 }
1477
1478 $info = new ilInfoScreenGUI($this);
1479
1480 $info->enablePrivateNotes();
1481
1482
1483 // standard meta data
1484 $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
1485
1486 // forward the command
1487 $this->ctrl->forwardCommand($info);
1488 }
Class ilInfoScreenGUI.

References 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 1450 of file class.ilObjMediaPoolGUI.php.

1450 : void
1451 {
1452 $this->ctrl->setCmd("showSummary");
1453 $this->ctrl->setCmdClass("ilinfoscreengui");
1454 $this->infoScreen();
1455 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ initCreationForms()

ilObjMediaPoolGUI::initCreationForms ( string  $new_type)
protected

Init creation forms.

This will create the default creation forms: new, import, clone

Returns
\ilPropertyFormGUI[]

Reimplemented from ilObject2GUI.

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

471 : array
472 {
473 $forms = array(self::CFORM_NEW => $this->initCreateForm($new_type),
474 self::CFORM_IMPORT => $this->initImportForm($new_type));
475
476 return $forms;
477 }
initImportForm(string $new_type)
initCreateForm(string $new_type)

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

+ Here is the call graph for this function:

◆ initEditCustomForm()

ilObjMediaPoolGUI::initEditCustomForm ( ilPropertyFormGUI  $a_form)
protected

Add custom fields to update form.

Reimplemented from ilObjectGUI.

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

488 : void
489 {
490 $obj_service = $this->object_service;
491
492 // default width
493 $ni = new ilNumberInputGUI($this->lng->txt("mep_default_width"), "default_width");
494 $ni->setMinValue(0);
495 $ni->setSuffix("px");
496 $ni->setMaxLength(5);
497 $ni->setSize(5);
498 $a_form->addItem($ni);
499
500 // default height
501 $ni = new ilNumberInputGUI($this->lng->txt("mep_default_height"), "default_height");
502 $ni->setSuffix("px");
503 $ni->setMinValue(0);
504 $ni->setMaxLength(5);
505 $ni->setSize(5);
506 $ni->setInfo($this->lng->txt("mep_default_width_height_info"));
507 $a_form->addItem($ni);
508
509 // presentation
510 $pres = new ilFormSectionHeaderGUI();
511 $pres->setTitle($this->lng->txt('obj_presentation'));
512 $a_form->addItem($pres);
513
514 // tile image
515 $obj_service->commonSettings()->legacyForm($a_form, $this->object)->addTileImage();
516
517 // additional features
518 $feat = new ilFormSectionHeaderGUI();
519 $feat->setTitle($this->lng->txt('obj_features'));
520 $a_form->addItem($feat);
521
523 $this->object->getId(),
524 $a_form,
525 array(
527 )
528 );
529 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class represents a number property in a property form.
ilObjectService $object_service
static initServiceSettingsForm(int $obj_id, ilPropertyFormGUI $form, array $services)

References ilObject2GUI\$object_service, ilPropertyFormGUI\addItem(), ilObjectServiceSettingsGUI\CUSTOM_METADATA, ilObjectServiceSettingsGUI\initServiceSettingsForm(), ILIAS\Repository\lng(), and ILIAS\Repository\object().

+ 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 1222 of file class.ilObjMediaPoolGUI.php.

1222 : void
1223 {
1224 $lng = $this->lng;
1225 $ilCtrl = $this->ctrl;
1226
1227 $this->form = new ilPropertyFormGUI();
1228
1229 // desc
1230 $ti = new ilTextInputGUI($lng->txt("title"), "title");
1231 $ti->setMaxLength(128);
1232 $ti->setRequired(true);
1233 $this->form->addItem($ti);
1234
1235 // save and cancel commands
1236 if ($a_mode === "create") {
1237 $this->form->addCommandButton("saveFolder", $lng->txt("save"));
1238 $this->form->addCommandButton("cancelSave", $lng->txt("cancel"));
1239 $this->form->setTitle($lng->txt("mep_new_folder"));
1240 } else {
1241 $this->form->addCommandButton("updateFolder", $lng->txt("save"));
1242 $this->form->addCommandButton("cancelFolderUpdate", $lng->txt("cancel"));
1243 $this->form->setTitle($lng->txt("mep_edit_folder"));
1244 }
1245
1246 $this->form->setFormAction($ilCtrl->getFormAction($this));
1247 }
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 1849 of file class.ilObjMediaPoolGUI.php.

1853 $lng = $this->lng;
1854
1855 $form = new ilPropertyFormGUI();
1856 $form->setOpenTag(false);
1857 $form->setCloseTag(false);
1858
1859 // title
1860 $ti = new ilTextInputGUI($lng->txt("title"), "title_" . $a_id);
1861 $ti->setValue($a_title);
1862 $form->addItem($ti);
1863
1864 // description
1865 $ti = new ilTextAreaInputGUI($lng->txt("description"), "description_" . $a_id);
1866 $form->addItem($ti);
1867
1868 return $form;
1869 }
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 985 of file class.ilObjMediaPoolGUI.php.

985 : void
986 {
987 $this->checkPermission("write");
988
990 $not_inserted = array();
991 foreach ($ids as $id2) {
992 $id = explode(":", $id2);
993 $type = $id[0];
994 $id = $id[1];
995
996 if ($type === "mob") { // media object
997 if (ilObjMediaPool::isForeignIdInTree($this->object->getId(), $id)) {
998 $not_inserted[] = ilObject::_lookupTitle($id) . " [" .
999 $id . "]";
1000 } else {
1001 $item = new ilMediaPoolItem();
1002 $item->setType("mob");
1003 $item->setForeignId($id);
1004 $item->setTitle(ilObject::_lookupTitle($id));
1005 $item->create();
1006 if ($item->getId() > 0) {
1007 $this->object->insertInTree($item->getId(), $this->mep_item_id);
1008 }
1009 }
1010 }
1011 if ($type === "incl") { // content snippet
1012 if (ilObjMediaPool::isItemIdInTree($this->object->getId(), $id)) {
1013 $not_inserted[] = ilMediaPoolPage::lookupTitle($id) . " [" .
1014 $id . "]";
1015 } else {
1016 $original = new ilMediaPoolPage($id);
1017
1018 // copy the page into the pool
1019 $item = new ilMediaPoolItem();
1020 $item->setType("pg");
1021 $item->setTitle(ilMediaPoolItem::lookupTitle($id));
1022 $item->create();
1023 if ($item->getId() > 0) {
1024 $this->object->insertInTree($item->getId(), $this->mep_item_id);
1025
1026 // create page
1027 $page = new ilMediaPoolPage();
1028 $page->setId($item->getId());
1029 $page->setParentId($this->object->getId());
1030 $page->create(false);
1031
1032 // copy content
1033 $original->copy($page->getId(), $page->getParentType(), $page->getParentId(), true);
1034 }
1035 }
1036 }
1037 }
1038 if (count($not_inserted) > 0) {
1039 $this->main_tpl->setOnScreenMessage('info', $this->lng->txt("mep_not_insert_already_exist") . "<br>" .
1040 implode("<br>", $not_inserted), true);
1041 }
1042 $this->ctrl->redirect($this, $this->mode);
1043 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static lookupTitle(int $a_page_id)
static isItemIdInTree(int $a_pool_id, int $a_item_id)
Check whether a mep item id is in the media pool.
static isForeignIdInTree(int $a_pool_id, int $a_foreign_id)
Check whether foreign id is in tree.

References ilObjectGUI\$id, ilObject2GUI\$type, ilEditClipboardGUI\_getSelectedIDs(), ilObject\_lookupTitle(), ilObject2GUI\checkPermission(), ILIAS\Repository\ctrl(), ilObjMediaPool\isForeignIdInTree(), ilObjMediaPool\isItemIdInTree(), ILIAS\Repository\lng(), ilMediaPoolItem\lookupTitle(), ilMediaPoolPage\lookupTitle(), and ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ listMedia()

ilObjMediaPoolGUI::listMedia ( )

list media objects

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

604 : void
605 {
606 $ilAccess = $this->access;
608 $ilTabs = $this->tabs;
609 $ilCtrl = $this->ctrl;
610 $ilToolbar = $this->toolbar;
612
613 $ilCtrl->setParameter($this, "mep_mode", "listMedia");
614
615 $this->checkPermission("read");
616
617 $ilTabs->setTabActive("content");
618 $this->setContentSubTabs("content");
619
620 if ($ilAccess->checkAccess("write", "", $this->object->getRefId())) {
621 $ilToolbar->addButton(
622 $lng->txt("mep_create_mob"),
623 $ilCtrl->getLinkTarget($this, "createMediaObject")
624 );
625
626 $mset = new ilSetting("mobs");
627 if ($mset->get("mep_activate_pages")) {
628 $ilToolbar->addButton(
629 $lng->txt("mep_create_content_snippet"),
630 $ilCtrl->getLinkTargetByClass(["ilobjmediapoolgui", "ilmediapoolpagegui"], "createMediaPoolPage")
631 );
632 }
633
634 $ilToolbar->addButton(
635 $lng->txt("mep_create_folder"),
636 $ilCtrl->getLinkTarget($this, "createFolderForm")
637 );
638
639 $upload_factory = new ilImportDirectoryFactory();
640 $media_upload = $upload_factory->getInstanceForComponent(ilImportDirectoryFactory::TYPE_MOB);
641 if ($media_upload->exists() && $this->rbac_system->checkAccess("visible", SYSTEM_FOLDER_ID)) {
642 $ilToolbar->addButton(
643 $lng->txt("mep_create_from_upload_dir"),
644 $ilCtrl->getLinkTargetByClass("ilfilesystemgui", "listFiles")
645 );
646 }
647
648 $ilToolbar->addButton(
649 $lng->txt("mep_bulk_upload"),
650 $ilCtrl->getLinkTarget($this, "bulkUpload")
651 );
652
653 $move_ids = ilSession::get("mep_move_ids");
654 if (is_array($move_ids) && count($move_ids) > 0) {
655 $ilToolbar->addSeparator();
656 $ilToolbar->addButton(
657 $lng->txt("paste"),
658 $ilCtrl->getLinkTarget($this, "paste")
659 );
660 }
661 }
662
663 $mep_table_gui = new ilMediaPoolTableGUI($this, "listMedia", $this->getMediaPool(), "mepitem_id");
664 $tpl->setContent($mep_table_gui->getHTML());
665 }
ilToolbarGUI $toolbar
static get(string $a_var)

References ilObject2GUI\$access, ilObject2GUI\$ctrl, ilObject2GUI\$lng, $tabs, ilObject2GUI\$toolbar, ilObject2GUI\$tpl, ilObject2GUI\checkPermission(), ilSession\get(), ilGlobalTemplateInterface\setContent(), setContentSubTabs(), SYSTEM_FOLDER_ID, ilLanguage\txt(), and ilImportDirectoryFactory\TYPE_MOB.

Referenced by returnFromItem().

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

◆ move()

ilObjMediaPoolGUI::move ( )
protected

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

1897 : void
1898 {
1899 ilSession::set("mep_move_ids", $this->mep_request->getItemIds());
1900 $this->main_tpl->setOnScreenMessage('info', $this->lng->txt("mep_move_select_insert"), true);
1901 $this->ctrl->redirect($this, "listMedia");
1902 }
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:

◆ openClipboard()

ilObjMediaPoolGUI::openClipboard ( )

paste from clipboard

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

961 : void
962 {
963 $ilCtrl = $this->ctrl;
964
965 $this->checkPermission("write");
966
967 $ilCtrl->setParameterByClass(
968 "ileditclipboardgui",
969 "returnCommand",
970 rawurlencode($ilCtrl->getLinkTarget(
971 $this,
972 "insertFromClipboard",
973 "",
974 false,
975 false
976 ))
977 );
978 $ilCtrl->redirectByClass("ilEditClipboardGUI", "getObject");
979 }

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

+ Here is the call graph for this function:

◆ performBulkUpload()

ilObjMediaPoolGUI::performBulkUpload ( )

Save bulk upload form.

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

1797 : void
1798 {
1799 $this->checkPermission("write");
1800 $this->ctrl->setParameter($this, "mep_hash", $this->mep_request->getUploadHash());
1801 $this->ctrl->redirect($this, "editTitlesAndDescriptions");
1802 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ remove()

ilObjMediaPoolGUI::remove ( )

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

1054 : void
1055 {
1056 $this->checkPermission("write");
1057
1058 $ids = $this->mep_request->getItemIds();
1059 foreach ($ids as $obj_id) {
1060 $this->object->deleteChild($obj_id);
1061 }
1062
1063 $this->main_tpl->setOnScreenMessage('success', $this->lng->txt("cont_obj_removed"), true);
1064 $this->ctrl->redirect($this, $this->mode);
1065 }

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 735 of file class.ilObjMediaPoolGUI.php.

735 : void
736 {
737 $mtab = new ilMediaPoolTableGUI(
738 $this,
739 "allMedia",
740 $this->getMediaPool(),
741 "mepitem_id",
743 true
744 );
745 $mtab->resetFilter();
746 $mtab->resetOffset();
747 $this->allMedia();
748 }

References allMedia(), and ilMediaPoolTableGUI\IL_MEP_EDIT.

+ Here is the call graph for this function:

◆ returnFromItem()

ilObjMediaPoolGUI::returnFromItem ( )
protected

Return from item editing.

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

450 : void
451 {
453
454 $type = ilMediaPoolItem::lookupType($this->mep_item_id);
455 if ($type !== "fold") {
456 $tree = $this->object->getTree();
457 $fold_id = $tree->getParentId($this->mep_item_id);
458 if ($fold_id > 0) {
459 $ctrl->setParameter($this, "mepitem_id", $fold_id);
460 $ctrl->redirect($this, "listMedia");
461 }
462 }
463 $this->listMedia();
464 }
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 1172 of file class.ilObjMediaPoolGUI.php.

1172 : void
1173 {
1174 $tpl = $this->tpl;
1175 $lng = $this->lng;
1176 $ilCtrl = $this->ctrl;
1177
1178 $this->checkPermission("write");
1179
1180 $this->initFolderForm("create");
1181 if ($this->form->checkInput()) {
1182 if ($this->object->createFolder($this->form->getInput("title"), $this->mep_item_id)) {
1183 $this->main_tpl->setOnScreenMessage('success', $lng->txt("mep_folder_created"), true);
1184 }
1185 $ilCtrl->redirect($this, "listMedia");
1186 }
1187
1188 $this->form->setValuesByPost();
1189 $tpl->setContent($this->form->getHTML());
1190 }

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

+ Here is the call graph for this function:

◆ saveTitlesAndDescriptions()

ilObjMediaPoolGUI::saveTitlesAndDescriptions ( )
protected

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

1871 : void
1872 {
1873 $lng = $this->lng;
1875
1876 $this->checkPermission("write");
1878 $this->mep_request->getUploadHash()
1879 );
1880
1881 foreach ($media_items as $mi) {
1882 $mob = new ilObjMediaObject($mi["mob_id"]);
1883 $form = $this->initMediaBulkForm($mi["mob_id"], $mob->getTitle());
1884 $form->checkInput();
1885 $title = $form->getInput("title_" . $mi["mob_id"]);
1886 $desc = $form->getInput("description_" . $mi["mob_id"]);
1887 if (trim($title) !== "") {
1888 $mob->setTitle($title);
1889 }
1890 $mob->setDescription($desc);
1891 $mob->update();
1892 }
1893 $this->main_tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
1894 $ctrl->redirect($this, "listMedia");
1895 }
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:

◆ selectUploadDirFiles()

ilObjMediaPoolGUI::selectUploadDirFiles ( ?array  $a_files = null)

Select files from upload directory.

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

1500 : void {
1501 $tpl = $this->tpl;
1502 $ilTabs = $this->tabs;
1503 $lng = $this->lng;
1504 $ilCtrl = $this->ctrl;
1505 $ilToolbar = $this->toolbar;
1506
1507
1508 if (!$a_files) {
1509 $a_files = $this->mep_request->getFiles();
1510 }
1511
1512 $ilTabs->clearTargets();
1513 $ilTabs->setBackTarget(
1514 $lng->txt("back"),
1515 $ilCtrl->getLinkTarget($this, "listMedia")
1516 );
1517
1518 $this->checkPermission("write");
1519
1520 if ($this->rbac_system->checkAccess("visible", SYSTEM_FOLDER_ID)) {
1521 $tb = new ilToolbarGUI();
1522 // action type
1523 $options = array(
1524 "rename" => $lng->txt("mep_up_dir_move"),
1525 "copy" => $lng->txt("mep_up_dir_copy"),
1526 );
1527 $si = new ilSelectInputGUI("", "action");
1528 $si->setOptions($options);
1529 $tb->addInputItem($si);
1530 $tb->setCloseFormTag(false);
1531 $tb->setFormAction($ilCtrl->getFormAction($this));
1532 $tb->setFormName("mep_up_form");
1533
1534 $tab = new ilUploadDirFilesTableGUI(
1535 $this,
1536 "selectUploadDirFiles",
1537 $a_files
1538 );
1539 $tab->setFormName("mep_up_form");
1540 $tpl->setContent($tb->getHTML() . $tab->getHTML());
1541 }
1542 }
This class represents a selection list property in a property form.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ setContentSubTabs()

ilObjMediaPoolGUI::setContentSubTabs ( string  $a_active)

Set sub tabs for content tab.

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

1275 : void {
1276 $ilAccess = $this->access;
1277 $ilTabs = $this->tabs;
1278 $ilCtrl = $this->ctrl;
1279
1280 $ilTabs->addSubTab("content", $this->lng->txt("objs_fold"), $this->ctrl->getLinkTarget($this, ""));
1281
1282 $ilCtrl->setParameter($this, "mepitem_id", "");
1283 $ilTabs->addSubTab("mep_all_mobs", $this->lng->txt("mep_all_mobs"), $this->ctrl->getLinkTarget($this, "allMedia"));
1284 $ilCtrl->setParameter($this, "mepitem_id", $this->mep_item_id);
1285
1286 if ($ilAccess->checkAccess('write', '', $this->ref_id)) {
1287 $ilTabs->addSubTab(
1288 "srt_files",
1289 $this->lng->txt("mep_media_subtitles"),
1290 $ilCtrl->getLinkTargetByClass("ilmobmultisrtuploadgui", "")
1291 );
1292 }
1293
1294 $ilTabs->activateSubTab($a_active);
1295 }

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 1387 of file class.ilObjMediaPoolGUI.php.

1389 : void {
1390 $ilTabs = $this->tabs;
1391 $lng = $this->lng;
1392 $ilAccess = $this->access;
1393
1394 if ($ilAccess->checkAccess("write", "", $this->object->getRefId())) {
1395 $ilTabs->addSubTab(
1396 "settings",
1397 $lng->txt("settings"),
1398 $this->ctrl->getLinkTarget($this, "edit")
1399 );
1400
1401 $mset = new ilSetting("mobs");
1402 if ($mset->get("mep_activate_pages")) {
1403 $ilTabs->addSubTabTarget(
1404 "obj_multilinguality",
1405 $this->ctrl->getLinkTargetByClass("ilobjecttranslationgui", "")
1406 );
1407 }
1408 }
1409
1410 $ilTabs->setSubTabActive($a_active);
1411 }

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

Referenced by edit(), and 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 1297 of file class.ilObjMediaPoolGUI.php.

1297 : void
1298 {
1299 $ilAccess = $this->access;
1300 $ilTabs = $this->tabs;
1301 $ilHelp = $this->help;
1302
1303 $ilHelp->setScreenIdComponent("mep");
1304
1305 if ($ilAccess->checkAccess('read', '', $this->ref_id) ||
1306 $ilAccess->checkAccess('write', '', $this->ref_id)) {
1307 $ilTabs->addTab("content", $this->lng->txt("mep_content"), $this->ctrl->getLinkTarget($this, ""));
1308 }
1309
1310 // info tab
1311 if ($ilAccess->checkAccess('visible', '', $this->ref_id) ||
1312 $ilAccess->checkAccess('read', '', $this->ref_id) ||
1313 $ilAccess->checkAccess('write', '', $this->ref_id)) {
1314 $force_active = $this->ctrl->getNextClass() === "ilinfoscreengui"
1315 || strtolower($this->ctrl->getCmdClass()) === "ilnotegui";
1316 $ilTabs->addTarget(
1317 "info_short",
1318 $this->ctrl->getLinkTargetByClass(
1319 array("ilobjmediapoolgui", "ilinfoscreengui"),
1320 "showSummary"
1321 ),
1322 array("showSummary", "infoScreen"),
1323 "",
1324 "",
1325 $force_active
1326 );
1327 }
1328
1329 if ($ilAccess->checkAccess("write", "", $this->object->getRefId())) {
1330 $ilTabs->addTarget(
1331 "settings",
1332 $this->ctrl->getLinkTarget($this, "edit"),
1333 "edit",
1334 array("", "ilobjmediapoolgui")
1335 );
1336 }
1337 if ($ilAccess->checkAccess("write", "", $this->object->getRefId())) {
1338 $ilTabs->addTarget(
1339 "clipboard",
1340 $this->ctrl->getLinkTarget($this, "openClipboard"),
1341 "view",
1342 "ileditclipboardgui"
1343 );
1344 }
1345
1346 // properties
1347 if ($ilAccess->checkAccess("write", "", $this->object->getRefId())) {
1348 // meta data
1349 $mdgui = new ilObjectMetaDataGUI($this->object, ['mob', "mpg"]);
1350 $mdtab = $mdgui->getTab();
1351 if ($mdtab) {
1352 $ilTabs->addTarget(
1353 "meta_data",
1354 $mdtab,
1355 "",
1356 "ilobjectmetadatagui"
1357 );
1358 }
1359 }
1360
1361 if ($ilAccess->checkAccess("write", "", $this->object->getRefId())) {
1362 $ilTabs->addTarget(
1363 "export",
1364 $this->ctrl->getLinkTargetByClass("ilexportgui", ""),
1365 "",
1366 "ilexportgui"
1367 );
1368
1369 $ilTabs->addTarget(
1370 "import",
1371 $this->ctrl->getLinkTargetByClass("ilmediapoolimportgui", ""),
1372 "",
1373 "ilmediapoolimportgui"
1374 );
1375 }
1376
1377 if ($ilAccess->checkAccess("edit_permission", "", $this->object->getRefId())) {
1378 $ilTabs->addTarget(
1379 "perm_settings",
1380 $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm"),
1381 array("perm","info","owner"),
1382 'ilpermissiongui'
1383 );
1384 }
1385 }
setScreenIdComponent(string $a_comp)

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

+ Here is the call graph for this function:

◆ showFullscreen()

ilObjMediaPoolGUI::showFullscreen ( )

show media fullscreen

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

901 : void
902 {
903 $this->showMedia();
904 }
showMedia()
show media object

References showMedia().

+ Here is the call graph for this function:

◆ showMedia()

ilObjMediaPoolGUI::showMedia ( )
protected

show media object

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

778 : void
779 {
780 $this->checkPermission("read");
781 $link_xml = "";
782 $pg_frame = "";
783
784 $item = new ilMediaPoolItem($this->mep_item_id);
785 $mob_id = $item->getForeignId();
786
787 $this->tpl = new ilGlobalTemplate("tpl.fullscreen.html", true, true, "Services/COPage");
788 $this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
789 $this->tpl->setVariable(
790 "LOCATION_CONTENT_STYLESHEET",
792 );
793
794
796 $media_obj = new ilObjMediaObject($mob_id);
797
798
799 $this->tpl->setVariable("TITLE", " - " . $media_obj->getTitle());
800
801 $xml = "<dummy>";
802 // todo: we get always the first alias now (problem if mob is used multiple
803 // times in page)
804 $xml .= $media_obj->getXML(IL_MODE_ALIAS);
805 $xml .= $media_obj->getXML(IL_MODE_OUTPUT);
806 $xml .= $link_xml;
807 $xml .= "</dummy>";
808
809 $xsl = file_get_contents("./Services/COPage/xsl/page.xsl");
810 $args = array( '/_xml' => $xml, '/_xsl' => $xsl );
811 $xh = xslt_create();
812
813 $wb_path = ilFileUtils::getWebspaceDir("output") . "/";
814
815 $mode = ($this->ctrl->getCmd() !== "showPreview")
816 ? "fullscreen"
817 : "media";
818 $enlarge_path = ilUtil::getImagePath("enlarge.svg", false, "output");
819 $fullscreen_link =
820 $this->ctrl->getLinkTarget($this, "showFullscreen", "", false, false);
821 $params = array('mode' => $mode, 'enlarge_path' => $enlarge_path,
822 'link_params' => "ref_id=" . $this->requested_ref_id,'fullscreen_link' => $fullscreen_link,
823 'enable_html_mob' => ilObjMediaObject::isTypeAllowed("html") ? "y" : "n",
824 'ref_id' => $this->requested_ref_id, 'pg_frame' => $pg_frame, 'webspace_path' => $wb_path);
825 $output = xslt_process($xh, "arg:/_xml", "arg:/_xsl", null, $args, $params);
826 xslt_free($xh);
827 // unmask user html
828 $this->tpl->setVariable("MEDIA_CONTENT", $output);
829 }
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 getStyleSheetLocation(string $mode="output", string $a_css_name="", string $a_css_location="")
get full style sheet file name (path inclusive) of current user
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
xslt_free(&$proc)
xslt_create()
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
Definition: ltiregstart.php:33
$xml
Definition: metadata.php:351

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

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 837 of file class.ilObjMediaPoolGUI.php.

837 : void
838 {
839 //$tpl = new \ilGlobalPageTemplate($DIC->globalScreen(), $DIC->ui(), $DIC->http());
840 $tpl = new ilGlobalTemplate("tpl.fullscreen.html", true, true, "Services/COPage");
841
845
846 // get page object
847 $page_gui = $this->getMediaPoolPageGUI($this->mep_item_id);
848 $page_gui->setTemplate($tpl);
849
850 $page_gui->setTemplateOutput(false);
851 $page_gui->setHeader("");
852 $ret = $page_gui->showPage(true);
853
854 //$tpl->setBodyClass("ilMediaPoolPagePreviewBody");
855 $tpl->setVariable("MEDIA_CONTENT", "<div>" . $ret . "</div>");
856
857
859 exit;
860 }
getMediaPoolPageGUI($mep_item_id, $old_nr=0)
Get media pool page.
printToStdout(string $part=self::DEFAULT_BLOCK, bool $has_tabs=true, bool $skip_main_menu=false)
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.
exit
Definition: login.php:28

References ilObject2GUI\$tpl, ilGlobalTemplateInterface\addCss(), exit, ilObjStyleSheet\getContentStylePath(), getMediaPoolPageGUI(), ilUtil\getStyleSheetLocation(), ilObjStyleSheet\getSyntaxStylePath(), ilGlobalTemplateInterface\printToStdout(), and ilGlobalTemplateInterface\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 880 of file class.ilObjMediaPoolGUI.php.

880 : void
881 {
882 $this->checkPermission("read");
883
884 $item = new ilMediaPoolItem($this->mep_item_id);
885
886 switch ($item->getType()) {
887 case "mob":
888 $this->showMedia();
889 break;
890
891 case "pg":
892 $this->showPage();
893 break;
894 }
895 }

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

+ Here is the call graph for this function:

◆ toggleExplorerNodeState()

ilObjMediaPoolGUI::toggleExplorerNodeState ( )
protected

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

667 : void
668 {
669 $exp = new ilMediaPoolExplorerGUI($this, "listMedia", $this->getMediaPool());
670 $exp->toggleExplorerNodeState();
671 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ updateCustom()

ilObjMediaPoolGUI::updateCustom ( ilPropertyFormGUI  $form)
protected

Insert custom update form values into object.

Reimplemented from ilObjectGUI.

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

574 : void
575 {
576 $obj_service = $this->object_service;
577
578 $ot = ilObjectTranslation::getInstance($this->getMediaPool()->getId());
579 if ($ot->getContentActivated()) {
580 $ot->setDefaultTitle($form->getInput('title'));
581 $ot->setDefaultDescription($form->getInput('desc'));
582 $ot->save();
583 }
584
585 $this->getMediaPool()->setDefaultWidth($form->getInput("default_width"));
586 $this->object->setDefaultHeight($form->getInput("default_height"));
587
588 // additional features
590 $this->object->getId(),
591 $form,
592 array(
594 )
595 );
596
597 // tile image
598 $obj_service->commonSettings()->legacyForm($form, $this->object)->saveTileImage();
599 }
static updateServiceSettingsForm(int $obj_id, ilPropertyFormGUI $form, array $services)

References $form, ilObject2GUI\$object_service, ilObjectServiceSettingsGUI\CUSTOM_METADATA, ILIAS\Survey\Mode\getId(), ilPropertyFormGUI\getInput(), ilObjectTranslation\getInstance(), ILIAS\Repository\object(), and ilObjectServiceSettingsGUI\updateServiceSettingsForm().

+ Here is the call graph for this function:

◆ updateFolder()

ilObjMediaPoolGUI::updateFolder ( )

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

1192 : void
1193 {
1194 $lng = $this->lng;
1195 $ilCtrl = $this->ctrl;
1196 $tpl = $this->tpl;
1197
1198 $this->checkPermission("write");
1199
1200 $this->initFolderForm("edit");
1201 if ($this->form->checkInput()) {
1202 $item = new ilMediaPoolItem($this->mep_item_id);
1203 $item->setTitle($this->form->getInput("title"));
1204 $item->update();
1205 $this->main_tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
1206 $ilCtrl->setParameter(
1207 $this,
1208 "mepitem_id",
1209 $this->object->getTree()->getParentId($this->mep_item_id)
1210 );
1211 $ilCtrl->redirect($this, "listMedia");
1212 }
1213
1214 $this->form->setValuesByPost();
1215 $tpl->setContent($this->form->getHTML());
1216 }

References ilObject2GUI\$ctrl, ilObject2GUI\$lng, ilObject2GUI\$tpl, ilObject2GUI\checkPermission(), ILIAS\Repository\form(), initFolderForm(), ILIAS\Repository\object(), ilGlobalTemplateInterface\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 40 of file class.ilObjMediaPoolGUI.php.

◆ $form

ilPropertyFormGUI ilObjMediaPoolGUI::$form
protected

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

Referenced by edit(), executeCommand(), and updateCustom().

◆ $gui

InternalGUIService ilObjMediaPoolGUI::$gui
protected

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

Referenced by executeCommand().

◆ $help

ilHelpGUI ilObjMediaPoolGUI::$help
protected

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

◆ $main_tpl

ilGlobalTemplateInterface ilObjMediaPoolGUI::$main_tpl
protected

Definition at line 48 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 50 of file class.ilObjMediaPoolGUI.php.

◆ $mep_request

StandardGUIRequest ilObjMediaPoolGUI::$mep_request
protected

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

◆ $mode

string ilObjMediaPoolGUI::$mode
protected

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

Referenced by showMedia().

◆ $output_prepared

bool ilObjMediaPoolGUI::$output_prepared

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

◆ $tabs

ilTabsGUI ilObjMediaPoolGUI::$tabs
protected

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

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

◆ $upload

FileUpload ilObjMediaPoolGUI::$upload
protected

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


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