ILIAS  trunk Revision v11.0_alpha-1723-g8e69f309bab
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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 ()
 
 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...
 
 export ()
 
 performBulkUpload ()
 Save bulk upload form. More...
 
 initMediaBulkForm (int $a_id, string $a_title)
 Init media bulk form. More...
 
 finishSingleUpload (int $mob_id)
 
- Public Member Functions inherited from ilObject2GUI
 __construct (int $id=0, int $id_type=self::REPOSITORY_NODE_ID, int $parent_node_id=0)
 
 executeCommand ()
 execute command More...
 
 getIdType ()
 
 delete ()
 Display delete confirmation form (repository/workspace switch) More...
 
 confirmedDelete ()
 Delete objects (repository/workspace switch) More...
 
 getHTML ()
 
 withReferences ()
 Final/Private declaration of unchanged parent methods. More...
 
 setCreationMode (bool $mode=true)
 
 getCreationMode ()
 
 prepareOutput (bool $show_sub_objects=true)
 
 isVisible (int $ref_id, string $type)
 
 setColumnSettings (ilColumnGUI $column_gui)
 
 view ()
 view object content (repository/workspace switch) More...
 
 getType ()
 Functions that must be overwritten. More...
 
 create ()
 CRUD. More...
 
 save ()
 
 edit ()
 
 update ()
 
 cancel ()
 
 putObjectInTree (ilObject $obj, ?int $parent_node_id=null)
 Add object to tree at given position. More...
 
- Public Member Functions inherited from ilObjectGUI
 getRefId ()
 
 setAdminMode (string $mode)
 
 getAdminMode ()
 
 getObject ()
 
 executeCommand ()
 
 withReferences ()
 determines whether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode (bool $mode=true)
 If true, a creation screen is displayed the current [ref_id] does belong to the parent class The mode is determined in ilRepositoryGUI. More...
 
 getCreationMode ()
 
 prepareOutput (bool $show_sub_objects=true)
 
 getAdminTabs ()
 administration tabs show only permissions and trash folder More...
 
 getHTML ()
 
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled More...
 
 cancelObject ()
 cancel action and go back to previous page More...
 
 createObject ()
 create new object form More...
 
 editAvailabilityPeriodObject ()
 
 saveAvailabilityPeriodObject ()
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 
 getDidacticTemplateVar (string $type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $obj, ?int $parent_node_id=null)
 Add object to tree at given position. More...
 
 editObject ()
 
 addExternalEditFormCustom (ilPropertyFormGUI $form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction (string $cmd, string $default_form_action="")
 Get form action for command (command is method name without "Object", e.g. More...
 
 isVisible (int $ref_id, string $type)
 
 viewObject ()
 viewObject container presentation for "administration -> repository, trash, permissions" More...
 
 deleteObject (bool $error=false)
 Display deletion confirmation screen. More...
 
 setColumnSettings (ilColumnGUI $column_gui)
 
 addToDeskObject ()
 
 removeFromDeskObject ()
 
- Public Member Functions inherited from ILIAS\Object\ImplementsCreationCallback
 callCreationCallback (\ilObject $object, \ilObjectDefinition $obj_definition, int $requested_crtcb)
 

Static Public Member Functions

static _goto (string $a_target)
 
static getPreviewModalHTML (int $a_mpool_ref_id, ilGlobalTemplateInterface $a_tpl)
 Get preview modal html. More...
 
- Static Public Member Functions inherited from ilObject2GUI
static handleAfterSaveCallback (ilObject $obj, ?int $callback_ref_id)
 After creation callback. More...
 
- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot (bool $raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode (int $ref_id, string $cmd="")
 
static _gotoSharedWorkspaceNode (int $wsp_id)
 

Data Fields

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

Protected Member Functions

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

Protected Attributes

ILIAS MediaPool InternalDomainService $domain
 
ILIAS COPage Xsl XslManager $xsl
 
FormAdapterGUI $bulk_upload_form = null
 
InternalGUIService $gui
 
ilPropertyFormGUI $form
 
string $mode
 
int $mep_item_id = 0
 
StandardGUIRequest $mep_request
 
ilTabsGUI $tabs
 
ilHelpGUI $help
 
ilGlobalTemplateInterface $main_tpl
 
FileUpload $upload
 
ilLogger $mep_log
 
- Protected Attributes inherited from ilObject2GUI
ilObjectDefinition $obj_definition
 
ilGlobalTemplateInterface $tpl
 
ilCtrl $ctrl
 
ilLanguage $lng
 
ilTabsGUI $tabs_gui
 
ilFavouritesManager $favourites
 
ilErrorHandling $error
 
ilLocatorGUI $locator
 
ilObjUser $user
 
ilAccessHandler $access
 
ilToolbarGUI $toolbar
 
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 = []
 
 $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
 
Refinery $refinery
 
ilFavouritesManager $favourites
 
ilObjectCustomIconFactory $custom_icon_factory
 
UIFactory $ui_factory
 
UIRenderer $ui_renderer
 
Filesystem $temp_file_system
 
ilObject $object = null
 
bool $creation_mode = false
 
 $data
 
int $id
 
bool $call_by_reference = false
 
bool $prepare_output
 
int $ref_id
 
int $obj_id
 
int $maxcount
 
array $form_action = []
 
array $return_location = []
 
array $target_frame = []
 
string $tmp_import_dir
 
string $sub_objects = ""
 
bool $omit_locator = false
 
string $type = ""
 
string $admin_mode = self::ADMIN_MODE_NONE
 
int $requested_ref_id = 0
 
int $requested_crtptrefid = 0
 
int $requested_crtcb = 0
 
string $requested_new_type = ""
 
string $link_params
 
string $html = ""
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

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

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

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

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

Member Function Documentation

◆ _goto()

static ilObjMediaPoolGUI::_goto ( string  $a_target)
static

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

References ilObject2GUI\$ctrl, $DIC, ilObject2GUI\$lng, ilObjectGUI\$ref_id, ilObjectGUI\_gotoRepositoryRoot(), ilObject\_lookupObjId(), ilObject\_lookupTitle(), ilCtrl\redirectByClass(), ROOT_FOLDER_ID, ILIAS\UICore\GlobalTemplate\setOnScreenMessage(), ilCtrl\setParameterByClass(), and ilLanguage\txt().

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

◆ addLocatorItems()

ilObjMediaPoolGUI::addLocatorItems ( )
protected

add locator items for media pool

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

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

946  : void
947  {
948  $ilLocator = $this->locator;
949  $ilAccess = $this->access;
950  if (!$this->getCreationMode() && $this->ctrl->getCmd() !== "explorer") {
951  $tree = $this->object->getTree();
954  foreach ($path as $node) {
955  if ($node["child"] == $tree->getRootId()) {
956  $this->ctrl->setParameter($this, "mepitem_id", "");
957  $link = "";
958  if ($ilAccess->checkAccess("read", "", $this->object->getRefId())) {
959  $link = $this->ctrl->getLinkTarget($this, "listMedia");
960  } elseif ($ilAccess->checkAccess("visible", "", $this->object->getRefId())) {
961  $link = $this->ctrl->getLinkTarget($this, "infoScreen");
962  }
963  $title = $this->object->getTitle();
964  $this->ctrl->setParameter($this, "mepitem_id", $this->mep_item_id);
965  $ilLocator->addItem($title, $link, "", $this->requested_ref_id);
966  }
967  }
968  }
969  }
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:29
ilLocatorGUI $locator
ilAccessHandler $access
+ Here is the call graph for this function:

◆ addMobsToPool()

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

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

References ilObject2GUI\$ctrl, $mep_item_id, ilObjectGUI\$object, ilObjectGUI\$tree, ilObject2GUI\$user, ilObject\getId(), ilObject\getTitle(), ilTree\insertNode(), and ilCtrl\redirect().

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

1675  : void {
1676  $ctrl = $this->ctrl;
1677  $user = $this->user;
1678 
1679  $item_ids = [];
1680  foreach ($mob_ids as $mob_id) {
1681  $object = new ilObjMediaObject($mob_id);
1682  if (!is_null($object)) {
1683  $mep_item = new ilMediaPoolItem();
1684  $mep_item->setTitle($object->getTitle());
1685  $mep_item->setType("mob");
1686  $mep_item->setForeignId($object->getId());
1687  $mep_item->create();
1688 
1689  $parent = $this->mep_item_id;
1690  $tree = $this->object->getTree();
1691  $tree->insertNode($mep_item->getId(), $parent);
1692  }
1693  }
1694 
1695  if ($redirect) {
1696  $ctrl->redirect($this, "listMedia");
1697  }
1698  }
redirect(object $a_gui_obj, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
insertNode(int $a_node_id, int $a_parent_id, int $a_pos=self::POS_LAST_NODE, bool $a_reset_deletion_date=false)
insert new node with node_id under parent node with parent_id
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ afterConstructor()

ilObjMediaPoolGUI::afterConstructor ( )
protected
Exceptions
ilCtrlException

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

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

102  : void
103  {
104  $lng = $this->lng;
105  if ($this->mep_item_id == 0 && !$this->getCreationMode()) {
106  $tree = $this->object->getTree();
107  $this->mep_item_id = $tree->readRootId();
108  }
109 
110  $lng->loadLanguageModule("mep");
111 
112  if ($this->ctrl->getCmd() === "explorer") {
113  $this->ctrl->saveParameter($this, array("ref_id"));
114  } else {
115  $this->ctrl->saveParameter($this, array("ref_id", "mepitem_id"));
116  }
117  $this->ctrl->saveParameter($this, array("mep_mode"));
118 
119  $lng->loadLanguageModule("content");
120  }
loadLanguageModule(string $a_module)
Load language module.
+ Here is the call graph for this function:

◆ afterPoolInsert()

ilObjMediaPoolGUI::afterPoolInsert ( array  $mob_ids)
protected

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

References addMobsToPool().

Referenced by executeCommand().

1700  : void
1701  {
1702  $this->addMobsToPool($mob_ids, "", true, true);
1703  }
addMobsToPool(array $mob_ids, string $long_desc="", bool $redirect=true, bool $extract=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ afterSave()

ilObjMediaPoolGUI::afterSave ( ilObject  $new_object)
protected

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

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

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)
+ Here is the call graph for this function:

◆ afterUpload()

ilObjMediaPoolGUI::afterUpload (   $mob_ids)
protected

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

References addMobsToPool().

Referenced by executeCommand().

1660  : void
1661  {
1662  $this->addMobsToPool($mob_ids, "", false);
1663  }
addMobsToPool(array $mob_ids, string $long_desc="", bool $redirect=true, bool $extract=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ afterUrlSaving()

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

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

References addMobsToPool().

Referenced by executeCommand().

1665  : void
1666  {
1667  $this->addMobsToPool([$mob_id], $long_desc);
1668  }
addMobsToPool(array $mob_ids, string $long_desc="", bool $redirect=true, bool $extract=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ allMedia()

ilObjMediaPoolGUI::allMedia ( )

list all media objects

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

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

Referenced by applyFilter(), and resetFilter().

566  : void
567  {
568  $tpl = $this->tpl;
569  $ilTabs = $this->tabs;
570  $ilCtrl = $this->ctrl;
571  $ilUser = $this->user;
572 
573  $ilCtrl->setParameter($this, "mep_mode", "allMedia");
574 
575  $this->checkPermission("read");
576  $ilTabs->setTabActive("content");
577  $this->setContentSubTabs("mep_all_mobs");
578 
579  $mep_table_gui = new ilMediaPoolTableGUI(
580  $this,
581  "allMedia",
582  $this->getMediaPool(),
583  "mepitem_id",
585  true
586  );
587 
588  if ($this->mep_request->getForceFilter() > 0) {
589  $mep_table_gui->setTitleFilter(
590  ilMediaPoolItem::lookupTitle($this->mep_request->getForceFilter())
591  );
592 
593  // Read again
594  $mep_table_gui = new ilMediaPoolTableGUI(
595  $this,
596  "allMedia",
597  $this->getMediaPool(),
598  "mepitem_id",
600  true
601  );
602  }
603 
604  $tpl->setContent($mep_table_gui->getHTML());
605  }
setContent(string $a_html)
Sets content for standard template.
static lookupTitle(int $a_id)
ilGlobalTemplateInterface $tpl
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
setContentSubTabs(string $a_active)
Set sub tabs for content tab.
TableGUI class for recent changes in wiki.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ applyFilter()

ilObjMediaPoolGUI::applyFilter ( )

Apply filter.

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

References allMedia(), and ilMediaPoolTableGUI\IL_MEP_EDIT.

610  : void
611  {
612  $mtab = new ilMediaPoolTableGUI(
613  $this,
614  "allMedia",
615  $this->getMediaPool(),
616  "mepitem_id",
618  true
619  );
620  $mtab->writeFilterToSession();
621  $mtab->resetOffset();
622  $this->allMedia();
623  }
allMedia()
list all media objects
TableGUI class for recent changes in wiki.
+ Here is the call graph for this function:

◆ bulkUpload()

ilObjMediaPoolGUI::bulkUpload ( )
protected

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

References $main_tpl, ilObject2GUI\checkPermission(), getBulkUploadForm(), and ILIAS\UICore\GlobalTemplate\setContent().

1431  : void
1432  {
1433  $this->checkPermission("write");
1434 
1436 
1437  $form = $this->getBulkUploadForm();
1438  $main_tpl->setContent($form->render());
1439  }
setContent(string $a_html)
Sets content for standard template.
ilGlobalTemplateInterface $main_tpl
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
+ Here is the call graph for this function:

◆ cancelFolderUpdate()

ilObjMediaPoolGUI::cancelFolderUpdate ( )

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

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

1088  : void
1089  {
1090  $ilCtrl = $this->ctrl;
1091  $ilCtrl->setParameter(
1092  $this,
1093  "mepitem_id",
1094  $this->object->getTree()->getParentId($this->mep_item_id)
1095  );
1096  $ilCtrl->redirect($this, "listMedia");
1097  }
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
+ Here is the call graph for this function:

◆ cancelRemove()

ilObjMediaPoolGUI::cancelRemove ( )

cancel deletion of media objects/folders

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

References ILIAS\Repository\ctrl().

888  : void
889  {
890  $this->ctrl->redirect($this, $this->mode);
891  }
+ Here is the call graph for this function:

◆ cancelSave()

ilObjMediaPoolGUI::cancelSave ( )

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

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

1099  : void
1100  {
1101  $ilCtrl = $this->ctrl;
1102  $ilCtrl->redirect($this, "listMedia");
1103  }
redirect(object $a_gui_obj, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false)
+ Here is the call graph for this function:

◆ confirmRemove()

ilObjMediaPoolGUI::confirmRemove ( )

confirm remove of mobs

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

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().

793  : void
794  {
795  $ilCtrl = $this->ctrl;
796  $lng = $this->lng;
797 
798  $this->checkPermission("write");
799 
800  $ids = $this->mep_request->getItemIds();
801  if (count($ids) === 0) {
802  $this->main_tpl->setOnScreenMessage('failure', $this->lng->txt("no_checkbox"), true);
803  $ilCtrl->redirect($this, "");
804  }
805 
806  // display confirmation message
807  $cgui = new ilConfirmationGUI();
808  $cgui->setFormAction($this->ctrl->getFormAction($this));
809  $cgui->setHeaderText($this->lng->txt("info_remove_sure"));
810  $cgui->setCancel($this->lng->txt("cancel"), "cancelRemove");
811  $cgui->setConfirm($this->lng->txt("confirm"), "remove");
812 
813  foreach ($ids as $obj_id) {
815  $title = ilMediaPoolItem::lookupTitle($obj_id);
816 
817  // check whether page can be removed
818  $add = "";
819  if ($type === "pg") {
820  $usages = ilPageContentUsage::getUsages("incl", $obj_id, false);
821  if (count($usages) > 0) {
822  $this->main_tpl->setOnScreenMessage('failure', sprintf($lng->txt("mep_content_snippet_in_use"), $title), true);
823  $ilCtrl->redirect($this, "listMedia");
824  } else {
825  // check whether the snippet is used in older versions of pages
826  $usages = ilPageContentUsage::getUsages("incl", $obj_id, true);
827  if (count($usages) > 0) {
828  $add = "<div class='small'>" . $lng->txt("mep_content_snippet_used_in_older_versions") . "</div>";
829  }
830  }
831  }
832 
833  $caption =
834  " " . $title . $add;
835 
836  $cgui->addItem("id[]", $obj_id, $caption);
837  }
838 
839  $this->tpl->setContent($cgui->getHTML());
840  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static lookupTitle(int $a_id)
static getUsages(string $a_pc_type, int $a_pc_id, bool $a_incl_hist=true)
Get usages.
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
static lookupType(int $a_id)
+ Here is the call graph for this function:

◆ copyToClipboard()

ilObjMediaPoolGUI::copyToClipboard ( )

copy media objects to clipboard

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

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

910  : void
911  {
912  $ilUser = $this->user;
913 
914  $this->checkPermission("write");
915 
916  $ids = $this->mep_request->getItemIds();
917  if (count($ids) === 0) {
918  $this->main_tpl->setOnScreenMessage('failure', $this->lng->txt("no_checkbox"), true);
919  $this->ctrl->redirect($this, $this->mode);
920  }
921 
922  foreach ($ids as $obj_id) {
924  if ($type === "fold") {
925  $this->main_tpl->setOnScreenMessage('failure', $this->lng->txt("cont_cant_copy_folders"), true);
926  $this->ctrl->redirect($this, $this->mode);
927  }
928  }
929  foreach ($ids as $obj_id) {
930  $fid = ilMediaPoolItem::lookupForeignId($obj_id);
932  if ($type === "mob") {
933  $ilUser->addObjectToClipboard($fid, "mob", "");
934  }
935  if ($type === "pg") {
936  $ilUser->addObjectToClipboard($obj_id, "incl", "");
937  }
938  }
939  $this->main_tpl->setOnScreenMessage('success', $this->lng->txt("copied_to_clipboard"), true);
940  $this->ctrl->redirect($this, $this->mode);
941  }
static lookupForeignId(int $a_id)
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
static lookupType(int $a_id)
+ Here is the call graph for this function:

◆ createFolderForm()

ilObjMediaPoolGUI::createFolderForm ( )

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

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

975  : void
976  {
977  $tpl = $this->tpl;
978 
979  $this->checkPermission("write");
980 
981  $this->initFolderForm("create");
982  $tpl->setContent($this->form->getHTML());
983  }
setContent(string $a_html)
Sets content for standard template.
ilGlobalTemplateInterface $tpl
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
form( $class_path, string $cmd, string $submit_caption="")
initFolderForm(string $a_mode="edit")
+ Here is the call graph for this function:

◆ createMediaObject()

ilObjMediaPoolGUI::createMediaObject ( )

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

References ILIAS\Repository\ctrl().

480  : void
481  {
482  $this->ctrl->redirectByClass("ilobjmediaobjectgui", "create");
483  }
+ Here is the call graph for this function:

◆ edit()

ilObjMediaPoolGUI::edit ( )

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

References ILIAS\Repository\ctrl().

494  : void
495  {
496  $this->ctrl->redirectByClass(SettingsGUI::class);
497  }
+ Here is the call graph for this function:

◆ editFolder()

ilObjMediaPoolGUI::editFolder ( )

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

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

985  : void
986  {
987  $tpl = $this->tpl;
988 
989  $this->checkPermission("write");
990 
991  $this->initFolderForm();
992  $this->getFolderValues();
993  $tpl->setContent($this->form->getHTML());
994  }
getFolderValues()
Get current values for folder from.
setContent(string $a_html)
Sets content for standard template.
ilGlobalTemplateInterface $tpl
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
form( $class_path, string $cmd, string $submit_caption="")
initFolderForm(string $a_mode="edit")
+ Here is the call graph for this function:

◆ editTitlesAndDescriptions()

ilObjMediaPoolGUI::editTitlesAndDescriptions ( )
protected

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

References ilObject2GUI\$ctrl, ilObject2GUI\$html, ilObject2GUI\$lng, $main_tpl, ilAccordionGUI\ALL_CLOSED, ilObject2GUI\checkPermission(), ilCtrl\getFormAction(), ilPropertyFormGUI\getHTML(), ilMediaItem\getMediaItemsForUploadHash(), initMediaBulkForm(), ilCtrl\saveParameter(), ILIAS\UICore\GlobalTemplate\setContent(), and ilLanguage\txt().

1539  : void
1540  {
1541  $ctrl = $this->ctrl;
1542  $lng = $this->lng;
1543 
1544  $this->checkPermission("write");
1545  $ctrl->saveParameter($this, "mep_hash");
1546 
1548 
1550  $this->mep_request->getUploadHash()
1551  );
1552 
1553  $tb = new ilToolbarGUI();
1554  $tb->setFormAction($ctrl->getFormAction($this));
1555  $tb->addFormButton($lng->txt("save"), "saveTitlesAndDescriptions");
1556  $tb->setOpenFormTag(true);
1557  $tb->setCloseFormTag(false);
1558  $tb->setId("tb_top");
1559 
1560  $html = $tb->getHTML();
1561  foreach ($media_items as $mi) {
1562  $acc = new ilAccordionGUI();
1563  $acc->setBehaviour(ilAccordionGUI::ALL_CLOSED);
1564  $acc->setId("acc_" . $mi["mob_id"]);
1565 
1566  $mob = new ilObjMediaObject($mi["mob_id"]);
1567  $form = $this->initMediaBulkForm($mi["mob_id"], $mob->getTitle());
1568  $acc->addItem($mob->getTitle(), $form->getHTML());
1569 
1570  $html .= $acc->getHTML();
1571  }
1572 
1573  $html .= $tb->getHTML();
1574  $tb->setOpenFormTag(false);
1575  $tb->setCloseFormTag(true);
1576  $tb->setId("tb_bottom");
1577 
1579  }
getFormAction(object $a_gui_obj, ?string $a_fallback_cmd=null, ?string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
setContent(string $a_html)
Sets content for standard template.
ilGlobalTemplateInterface $main_tpl
static getMediaItemsForUploadHash(string $a_hash)
Get media items for upload hash.
initMediaBulkForm(int $a_id, string $a_title)
Init media bulk form.
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
saveParameter(object $a_gui_obj, $a_parameter)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ executeCommand()

ilObjMediaPoolGUI::executeCommand ( )
Exceptions
ilCtrlException
ilObjectException
ilPermissionException

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

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

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

◆ export()

ilObjMediaPoolGUI::export ( )

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

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

1415  : void
1416  {
1417  $ot = ilObjectTranslation::getInstance($this->object->getId());
1418  $opt = "";
1419  if ($ot->getContentActivated()) {
1420  $format = explode("_", $this->mep_request->getExportFormat());
1421  $opt = ilUtil::stripSlashes($format[1]);
1422  }
1423 
1424  $this->object->exportXML($opt);
1425  }
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
static getInstance(int $obj_id)
+ Here is the call graph for this function:

◆ finishSingleUpload()

ilObjMediaPoolGUI::finishSingleUpload ( int  $mob_id)

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

References ILIAS\Repository\ctrl().

Referenced by executeCommand().

1705  : void
1706  {
1707  $this->ctrl->redirect($this, "listMedia");
1708  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getBulkUploadForm()

ilObjMediaPoolGUI::getBulkUploadForm ( )
protected

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

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

Referenced by bulkUpload(), and executeCommand().

1441  : FormAdapterGUI
1442  {
1443  if (is_null($this->bulk_upload_form)) {
1444  $mep_hash = uniqid();
1445  $this->ctrl->setParameter($this, "mep_hash", $mep_hash);
1446  $this->bulk_upload_form = $this->gui
1447  ->form(self::class, 'performBulkUpload')
1448  ->section("props", $this->lng->txt('mep_bulk_upload'))
1449  ->file(
1450  "media_files",
1451  $this->lng->txt("mep_media_files"),
1452  \Closure::fromCallable([$this, 'handleUploadResult']),
1453  "mep_id",
1454  "",
1455  20
1456  );
1457  // ->meta()->text()->meta()->textarea()
1458  }
1459  return $this->bulk_upload_form;
1460  }
FormAdapterGUI $bulk_upload_form
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getFolderValues()

ilObjMediaPoolGUI::getFolderValues ( )

Get current values for folder from.

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

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

Referenced by editFolder().

999  : void
1000  {
1001  $values = array();
1002 
1003  $values["title"] = ilMediaPoolItem::lookupTitle($this->mep_item_id);
1004 
1005  $this->form->setValuesByArray($values);
1006  }
static lookupTitle(int $a_id)
form( $class_path, string $cmd, string $submit_caption="")
+ 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

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

Referenced by showPage().

753  {
754  $page_gui = new ilMediaPoolPageGUI($mep_item_id, $old_nr);
755  $page_gui->setPoolGUI($this);
756 
757  return $page_gui;
758  }
Class ilMediaPoolPage GUI class.
+ Here is the caller graph for this function:

◆ getParentFolderId()

ilObjMediaPoolGUI::getParentFolderId ( )

Get folder parent ID.

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

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

Referenced by executeCommand().

652  : ?int
653  {
654  if ($this->mep_item_id == 0) {
655  return null;
656  }
657  $par_id = $this->object->getPoolTree()->getParentId($this->mep_item_id);
658  if ($par_id != $this->object->getPoolTree()->getRootId()) {
659  return (int) $par_id;
660  }
661 
662  return null;
663  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ 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 1372 of file class.ilObjMediaPoolGUI.php.

References $DIC, ilObject2GUI\$html, ilObject2GUI\$lng, ilObjectGUI\$request, ilObject2GUI\$tpl, ILIAS\UICore\GlobalTemplate\addJavaScript(), ilObjMediaObjectGUI\includePresentationJS(), and ilLanguage\txt().

Referenced by ilMediaPoolTableGUI\getHTML().

1375  : string {
1376  global $DIC;
1377 
1378  $tpl = $DIC["tpl"];
1379  $ilCtrl = $DIC->ctrl();
1380  $lng = $DIC->language();
1381  $internal_gui = $DIC->mediaPool()
1382  ->internal()
1383  ->gui();
1384  $request = $internal_gui
1385  ->standardRequest();
1386 
1388 
1389  $tpl->addJavaScript("assets/js/ilMediaPool.js");
1390 
1391  $ilCtrl->setParameterByClass("ilobjmediapoolgui", "mepitem_id", "");
1392  $ilCtrl->setParameterByClass("ilobjmediapoolgui", "ref_id", $a_mpool_ref_id);
1393  $tpl->addOnloadCode("il.MediaPool.setPreviewUrl('" . $ilCtrl->getLinkTargetByClass(array("ilmediapoolpresentationgui", "ilobjmediapoolgui"), "showPreview", "", false, false) . "');");
1394  $ilCtrl->setParameterByClass("ilobjmediapoolgui", "mepitem_id", $request->getItemId());
1395  $ilCtrl->setParameterByClass(
1396  "ilobjmediapoolgui",
1397  "ref_id",
1398  $request->getRefId()
1399  );
1400 
1401  $modal = $internal_gui->ui()->factory()->modal()->roundtrip(
1402  $lng->txt("preview"),
1403  $internal_gui->ui()->factory()->legacy()->content("<iframe id='ilMepPreviewContent'></iframe>")
1404  );
1405  $html = $internal_gui->ui()->renderer()->render($modal);
1406  $html = str_replace(
1407  "<iframe id='ilMepPreviewContent'",
1408  "<iframe data-signal='" . $modal->getShowSignal()->getId() . "' id='ilMepPreviewContent'",
1409  $html
1410  );
1411 
1412  return $html;
1413  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static includePresentationJS(?ilGlobalTemplateInterface $a_tpl=null)
Include media object presentation JS.
ServerRequestInterface $request
global $DIC
Definition: shib_login.php:22
ilGlobalTemplateInterface $tpl
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.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTemplate()

ilObjMediaPoolGUI::getTemplate ( )

Get standard template.

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

Referenced by executeCommand().

643  : void
644  {
645  $this->tpl->loadStandardTemplate();
646  }
+ Here is the caller graph for this function:

◆ getType()

ilObjMediaPoolGUI::getType ( )
final

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

122  : string
123  {
124  return "mep";
125  }

◆ handleUploadResult()

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

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

References $location, $mep_item_id, ilObjectGUI\$tree, ilObjMediaObject\_getRelativeDirectory(), ilObjMediaObject\fixFilename(), ilObjMediaObject\getMediaItem(), ilObjMediaObject\getMimeType(), ILIAS\FileUpload\DTO\UploadResult\getName(), ilTree\insertNode(), and ILIAS\FileUpload\FileUpload\moveOneFileTo().

1465  : BasicHandlerResult {
1466  $title = $result->getName();
1467 
1468  $mob = new ilObjMediaObject();
1469  $mob->setTitle($title);
1470  $mob->setDescription("");
1471  $mob->create();
1472 
1473  $mob->createDirectory();
1474  $media_item = new ilMediaItem();
1475  $mob->addMediaItem($media_item);
1476  $media_item->setPurpose("Standard");
1477 
1478  $mob_dir = ilObjMediaObject::_getRelativeDirectory($mob->getId());
1479  $file_name = ilObjMediaObject::fixFilename($title);
1480  $file = $mob_dir . "/" . $file_name;
1481 
1482  $upload->moveOneFileTo(
1483  $result,
1484  $mob_dir,
1485  Location::WEB,
1486  $file_name,
1487  true
1488  );
1489 
1490  $mep_item = new ilMediaPoolItem();
1491  $mep_item->setTitle($title);
1492  $mep_item->setType("mob");
1493  $mep_item->setForeignId($mob->getId());
1494  $mep_item->create();
1495 
1496  $tree = $this->object->getTree();
1497  $parent = $this->mep_item_id;
1498  $tree->insertNode($mep_item->getId(), $parent);
1499 
1500  // get mime type
1501  $format = ilObjMediaObject::getMimeType($file);
1502  $location = $file_name;
1503 
1504  // set real meta and object data
1505  $media_item->setFormat($format);
1506  $media_item->setLocation($location);
1507  $media_item->setLocationType("LocalFile");
1508  $media_item->setUploadHash($this->mep_request->getUploadHash());
1509  $mob->update();
1510 
1511  $item_ids[] = $mob->getId();
1512 
1513  $mob = new ilObjMediaObject($mob->getId());
1514  $mob->generatePreviewPic(320, 240);
1515 
1516  // duration
1517  $med_item = $mob->getMediaItem("Standard");
1518  $med_item->determineDuration();
1519  $med_item->update();
1520 
1521  return new BasicHandlerResult(
1522  "mep_id",
1523  HandlerResult::STATUS_OK,
1524  $med_item->getId(),
1525  ''
1526  );
1527  }
static _getRelativeDirectory(int $a_mob_id)
Get relative (to webspace dir) directory.
$location
Definition: buildRTE.php:22
static getMimeType(string $a_file, bool $a_external=false)
get mime type for file
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...
getMediaItem(string $a_purpose)
get item for media purpose
Class ilMediaItem Media Item, component of a media object (file or reference)
static fixFilename(string $a_name)
Fix filename of uploaded file.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
insertNode(int $a_node_id, int $a_parent_id, int $a_pos=self::POS_LAST_NODE, bool $a_reset_deletion_date=false)
insert new node with node_id under parent node with parent_id
+ Here is the call graph for this function:

◆ infoScreen()

ilObjMediaPoolGUI::infoScreen ( )

show information screen

Exceptions
ilCtrlException
ilPermissionException

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

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

Referenced by executeCommand().

1288  : void
1289  {
1290  $this->tabs->activateTab("info_short");
1291  $ilAccess = $this->access;
1292 
1293  if (!$ilAccess->checkAccess("visible", "", $this->ref_id) &&
1294  !$ilAccess->checkAccess("read", "", $this->ref_id) &&
1295  !$ilAccess->checkAccess("write", "", $this->ref_id)) {
1296  throw new ilPermissionException($this->lng->txt("msg_no_perm_read"));
1297  }
1298 
1299  if ($this->ctrl->getCmd() === "infoScreen") {
1300  $this->ctrl->redirectByClass(ilInfoScreenGUI::class, "showSummary");
1301  }
1302 
1303  $info = new ilInfoScreenGUI($this);
1304 
1305  $info->enablePrivateNotes();
1306 
1307 
1308  // standard meta data
1309  $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
1310 
1311  // forward the command
1312  $this->ctrl->forwardCommand($info);
1313  }
ilAccessHandler $access
+ 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 1278 of file class.ilObjMediaPoolGUI.php.

References ILIAS\Repository\ctrl().

1278  : void
1279  {
1280  $this->ctrl->redirectByClass(ilInfoScreenGUI::class, "showSummary");
1281  }
+ 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 1061 of file class.ilObjMediaPoolGUI.php.

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

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

1061  : void
1062  {
1063  $lng = $this->lng;
1064  $ilCtrl = $this->ctrl;
1065 
1066  $this->form = new ilPropertyFormGUI();
1067 
1068  // desc
1069  $ti = new ilTextInputGUI($lng->txt("title"), "title");
1070  $ti->setMaxLength(128);
1071  $ti->setRequired(true);
1072  $this->form->addItem($ti);
1073 
1074  // save and cancel commands
1075  if ($a_mode === "create") {
1076  $this->form->addCommandButton("saveFolder", $lng->txt("save"));
1077  $this->form->addCommandButton("cancelSave", $lng->txt("cancel"));
1078  $this->form->setTitle($lng->txt("mep_new_folder"));
1079  } else {
1080  $this->form->addCommandButton("updateFolder", $lng->txt("save"));
1081  $this->form->addCommandButton("cancelFolderUpdate", $lng->txt("cancel"));
1082  $this->form->setTitle($lng->txt("mep_edit_folder"));
1083  }
1084 
1085  $this->form->setFormAction($ilCtrl->getFormAction($this));
1086  }
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...
form( $class_path, string $cmd, string $submit_caption="")
+ 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 1584 of file class.ilObjMediaPoolGUI.php.

References $form, ilObject2GUI\$lng, ilPropertyFormGUI\addItem(), ilFormGUI\setCloseTag(), ilFormGUI\setOpenTag(), and ilLanguage\txt().

Referenced by editTitlesAndDescriptions(), and saveTitlesAndDescriptions().

1587  : ilPropertyFormGUI {
1588  $lng = $this->lng;
1589 
1590  $form = new ilPropertyFormGUI();
1591  $form->setOpenTag(false);
1592  $form->setCloseTag(false);
1593 
1594  // title
1595  $ti = new ilTextInputGUI($lng->txt("title"), "title_" . $a_id);
1596  $ti->setValue($a_title);
1597  $form->addItem($ti);
1598 
1599  // description
1600  $ti = new ilTextAreaInputGUI($lng->txt("description"), "description_" . $a_id);
1601  $form->addItem($ti);
1602 
1603  return $form;
1604  }
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...
setCloseTag(bool $a_val)
setOpenTag(bool $a_open)
This class represents a text area property in a property form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ insertFromClipboard()

ilObjMediaPoolGUI::insertFromClipboard ( )

insert media object from clipboard

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

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

869  : void
870  {
871  $this->checkPermission("write");
872 
873  $this->domain->mediapool($this->object->getId())
874  ->copySelectedFromEditClipboard($this->mep_item_id);
875 
876  /*
877  if (count($not_inserted) > 0) {
878  $this->main_tpl->setOnScreenMessage('info', $this->lng->txt("mep_not_insert_already_exist") . "<br>" .
879  implode("<br>", $not_inserted), true);
880  }*/
881  $this->ctrl->redirect($this, $this->mode);
882  }
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
+ Here is the call graph for this function:

◆ listMedia()

ilObjMediaPoolGUI::listMedia ( )

list media objects

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

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

Referenced by returnFromItem().

503  : void
504  {
505  $ilAccess = $this->access;
506  $tpl = $this->tpl;
507  $ilTabs = $this->tabs;
508  $ilCtrl = $this->ctrl;
509  $ilToolbar = $this->toolbar;
510  $lng = $this->lng;
511 
512  $ilCtrl->setParameter($this, "mep_mode", "listMedia");
513 
514  $this->checkPermission("read");
515 
516  $ilTabs->setTabActive("content");
517  $this->setContentSubTabs("content");
518 
519  if ($ilAccess->checkAccess("write", "", $this->object->getRefId())) {
520  $ilToolbar->addButton(
521  $lng->txt("mep_create_mob"),
522  $ilCtrl->getLinkTargetByClass("ilMediaCreationGUI", "")
523  );
524 
525  $mset = new ilSetting("mobs");
526  if ($mset->get("mep_activate_pages")) {
527  $ilToolbar->addButton(
528  $lng->txt("mep_create_content_snippet"),
529  $ilCtrl->getLinkTargetByClass(["ilobjmediapoolgui", "ilmediapoolpagegui"], "createMediaPoolPage")
530  );
531  }
532 
533  $ilToolbar->addButton(
534  $lng->txt("mep_create_folder"),
535  $ilCtrl->getLinkTarget($this, "createFolderForm")
536  );
537 
538  $ilToolbar->addButton(
539  $lng->txt("mep_bulk_upload"),
540  $ilCtrl->getLinkTarget($this, "bulkUpload")
541  );
542 
543  $move_ids = ilSession::get("mep_move_ids");
544  if (is_array($move_ids) && count($move_ids) > 0) {
545  $ilToolbar->addSeparator();
546  $ilToolbar->addButton(
547  $lng->txt("paste"),
548  $ilCtrl->getLinkTarget($this, "paste")
549  );
550  }
551  }
552 
553  $mep_table_gui = new ilMediaPoolTableGUI($this, "listMedia", $this->getMediaPool(), "mepitem_id");
554  $tpl->setContent($mep_table_gui->getHTML());
555  }
static get(string $a_var)
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...
setContent(string $a_html)
Sets content for standard template.
ilToolbarGUI $toolbar
ilGlobalTemplateInterface $tpl
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
setContentSubTabs(string $a_active)
Set sub tabs for content tab.
TableGUI class for recent changes in wiki.
ilAccessHandler $access
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ move()

ilObjMediaPoolGUI::move ( )
protected

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

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

1632  : void
1633  {
1634  ilSession::set("mep_move_ids", $this->mep_request->getItemIds());
1635  $this->main_tpl->setOnScreenMessage('info', $this->lng->txt("mep_move_select_insert"), true);
1636  $this->ctrl->redirect($this, "listMedia");
1637  }
static set(string $a_var, $a_val)
Set a value.
+ Here is the call graph for this function:

◆ onMobUpdate()

ilObjMediaPoolGUI::onMobUpdate ( int  $mob_id)
protected

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

Referenced by executeCommand().

1710  : void
1711  {
1712  }
+ Here is the caller graph for this function:

◆ openClipboard()

ilObjMediaPoolGUI::openClipboard ( )

paste from clipboard

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

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

845  : void
846  {
847  $ilCtrl = $this->ctrl;
848 
849  $this->checkPermission("write");
850 
851  $ilCtrl->setParameterByClass(
852  "ileditclipboardgui",
853  "returnCommand",
854  rawurlencode($ilCtrl->getLinkTarget(
855  $this,
856  "insertFromClipboard",
857  "",
858  false,
859  false
860  ))
861  );
862  $ilCtrl->redirectByClass("ilEditClipboardGUI", "getObject");
863  }
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
+ Here is the call graph for this function:

◆ paste()

ilObjMediaPoolGUI::paste ( )
protected

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

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

1639  : void
1640  {
1641  $target_folder_id = $this->mep_request->getItemId();
1642  $target_tree = $this->domain->tree($this->object->getId());
1643  if (ilMediaPoolItem::lookupType($target_folder_id) !== "fold") {
1644  $target_folder_id = $target_tree->readRootId();
1645  }
1646 
1647  try {
1648  $this->domain->mediapool($this->object->getId())->pasteFromClipboard($target_folder_id);
1649  } catch (Exception $e) {
1650  $this->main_tpl->setOnScreenMessage(
1651  'failure',
1652  $this->lng->txt("mep_target_in_source_not_allowed") . " " . $e->getMessage(),
1653  true
1654  );
1655  }
1656 
1657  $this->ctrl->redirect($this, "listMedia");
1658  }
static lookupType(int $a_id)
+ Here is the call graph for this function:

◆ performBulkUpload()

ilObjMediaPoolGUI::performBulkUpload ( )

Save bulk upload form.

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

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

1532  : void
1533  {
1534  $this->checkPermission("write");
1535  $this->ctrl->setParameter($this, "mep_hash", $this->mep_request->getUploadHash());
1536  $this->ctrl->redirect($this, "editTitlesAndDescriptions");
1537  }
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
+ Here is the call graph for this function:

◆ remove()

ilObjMediaPoolGUI::remove ( )

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

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

893  : void
894  {
895  $this->checkPermission("write");
896 
897  $ids = $this->mep_request->getItemIds();
898  foreach ($ids as $obj_id) {
899  $this->object->deleteChild($obj_id);
900  }
901 
902  $this->main_tpl->setOnScreenMessage('success', $this->lng->txt("cont_obj_removed"), true);
903  $this->ctrl->redirect($this, $this->mode);
904  }
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
+ Here is the call graph for this function:

◆ resetFilter()

ilObjMediaPoolGUI::resetFilter ( )

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

References allMedia(), and ilMediaPoolTableGUI\IL_MEP_EDIT.

625  : void
626  {
627  $mtab = new ilMediaPoolTableGUI(
628  $this,
629  "allMedia",
630  $this->getMediaPool(),
631  "mepitem_id",
633  true
634  );
635  $mtab->resetFilter();
636  $mtab->resetOffset();
637  $this->allMedia();
638  }
allMedia()
list all media objects
TableGUI class for recent changes in wiki.
+ Here is the call graph for this function:

◆ returnFromItem()

ilObjMediaPoolGUI::returnFromItem ( )
protected

Return from item editing.

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

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

464  : void
465  {
466  $ctrl = $this->ctrl;
467 
468  $type = ilMediaPoolItem::lookupType($this->mep_item_id);
469  if ($type !== "fold") {
470  $tree = $this->object->getTree();
471  $fold_id = $tree->getParentId($this->mep_item_id);
472  if ($fold_id > 0) {
473  $ctrl->setParameter($this, "mepitem_id", $fold_id);
474  $ctrl->redirect($this, "listMedia");
475  }
476  }
477  $this->listMedia();
478  }
redirect(object $a_gui_obj, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false)
listMedia()
list media objects
getParentId(int $a_node_id)
get parent id of given node
static lookupType(int $a_id)
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
+ Here is the call graph for this function:

◆ saveFolder()

ilObjMediaPoolGUI::saveFolder ( )

Save folder form.

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

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

1011  : void
1012  {
1013  $tpl = $this->tpl;
1014  $lng = $this->lng;
1015  $ilCtrl = $this->ctrl;
1016 
1017  $this->checkPermission("write");
1018 
1019  $this->initFolderForm("create");
1020  if ($this->form->checkInput()) {
1021  if ($this->object->createFolder($this->form->getInput("title"), $this->mep_item_id)) {
1022  $this->main_tpl->setOnScreenMessage('success', $lng->txt("mep_folder_created"), true);
1023  }
1024  $ilCtrl->redirect($this, "listMedia");
1025  }
1026 
1027  $this->form->setValuesByPost();
1028  $tpl->setContent($this->form->getHTML());
1029  }
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...
setContent(string $a_html)
Sets content for standard template.
ilGlobalTemplateInterface $tpl
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
form( $class_path, string $cmd, string $submit_caption="")
initFolderForm(string $a_mode="edit")
+ Here is the call graph for this function:

◆ saveTitlesAndDescriptions()

ilObjMediaPoolGUI::saveTitlesAndDescriptions ( )
protected

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

References ilObject2GUI\$ctrl, ilObject2GUI\$lng, ilPropertyFormGUI\checkInput(), ilObject2GUI\checkPermission(), ilPropertyFormGUI\getInput(), ilMediaItem\getMediaItemsForUploadHash(), initMediaBulkForm(), ilCtrl\redirect(), and ilLanguage\txt().

1606  : void
1607  {
1608  $lng = $this->lng;
1609  $ctrl = $this->ctrl;
1610 
1611  $this->checkPermission("write");
1613  $this->mep_request->getUploadHash()
1614  );
1615 
1616  foreach ($media_items as $mi) {
1617  $mob = new ilObjMediaObject($mi["mob_id"]);
1618  $form = $this->initMediaBulkForm($mi["mob_id"], $mob->getTitle());
1619  $form->checkInput();
1620  $title = $form->getInput("title_" . $mi["mob_id"]);
1621  $desc = $form->getInput("description_" . $mi["mob_id"]);
1622  if (trim($title) !== "") {
1623  $mob->setTitle($title);
1624  }
1625  $mob->setDescription($desc);
1626  $mob->update();
1627  }
1628  $this->main_tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
1629  $ctrl->redirect($this, "listMedia");
1630  }
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...
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-...
redirect(object $a_gui_obj, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false)
static getMediaItemsForUploadHash(string $a_hash)
Get media items for upload hash.
initMediaBulkForm(int $a_id, string $a_title)
Init media bulk form.
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
+ Here is the call graph for this function:

◆ selectUploadDirFiles()

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

Select files from upload directory.

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

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

1325  : void {
1326  $tpl = $this->tpl;
1327  $ilTabs = $this->tabs;
1328  $lng = $this->lng;
1329  $ilCtrl = $this->ctrl;
1330  $ilToolbar = $this->toolbar;
1331 
1332 
1333  if (!$a_files) {
1334  $a_files = $this->mep_request->getFiles();
1335  }
1336 
1337  $ilTabs->clearTargets();
1338  $ilTabs->setBackTarget(
1339  $lng->txt("back"),
1340  $ilCtrl->getLinkTarget($this, "listMedia")
1341  );
1342 
1343  $this->checkPermission("write");
1344 
1345  if ($this->rbac_system->checkAccess("visible", SYSTEM_FOLDER_ID)) {
1346  $tb = new ilToolbarGUI();
1347  // action type
1348  $options = array(
1349  "rename" => $lng->txt("mep_up_dir_move"),
1350  "copy" => $lng->txt("mep_up_dir_copy"),
1351  );
1352  $si = new ilSelectInputGUI("", "action");
1353  $si->setOptions($options);
1354  $tb->addInputItem($si);
1355  $tb->setCloseFormTag(false);
1356  $tb->setFormAction($ilCtrl->getFormAction($this));
1357  $tb->setFormName("mep_up_form");
1358 
1359  $tab = new ilUploadDirFilesTableGUI(
1360  $this,
1361  "selectUploadDirFiles",
1362  $a_files
1363  );
1364  $tab->setFormName("mep_up_form");
1365  $tpl->setContent($tb->getHTML() . $tab->getHTML());
1366  }
1367  }
This class represents a selection list property in a property form.
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
setContent(string $a_html)
Sets content for standard template.
const SYSTEM_FOLDER_ID
Definition: constants.php:35
ilToolbarGUI $toolbar
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilGlobalTemplateInterface $tpl
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
+ Here is the call graph for this function:

◆ setContentSubTabs()

ilObjMediaPoolGUI::setContentSubTabs ( string  $a_active)

Set sub tabs for content tab.

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

References ilObject2GUI\$access, ilObject2GUI\$ctrl, $tabs, ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and ilCtrl\setParameter().

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

1114  : void {
1115  $ilAccess = $this->access;
1116  $ilTabs = $this->tabs;
1117  $ilCtrl = $this->ctrl;
1118 
1119  $ilTabs->addSubTab("content", $this->lng->txt("objs_fold"), $this->ctrl->getLinkTarget($this, ""));
1120 
1121  $ilCtrl->setParameter($this, "mepitem_id", "");
1122  $ilTabs->addSubTab("mep_all_mobs", $this->lng->txt("mep_all_mobs"), $this->ctrl->getLinkTarget($this, "allMedia"));
1123  $ilCtrl->setParameter($this, "mepitem_id", $this->mep_item_id);
1124 
1125  if ($ilAccess->checkAccess('write', '', $this->ref_id)) {
1126  $ilTabs->addSubTab(
1127  "srt_files",
1128  $this->lng->txt("mep_media_subtitles"),
1129  $ilCtrl->getLinkTargetByClass("ilmobmultisrtuploadgui", "")
1130  );
1131  }
1132 
1133  $ilTabs->activateSubTab($a_active);
1134  }
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
ilAccessHandler $access
+ 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 1215 of file class.ilObjMediaPoolGUI.php.

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

Referenced by executeCommand().

1217  : void {
1218  $ilTabs = $this->tabs;
1219  $lng = $this->lng;
1220  $ilAccess = $this->access;
1221 
1222  if ($ilAccess->checkAccess("write", "", $this->object->getRefId())) {
1223  $ilTabs->addSubTab(
1224  "settings",
1225  $lng->txt("settings"),
1226  $this->ctrl->getLinkTarget($this, "edit")
1227  );
1228 
1229  $mset = new ilSetting("mobs");
1230  if ($mset->get("mep_activate_pages")) {
1231  $ilTabs->addSubTabTarget(
1232  "obj_multilinguality",
1233  $this->ctrl->getLinkTargetByClass("ilobjecttranslationgui", "")
1234  );
1235  }
1236  }
1237 
1238  $ilTabs->setSubTabActive($a_active);
1239  }
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...
ilAccessHandler $access
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setTabs()

ilObjMediaPoolGUI::setTabs ( )
protected

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

References ilObject2GUI\$access, $help, $tabs, ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and ilHelpGUI\setScreenIdComponent().

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

◆ showFullscreen()

ilObjMediaPoolGUI::showFullscreen ( )

show media fullscreen

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

References showMedia().

785  : void
786  {
787  $this->showMedia();
788  }
showMedia()
show media object
+ Here is the call graph for this function:

◆ showMedia()

ilObjMediaPoolGUI::showMedia ( )
protected

show media object

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

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

Referenced by showFullscreen(), and showPreview().

668  : void
669  {
670  $this->checkPermission("read");
671  $link_xml = "";
672  $pg_frame = "";
673 
674  $item = new ilMediaPoolItem($this->mep_item_id);
675  $mob_id = $item->getForeignId();
676 
677  $this->tpl = new ilGlobalTemplate("tpl.fullscreen.html", true, true, "components/ILIAS/COPage");
678  $this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
679  $this->tpl->setVariable(
680  "LOCATION_CONTENT_STYLESHEET",
682  );
683 
684 
686  $media_obj = new ilObjMediaObject($mob_id);
687 
688 
689  $this->tpl->setVariable("TITLE", " - " . $media_obj->getTitle());
690 
691  $xml = "<dummy>";
692  // todo: we get always the first alias now (problem if mob is used multiple
693  // times in page)
694  $xml .= $media_obj->getXML(IL_MODE_ALIAS);
695  $xml .= $media_obj->getXML(IL_MODE_OUTPUT);
696  $xml .= $link_xml;
697  $xml .= "</dummy>";
698  $wb_path = ilFileUtils::getWebspaceDir("output") . "/";
699 
700  $mode = ($this->ctrl->getCmd() !== "showPreview")
701  ? "fullscreen"
702  : "media";
703  $enlarge_path = ilUtil::getImagePath("media/enlarge.svg", false, "output");
704  $fullscreen_link =
705  $this->ctrl->getLinkTarget($this, "showFullscreen", "", false, false);
706  $params = array('mode' => $mode, 'enlarge_path' => $enlarge_path,
707  'link_params' => "ref_id=" . $this->requested_ref_id,'fullscreen_link' => $fullscreen_link,
708  'enable_html_mob' => ilObjMediaObject::isTypeAllowed("html") ? "y" : "n",
709  'ref_id' => $this->requested_ref_id, 'pg_frame' => $pg_frame, 'webspace_path' => $wb_path);
710  $output = $this->xsl->process($xml, $params);
711 
712  // unmask user html
713  $this->tpl->setVariable("MEDIA_CONTENT", $output);
714  }
static getWebspaceDir(string $mode="filesystem")
get webspace directory
static getStyleSheetLocation(string $mode="output", string $a_css_name="")
get full style sheet file name (path inclusive) of current user
special template class to simplify handling of ITX/PEAR
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
Definition: ltiregstart.php:31
static includePresentationJS(?ilGlobalTemplateInterface $a_tpl=null)
Include media object presentation JS.
static isTypeAllowed(string $a_type)
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
const IL_MODE_ALIAS
static getContentStylePath(int $a_style_id, bool $add_random=true, bool $add_token=true)
get content style path static (to avoid full reading)
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const IL_MODE_OUTPUT
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showPage()

ilObjMediaPoolGUI::showPage ( )

Show page.

Parameters

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

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

Referenced by showPreview().

722  : void
723  {
724  //$tpl = new \ilGlobalPageTemplate($DIC->globalScreen(), $DIC->ui(), $DIC->http());
725  $tpl = new ilGlobalTemplate("tpl.fullscreen.html", true, true, "components/ILIAS/COPage");
726 
730 
731  // get page object
732  $page_gui = $this->getMediaPoolPageGUI($this->mep_item_id);
733  $page_gui->setTemplate($tpl);
734 
735  $page_gui->setTemplateOutput(false);
736  $page_gui->setHeader("");
737  $ret = $page_gui->showPage(true);
738 
739  //$tpl->setBodyClass("ilMediaPoolPagePreviewBody");
740  $tpl->setVariable("MEDIA_CONTENT", "<div>" . $ret . "</div>");
741 
742 
743  $tpl->printToStdout();
744  exit;
745  }
static getStyleSheetLocation(string $mode="output", string $a_css_name="")
get full style sheet file name (path inclusive) of current user
special template class to simplify handling of ITX/PEAR
setVariable(string $variable, $value='')
Sets the given variable to the given value.
ilGlobalTemplateInterface $tpl
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)
static getContentStylePath(int $a_style_id, bool $add_random=true, bool $add_token=true)
get content style path static (to avoid full reading)
addCss(string $a_css_file, string $media="screen")
Add a css file that should be included in the header.
exit
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showPreview()

ilObjMediaPoolGUI::showPreview ( )

Show content snippet.

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

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

764  : void
765  {
766  $this->checkPermission("read");
767 
768  $item = new ilMediaPoolItem($this->mep_item_id);
769 
770  switch ($item->getType()) {
771  case "mob":
772  $this->showMedia();
773  break;
774 
775  case "pg":
776  $this->showPage();
777  break;
778  }
779  }
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
showMedia()
show media object
+ Here is the call graph for this function:

◆ toggleExplorerNodeState()

ilObjMediaPoolGUI::toggleExplorerNodeState ( )
protected

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

557  : void
558  {
559  $exp = new ilMediaPoolExplorerGUI($this, "listMedia", $this->getMediaPool());
560  $exp->toggleExplorerNodeState();
561  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ updateFolder()

ilObjMediaPoolGUI::updateFolder ( )

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

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

1031  : void
1032  {
1033  $lng = $this->lng;
1034  $ilCtrl = $this->ctrl;
1035  $tpl = $this->tpl;
1036 
1037  $this->checkPermission("write");
1038 
1039  $this->initFolderForm("edit");
1040  if ($this->form->checkInput()) {
1041  $item = new ilMediaPoolItem($this->mep_item_id);
1042  $item->setTitle($this->form->getInput("title"));
1043  $item->update();
1044  $this->main_tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
1045  $ilCtrl->setParameter(
1046  $this,
1047  "mepitem_id",
1048  $this->object->getTree()->getParentId($this->mep_item_id)
1049  );
1050  $ilCtrl->redirect($this, "listMedia");
1051  }
1052 
1053  $this->form->setValuesByPost();
1054  $tpl->setContent($this->form->getHTML());
1055  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
setContent(string $a_html)
Sets content for standard template.
ilGlobalTemplateInterface $tpl
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
form( $class_path, string $cmd, string $submit_caption="")
initFolderForm(string $a_mode="edit")
+ Here is the call graph for this function:

Field Documentation

◆ $bulk_upload_form

FormAdapterGUI ilObjMediaPoolGUI::$bulk_upload_form = null
protected

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

Referenced by getBulkUploadForm().

◆ $domain

ILIAS MediaPool InternalDomainService ilObjMediaPoolGUI::$domain
protected

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

◆ $form

ilPropertyFormGUI ilObjMediaPoolGUI::$form
protected

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

Referenced by initMediaBulkForm().

◆ $gui

InternalGUIService ilObjMediaPoolGUI::$gui
protected

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

◆ $help

ilHelpGUI ilObjMediaPoolGUI::$help
protected

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

Referenced by setTabs().

◆ $main_tpl

ilGlobalTemplateInterface ilObjMediaPoolGUI::$main_tpl
protected

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

Referenced by bulkUpload(), and editTitlesAndDescriptions().

◆ $mep_item_id

int ilObjMediaPoolGUI::$mep_item_id = 0
protected

◆ $mep_log

ilLogger ilObjMediaPoolGUI::$mep_log
protected

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

◆ $mep_request

StandardGUIRequest ilObjMediaPoolGUI::$mep_request
protected

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

◆ $mode

string ilObjMediaPoolGUI::$mode
protected

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

◆ $output_prepared

bool ilObjMediaPoolGUI::$output_prepared

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

◆ $tabs

ilTabsGUI ilObjMediaPoolGUI::$tabs
protected

◆ $upload

FileUpload ilObjMediaPoolGUI::$upload
protected

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

◆ $xsl

ILIAS COPage Xsl XslManager ilObjMediaPoolGUI::$xsl
protected

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


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