ILIAS  release_8 Revision v8.25-1-g13de6a5eca6
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 1409 of file class.ilObjMediaPoolGUI.php.

1409 : void
1410 {
1411 global $DIC;
1412 $main_tpl = $DIC->ui()->mainTemplate();
1413
1414 $ilAccess = $DIC->access();
1415 $lng = $DIC->language();
1416 $ctrl = $DIC->ctrl();
1417
1418 $subitem_id = "";
1419 $targets = explode('_', $a_target);
1420 $ref_id = $targets[0];
1421 if (count((array) $targets) > 1) {
1422 $subitem_id = $targets[1];
1423 }
1424
1425 $ctrl->setParameterByClass("ilMediaPoolPresentationGUI", "ref_id", $ref_id);
1426 if ($ilAccess->checkAccess("read", "", $ref_id)) {
1427 $ctrl->setParameterByClass("ilMediaPoolPresentationGUI", "mepitem_id", $subitem_id);
1428 $ctrl->redirectByClass("ilMediaPoolPresentationGUI", "");
1429 } elseif ($ilAccess->checkAccess("visible", "", $ref_id)) {
1430 $ctrl->redirectByClass("ilMediaPoolPresentationGUI", "infoScreen");
1431 } elseif ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID)) {
1432 $main_tpl->setOnScreenMessage('failure', sprintf(
1433 $lng->txt("msg_no_perm_read_item"),
1435 ), true);
1437 }
1438
1439 throw new ilPermissionException($lng->txt("msg_no_perm_read"));
1440 }
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 1102 of file class.ilObjMediaPoolGUI.php.

1102 : void
1103 {
1104 $ilLocator = $this->locator;
1105 $ilAccess = $this->access;
1106 if (!$this->getCreationMode() && $this->ctrl->getCmd() !== "explorer") {
1107 $tree = $this->object->getTree();
1110 foreach ($path as $node) {
1111 if ($node["child"] == $tree->getRootId()) {
1112 $this->ctrl->setParameter($this, "mepitem_id", "");
1113 $link = "";
1114 if ($ilAccess->checkAccess("read", "", $this->object->getRefId())) {
1115 $link = $this->ctrl->getLinkTarget($this, "listMedia");
1116 } elseif ($ilAccess->checkAccess("visible", "", $this->object->getRefId())) {
1117 $link = $this->ctrl->getLinkTarget($this, "infoScreen");
1118 }
1119 $title = $this->object->getTitle();
1120 $this->ctrl->setParameter($this, "mepitem_id", $this->mep_item_id);
1121 $ilLocator->addItem($title, $link, "", $this->requested_ref_id);
1122 }
1123 }
1124 }
1125 }
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 485 of file class.ilObjMediaPoolGUI.php.

485 : void
486 {
487 // always send a message
488 $this->main_tpl->setOnScreenMessage('success', $this->lng->txt("object_added"), true);
489
490 //ilUtil::redirect($this->getReturnLocation("save","adm_object.php?".$this->link_params));
491 ilUtil::redirect("ilias.php?baseClass=ilMediaPoolPresentationGUI&ref_id=" . $new_object->getRefId() . "&cmd=listMedia");
492 }
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 682 of file class.ilObjMediaPoolGUI.php.

682 : void
683 {
685 $ilTabs = $this->tabs;
686 $ilCtrl = $this->ctrl;
688
689 $ilCtrl->setParameter($this, "mep_mode", "allMedia");
690
691 $this->checkPermission("read");
692 $ilTabs->setTabActive("content");
693 $this->setContentSubTabs("mep_all_mobs");
694
695 $mep_table_gui = new ilMediaPoolTableGUI(
696 $this,
697 "allMedia",
698 $this->getMediaPool(),
699 "mepitem_id",
701 true
702 );
703
704 if ($this->mep_request->getForceFilter() > 0) {
705 $mep_table_gui->setTitleFilter(
706 ilMediaPoolItem::lookupTitle($this->mep_request->getForceFilter())
707 );
708
709 // Read again
710 $mep_table_gui = new ilMediaPoolTableGUI(
711 $this,
712 "allMedia",
713 $this->getMediaPool(),
714 "mepitem_id",
716 true
717 );
718 }
719
720 $tpl->setContent($mep_table_gui->getHTML());
721 }
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 726 of file class.ilObjMediaPoolGUI.php.

726 : void
727 {
728 $mtab = new ilMediaPoolTableGUI(
729 $this,
730 "allMedia",
731 $this->getMediaPool(),
732 "mepitem_id",
734 true
735 );
736 $mtab->writeFilterToSession();
737 $mtab->resetOffset();
738 $this->allMedia();
739 }
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 1691 of file class.ilObjMediaPoolGUI.php.

1691 : void
1692 {
1693 $this->checkPermission("write");
1694
1696
1697 $form = $this->getBulkUploadForm();
1698 $main_tpl->setContent($form->render());
1699 }

References ilGlobalTemplateInterface\setContent().

+ Here is the call graph for this function:

◆ cancelFolderUpdate()

ilObjMediaPoolGUI::cancelFolderUpdate ( )

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

1244 : void
1245 {
1246 $ilCtrl = $this->ctrl;
1247 $ilCtrl->setParameter(
1248 $this,
1249 "mepitem_id",
1250 $this->object->getTree()->getParentId($this->mep_item_id)
1251 );
1252 $ilCtrl->redirect($this, "listMedia");
1253 }
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 1044 of file class.ilObjMediaPoolGUI.php.

1044 : void
1045 {
1046 $this->ctrl->redirect($this, $this->mode);
1047 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ cancelSave()

ilObjMediaPoolGUI::cancelSave ( )

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

1255 : void
1256 {
1257 $ilCtrl = $this->ctrl;
1258 $ilCtrl->redirect($this, "listMedia");
1259 }
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 915 of file class.ilObjMediaPoolGUI.php.

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

1066 : void
1067 {
1069
1070 $this->checkPermission("write");
1071
1072 $ids = $this->mep_request->getItemIds();
1073 if (count($ids) === 0) {
1074 $this->main_tpl->setOnScreenMessage('failure', $this->lng->txt("no_checkbox"), true);
1075 $this->ctrl->redirect($this, $this->mode);
1076 }
1077
1078 foreach ($ids as $obj_id) {
1080 if ($type === "fold") {
1081 $this->main_tpl->setOnScreenMessage('failure', $this->lng->txt("cont_cant_copy_folders"), true);
1082 $this->ctrl->redirect($this, $this->mode);
1083 }
1084 }
1085 foreach ($ids as $obj_id) {
1088 if ($type === "mob") {
1089 $ilUser->addObjectToClipboard($fid, "mob", "");
1090 }
1091 if ($type === "pg") {
1092 $ilUser->addObjectToClipboard($obj_id, "incl", "");
1093 }
1094 }
1095 $this->main_tpl->setOnScreenMessage('success', $this->lng->txt("copied_to_clipboard"), true);
1096 $this->ctrl->redirect($this, $this->mode);
1097 }
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 1131 of file class.ilObjMediaPoolGUI.php.

1131 : void
1132 {
1133 $tpl = $this->tpl;
1134
1135 $this->checkPermission("write");
1136
1137 $this->initFolderForm("create");
1138 $tpl->setContent($this->form->getHTML());
1139 }
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 1542 of file class.ilObjMediaPoolGUI.php.

1542 : void
1543 {
1544 $this->checkPermission("write");
1545
1546 $import_directory_factory = new ilImportDirectoryFactory();
1547 $mob_import_directory = $import_directory_factory->getInstanceForComponent(ilImportDirectoryFactory::TYPE_MOB);
1548 $upload_dir = $mob_import_directory->getAbsolutePath();
1549
1550 $files = $this->mep_request->getFiles();
1551 if ($this->rbac_system->checkAccess("visible", SYSTEM_FOLDER_ID)) {
1552 foreach ($files as $f) {
1553 $f = str_replace("..", "", $f);
1554 $fullpath = $upload_dir . "/" . $f;
1555 $mob = new ilObjMediaObject();
1556 $mob->setTitle(basename($fullpath));
1557 $mob->setDescription("");
1558 $mob->create();
1559
1560 // determine and create mob directory, move uploaded file to directory
1561 //$mob_dir = ilUtil::getWebspaceDir()."/mobs/mm_".$a_mob->getId();
1562 $mob->createDirectory();
1563 $mob_dir = ilObjMediaObject::_getDirectory($mob->getId());
1564
1565 $media_item = new ilMediaItem();
1566 $mob->addMediaItem($media_item);
1567 $media_item->setPurpose("Standard");
1568
1569 $file = $mob_dir . "/" . basename($fullpath);
1570
1571 // virus handling
1572 $vir = ilVirusScanner::virusHandling($fullpath, basename($fullpath));
1573 if (!$vir[0]) {
1574 $this->main_tpl->setOnScreenMessage('failure', $this->lng->txt("file_is_infected") . "<br />" . $vir[1], true);
1575 ilUtil::redirect("ilias.php?baseClass=ilMediaPoolPresentationGUI&cmd=listMedia&ref_id=" .
1576 $this->requested_ref_id . "&mepitem_id=" . $this->mep_item_id);
1577 }
1578
1579 switch ($this->mep_request->getFileAction()) {
1580 case "rename":
1581 rename($fullpath, $file);
1582 break;
1583
1584 case "copy":
1585 copy($fullpath, $file);
1586 break;
1587 }
1588
1589 // get mime type
1591 $location = basename($fullpath);
1592
1593 // set real meta and object data
1594 $media_item->setFormat($format);
1595 $media_item->setLocation($location);
1596 $media_item->setLocationType("LocalFile");
1597
1598 $mob->setDescription($format);
1599
1600 // determine width and height of known image types
1602 $format,
1603 "File",
1604 $mob_dir . "/" . $location,
1605 $media_item->getLocation(),
1606 true,
1607 true,
1608 null,
1609 null
1610 );
1611 $media_item->setWidth($wh["width"]);
1612 $media_item->setHeight($wh["height"]);
1613
1614 $media_item->setHAlign("Left");
1616 $mob->update();
1617
1618
1619 // put it into current folder
1620 $mep_item = new ilMediaPoolItem();
1621 $mep_item->setTitle($mob->getTitle());
1622 $mep_item->setType("mob");
1623 $mep_item->setForeignId($mob->getId());
1624 $mep_item->create();
1625
1626 $tree = $this->object->getTree();
1627 $parent = $this->mep_item_id;
1628 $tree->insertNode($mep_item->getId(), $parent);
1629 }
1630 }
1631 ilUtil::redirect("ilias.php?baseClass=ilMediaPoolPresentationGUI&cmd=listMedia&ref_id=" .
1632 $this->requested_ref_id . "&mepitem_id=" . $this->mep_item_id);
1633 }
$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 472 of file class.ilObjMediaPoolGUI.php.

472 : void
473 {
474 $this->ctrl->redirectByClass("ilobjmediaobjectgui", "create");
475 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ edit()

ilObjMediaPoolGUI::edit ( )
Exceptions
ilPermissionException

Reimplemented from ilObject2GUI.

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

540 : void
541 {
543 $ilTabs = $this->tabs_gui;
544
545 $this->setSettingsSubTabs("settings");
546
547 if (!$this->checkPermissionBool("write")) {
548 throw new ilPermissionException($this->lng->txt("msg_no_perm_write"));
549 }
550
551 $ilTabs->activateTab("settings");
552
553 $form = $this->initEditForm();
554 $values = $this->getEditFormValues();
555 if ($values) {
556 $form->setValuesByArray($values, true);
557 }
558
560
562 }
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 1141 of file class.ilObjMediaPoolGUI.php.

1141 : void
1142 {
1143 $tpl = $this->tpl;
1144
1145 $this->checkPermission("write");
1146
1147 $this->initFolderForm();
1148 $this->getFolderValues();
1149 $tpl->setContent($this->form->getHTML());
1150 }
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 1799 of file class.ilObjMediaPoolGUI.php.

1799 : void
1800 {
1802 $lng = $this->lng;
1803
1804 $this->checkPermission("write");
1805 $ctrl->saveParameter($this, "mep_hash");
1806
1808
1810 $this->mep_request->getUploadHash()
1811 );
1812
1813 $tb = new ilToolbarGUI();
1814 $tb->setFormAction($ctrl->getFormAction($this));
1815 $tb->addFormButton($lng->txt("save"), "saveTitlesAndDescriptions");
1816 $tb->setOpenFormTag(true);
1817 $tb->setCloseFormTag(false);
1818 $tb->setId("tb_top");
1819
1820 $html = $tb->getHTML();
1821 foreach ($media_items as $mi) {
1822 $acc = new ilAccordionGUI();
1823 $acc->setBehaviour(ilAccordionGUI::ALL_CLOSED);
1824 $acc->setId("acc_" . $mi["mob_id"]);
1825
1826 $mob = new ilObjMediaObject($mi["mob_id"]);
1827 $form = $this->initMediaBulkForm($mi["mob_id"], $mob->getTitle());
1828 $acc->addItem($mob->getTitle(), $form->getHTML());
1829
1830 $html .= $acc->getHTML();
1831 }
1832
1833 $html .= $tb->getHTML();
1834 $tb->setOpenFormTag(false);
1835 $tb->setCloseFormTag(true);
1836 $tb->setId("tb_bottom");
1837
1839 }
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
326 $return_cmd = $ilCtrl->getLinkTarget(
327 $this,
328 "insertFromClipboard"
329 );
330
331 $clip_gui = new ilEditClipboardGUI($return_cmd);
332 $clip_gui->setMultipleSelections(true);
333 $clip_gui->setInsertButtonTitle($lng->txt("mep_copy_to_mep"));
334 $ilTabs->setTabActive("clipboard");
335 $this->ctrl->forwardCommand($clip_gui);
336 $this->tpl->printToStdout();
337 break;
338
339 case 'ilinfoscreengui':
340 $this->prepareOutput();
341 $this->addHeaderAction();
342 $this->infoScreen();
343 $this->tpl->printToStdout();
344 break;
345
346 case 'ilpermissiongui':
347 $this->checkPermission("edit_permission");
348 $this->prepareOutput();
349 $this->addHeaderAction();
350 $perm_gui = new ilPermissionGUI($this);
351 $ilTabs->activateTab("perm_settings");
352 $this->ctrl->forwardCommand($perm_gui);
353 $this->tpl->printToStdout();
354 break;
355
356 case "ilexportgui":
357 $this->checkPermission("write");
358 $this->prepareOutput();
359 $this->addHeaderAction();
360 $ilTabs->activateTab("export");
361 $exp_gui = new ilExportGUI($this);
362 $exp_gui->addFormat("xml");
363 $ot = ilObjectTranslation::getInstance($this->object->getId());
364 if ($ot->getContentActivated()) {
365 $exp_gui->addFormat("xml_master", "XML (" . $lng->txt("mep_master_language_only") . ")", $this, "export");
366 $exp_gui->addFormat("xml_masternomedia", "XML (" . $lng->txt("mep_master_language_only_no_media") . ")", $this, "export");
367 }
368 $this->ctrl->forwardCommand($exp_gui);
369 $this->tpl->printToStdout();
370 break;
371
372 case "ilfilesystemgui":
373 $this->checkPermission("write");
374 $this->prepareOutput();
375 $this->addHeaderAction();
376 $ilTabs->clearTargets();
377 $ilTabs->setBackTarget(
378 $lng->txt("back"),
379 $ilCtrl->getLinkTarget($this, "listMedia")
380 );
381 $mset = new ilSetting("mobs");
382 $import_directory_factory = new ilImportDirectoryFactory();
383 $mob_import_directory = $import_directory_factory->getInstanceForComponent(ilImportDirectoryFactory::TYPE_MOB);
384 if ($mob_import_directory->exists()) {
385 $fs_gui = new ilFileSystemGUI($mob_import_directory->getAbsolutePath());
386 $fs_gui->setPostDirPath(true);
387 $fs_gui->setTableId("mepud" . $this->object->getId());
388 $fs_gui->setAllowFileCreation(false);
389 $fs_gui->setAllowDirectoryCreation(false);
390 $fs_gui->clearCommands();
391 $fs_gui->addCommand(
392 $this,
393 "selectUploadDirFiles",
394 $this->lng->txt("mep_sel_upload_dir_files"),
395 false,
396 true
397 );
398 $this->ctrl->forwardCommand($fs_gui);
399 }
400 $this->tpl->printToStdout();
401 break;
402
403 case "ilcommonactiondispatchergui":
405 $this->ctrl->forwardCommand($gui);
406 break;
407
408 case 'ilobjecttranslationgui':
409 $this->prepareOutput();
410 $this->addHeaderAction();
411 //$this->setTabs("settings");
412 $ilTabs->activateTab("settings");
413 $this->setSettingsSubTabs("obj_multilinguality");
414 $transgui = new ilObjectTranslationGUI($this);
415 $transgui->setTitleDescrOnlyMode(false);
416 $this->ctrl->forwardCommand($transgui);
417 $this->tpl->printToStdout();
418 break;
419
420 case "ilmediapoolimportgui":
421 $this->prepareOutput();
422 $this->addHeaderAction();
423 $this->checkPermission("write");
424 $ilTabs->activateTab("import");
425 $gui = new ilMediaPoolImportGUI($this->getMediaPool());
426 $this->ctrl->forwardCommand($gui);
427 $this->tpl->printToStdout();
428 break;
429
430 case "ilmobmultisrtuploadgui":
431 $this->checkPermission("write");
432 $this->prepareOutput();
433 $this->addHeaderAction();
434 $this->setContentSubTabs("srt_files");
435 $gui = new ilMobMultiSrtUploadGUI(new ilMepMultiSrt($this->getMediaPool()));
436 $this->ctrl->forwardCommand($gui);
437 $this->tpl->printToStdout();
438 break;
439
440
441 default:
442 $this->prepareOutput();
443 $this->addHeaderAction();
444 $cmd = $this->ctrl->getCmd("listMedia") ?: "listMedia";
445 $this->$cmd();
446 if (!$this->getCreationMode()) {
447 $this->tpl->printToStdout();
448 }
449 break;
450 }
451 }
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 1675 of file class.ilObjMediaPoolGUI.php.

1675 : void
1676 {
1677 $ot = ilObjectTranslation::getInstance($this->object->getId());
1678 $opt = "";
1679 if ($ot->getContentActivated()) {
1680 $format = explode("_", $this->mep_request->getExportFormat());
1681 $opt = ilUtil::stripSlashes($format[1]);
1682 }
1683
1684 $this->object->exportXML($opt);
1685 }
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 1701 of file class.ilObjMediaPoolGUI.php.

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

565 : void
566 {
567 $ot = ilObjectTranslation::getInstance($this->getMediaPool()->getId());
568 if ($ot->getContentActivated()) {
569 $a_values["title"] = $ot->getDefaultTitle();
570 $a_values["desc"] = $ot->getDefaultDescription();
571 }
572 if ($this->getMediaPool()->getDefaultWidth() > 0) {
573 $a_values["default_width"] = $this->object->getDefaultWidth();
574 }
575 if ($this->getMediaPool()->getDefaultHeight() > 0) {
576 $a_values["default_height"] = $this->object->getDefaultHeight();
577 }
578 }

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

1155 : void
1156 {
1157 $values = array();
1158
1159 $values["title"] = ilMediaPoolItem::lookupTitle($this->mep_item_id);
1160
1161 $this->form->setValuesByArray($values);
1162 }

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

874 {
875 include_once("./Modules/MediaPool/classes/class.ilMediaPoolPageGUI.php");
876 $page_gui = new ilMediaPoolPageGUI($mep_item_id, $old_nr);
877 $page_gui->setPoolGUI($this);
878
879 return $page_gui;
880 }

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

768 : ?int
769 {
770 if ($this->mep_item_id == 0) {
771 return null;
772 }
773 $par_id = $this->object->getPoolTree()->getParentId($this->mep_item_id);
774 if ($par_id != $this->object->getPoolTree()->getRootId()) {
775 return (int) $par_id;
776 }
777
778 return null;
779 }

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

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

759 : void
760 {
761 $this->tpl->loadStandardTemplate();
762 }

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

1726 $title = $result->getName();
1727
1728 $mob = new ilObjMediaObject();
1729 $mob->setTitle($title);
1730 $mob->setDescription("");
1731 $mob->create();
1732
1733 $mob->createDirectory();
1734 $media_item = new ilMediaItem();
1735 $mob->addMediaItem($media_item);
1736 $media_item->setPurpose("Standard");
1737
1738 $mob_dir = ilObjMediaObject::_getRelativeDirectory($mob->getId());
1739 $file_name = ilObjMediaObject::fixFilename($title);
1740 $file = $mob_dir . "/" . $file_name;
1741
1743 $result,
1744 $mob_dir,
1745 Location::WEB,
1746 $file_name,
1747 true
1748 );
1749
1750 $mep_item = new ilMediaPoolItem();
1751 $mep_item->setTitle($title);
1752 $mep_item->setType("mob");
1753 $mep_item->setForeignId($mob->getId());
1754 $mep_item->create();
1755
1756 $tree = $this->object->getTree();
1757 $parent = $this->mep_item_id;
1758 $tree->insertNode($mep_item->getId(), $parent);
1759
1760 // get mime type
1762 $location = $file_name;
1763
1764 // set real meta and object data
1765 $media_item->setFormat($format);
1766 $media_item->setLocation($location);
1767 $media_item->setLocationType("LocalFile");
1768 $media_item->setUploadHash($this->mep_request->getUploadHash());
1769 $mob->update();
1770
1771 $item_ids[] = $mob->getId();
1772
1773 $mob = new ilObjMediaObject($mob->getId());
1774 $mob->generatePreviewPic(320, 240);
1775
1776 // duration
1777 $med_item = $mob->getMediaItem("Standard");
1778 $med_item->determineDuration();
1779 $med_item->update();
1780
1781 return new BasicHandlerResult(
1782 "mep_id",
1783 HandlerResult::STATUS_OK,
1784 $med_item->getId(),
1785 ''
1786 );
1787 }
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 1457 of file class.ilObjMediaPoolGUI.php.

1457 : void
1458 {
1459 $this->tabs->activateTab("info_short");
1460 $ilAccess = $this->access;
1461
1462 if (!$ilAccess->checkAccess("visible", "", $this->ref_id) &&
1463 !$ilAccess->checkAccess("read", "", $this->ref_id) &&
1464 !$ilAccess->checkAccess("write", "", $this->ref_id)) {
1465 throw new ilPermissionException($this->lng->txt("msg_no_perm_read"));
1466 }
1467
1468 if ($this->ctrl->getCmd() === "infoScreen") {
1469 $this->ctrl->setCmd("showSummary");
1470 $this->ctrl->setCmdClass("ilinfoscreengui");
1471 }
1472
1473 $info = new ilInfoScreenGUI($this);
1474
1475 $info->enablePrivateNotes();
1476
1477
1478 // standard meta data
1479 $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
1480
1481 // forward the command
1482 $this->ctrl->forwardCommand($info);
1483 }
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 1445 of file class.ilObjMediaPoolGUI.php.

1445 : void
1446 {
1447 $this->ctrl->setCmd("showSummary");
1448 $this->ctrl->setCmdClass("ilinfoscreengui");
1449 $this->infoScreen();
1450 }

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

477 : array
478 {
479 $forms = array(self::CFORM_NEW => $this->initCreateForm($new_type),
480 self::CFORM_IMPORT => $this->initImportForm($new_type));
481
482 return $forms;
483 }
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 494 of file class.ilObjMediaPoolGUI.php.

494 : void
495 {
496 $obj_service = $this->object_service;
497
498 // default width
499 $ni = new ilNumberInputGUI($this->lng->txt("mep_default_width"), "default_width");
500 $ni->setMinValue(0);
501 $ni->setSuffix("px");
502 $ni->setMaxLength(5);
503 $ni->setSize(5);
504 $a_form->addItem($ni);
505
506 // default height
507 $ni = new ilNumberInputGUI($this->lng->txt("mep_default_height"), "default_height");
508 $ni->setSuffix("px");
509 $ni->setMinValue(0);
510 $ni->setMaxLength(5);
511 $ni->setSize(5);
512 $ni->setInfo($this->lng->txt("mep_default_width_height_info"));
513 $a_form->addItem($ni);
514
515 // presentation
516 $pres = new ilFormSectionHeaderGUI();
517 $pres->setTitle($this->lng->txt('obj_presentation'));
518 $a_form->addItem($pres);
519
520 // tile image
521 $obj_service->commonSettings()->legacyForm($a_form, $this->object)->addTileImage();
522
523 // additional features
524 $feat = new ilFormSectionHeaderGUI();
525 $feat->setTitle($this->lng->txt('obj_features'));
526 $a_form->addItem($feat);
527
529 $this->object->getId(),
530 $a_form,
531 array(
533 )
534 );
535 }
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 1217 of file class.ilObjMediaPoolGUI.php.

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

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

980 : void
981 {
982 $this->checkPermission("write");
983
985 $not_inserted = array();
986 foreach ($ids as $id2) {
987 $id = explode(":", $id2);
988 $type = $id[0];
989 $id = $id[1];
990
991 if ($type === "mob") { // media object
992 if (ilObjMediaPool::isForeignIdInTree($this->object->getId(), $id)) {
993 $not_inserted[] = ilObject::_lookupTitle($id) . " [" .
994 $id . "]";
995 } else {
996 $item = new ilMediaPoolItem();
997 $item->setType("mob");
998 $item->setForeignId($id);
999 $item->setTitle(ilObject::_lookupTitle($id));
1000 $item->create();
1001 if ($item->getId() > 0) {
1002 $this->object->insertInTree($item->getId(), $this->mep_item_id);
1003 }
1004 }
1005 }
1006 if ($type === "incl") { // content snippet
1007 if (ilObjMediaPool::isItemIdInTree($this->object->getId(), $id)) {
1008 $not_inserted[] = ilMediaPoolPage::lookupTitle($id) . " [" .
1009 $id . "]";
1010 } else {
1011 $original = new ilMediaPoolPage($id);
1012
1013 // copy the page into the pool
1014 $item = new ilMediaPoolItem();
1015 $item->setType("pg");
1016 $item->setTitle(ilMediaPoolItem::lookupTitle($id));
1017 $item->create();
1018 if ($item->getId() > 0) {
1019 $this->object->insertInTree($item->getId(), $this->mep_item_id);
1020
1021 // create page
1022 $page = new ilMediaPoolPage();
1023 $page->setId($item->getId());
1024 $page->setParentId($this->object->getId());
1025 $page->create(false);
1026
1027 // copy content
1028 $original->copy($page->getId(), $page->getParentType(), $page->getParentId(), true);
1029 }
1030 }
1031 }
1032 }
1033 if (count($not_inserted) > 0) {
1034 $this->main_tpl->setOnScreenMessage('info', $this->lng->txt("mep_not_insert_already_exist") . "<br>" .
1035 implode("<br>", $not_inserted), true);
1036 }
1037 $this->ctrl->redirect($this, $this->mode);
1038 }
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 610 of file class.ilObjMediaPoolGUI.php.

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

1892 : void
1893 {
1894 ilSession::set("mep_move_ids", $this->mep_request->getItemIds());
1895 $this->main_tpl->setOnScreenMessage('info', $this->lng->txt("mep_move_select_insert"), true);
1896 $this->ctrl->redirect($this, "listMedia");
1897 }
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 967 of file class.ilObjMediaPoolGUI.php.

967 : void
968 {
969 $ilCtrl = $this->ctrl;
970
971 $this->checkPermission("write");
972
973 $ilCtrl->redirectByClass("ilEditClipboardGUI", "getObject");
974 }

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

+ Here is the call graph for this function:

◆ performBulkUpload()

ilObjMediaPoolGUI::performBulkUpload ( )

Save bulk upload form.

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

1792 : void
1793 {
1794 $this->checkPermission("write");
1795 $this->ctrl->setParameter($this, "mep_hash", $this->mep_request->getUploadHash());
1796 $this->ctrl->redirect($this, "editTitlesAndDescriptions");
1797 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ remove()

ilObjMediaPoolGUI::remove ( )

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

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

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

741 : void
742 {
743 $mtab = new ilMediaPoolTableGUI(
744 $this,
745 "allMedia",
746 $this->getMediaPool(),
747 "mepitem_id",
749 true
750 );
751 $mtab->resetFilter();
752 $mtab->resetOffset();
753 $this->allMedia();
754 }

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

456 : void
457 {
459
460 $type = ilMediaPoolItem::lookupType($this->mep_item_id);
461 if ($type !== "fold") {
462 $tree = $this->object->getTree();
463 $fold_id = $tree->getParentId($this->mep_item_id);
464 if ($fold_id > 0) {
465 $ctrl->setParameter($this, "mepitem_id", $fold_id);
466 $ctrl->redirect($this, "listMedia");
467 }
468 }
469 $this->listMedia();
470 }
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 1167 of file class.ilObjMediaPoolGUI.php.

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

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

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

1495 : void {
1496 $tpl = $this->tpl;
1497 $ilTabs = $this->tabs;
1498 $lng = $this->lng;
1499 $ilCtrl = $this->ctrl;
1500 $ilToolbar = $this->toolbar;
1501
1502
1503 if (!$a_files) {
1504 $a_files = $this->mep_request->getFiles();
1505 }
1506
1507 $ilTabs->clearTargets();
1508 $ilTabs->setBackTarget(
1509 $lng->txt("back"),
1510 $ilCtrl->getLinkTarget($this, "listMedia")
1511 );
1512
1513 $this->checkPermission("write");
1514
1515 if ($this->rbac_system->checkAccess("visible", SYSTEM_FOLDER_ID)) {
1516 $tb = new ilToolbarGUI();
1517 // action type
1518 $options = array(
1519 "rename" => $lng->txt("mep_up_dir_move"),
1520 "copy" => $lng->txt("mep_up_dir_copy"),
1521 );
1522 $si = new ilSelectInputGUI("", "action");
1523 $si->setOptions($options);
1524 $tb->addInputItem($si);
1525 $tb->setCloseFormTag(false);
1526 $tb->setFormAction($ilCtrl->getFormAction($this));
1527 $tb->setFormName("mep_up_form");
1528
1529 $tab = new ilUploadDirFilesTableGUI(
1530 $this,
1531 "selectUploadDirFiles",
1532 $a_files
1533 );
1534 $tab->setFormName("mep_up_form");
1535 $tpl->setContent($tb->getHTML() . $tab->getHTML());
1536 }
1537 }
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 1268 of file class.ilObjMediaPoolGUI.php.

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

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

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

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

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

907 : void
908 {
909 $this->showMedia();
910 }
showMedia()
show media object

References showMedia().

+ Here is the call graph for this function:

◆ showMedia()

ilObjMediaPoolGUI::showMedia ( )
protected

show media object

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

784 : void
785 {
786 $this->checkPermission("read");
787 $link_xml = "";
788 $pg_frame = "";
789
790 $item = new ilMediaPoolItem($this->mep_item_id);
791 $mob_id = $item->getForeignId();
792
793 $this->tpl = new ilGlobalTemplate("tpl.fullscreen.html", true, true, "Services/COPage");
794 $this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
795 $this->tpl->setVariable(
796 "LOCATION_CONTENT_STYLESHEET",
798 );
799
800
802 $media_obj = new ilObjMediaObject($mob_id);
803
804
805 $this->tpl->setVariable("TITLE", " - " . $media_obj->getTitle());
806
807 $xml = "<dummy>";
808 // todo: we get always the first alias now (problem if mob is used multiple
809 // times in page)
810 $xml .= $media_obj->getXML(IL_MODE_ALIAS);
811 $xml .= $media_obj->getXML(IL_MODE_OUTPUT);
812 $xml .= $link_xml;
813 $xml .= "</dummy>";
814
815 $xsl = file_get_contents("./Services/COPage/xsl/page.xsl");
816 $args = array( '/_xml' => $xml, '/_xsl' => $xsl );
817 $xh = xslt_create();
818
819 $wb_path = ilFileUtils::getWebspaceDir("output") . "/";
820
821 $mode = ($this->ctrl->getCmd() !== "showPreview")
822 ? "fullscreen"
823 : "media";
824 $enlarge_path = ilUtil::getImagePath("enlarge.svg", false, "output");
825 $fullscreen_link =
826 $this->ctrl->getLinkTarget($this, "showFullscreen", "", false, false);
827 $params = array('mode' => $mode, 'enlarge_path' => $enlarge_path,
828 'link_params' => "ref_id=" . $this->requested_ref_id,'fullscreen_link' => $fullscreen_link,
829 'enable_html_mob' => ilObjMediaObject::isTypeAllowed("html") ? "y" : "n",
830 'ref_id' => $this->requested_ref_id, 'pg_frame' => $pg_frame, 'webspace_path' => $wb_path);
831 $output = xslt_process($xh, "arg:/_xml", "arg:/_xsl", null, $args, $params);
832 xslt_free($xh);
833 // unmask user html
834 $this->tpl->setVariable("MEDIA_CONTENT", $output);
835 }
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 843 of file class.ilObjMediaPoolGUI.php.

843 : void
844 {
845 //$tpl = new \ilGlobalPageTemplate($DIC->globalScreen(), $DIC->ui(), $DIC->http());
846 $tpl = new ilGlobalTemplate("tpl.fullscreen.html", true, true, "Services/COPage");
847
851
852 // get page object
853 $page_gui = $this->getMediaPoolPageGUI($this->mep_item_id);
854 $page_gui->setTemplate($tpl);
855
856 $page_gui->setTemplateOutput(false);
857 $page_gui->setHeader("");
858 $ret = $page_gui->showPage(true);
859
860 //$tpl->setBodyClass("ilMediaPoolPagePreviewBody");
861 $tpl->setVariable("MEDIA_CONTENT", "<div>" . $ret . "</div>");
862
863
865 exit;
866 }
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 886 of file class.ilObjMediaPoolGUI.php.

886 : void
887 {
888 $this->checkPermission("read");
889
890 $item = new ilMediaPoolItem($this->mep_item_id);
891
892 switch ($item->getType()) {
893 case "mob":
894 $this->showMedia();
895 break;
896
897 case "pg":
898 $this->showPage();
899 break;
900 }
901 }

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

+ Here is the call graph for this function:

◆ toggleExplorerNodeState()

ilObjMediaPoolGUI::toggleExplorerNodeState ( )
protected

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

673 : void
674 {
675 $exp = new ilMediaPoolExplorerGUI($this, "listMedia", $this->getMediaPool());
676 $exp->toggleExplorerNodeState();
677 }
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 580 of file class.ilObjMediaPoolGUI.php.

580 : void
581 {
582 $obj_service = $this->object_service;
583
584 $ot = ilObjectTranslation::getInstance($this->getMediaPool()->getId());
585 if ($ot->getContentActivated()) {
586 $ot->setDefaultTitle($form->getInput('title'));
587 $ot->setDefaultDescription($form->getInput('desc'));
588 $ot->save();
589 }
590
591 $this->getMediaPool()->setDefaultWidth($form->getInput("default_width"));
592 $this->object->setDefaultHeight($form->getInput("default_height"));
593
594 // additional features
596 $this->object->getId(),
597 $form,
598 array(
600 )
601 );
602
603 // tile image
604 $obj_service->commonSettings()->legacyForm($form, $this->object)->saveTileImage();
605 }
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 1187 of file class.ilObjMediaPoolGUI.php.

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

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: