ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilObjMediaPoolGUI Class Reference

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

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

Public Member Functions

 __construct ($a_id=0, $a_id_type=self::REPOSITORY_NODE_ID, $a_parent_node_id=0)
 Constructor. More...
 
 getType ()
 Get type. More...
 
 executeCommand ()
 execute command More...
 
 createMediaObject ()
 obsolete? More...
 
 afterSave (ilObject $newObj)
 save object More...
 
 edit ()
 edit object More...
 
 listMedia ()
 list media objects More...
 
 allMedia ()
 list all objects More...
 
 applyFilter ()
 Apply filter. More...
 
 resetFilter ()
 Reset filter. More...
 
 getTemplate ()
 Get standard template. More...
 
 getParentFolderId ()
 Get folder parent ID. More...
 
 showPage ()
 Show page. More...
 
 showPreview ()
 Show content snippet. More...
 
 showFullscreen ()
 show 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 ()
 confirm deletion of More...
 
 copyToClipboard ()
 copy media objects to clipboard More...
 
 addLocatorItems ()
 add locator items for media pool More...
 
 createFolderForm ()
 create folder form More...
 
 editFolder ()
 Edit folder. More...
 
 getFolderValues ()
 Get current values for folder from. More...
 
 saveFolder ()
 Save folder form. More...
 
 updateFolder ()
 Update folder. More...
 
 initFolderForm ($a_mode="edit")
 Init folder form. More...
 
 cancelFolderUpdate ()
 Cancel save. More...
 
 cancelSave ()
 Cancel save. More...
 
 createMediaPoolPage ()
 Create new content snippet. More...
 
 editMediaPoolPage ()
 Edit media pool page. More...
 
 saveMediaPoolPage ()
 Save media pool page. More...
 
 updateMediaPoolPage ()
 Update media pool page. More...
 
 initMediaPoolPageForm ($a_mode="edit")
 Init page form. More...
 
 getMediaPoolPageValues ()
 Get current values for media pool page from. More...
 
 setMediaPoolPageTabs ()
 Set media pool page tabs. More...
 
 showAllMediaPoolPageUsages ()
 List usages of the contnet snippet. More...
 
 showMediaPoolPageUsages ($a_all=false)
 List usages of the contnet snippet. More...
 
 setContentSubTabs ($a_active)
 Set sub tabs for content tab. More...
 
 setTabs ()
 Set tabs. More...
 
 setSettingsSubTabs ($a_active)
 Set setting sub tabs. More...
 
 infoScreenObject ()
 this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually, if everything works through ilCtrl in the future this may be changed More...
 
 infoScreen ()
 show information screen More...
 
 selectUploadDirFiles ($a_files=null)
 Select files from upload directory. More...
 
 createMediaFromUploadDir ()
 Create media object from upload directory. More...
 
 export ()
 export content object More...
 
 initBulkUploadForm ()
 Init bulk upload form. More...
 
 performBulkUpload ()
 Save bulk upload form. More...
 
 initMediaBulkForm ($a_id, $a_title)
 Init media bulk form. More...
 
- Public Member Functions inherited from ilObject2GUI
 __construct ($a_id=0, $a_id_type=self::REPOSITORY_NODE_ID, $a_parent_node_id=0)
 Constructor. More...
 
 executeCommand ()
 execute command More...
 
 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 ($a_mode=true)
 if true, a creation screen is displayed the current $_GET[ref_id] don't belong to the current class! the mode is determined in ilrepositorygui More...
 
 getCreationMode ()
 get creation mode More...
 
 prepareOutput ($a_show_subobjects=true)
 prepare output More...
 
 isVisible ($a_ref_id, $a_type)
 
 trash ()
 
 undelete ()
 
 cancelDelete ()
 
 removeFromSystem ()
 
 cloneAll ()
 
 view ()
 view object content (repository/workspace switch) More...
 
 getType ()
 Functions that must be overwritten. More...
 
 create ()
 Deleted in ilObject. More...
 
 save ()
 
 edit ()
 
 update ()
 
 cancel ()
 
 importFile ()
 Import. More...
 
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position. More...
 
- Public Member Functions inherited from ilObjectGUI
 executeCommand ()
 execute command More...
 
 withReferences ()
 determines wether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode ($a_mode=true)
 if true, a creation screen is displayed the current $_GET[ref_id] don't belong to the current class! the mode is determined in ilrepositorygui More...
 
 getCreationMode ()
 get creation mode More...
 
 prepareOutput ($a_show_subobjects=true)
 prepare output More...
 
 getAdminTabs ()
 administration tabs show only permissions and trash folder More...
 
 getHTML ()
 
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled More...
 
 cancelDeleteObject ()
 cancel deletion of object More...
 
 cancelObject ()
 cancel action and go back to previous page @access public More...
 
 createObject ()
 create new object form More...
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 save object More...
 
 getDidacticTemplateVar ($a_type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position. More...
 
 editObject ()
 edit object More...
 
 addExternalEditFormCustom (ilPropertyFormGUI $a_form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction ($a_cmd, $a_formaction="")
 get form action for command (command is method name without "Object", e.g. More...
 
 isVisible ($a_ref_id, $a_type)
 
 viewObject ()
 viewObject container presentation for "administration -> repository, trash, permissions" More...
 
 deleteObject ($a_error=false)
 Display deletion confirmation screen. More...
 
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI. More...
 
 redirectAfterCreation ()
 Redirect after creation, see https://docu.ilias.de/goto_docu_wiki_wpage_5035_1357.html. More...
 
 addToDeskObject ()
 @inheritDoc More...
 
 removeFromDeskObject ()
 @inheritDoc More...
 

Static Public Member Functions

static _goto ($a_target)
 goto target media pool More...
 
static getPreviewModalHTML ($a_mpool_ref_id, $a_tpl)
 Get preview modal html. More...
 
- Static Public Member Functions inherited from ilObject2GUI
static handleAfterSaveCallback (ilObject $a_obj, $a_callback_ref_id)
 After creation callback. More...
 
- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot ($a_raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode ($a_ref_id, $a_cmd="frameset")
 Goto repository root. More...
 

Data Fields

 $output_prepared
 
- Data Fields inherited from ilObject2GUI
 $tree
 
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 COPY_WIZARD_NEEDS_PAGE = 1
 
 $objDefinition
 
 $tpl
 
 $tree
 
 $lng
 
 $data
 
 $object
 
 $ref_id
 
 $obj_id
 
 $maxcount
 
 $formaction
 
 $return_location
 
 $target_frame
 
 $tab_target_script
 
 $actions
 
 $sub_objects
 
 $omit_locator = false
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 

Protected Member Functions

 afterConstructor ()
 Initialisation. More...
 
 initCreationForms ($a_new_type)
 Init creation froms. More...
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 updateCustom (ilPropertyFormGUI $a_form)
 Insert custom update form values into object. More...
 
 toggleExplorerNodeState ()
 Toggle explorer node. More...
 
 showMedia ()
 show media object More...
 
 bulkUpload ()
 Bulk upload. More...
 
 editTitlesAndDescriptions ()
 Edit titles and descriptions. More...
 
 saveTitlesAndDescriptions ()
 Save titles and descriptions. More...
 
- 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 ()
 Get access handler. More...
 
 setLocator ()
 set Locator More...
 
 deleteConfirmedObjects ()
 Delete objects (workspace specific) More...
 
 setTitleAndDescription ()
 called by prepare output More...
 
 showUpperIcon ()
 
 omitLocator ($a_omit=true)
 
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame ($a_cmd, $a_target_frame)
 set specific target frame for command More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 setColumnSettings (ilColumnGUI $column_gui)
 May be overwritten in subclasses. More...
 
 checkPermission ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission and redirect on error. More...
 
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu) More...
 
 redirectToRefId ($a_ref_id, $a_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 $_GET["ref_id"] value More...
 
 fillCloneTemplate ($a_tpl_varname, $a_type)
 Fill object clone template This method can be called from any object GUI class that wants to offer object cloning. More...
 
 fillCloneSearchTemplate ($a_tpl_varname, $a_type)
 
 searchCloneSource ()
 
 buildCloneSelect ($existing_objs)
 
 addAdminLocatorItems ($a_do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 setTabs ()
 create tabs (repository/workspace switch) More...
 
 getReturnLocation ($a_cmd, $a_location="")
 Deprecated functions. More...
 
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command More...
 
 showActions ()
 
 getTabs ()
 get tabs abstract method. More...
 
 __showButton ($a_cmd, $a_text, $a_target='')
 
 hitsperpageObject ()
 
__initTableGUI ()
 
 __setTableGUIBasicData (&$tbl, &$result_set, $a_from="")
 standard implementation for tables use 'from' variable use different initial setting of table More...
 
 addLocatorItems ()
 Functions to be overwritten. More...
 
 initCreationForms ($a_new_type)
 Init creation froms. More...
 
 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
 Check permission. More...
 
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 Add header action menu. More...
 
 redrawHeaderAction ()
 Updating icons after ajax call. More...
 
 getPermanentLinkWidget ($a_append=null, $a_center=false)
 
 handleAutoRating (ilObject $a_new_obj)
 
- Protected Member Functions inherited from ilObjectGUI
 getObjectService ()
 Get object service. More...
 
 assignObject ()
 
 setTitleAndDescription ()
 called by prepare output More...
 
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction ($a_list_gui)
 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 @access public More...
 
 setAdminTabs ()
 set admin tabs @access public More...
 
 setLocator ()
 set Locator More...
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator ($a_omit=true)
 
 addAdminLocatorItems ($a_do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 initCreationForms ($a_new_type)
 Init creation froms. More...
 
 getCreationFormsHTML (array $a_forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm ($a_new_type)
 Init object creation form. More...
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 Show didactic template types. More...
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 afterSave (ilObject $a_new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 Init object edit form. More...
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 Get values for edit form. More...
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $a_form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $a_form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 initImportForm ($a_new_type)
 Init object import form. More...
 
 importFileObject ($parent_id=null, $a_catch_errors=true)
 Import. More...
 
 afterImport (ilObject $a_new_object)
 Post (successful) object import hook. More...
 
 setFormAction ($a_cmd, $a_formaction)
 set specific form action for command More...
 
 getReturnLocation ($a_cmd, $a_location="")
 get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command More...
 
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame ($a_cmd, $a_target_frame)
 set specific target frame for command More...
 
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu) More...
 
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl. More...
 
 getTabs ()
 get tabs abstract method. More...
 
 __showButton ($a_cmd, $a_text, $a_target='')
 
 hitsperpageObject ()
 
__initTableGUI ()
 
 __setTableGUIBasicData (&$tbl, &$result_set, $a_from="")
 standard implementation for tables use 'from' variable use different initial setting of table More...
 
 redirectToRefId ($a_ref_id, $a_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 $_GET["ref_id"] value More...
 
 fillCloneTemplate ($a_tpl_varname, $a_type)
 Fill object clone template This method can be called from any object GUI class that wants to offer object cloning. More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 setColumnSettings (ilColumnGUI $column_gui)
 May be overwritten in subclasses. More...
 
 checkPermission ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission and redirect on error. More...
 
 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission. More...
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 handleAutoRating (ilObject $a_new_obj)
 Activate rating automatically if parent container setting. More...
 

Protected Attributes

 $tabs
 
 $error
 
 $help
 
 $main_tpl
 
 $upload
 
 $mep_log
 
- Protected Attributes inherited from ilObject2GUI
 $object_id
 
 $node_id
 
 $creation_forms = array()
 
 $id_type = array()
 
 $parent_id
 
 $access_handler
 
- Protected Attributes inherited from ilObjectGUI
 $ilErr
 
 $locator
 
 $user
 
 $access
 
 $rbacsystem
 
 $settings
 
 $rbacreview
 
 $toolbar
 
 $tmp_import_dir
 
 $tabs_gui = null
 
 $ctrl
 
 $object_service
 
 $favourites
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

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

Constructor.

Reimplemented from ilObject2GUI.

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

62 {
63 global $DIC;
64
65 parent::__construct($a_id, $a_id_type, $a_parent_node_id);
66
67 $this->tabs = $DIC->tabs();
68 $this->error = $DIC["ilErr"];
69 $this->locator = $DIC["ilLocator"];
70 $this->help = $DIC["ilHelp"];
71
72 $this->main_tpl = $DIC->ui()->mainTemplate();
73
74 $this->upload = $DIC->upload();
75
76 $this->mep_log = ilLoggerFactory::getLogger("mep");
77 }
error($a_errmsg)
set error message @access public
static getLogger($a_component_id)
Get component logger.
help()
Definition: help.php:2
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
$DIC
Definition: xapitoken.php:46

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), error(), ilLoggerFactory\getLogger(), and help().

+ Here is the call graph for this function:

Member Function Documentation

◆ _goto()

static ilObjMediaPoolGUI::_goto (   $a_target)
static

goto target media pool

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

1680 {
1681 global $DIC;
1682
1683 $ilAccess = $DIC->access();
1684 $ilErr = $DIC["ilErr"];
1685 $lng = $DIC->language();
1686
1687 $targets = explode('_', $a_target);
1688 if (count((array) $targets) > 1) {
1689 $ref_id = $targets[0];
1690 $subitem_id = $targets[1];
1691 } else {
1692 $ref_id = $targets[0];
1693 }
1694
1695 if ($ilAccess->checkAccess("read", "", $ref_id)) {
1696 $_GET["baseClass"] = "ilMediaPoolPresentationGUI";
1697 $_GET["ref_id"] = $ref_id;
1698 $_GET['mepitem_id'] = $subitem_id;
1699 include("ilias.php");
1700 exit;
1701 } elseif ($ilAccess->checkAccess("visible", "", $ref_id)) {
1702 $_GET["baseClass"] = "ilMediaPoolPresentationGUI";
1703 $_GET["ref_id"] = $ref_id;
1704 $_GET["cmd"] = "infoScreen";
1705 include("ilias.php");
1706 exit;
1707 } elseif ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID)) {
1708 ilUtil::sendFailure(sprintf(
1709 $lng->txt("msg_no_perm_read_item"),
1711 ), true);
1713 }
1714
1715 $ilErr->raiseError($lng->txt("msg_no_perm_read"), $ilErr->FATAL);
1716 }
$_GET["client_id"]
static _gotoRepositoryRoot($a_raise_error=false)
Goto repository root.
static _lookupObjId($a_id)
static _lookupTitle($a_id)
lookup object title
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
exit
Definition: login.php:29

References $_GET, $DIC, ilObjectGUI\$ilErr, ilObjectGUI\$lng, ilObjectGUI\$ref_id, ilObjectGUI\_gotoRepositoryRoot(), ilObject\_lookupObjId(), ilObject\_lookupTitle(), exit, and ilUtil\sendFailure().

+ Here is the call graph for this function:

◆ addLocatorItems()

ilObjMediaPoolGUI::addLocatorItems ( )

add locator items for media pool

Reimplemented from ilObject2GUI.

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

1087 {
1088 $ilLocator = $this->locator;
1089 $ilAccess = $this->access;
1090
1091 if (!$this->getCreationMode() && $this->ctrl->getCmd() != "explorer") {
1092 $tree = $this->object->getTree();
1093 $obj_id = ($_GET["mepitem_id"] == "")
1094 ? $tree->getRootId()
1095 : $_GET["mepitem_id"];
1096 $path = $tree->getPathFull($obj_id);
1097 foreach ($path as $node) {
1098 if ($node["child"] == $tree->getRootId()) {
1099 $this->ctrl->setParameter($this, "mepitem_id", "");
1100 if ($ilAccess->checkAccess("read", "", $this->object->getRefId())) {
1101 $link = $this->ctrl->getLinkTarget($this, "listMedia");
1102 } elseif ($ilAccess->checkAccess("visible", "", $this->object->getRefId())) {
1103 $link = $this->ctrl->getLinkTarget($this, "infoScreen");
1104 }
1105 $title = $this->object->getTitle();
1106 $this->ctrl->setParameter($this, "mepitem_id", $_GET["mepitem_id"]);
1107 $ilLocator->addItem($title, $link, "", $_GET["ref_id"]);
1108 }
1109 }
1110 }
1111 }
getCreationMode()
get creation mode

References $_GET, ilObjectGUI\$access, ilObjectGUI\$locator, ilObjectGUI\$obj_id, ilObject2GUI\$tree, and ilObject2GUI\getCreationMode().

+ Here is the call graph for this function:

◆ afterConstructor()

ilObjMediaPoolGUI::afterConstructor ( )
protected

Initialisation.

Reimplemented from ilObject2GUI.

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

85 {
87
88 $lng->loadLanguageModule("mep");
89
90 if ($this->ctrl->getCmd() == "explorer") {
91 $this->ctrl->saveParameter($this, array("ref_id"));
92 } else {
93 $this->ctrl->saveParameter($this, array("ref_id", "mepitem_id"));
94 }
95 $this->ctrl->saveParameter($this, array("mep_mode"));
96
97 $lng->loadLanguageModule("content");
98 }

References ilObjectGUI\$lng.

◆ afterSave()

ilObjMediaPoolGUI::afterSave ( ilObject  $newObj)

save object

Reimplemented from ilObjectGUI.

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

451 {
452 // always send a message
453 ilUtil::sendSuccess($this->lng->txt("object_added"), true);
454
455 //ilUtil::redirect($this->getReturnLocation("save","adm_object.php?".$this->link_params));
456 ilUtil::redirect("ilias.php?baseClass=ilMediaPoolPresentationGUI&ref_id=" . $newObj->getRefId() . "&cmd=listMedia");
457 }
getRefId()
get reference id @access public
static redirect($a_script)

References ilObject\getRefId(), and ilUtil\redirect().

+ Here is the call graph for this function:

◆ allMedia()

ilObjMediaPoolGUI::allMedia ( )

list all objects

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

635 {
637 $ilTabs = $this->tabs;
640
641 $ilCtrl->setParameter($this, "mep_mode", "allMedia");
642
643 $this->checkPermission("read");
644 $ilTabs->setTabActive("content");
645 $this->setContentSubTabs("mep_all_mobs");
646
647
648 include_once("./Modules/MediaPool/classes/class.ilMediaPoolTableGUI.php");
649 $mep_table_gui = new ilMediaPoolTableGUI(
650 $this,
651 "allMedia",
652 $this->object,
653 "mepitem_id",
655 true
656 );
657
658
659 if (isset($_GET['force_filter']) and $_GET['force_filter']) {
660 $_POST['title'] = ilMediaPoolItem::lookupTitle((int) $_GET['force_filter']);
661
662 include_once("./Services/Table/classes/class.ilTablePropertiesStorage.php");
663 $tprop = new ilTablePropertiesStorage();
664 $tprop->storeProperty(
665 $mep_table_gui->getId(),
666 $ilUser->getId(),
667 'filter',
668 1
669 );
670 $mep_table_gui->resetFilter();
671 $mep_table_gui->resetOffset();
672 $mep_table_gui->writeFilterToSession();
673
674 // Read again
675 $mep_table_gui = new ilMediaPoolTableGUI(
676 $this,
677 "allMedia",
678 $this->object,
679 "mepitem_id",
681 true
682 );
683 }
684
685 $tpl->setContent($mep_table_gui->getHTML());
686 }
$_POST["username"]
static lookupTitle($a_id)
Lookup title.
TableGUI class for recent changes in wiki.
setContentSubTabs($a_active)
Set sub tabs for content tab.
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
Saves (mostly asynchronously) user properties of tables (e.g.
global $ilCtrl
Definition: ilias.php:18
$ilUser
Definition: imgupload.php:18

References $_GET, $_POST, ilObjectGUI\$ctrl, $ilCtrl, $ilUser, $tabs, ilObjectGUI\$tpl, ilObjectGUI\$user, ilObject2GUI\checkPermission(), ilMediaPoolTableGUI\IL_MEP_EDIT, ilMediaPoolItem\lookupTitle(), and setContentSubTabs().

Referenced by applyFilter(), and resetFilter().

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

◆ applyFilter()

ilObjMediaPoolGUI::applyFilter ( )

Apply filter.

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

692 {
693 include_once("./Modules/MediaPool/classes/class.ilMediaPoolTableGUI.php");
694 $mtab = new ilMediaPoolTableGUI(
695 $this,
696 "allMedia",
697 $this->object,
698 "mepitem_id",
700 true
701 );
702 $mtab->writeFilterToSession();
703 $mtab->resetOffset();
704 $this->allMedia();
705 }
allMedia()
list all objects

References allMedia(), and ilMediaPoolTableGUI\IL_MEP_EDIT.

+ Here is the call graph for this function:

◆ bulkUpload()

ilObjMediaPoolGUI::bulkUpload ( )
protected

Bulk upload.

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

1973 {
1974 $this->checkPermission("write");
1975
1977
1978 $form = $this->initBulkUploadForm();
1979 $main_tpl->setContent($form->getHTML());
1980 }
initBulkUploadForm()
Init bulk upload form.

References $main_tpl, ilObject2GUI\checkPermission(), and initBulkUploadForm().

+ Here is the call graph for this function:

◆ cancelFolderUpdate()

ilObjMediaPoolGUI::cancelFolderUpdate ( )

Cancel save.

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

1249 {
1251 $ilCtrl->setParameter(
1252 $this,
1253 "mepitem_id",
1254 $this->object->getTree()->getParentId($_GET["mepitem_id"])
1255 );
1256 $ilCtrl->redirect($this, "listMedia");
1257 }

References $_GET, ilObjectGUI\$ctrl, and $ilCtrl.

◆ cancelRemove()

ilObjMediaPoolGUI::cancelRemove ( )

cancel deletion of media objects/folders

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

1025 {
1026 $this->ctrl->redirect($this, $_GET["mep_mode"] ? $_GET["mep_mode"] : "listMedia");
1027 }

References $_GET.

◆ cancelSave()

ilObjMediaPoolGUI::cancelSave ( )

Cancel save.

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

1263 {
1265 $ilCtrl->redirect($this, "listMedia");
1266 }

References ilObjectGUI\$ctrl, and $ilCtrl.

◆ confirmRemove()

ilObjMediaPoolGUI::confirmRemove ( )

confirm remove of mobs

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

875 {
879
880 $this->checkPermission("write");
881
882 if (!isset($_POST["id"])) {
883 $ilErr->raiseError($this->lng->txt("no_checkbox"), $ilErr->MESSAGE);
884 }
885
886 // display confirmation message
887 include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
888 $cgui = new ilConfirmationGUI();
889 $cgui->setFormAction($this->ctrl->getFormAction($this));
890 $cgui->setHeaderText($this->lng->txt("info_remove_sure"));
891 $cgui->setCancel($this->lng->txt("cancel"), "cancelRemove");
892 $cgui->setConfirm($this->lng->txt("confirm"), "remove");
893
894 foreach ($_POST["id"] as $obj_id) {
897
898 // check whether page can be removed
899 $add = "";
900 if ($type == "pg") {
901 include_once("./Services/COPage/classes/class.ilPageContentUsage.php");
902 $usages = ilPageContentUsage::getUsages("incl", $obj_id, false);
903 if (count($usages) > 0) {
904 ilUtil::sendFailure(sprintf($lng->txt("mep_content_snippet_in_use"), $title), true);
905 $ilCtrl->redirect($this, "listMedia");
906 } else {
907 // check whether the snippet is used in older versions of pages
908 $usages = ilPageContentUsage::getUsages("incl", $obj_id, true);
909 if (count($usages) > 0) {
910 $add = "<div class='small'>" . $lng->txt("mep_content_snippet_used_in_older_versions") . "</div>";
911 }
912 }
913 }
914
915 $caption = ilUtil::getImageTagByType($type, $this->tpl->tplPath) .
916 " " . $title . $add;
917
918 $cgui->addItem("id[]", $obj_id, $caption);
919 }
920
921 $this->tpl->setContent($cgui->getHTML());
922 }
Confirmation screen class.
static lookupType($a_id)
Lookup type.
static getUsages($a_pc_type, $a_pc_id, $a_incl_hist=true)
Get usages.
static getImageTagByType($a_type, $a_path, $a_big=false)
Builds an html image tag TODO: function still in use, but in future use getImagePath and move HTML-Co...
$type

References $_POST, ilObjectGUI\$ctrl, $error, $ilCtrl, ilObjectGUI\$ilErr, ilObjectGUI\$lng, ilObjectGUI\$obj_id, $type, ilObject2GUI\checkPermission(), ilUtil\getImageTagByType(), ilPageContentUsage\getUsages(), ilMediaPoolItem\lookupTitle(), ilMediaPoolItem\lookupType(), and ilUtil\sendFailure().

+ Here is the call graph for this function:

◆ copyToClipboard()

ilObjMediaPoolGUI::copyToClipboard ( )

copy media objects to clipboard

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

1051 {
1053 $ilAccess = $this->access;
1054
1055 $this->checkPermission("write");
1056
1057 if (!isset($_POST["id"])) {
1058 ilUtil::sendFailure($this->lng->txt("no_checkbox"), true);
1059 $this->ctrl->redirect($this, $_GET["mep_mode"] ? $_GET["mep_mode"] : "listMedia");
1060 }
1061
1062 foreach ($_POST["id"] as $obj_id) {
1064 if ($type == "fold") {
1065 ilUtil::sendFailure($this->lng->txt("cont_cant_copy_folders"), true);
1066 $this->ctrl->redirect($this, $_GET["mep_mode"] ? $_GET["mep_mode"] : "listMedia");
1067 }
1068 }
1069 foreach ($_POST["id"] as $obj_id) {
1072 if ($type == "mob") {
1073 $ilUser->addObjectToClipboard($fid, "mob", "");
1074 }
1075 if ($type == "pg") {
1076 $ilUser->addObjectToClipboard($obj_id, "incl", "");
1077 }
1078 }
1079 ilUtil::sendSuccess($this->lng->txt("copied_to_clipboard"), true);
1080 $this->ctrl->redirect($this, $_GET["mep_mode"] ? $_GET["mep_mode"] : "listMedia");
1081 }
static lookupForeignId($a_id)
Lookup Foreign Id.

References $_GET, $_POST, ilObjectGUI\$access, $ilUser, ilObjectGUI\$obj_id, $type, ilObjectGUI\$user, ilObject2GUI\checkPermission(), ilMediaPoolItem\lookupForeignId(), ilMediaPoolItem\lookupType(), and ilUtil\sendFailure().

+ Here is the call graph for this function:

◆ createFolderForm()

ilObjMediaPoolGUI::createFolderForm ( )

create folder form

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

1121 {
1122 $ilAccess = $this->access;
1123 $tpl = $this->tpl;
1124
1125 $this->checkPermission("write");
1126
1127 $this->initFolderForm("create");
1128 $tpl->setContent($this->form->getHTML());
1129 }
initFolderForm($a_mode="edit")
Init folder form.

References ilObjectGUI\$access, ilObjectGUI\$tpl, ilObject2GUI\checkPermission(), and initFolderForm().

+ Here is the call graph for this function:

◆ createMediaFromUploadDir()

ilObjMediaPoolGUI::createMediaFromUploadDir ( )

Create media object from upload directory.

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

1821 {
1822 $this->checkPermission("write");
1823
1824 $mset = new ilSetting("mobs");
1825 $upload_dir = trim($mset->get("upload_dir"));
1826
1827 include_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
1828
1829 if (is_array($_POST["file"]) && ilMainMenuGUI::_checkAdministrationPermission()) {
1830 foreach ($_POST["file"] as $f) {
1831 $f = str_replace("..", "", $f);
1832 $fullpath = $upload_dir . "/" . $f;
1833 $mob = new ilObjMediaObject();
1834 $mob->setTitle(basename($fullpath));
1835 $mob->setDescription("");
1836 $mob->create();
1837
1838 // determine and create mob directory, move uploaded file to directory
1839 //$mob_dir = ilUtil::getWebspaceDir()."/mobs/mm_".$a_mob->getId();
1840 $mob->createDirectory();
1841 $mob_dir = ilObjMediaObject::_getDirectory($mob->getId());
1842
1843 $media_item = new ilMediaItem();
1844 $mob->addMediaItem($media_item);
1845 $media_item->setPurpose("Standard");
1846
1847 $file = $mob_dir . "/" . basename($fullpath);
1848
1849 // virus handling
1850 $vir = ilUtil::virusHandling($fullpath, basename($fullpath));
1851 if (!$vir[0]) {
1852 ilUtil::sendFailure($this->lng->txt("file_is_infected") . "<br />" . $vir[1], true);
1853 ilUtil::redirect("ilias.php?baseClass=ilMediaPoolPresentationGUI&cmd=listMedia&ref_id=" .
1854 $_GET["ref_id"] . "&mepitem_id=" . $_GET["mepitem_id"]);
1855 }
1856
1857 switch ($_POST["action"]) {
1858 case "rename":
1859 rename($fullpath, $file);
1860 break;
1861
1862 case "copy":
1863 copy($fullpath, $file);
1864 break;
1865 }
1866
1867 // get mime type
1869 $location = basename($fullpath);
1870
1871 // set real meta and object data
1872 $media_item->setFormat($format);
1873 $media_item->setLocation($location);
1874 $media_item->setLocationType("LocalFile");
1875
1876 $mob->setDescription($format);
1877
1878 // determine width and height of known image types
1880 $format,
1881 "File",
1882 $mob_dir . "/" . $location,
1883 $media_item->getLocation(),
1884 true,
1885 true,
1886 "",
1887 ""
1888 );
1889 $media_item->setWidth($wh["width"]);
1890 $media_item->setHeight($wh["height"]);
1891 if ($wh["info"] != "") {
1892 // ilUtil::sendInfo($wh["info"], true);
1893 }
1894
1895 $media_item->setHAlign("Left");
1896 ilUtil::renameExecutables($mob_dir);
1897 $mob->update();
1898
1899
1900 // put it into current folder
1901 $mep_item = new ilMediaPoolItem();
1902 $mep_item->setTitle($mob->getTitle());
1903 $mep_item->setType("mob");
1904 $mep_item->setForeignId($mob->getId());
1905 $mep_item->create();
1906
1907 $tree = $this->object->getTree();
1908 $parent = ($_GET["mepitem_id"] == "")
1909 ? $tree->getRootId()
1910 : $_GET["mepitem_id"];
1911 $tree->insertNode($mep_item->getId(), $parent);
1912 }
1913 }
1914 ilUtil::redirect("ilias.php?baseClass=ilMediaPoolPresentationGUI&cmd=listMedia&ref_id=" .
1915 $_GET["ref_id"] . "&mepitem_id=" . $_GET["mepitem_id"]);
1916 }
$location
Definition: buildRTE.php:44
static _checkAdministrationPermission()
Class ilMediaItem.
Class ilObjMediaObject.
static getMimeType($a_file, $a_external=null)
get mime type for file
static _getDirectory($a_mob_id)
Get absolute directory.
static _determineWidthHeight( $a_format, $a_type, $a_file, $a_reference, $a_constrain_proportions, $a_use_original, $a_user_width, $a_user_height)
Determine width and height.
ILIAS Setting Class.
static virusHandling($a_file, $a_orig_name="", $a_clean=true)
scan file for viruses and clean files if possible
static renameExecutables($a_dir)
Rename uploaded executables for security reasons.
$format
Definition: metadata.php:218

References $_GET, $_POST, Vendor\Package\$f, $format, $location, ilObject2GUI\$tree, ilMainMenuGUI\_checkAdministrationPermission(), ilObjMediaObject\_determineWidthHeight(), ilObjMediaObject\_getDirectory(), ilObject2GUI\checkPermission(), ilObjMediaObject\getMimeType(), ilUtil\redirect(), ilUtil\renameExecutables(), ilUtil\sendFailure(), and ilUtil\virusHandling().

+ Here is the call graph for this function:

◆ createMediaObject()

ilObjMediaPoolGUI::createMediaObject ( )

obsolete?

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

435 {
436 $this->ctrl->redirectByClass("ilobjmediaobjectgui", "create");
437 }

◆ createMediaPoolPage()

ilObjMediaPoolGUI::createMediaPoolPage ( )

Create new content snippet.

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

1276 {
1277 $tpl = $this->tpl;
1278
1279 $this->checkPermission("write");
1280
1281 $this->initMediaPoolPageForm("create");
1282 $tpl->setContent($this->form->getHTML());
1283 }
initMediaPoolPageForm($a_mode="edit")
Init page form.

References ilObjectGUI\$tpl, ilObject2GUI\checkPermission(), and initMediaPoolPageForm().

+ Here is the call graph for this function:

◆ edit()

ilObjMediaPoolGUI::edit ( )

edit object

@access public

Reimplemented from ilObject2GUI.

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

510 {
512 $ilTabs = $this->tabs_gui;
514
515 $this->setSettingsSubTabs("settings");
516
517 if (!$this->checkPermissionBool("write")) {
518 $ilErr->raiseError($this->lng->txt("msg_no_perm_write"), $ilErr->MESSAGE);
519 }
520
521 $ilTabs->activateTab("settings");
522
523 $form = $this->initEditForm();
524 $values = $this->getEditFormValues();
525 if ($values) {
526 $form->setValuesByArray($values, true);
527 }
528
529 $this->addExternalEditFormCustom($form);
530
531 $tpl->setContent($form->getHTML());
532 }
setSettingsSubTabs($a_active)
Set setting sub tabs.
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
Check permission.
getEditFormValues()
Get values for edit form.
initEditForm()
Init object edit form.
addExternalEditFormCustom(ilPropertyFormGUI $a_form)

References ilObjectGUI\$ilErr, ilObjectGUI\$tabs_gui, ilObjectGUI\$tpl, ilObjectGUI\addExternalEditFormCustom(), ilObject2GUI\checkPermissionBool(), ilObjectGUI\getEditFormValues(), ilObjectGUI\initEditForm(), and setSettingsSubTabs().

+ Here is the call graph for this function:

◆ editFolder()

ilObjMediaPoolGUI::editFolder ( )

Edit folder.

Parameters

return

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

1138 {
1139 $tpl = $this->tpl;
1140
1141 $this->checkPermission("write");
1142
1143 $this->initFolderForm();
1144 $this->getFolderValues();
1145 $tpl->setContent($this->form->getHTML());
1146 }
getFolderValues()
Get current values for folder from.

References ilObjectGUI\$tpl, ilObject2GUI\checkPermission(), getFolderValues(), and initFolderForm().

+ Here is the call graph for this function:

◆ editMediaPoolPage()

ilObjMediaPoolGUI::editMediaPoolPage ( )

Edit media pool page.

Parameters

return

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

1292 {
1293 $tpl = $this->tpl;
1294 $ilTabs = $this->tabs;
1295
1296 $this->checkPermission("write");
1297
1298 $ilTabs->clearTargets();
1299
1300 include_once("./Modules/MediaPool/classes/class.ilMediaPoolPageGUI.php");
1301 $mep_page_gui = new ilMediaPoolPageGUI($_GET["mepitem_id"], $_GET["old_nr"]);
1302 $mep_page_gui->getTabs();
1303
1304 $this->setMediaPoolPageTabs();
1305
1306 $this->initMediaPoolPageForm("edit");
1307 $this->getMediaPoolPageValues();
1308 $tpl->setContent($this->form->getHTML());
1309 }
Class ilMediaPoolPage GUI class.
getMediaPoolPageValues()
Get current values for media pool page from.
setMediaPoolPageTabs()
Set media pool page tabs.

References $_GET, $tabs, ilObjectGUI\$tpl, ilObject2GUI\checkPermission(), getMediaPoolPageValues(), initMediaPoolPageForm(), and setMediaPoolPageTabs().

+ Here is the call graph for this function:

◆ editTitlesAndDescriptions()

ilObjMediaPoolGUI::editTitlesAndDescriptions ( )
protected

Edit titles and descriptions.

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

2106 {
2108 $lng = $this->lng;
2109
2110 $this->checkPermission("write");
2111 $ctrl->saveParameter($this, "mep_hash");
2112
2114
2115 include_once("./Services/MediaObjects/classes/class.ilMediaItem.php");
2116 $media_items = ilMediaItem::getMediaItemsForUploadHash($_GET["mep_hash"]);
2117
2118 include_once("./Services/Accordion/classes/class.ilAccordionGUI.php");
2119
2120 $tb = new ilToolbarGUI();
2121 $tb->setFormAction($ctrl->getFormAction($this));
2122 $tb->addFormButton($lng->txt("save"), "saveTitlesAndDescriptions");
2123 $tb->setOpenFormTag(true);
2124 $tb->setCloseFormTag(false);
2125 $tb->setId("tb_top");
2126
2127 $html = $tb->getHTML();
2128 foreach ($media_items as $mi) {
2129 $acc = new ilAccordionGUI();
2130 $acc->setBehaviour(ilAccordionGUI::ALL_CLOSED);
2131 $acc->setId("acc_" . $mi["mob_id"]);
2132
2133 $mob = new ilObjMediaObject($mi["mob_id"]);
2134 $form = $this->initMediaBulkForm($mi["mob_id"], $mob->getTitle());
2135 $acc->addItem($mob->getTitle(), $form->getHTML());
2136
2137 $html .= $acc->getHTML();
2138 }
2139
2140 $html .= $tb->getHTML();
2141 $tb->setOpenFormTag(false);
2142 $tb->setCloseFormTag(true);
2143 $tb->setId("tb_bottom");
2144
2145 $main_tpl->setContent($html);
2146 }
Accordion user interface class.
static getMediaItemsForUploadHash($a_hash)
Get media items for upload hash.
initMediaBulkForm($a_id, $a_title)
Init media bulk form.

References $_GET, ilObjectGUI\$ctrl, ilObjectGUI\$lng, $main_tpl, ilAccordionGUI\ALL_CLOSED, ilObject2GUI\checkPermission(), ilMediaItem\getMediaItemsForUploadHash(), and initMediaBulkForm().

+ Here is the call graph for this function:

◆ executeCommand()

ilObjMediaPoolGUI::executeCommand ( )

execute command

Returns
bool|void
Exceptions
ilCtrlException

Reimplemented from ilObject2GUI.

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

115 {
116 $ilTabs = $this->tabs;
118 $ilAccess = $this->access;
121
122 if ($this->ctrl->getRedirectSource() == "ilinternallinkgui") {
123 $this->explorer();
124 return;
125 }
126
127 $next_class = $this->ctrl->getNextClass($this);
128 $cmd = $this->ctrl->getCmd();
129 $new_type = $_POST["new_type"]
130 ? $_POST["new_type"]
131 : $_GET["new_type"];
132
133 if ($new_type != "" && ($cmd != "confirmRemove" && $cmd != "copyToClipboard"
134 && $cmd != "pasteFromClipboard")) {
135 $this->setCreationMode(true);
136 }
137
138 if (!$this->getCreationMode()) {
139 $tree = $this->object->getTree();
140 if ($_GET["mepitem_id"] == "") {
141 $_GET["mepitem_id"] = $tree->getRootId();
142 }
143 }
144 if ($cmd == "create") {
145 switch ($_POST["new_type"]) {
146 case "mob":
147 $this->ctrl->redirectByClass("ilobjmediaobjectgui", "create");
148 break;
149
150 case "fold":
151 $this->ctrl->redirectByClass("ilobjfoldergui", "create");
152 break;
153 }
154 }
155
156 switch ($next_class) {
157 case 'ilobjectmetadatagui':
158 $this->checkPermission("write");
159
160 $this->prepareOutput();
161 $this->addHeaderAction();
162
163 $this->tabs_gui->activateTab('meta_data');
164 include_once 'Services/Object/classes/class.ilObjectMetaDataGUI.php';
165 $md_gui = new ilObjectMetaDataGUI($this->object, 'mob');
166 $this->ctrl->forwardCommand($md_gui);
167 $this->tpl->printToStdout();
168 break;
169
170
171 case 'ilmediapoolpagegui':
172 $this->checkPermission("write");
173 $this->prepareOutput();
174 $this->addHeaderAction();
175 $ilTabs->clearTargets();
176 include_once("./Modules/MediaPool/classes/class.ilMediaPoolPageGUI.php");
177 $mep_page_gui = new ilMediaPoolPageGUI($_GET["mepitem_id"], $_GET["old_nr"]);
178
179 if (!$ilAccess->checkAccess("write", "", $this->object->getRefId())) {
180 $mep_page_gui->setEnableEditing(false);
181 }
182 $ret = $this->ctrl->forwardCommand($mep_page_gui);
183 if ($ret != "") {
184 $tpl->setContent($ret);
185 }
186 $this->setMediaPoolPageTabs();
187 $this->tpl->printToStdout();
188 break;
189
190 case "ilobjmediaobjectgui":
191 $this->checkPermission("write");
192 if ($cmd == "create" || $cmd == "save" || $cmd == "cancel") {
193 $ret_obj = $_GET["mepitem_id"];
194 $ilObjMediaObjectGUI = new ilObjMediaObjectGUI("", 0, false, false);
195 $ilObjMediaObjectGUI->setWidthPreset($this->object->getDefaultWidth());
196 $ilObjMediaObjectGUI->setHeightPreset($this->object->getDefaultHeight());
197 } else {
198 $ret_obj = $tree->getParentId($_GET["mepitem_id"]);
199 $ilObjMediaObjectGUI = new ilObjMediaObjectGUI("", ilMediaPoolItem::lookupForeignId($_GET["mepitem_id"]), false, false);
200 $this->ctrl->setParameter($this, "mepitem_id", $this->getParentFolderId());
201 $ilTabs->setBackTarget(
202 $lng->txt("back"),
203 $this->ctrl->getLinkTarget(
204 $this,
205 $_GET["mep_mode"] ? $_GET["mep_mode"] : "listMedia"
206 )
207 );
208 }
209 if ($this->ctrl->getCmdClass() == "ilinternallinkgui") {
210 $this->ctrl->setReturn($this, "explorer");
211 } else {
212 $this->ctrl->setParameter($this, "mepitem_id", $ret_obj);
213 $this->ctrl->setReturn(
214 $this,
215 $_GET["mep_mode"] ? $_GET["mep_mode"] : "listMedia"
216 );
217 $this->ctrl->setParameter($this, "mepitem_id", $_GET["mepitem_id"]);
218 }
219 $this->getTemplate();
220 $ilObjMediaObjectGUI->setTabs();
221 $this->setLocator();
222
223 // set adv metadata record dobject
224 $ilObjMediaObjectGUI->setAdvMdRecordObject($this->object->getRefId(), "mep", "mob");
225
226 $ret = $this->ctrl->forwardCommand($ilObjMediaObjectGUI);
227
228 if ($cmd == "save" && $ret != false) {
229 $mep_item = new ilMediaPoolItem();
230 $mep_item->setTitle($ret->getTitle());
231 $mep_item->setType("mob");
232 $mep_item->setForeignId($ret->getId());
233 $mep_item->create();
234
235 $parent = ($_GET["mepitem_id"] == "")
236 ? $tree->getRootId()
237 : $_GET["mepitem_id"];
238 $tree->insertNode($mep_item->getId(), $parent);
239 ilUtil::redirect("ilias.php?baseClass=ilMediaPoolPresentationGUI&cmd=listMedia&ref_id=" .
240 $_GET["ref_id"] . "&mepitem_id=" . $_GET["mepitem_id"]);
241 } else {
242 $this->tpl->printToStdout();
243 }
244 break;
245
246 case "ilobjfoldergui":
247 $this->checkPermission("write");
248 $this->addHeaderAction();
249 $folder_gui = new ilObjFolderGUI("", 0, false, false);
250 $this->ctrl->setReturn($this, "listMedia");
251 $cmd .= "Object";
252 switch ($cmd) {
253 case "createObject":
254 $this->prepareOutput();
255 $folder_gui = new ilObjFolderGUI("", 0, false, false);
256 $folder_gui->setFormAction(
257 "save",
258 $this->ctrl->getFormActionByClass("ilobjfoldergui")
259 );
260 $folder_gui->createObject();
261 $this->tpl->printToStdout();
262 break;
263
264 case "saveObject":
265 //$folder_gui->setReturnLocation("save", $this->ctrl->getLinkTarget($this, "listMedia"));
266 $parent = ($_GET["mepitem_id"] == "")
267 ? $tree->getRootId()
268 : $_GET["mepitem_id"];
269 $folder_gui->setFolderTree($tree);
270 $folder_gui->saveObject($parent);
271 //$this->ctrl->redirect($this, "listMedia");
272 break;
273
274 case "editObject":
275 $this->prepareOutput();
276 $folder_gui = new ilObjFolderGUI("", ilMediaPoolItem::lookupForeignId($_GET["mepitem_id"]), false, false);
277 $this->ctrl->setParameter($this, "foldereditmode", "1");
278 $folder_gui->setFormAction("update", $this->ctrl->getFormActionByClass("ilobjfoldergui"));
279 $folder_gui->editObject();
280 $this->tpl->printToStdout();
281 break;
282
283 case "updateObject":
284 $folder_gui = new ilObjFolderGUI("", ilMediaPoolItem::lookupForeignId($_GET["mepitem_id"]), false, false);
285 $this->ctrl->setParameter($this, "mepitem_id", $this->getParentFolderId());
286 $this->ctrl->setReturn($this, "listMedia");
287 $folder_gui->updateObject(true); // this returns to parent
288 break;
289
290 case "cancelObject":
291 if ($_GET["foldereditmode"]) {
292 $this->ctrl->setParameter($this, "mepitem_id", $this->getParentFolderId());
293 }
294 $this->ctrl->redirect($this, "listMedia");
295 break;
296 }
297 break;
298
299 case "ileditclipboardgui":
300 $this->prepareOutput();
301 $this->addHeaderAction();
302 $this->ctrl->setReturn($this, $_GET["mep_mode"] ? $_GET["mep_mode"] : "listMedia");
303 $clip_gui = new ilEditClipboardGUI();
304 $clip_gui->setMultipleSelections(true);
305 $clip_gui->setInsertButtonTitle($lng->txt("mep_copy_to_mep"));
306 $ilTabs->setTabActive("clipboard");
307 $this->ctrl->forwardCommand($clip_gui);
308 $this->tpl->printToStdout();
309 break;
310
311 case 'ilinfoscreengui':
312 $this->prepareOutput();
313 $this->addHeaderAction();
314 $this->infoScreen();
315 $this->tpl->printToStdout();
316 break;
317
318 case 'ilpermissiongui':
319 $this->checkPermission("edit_permission");
320 $this->prepareOutput();
321 $this->addHeaderAction();
322 include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
323 $perm_gui = new ilPermissionGUI($this);
324 $this->ctrl->forwardCommand($perm_gui);
325 $this->tpl->printToStdout();
326 break;
327
328 case "ilexportgui":
329 $this->checkPermission("write");
330 $this->prepareOutput();
331 $this->addHeaderAction();
332 include_once("./Services/Export/classes/class.ilExportGUI.php");
333 $exp_gui = new ilExportGUI($this);
334 $exp_gui->addFormat("xml");
335 include_once("./Services/Object/classes/class.ilObjectTranslation.php");
336 $ot = ilObjectTranslation::getInstance($this->object->getId());
337 if ($ot->getContentActivated()) {
338 $exp_gui->addFormat("xml_master", "XML (" . $lng->txt("mep_master_language_only") . ")", $this, "export");
339 $exp_gui->addFormat("xml_masternomedia", "XML (" . $lng->txt("mep_master_language_only_no_media") . ")", $this, "export");
340 }
341 $this->ctrl->forwardCommand($exp_gui);
342 $this->tpl->printToStdout();
343 break;
344
345 case "ilfilesystemgui":
346 $this->checkPermission("write");
347 $this->prepareOutput();
348 $this->addHeaderAction();
349 $ilTabs->clearTargets();
350 $ilTabs->setBackTarget(
351 $lng->txt("back"),
352 $ilCtrl->getLinkTarget($this, "listMedia")
353 );
354 $mset = new ilSetting("mobs");
355 if (trim($mset->get("upload_dir")) != "") {
356 include_once("./Services/FileSystem/classes/class.ilFileSystemGUI.php");
357 $fs_gui = new ilFileSystemGUI($mset->get("upload_dir"));
358 $fs_gui->setPostDirPath(true);
359 $fs_gui->setTableId("mepud" . $this->object->getId());
360 $fs_gui->setAllowFileCreation(false);
361 $fs_gui->setAllowDirectoryCreation(false);
362 $fs_gui->clearCommands();
363 $fs_gui->addCommand(
364 $this,
365 "selectUploadDirFiles",
366 $this->lng->txt("mep_sel_upload_dir_files"),
367 false,
368 true
369 );
370 $this->ctrl->forwardCommand($fs_gui);
371 }
372 $this->tpl->printToStdout();
373 break;
374
375 case "ilcommonactiondispatchergui":
376 include_once("Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
378 $this->ctrl->forwardCommand($gui);
379 break;
380
381 case 'ilobjecttranslationgui':
382 $this->prepareOutput();
383 $this->addHeaderAction();
384 //$this->setTabs("settings");
385 $ilTabs->activateTab("settings");
386 $this->setSettingsSubTabs("obj_multilinguality");
387 include_once("./Services/Object/classes/class.ilObjectTranslationGUI.php");
388 $transgui = new ilObjectTranslationGUI($this);
389 $transgui->setTitleDescrOnlyMode(false);
390 $this->ctrl->forwardCommand($transgui);
391 $this->tpl->printToStdout();
392 break;
393
394 case "ilmediapoolimportgui":
395 $this->prepareOutput();
396 $this->addHeaderAction();
397 $this->checkPermission("write");
398 $ilTabs->activateTab("import");
399 include_once("./Modules/MediaPool/classes/class.ilMediaPoolImportGUI.php");
400 $gui = new ilMediaPoolImportGUI($this->object);
401 $this->ctrl->forwardCommand($gui);
402 $this->tpl->printToStdout();
403 break;
404
405 case "ilmobmultisrtuploadgui":
406 $this->checkPermission("write");
407 $this->prepareOutput();
408 $this->addHeaderAction();
409 //$this->setTabs("content");
410 $this->setContentSubTabs("srt_files");
411 include_once("./Services/MediaObjects/classes/class.ilMobMultiSrtUploadGUI.php");
412 include_once("./Modules/MediaPool/classes/class.ilMepMultiSrt.php");
413 $gui = new ilMobMultiSrtUploadGUI(new ilMepMultiSrt($this->object));
414 $this->ctrl->forwardCommand($gui);
415 $this->tpl->printToStdout();
416 break;
417
418
419 default:
420 $this->prepareOutput();
421 $this->addHeaderAction();
422 $cmd = $this->ctrl->getCmd("listMedia");
423 $this->$cmd();
424 if (!$this->getCreationMode()) {
425 $this->tpl->printToStdout();
426 }
427 break;
428 }
429 }
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
Class ilEditClipboardGUI.
Export User Interface Class.
File System Explorer GUI class.
Import related features for media pools (currently used for translation imports)
Handler class for multi srt upload in learning modules.
Upload SRT files to a set of media objects.
Class ilObjFolderGUI.
Class ilObjMediaObjectGUI.
getTemplate()
Get standard template.
getParentFolderId()
Get folder parent ID.
infoScreen()
show information screen
prepareOutput($a_show_subobjects=true)
prepare output
setCreationMode($a_mode=true)
if true, a creation screen is displayed the current $_GET[ref_id] don't belong to the current class!...
setLocator()
set Locator
addHeaderAction()
Add header action menu.
Class ilObjectMetaDataGUI.
GUI class for object translation handling.
static getInstance($a_obj_id)
Get instance.
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
$ret
Definition: parser.php:6

References $_GET, $_POST, ilObjectGUI\$access, ilObjectGUI\$ctrl, $ilCtrl, ilObjectGUI\$lng, $ret, $tabs, ilObjectGUI\$tpl, ilObject2GUI\$tree, ilObjectGUI\addHeaderAction(), ilObject2GUI\checkPermission(), ilObject2GUI\getCreationMode(), ilObjectTranslation\getInstance(), ilCommonActionDispatcherGUI\getInstanceFromAjaxCall(), getParentFolderId(), getTemplate(), infoScreen(), ilMediaPoolItem\lookupForeignId(), ilObject2GUI\prepareOutput(), ilUtil\redirect(), setContentSubTabs(), ilObject2GUI\setCreationMode(), ilObject2GUI\setLocator(), setMediaPoolPageTabs(), and setSettingsSubTabs().

+ Here is the call graph for this function:

◆ export()

ilObjMediaPoolGUI::export ( )

export content object

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

1954 {
1955 $ot = ilObjectTranslation::getInstance($this->object->getId());
1956 $opt = "";
1957 if ($ot->getContentActivated()) {
1958 $format = explode("_", $_POST["format"]);
1959 $opt = ilUtil::stripSlashes($format[1]);
1960 }
1961
1962 $this->object->exportXML($opt);
1963 }
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled

References $_POST, $format, ilObjectTranslation\getInstance(), and ilUtil\stripSlashes().

+ Here is the call graph for this function:

◆ getEditFormCustomValues()

ilObjMediaPoolGUI::getEditFormCustomValues ( array &  $a_values)
protected

Add values to custom edit fields.

Parameters
array$a_values

Reimplemented from ilObjectGUI.

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

536 {
537 if ($this->object->getDefaultWidth() > 0) {
538 $a_values["default_width"] = $this->object->getDefaultWidth();
539 }
540 if ($this->object->getDefaultHeight() > 0) {
541 $a_values["default_height"] = $this->object->getDefaultHeight();
542 }
543 }

◆ getFolderValues()

ilObjMediaPoolGUI::getFolderValues ( )

Get current values for folder from.

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

1152 {
1153 $values = array();
1154
1155 $values["title"] = ilMediaPoolItem::lookupTitle($_GET["mepitem_id"]);
1156
1157 $this->form->setValuesByArray($values);
1158 }

References $_GET, and ilMediaPoolItem\lookupTitle().

Referenced by editFolder().

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

◆ getMediaPoolPageValues()

ilObjMediaPoolGUI::getMediaPoolPageValues ( )

Get current values for media pool page from.

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

1415 {
1416 $values = array();
1417
1418 include_once("./Modules/MediaPool/classes/class.ilMediaPoolItem.php");
1419 $values["title"] = ilMediaPoolItem::lookupTitle($_GET["mepitem_id"]);
1420
1421 $this->form->setValuesByArray($values);
1422 }

References $_GET, and ilMediaPoolItem\lookupTitle().

Referenced by editMediaPoolPage().

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

◆ getParentFolderId()

ilObjMediaPoolGUI::getParentFolderId ( )

Get folder parent ID.

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

739 {
740 if ($_GET["mepitem_id"] == "") {
741 return "";
742 }
743 $par_id = $this->object->getPoolTree()->getParentId($_GET["mepitem_id"]);
744 if ($par_id != $this->object->getPoolTree()->getRootId()) {
745 return $par_id;
746 } else {
747 return "";
748 }
749 }

References $_GET.

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ getPreviewModalHTML()

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

Get preview modal html.

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

1922 {
1923 global $DIC;
1924
1925 $tpl = $DIC["tpl"];
1926 $ilCtrl = $DIC->ctrl();
1927 $lng = $DIC->language();
1928
1929 require_once("./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
1931
1932 $tpl->addJavaScript("./Modules/MediaPool/js/ilMediaPool.js");
1933
1934 $ilCtrl->setParameterByClass("ilobjmediapoolgui", "mepitem_id", "");
1935 $ilCtrl->setParameterByClass("ilobjmediapoolgui", "ref_id", $a_mpool_ref_id);
1936 $tpl->addOnloadCode("il.MediaPool.setPreviewUrl('" . $ilCtrl->getLinkTargetByClass(array("ilmediapoolpresentationgui", "ilobjmediapoolgui"), "showPreview", "", false, false) . "');");
1937 $ilCtrl->setParameterByClass("ilobjmediapoolgui", "mepitem_id", $_GET["mepitem_id"]);
1938 $ilCtrl->setParameterByClass("ilobjmediapoolgui", "ref_id", $_GET["red_id"]);
1939
1940 include_once("./Services/UIComponent/Modal/classes/class.ilModalGUI.php");
1941 $modal = ilModalGUI::getInstance();
1942 $modal->setHeading($lng->txt("preview"));
1943 $modal->setId("ilMepPreview");
1944 $modal->setType(ilModalGUI::TYPE_LARGE);
1945 $modal->setBody("<iframe id='ilMepPreviewContent'></iframe>");
1946
1947 return $modal->getHTML();
1948 }
static getInstance()
Get instance.
static includePresentationJS($a_tpl=null)
Include media object presentation JS.

References $_GET, $DIC, $ilCtrl, ilObjectGUI\$lng, ilObjectGUI\$tpl, ilModalGUI\getInstance(), ilObjMediaObjectGUI\includePresentationJS(), and ilModalGUI\TYPE_LARGE.

Referenced by ilMediaPoolTableGUI\getHTML().

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

730 {
731 $this->tpl->loadStandardTemplate();
732 }

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ getType()

ilObjMediaPoolGUI::getType ( )
final

Get type.

Reimplemented from ilObject2GUI.

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

104 {
105 return "mep";
106 }

◆ infoScreen()

ilObjMediaPoolGUI::infoScreen ( )

show information screen

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

1734 {
1735 $this->tabs->activateTab("info_short");
1736 $ilAccess = $this->access;
1738
1739 if (!$ilAccess->checkAccess("visible", "", $this->ref_id) &&
1740 !$ilAccess->checkAccess("read", "", $this->ref_id) &&
1741 !$ilAccess->checkAccess("write", "", $this->ref_id)) {
1742 $ilErr->raiseError($this->lng->txt("msg_no_perm_read"), $ilErr->MESSAGE);
1743 }
1744
1745 if ($this->ctrl->getCmd() == "infoScreen") {
1746 $this->ctrl->setCmd("showSummary");
1747 $this->ctrl->setCmdClass("ilinfoscreengui");
1748 }
1749
1750 include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
1751 $info = new ilInfoScreenGUI($this);
1752
1753 $info->enablePrivateNotes();
1754
1755
1756 // standard meta data
1757 $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
1758
1759 // forward the command
1760 $this->ctrl->forwardCommand($info);
1761 }
Class ilInfoScreenGUI.

References ilObjectGUI\$access, $error, and ilObjectGUI\$ilErr.

Referenced by executeCommand(), and infoScreenObject().

+ Here is the caller graph for this function:

◆ infoScreenObject()

ilObjMediaPoolGUI::infoScreenObject ( )

this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually, if everything works through ilCtrl in the future this may be changed

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

1724 {
1725 $this->ctrl->setCmd("showSummary");
1726 $this->ctrl->setCmdClass("ilinfoscreengui");
1727 $this->infoScreen();
1728 }

References infoScreen().

+ Here is the call graph for this function:

◆ initBulkUploadForm()

ilObjMediaPoolGUI::initBulkUploadForm ( )

Init bulk upload form.

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

1986 {
1988 $lng = $this->lng;
1989
1990 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
1991 $form = new ilPropertyFormGUI();
1992
1993 $form->setFormAction($ctrl->getFormAction($this));
1994 $form->setPreventDoubleSubmission(false);
1995
1997 'cancel',
1998 $lng->txt("mep_media_files"),
1999 'media_files'
2000 );
2001 $item->setUploadUrl($ctrl->getLinkTarget($this, "performBulkUpload", "", true, true));
2002 $item->setMaxFiles(20);
2003 $form->addItem($item);
2004
2005 $form->addCommandButton("performBulkUpload", $lng->txt("upload"));
2006
2007 $form->setTitle($lng->txt("mep_bulk_upload"));
2008
2009 return $form;
2010 }
Class ilFileStandardDropzoneInputGUI.
This class represents a property form user interface.

References ilObjectGUI\$ctrl, and ilObjectGUI\$lng.

Referenced by bulkUpload(), and performBulkUpload().

+ Here is the caller graph for this function:

◆ initCreationForms()

ilObjMediaPoolGUI::initCreationForms (   $a_new_type)
protected

Init creation froms.

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

Parameters
string$a_new_type
Returns
array

Reimplemented from ilObject2GUI.

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

440 {
441 $forms = array(self::CFORM_NEW => $this->initCreateForm($a_new_type),
442 self::CFORM_IMPORT => $this->initImportForm($a_new_type));
443
444 return $forms;
445 }
initImportForm($a_new_type)
Init object import form.
initCreateForm($a_new_type)
Init object creation form.

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

+ Here is the call graph for this function:

◆ initEditCustomForm()

ilObjMediaPoolGUI::initEditCustomForm ( ilPropertyFormGUI  $a_form)
protected

Add custom fields to update form.

Parameters
ilPropertyFormGUI$a_form

Reimplemented from ilObjectGUI.

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

460 {
461 $obj_service = $this->object_service;
462
463 // default width
464 $ni = new ilNumberInputGUI($this->lng->txt("mep_default_width"), "default_width");
465 $ni->setMinValue(0);
466 $ni->setSuffix("px");
467 $ni->setMaxLength(5);
468 $ni->setSize(5);
469 $a_form->addItem($ni);
470
471 // default height
472 $ni = new ilNumberInputGUI($this->lng->txt("mep_default_height"), "default_height");
473 $ni->setSuffix("px");
474 $ni->setMinValue(0);
475 $ni->setMaxLength(5);
476 $ni->setSize(5);
477 $ni->setInfo($this->lng->txt("mep_default_width_height_info"));
478 $a_form->addItem($ni);
479
480 // presentation
481 $pres = new ilFormSectionHeaderGUI();
482 $pres->setTitle($this->lng->txt('obj_presentation'));
483 $a_form->addItem($pres);
484
485 // tile image
486 $obj_service->commonSettings()->legacyForm($a_form, $this->object)->addTileImage();
487
488 // additional features
489 $feat = new ilFormSectionHeaderGUI();
490 $feat->setTitle($this->lng->txt('obj_features'));
491 $a_form->addItem($feat);
492
493 include_once './Services/Container/classes/class.ilContainer.php';
494 include_once './Services/Object/classes/class.ilObjectServiceSettingsGUI.php';
496 $this->object->getId(),
497 $a_form,
498 array(
500 )
501 );
502 }
This class represents a section header in a property form.
This class represents a number property in a property form.
static initServiceSettingsForm($a_obj_id, ilPropertyFormGUI $form, $services)
Init service settings form.
addItem($a_item)
Add Item (Property, SectionHeader).

References ilObjectGUI\$object_service, ilPropertyFormGUI\addItem(), ilObjectServiceSettingsGUI\CUSTOM_METADATA, and ilObjectServiceSettingsGUI\initServiceSettingsForm().

+ Here is the call graph for this function:

◆ initFolderForm()

ilObjMediaPoolGUI::initFolderForm (   $a_mode = "edit")

Init folder form.

Parameters
int$a_modeEdit Mode

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

1218 {
1219 $lng = $this->lng;
1221
1222 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
1223 $this->form = new ilPropertyFormGUI();
1224
1225 // desc
1226 $ti = new ilTextInputGUI($lng->txt("title"), "title");
1227 $ti->setMaxLength(128);
1228 $ti->setRequired(true);
1229 $this->form->addItem($ti);
1230
1231 // save and cancel commands
1232 if ($a_mode == "create") {
1233 $this->form->addCommandButton("saveFolder", $lng->txt("save"));
1234 $this->form->addCommandButton("cancelSave", $lng->txt("cancel"));
1235 $this->form->setTitle($lng->txt("mep_new_folder"));
1236 } else {
1237 $this->form->addCommandButton("updateFolder", $lng->txt("save"));
1238 $this->form->addCommandButton("cancelFolderUpdate", $lng->txt("cancel"));
1239 $this->form->setTitle($lng->txt("mep_edit_folder"));
1240 }
1241
1242 $this->form->setFormAction($ilCtrl->getFormAction($this));
1243 }
This class represents a text property in a property form.

References ilObjectGUI\$ctrl, $ilCtrl, and ilObjectGUI\$lng.

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

+ Here is the caller graph for this function:

◆ initMediaBulkForm()

ilObjMediaPoolGUI::initMediaBulkForm (   $a_id,
  $a_title 
)

Init media bulk form.

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

2152 {
2153 $lng = $this->lng;
2154
2155 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
2156 $form = new ilPropertyFormGUI();
2157 $form->setOpenTag(false);
2158 $form->setCloseTag(false);
2159
2160 // title
2161 $ti = new ilTextInputGUI($lng->txt("title"), "title_" . $a_id);
2162 $ti->setValue($a_title);
2163 $form->addItem($ti);
2164
2165 // description
2166 $ti = new ilTextAreaInputGUI($lng->txt("description"), "description_" . $a_id);
2167 $form->addItem($ti);
2168
2169 return $form;
2170 }
This class represents a text area property in a property form.

References ilObjectGUI\$lng.

Referenced by editTitlesAndDescriptions(), and saveTitlesAndDescriptions().

+ Here is the caller graph for this function:

◆ initMediaPoolPageForm()

ilObjMediaPoolGUI::initMediaPoolPageForm (   $a_mode = "edit")

Init page form.

Parameters
int$a_modeEdit Mode

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

1385 {
1386 $lng = $this->lng;
1388
1389 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
1390 $this->form = new ilPropertyFormGUI();
1391
1392 // title
1393 $ti = new ilTextInputGUI($lng->txt("title"), "title");
1394 $ti->setMaxLength(128);
1395 $ti->setRequired(true);
1396 $this->form->addItem($ti);
1397
1398 // save and cancel commands
1399 if ($a_mode == "create") {
1400 $this->form->addCommandButton("saveMediaPoolPage", $lng->txt("save"));
1401 $this->form->addCommandButton("cancelSave", $lng->txt("cancel"));
1402 $this->form->setTitle($lng->txt("mep_new_content_snippet"));
1403 } else {
1404 $this->form->addCommandButton("updateMediaPoolPage", $lng->txt("save"));
1405 $this->form->setTitle($lng->txt("mep_edit_content_snippet"));
1406 }
1407
1408 $this->form->setFormAction($ilCtrl->getFormAction($this));
1409 }

References ilObjectGUI\$ctrl, $ilCtrl, and ilObjectGUI\$lng.

Referenced by createMediaPoolPage(), editMediaPoolPage(), saveMediaPoolPage(), and updateMediaPoolPage().

+ Here is the caller graph for this function:

◆ insertFromClipboard()

ilObjMediaPoolGUI::insertFromClipboard ( )

insert media object from clipboard

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

953 {
954 $ilAccess = $this->access;
955
956 $this->checkPermission("write");
957
958 include_once("./Services/Clipboard/classes/class.ilEditClipboardGUI.php");
960 $not_inserted = array();
961 if (is_array($ids)) {
962 foreach ($ids as $id2) {
963 $id = explode(":", $id2);
964 $type = $id[0];
965 $id = $id[1];
966
967 if ($type == "mob") { // media object
968 if (ilObjMEdiaPool::isForeignIdInTree($this->object->getId(), $id)) {
969 $not_inserted[] = ilObject::_lookupTitle($id) . " [" .
970 $id . "]";
971 } else {
972 $item = new ilMediaPoolItem();
973 $item->setType("mob");
974 $item->setForeignId($id);
975 $item->setTitle(ilObject::_lookupTitle($id));
976 $item->create();
977 if ($item->getId() > 0) {
978 $this->object->insertInTree($item->getId(), $_GET["mepitem_id"]);
979 }
980 }
981 }
982 if ($type == "incl") { // content snippet
983 include_once("./Modules/MediaPool/classes/class.ilMediaPoolPage.php");
984 include_once("./Modules/MediaPool/classes/class.ilMediaPoolItem.php");
985 if (ilObjMEdiaPool::isItemIdInTree($this->object->getId(), $id)) {
986 $not_inserted[] = ilMediaPoolPage::lookupTitle($id) . " [" .
987 $id . "]";
988 } else {
989 $original = new ilMediaPoolPage($id);
990
991 // copy the page into the pool
992 $item = new ilMediaPoolItem();
993 $item->setType("pg");
994 $item->setTitle(ilMediaPoolItem::lookupTitle($id));
995 $item->create();
996 if ($item->getId() > 0) {
997 $this->object->insertInTree($item->getId(), $_GET["mepitem_id"]);
998
999 // create page
1000 include_once("./Modules/MediaPool/classes/class.ilMediaPoolPage.php");
1001 $page = new ilMediaPoolPage();
1002 $page->setId($item->getId());
1003 $page->setParentId($this->object->getId());
1004 $page->create();
1005
1006 // copy content
1007 $original->copy($page->getId(), $page->getParentType(), $page->getParentId(), true);
1008 }
1009 }
1010 }
1011 }
1012 }
1013 if (count($not_inserted) > 0) {
1014 ilUtil::sendInfo($this->lng->txt("mep_not_insert_already_exist") . "<br>" .
1015 implode("<br>", $not_inserted), true);
1016 }
1017 $this->ctrl->redirect($this, $_GET["mep_mode"] ? $_GET["mep_mode"] : "listMedia");
1018 }
Class ilMediaPoolPage.
static lookupTitle($a_page_id)
Lookup title.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.

References $_GET, ilObjectGUI\$access, $type, ilEditClipboardGUI\_getSelectedIDs(), ilObject\_lookupTitle(), ilObject2GUI\checkPermission(), ilMediaPoolItem\lookupTitle(), ilMediaPoolPage\lookupTitle(), and ilUtil\sendInfo().

+ Here is the call graph for this function:

◆ listMedia()

ilObjMediaPoolGUI::listMedia ( )

list media objects

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

571 {
572 $ilAccess = $this->access;
574 $ilTabs = $this->tabs;
576 $ilToolbar = $this->toolbar;
578
579 $ilCtrl->setParameter($this, "mep_mode", "listMedia");
580
581 $this->checkPermission("read");
582
583 $ilTabs->setTabActive("content");
584 $this->setContentSubTabs("content");
585
586 if ($ilAccess->checkAccess("write", "", $this->object->getRefId())) {
587 $ilToolbar->addButton(
588 $lng->txt("mep_create_mob"),
589 $ilCtrl->getLinkTarget($this, "createMediaObject")
590 );
591
592 $mset = new ilSetting("mobs");
593 if ($mset->get("mep_activate_pages")) {
594 $ilToolbar->addButton(
595 $lng->txt("mep_create_content_snippet"),
596 $ilCtrl->getLinkTarget($this, "createMediaPoolPage")
597 );
598 }
599
600 $ilToolbar->addButton(
601 $lng->txt("mep_create_folder"),
602 $ilCtrl->getLinkTarget($this, "createFolderForm")
603 );
604
605 if (trim($mset->get("upload_dir")) != "" && ilMainMenuGUI::_checkAdministrationPermission()) {
606 $ilToolbar->addButton(
607 $lng->txt("mep_create_from_upload_dir"),
608 $ilCtrl->getLinkTargetByClass("ilfilesystemgui", "listFiles")
609 );
610 }
611
612 $ilToolbar->addButton(
613 $lng->txt("mep_bulk_upload"),
614 $ilCtrl->getLinkTarget($this, "bulkUpload")
615 );
616 }
617
618 $mep_table_gui = new ilMediaPoolTableGUI($this, "listMedia", $this->object, "mepitem_id");
619 $tpl->setContent($mep_table_gui->getHTML());
620 }

References ilObjectGUI\$access, ilObjectGUI\$ctrl, $ilCtrl, ilObjectGUI\$lng, $tabs, ilObjectGUI\$toolbar, ilObjectGUI\$tpl, ilMainMenuGUI\_checkAdministrationPermission(), ilObject2GUI\checkPermission(), and setContentSubTabs().

+ Here is the call graph for this function:

◆ openClipboard()

ilObjMediaPoolGUI::openClipboard ( )

paste from clipboard

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

928 {
930 $ilAccess = $this->access;
931
932 $this->checkPermission("write");
933
934 $ilCtrl->setParameterByClass(
935 "ileditclipboardgui",
936 "returnCommand",
937 rawurlencode($ilCtrl->getLinkTarget(
938 $this,
939 "insertFromClipboard",
940 "",
941 false,
942 false
943 ))
944 );
945 $ilCtrl->redirectByClass("ilEditClipboardGUI", "getObject");
946 }

References ilObjectGUI\$access, ilObjectGUI\$ctrl, $ilCtrl, and ilObject2GUI\checkPermission().

+ Here is the call graph for this function:

◆ performBulkUpload()

ilObjMediaPoolGUI::performBulkUpload ( )

Save bulk upload form.

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

2016 {
2017 $this->checkPermission("write");
2018
2020 $lng = $this->lng;
2024
2025 $form = $this->initBulkUploadForm();
2026 if ($form->checkInput()) {
2027 $mep_item_ids = [];
2028 // Check if this is a request to upload a file
2029 $log->debug("checking for uploads...");
2030 if ($upload->hasUploads()) {
2031 $log->debug("has upload...");
2032 try {
2033 $upload->process();
2034 $log->debug("nr of results: " . count($upload->getResults()));
2035 foreach ($upload->getResults() as $result) {
2036 $title = $result->getName();
2037
2038 $mob = new ilObjMediaObject();
2039 $mob->setTitle($title);
2040 $mob->setDescription("");
2041 $mob->create();
2042
2043 $mob->createDirectory();
2044 $media_item = new ilMediaItem();
2045 $mob->addMediaItem($media_item);
2046 $media_item->setPurpose("Standard");
2047
2048 $mob_dir = ilObjMediaObject::_getRelativeDirectory($mob->getId());
2049 $file_name = ilObjMediaObject::fixFilename($title);
2050 $file = $mob_dir . "/" . $file_name;
2051
2052 $upload->moveOneFileTo(
2053 $result,
2054 $mob_dir,
2055 Location::WEB,
2056 $file_name,
2057 true
2058 );
2059
2060 $mep_item = new ilMediaPoolItem();
2061 $mep_item->setTitle($title);
2062 $mep_item->setType("mob");
2063 $mep_item->setForeignId($mob->getId());
2064 $mep_item->create();
2065
2066 $tree = $this->object->getTree();
2067 $parent = ($_GET["mepitem_id"] == "")
2068 ? $tree->getRootId()
2069 : $_GET["mepitem_id"];
2070 $tree->insertNode($mep_item->getId(), $parent);
2071
2072 // get mime type
2074 $location = $file_name;
2075
2076 // set real meta and object data
2077 $media_item->setFormat($format);
2078 $media_item->setLocation($location);
2079 $media_item->setLocationType("LocalFile");
2080 $media_item->setUploadHash(ilUtil::stripSlashes($_POST["ilfilehash"]));
2081 $mob->update();
2082 $mep_item_ids[] = $mob->getId();
2083 }
2084 } catch (Exception $e) {
2085 $log->debug("Got exception: " . $e->getMessage());
2086 echo json_encode(array( 'success' => false, 'message' => $e->getMessage()));
2087 }
2088 $log->debug("end of 'has_uploads'");
2089 }
2090 $log->debug("has no upload...");
2091
2092 $log->debug("calling redirect... (" . $_POST["ilfilehash"] . ")");
2093 ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
2094 $ctrl->setParameter($this, "mep_hash", $_POST["ilfilehash"]);
2095 $ctrl->redirect($this, "editTitlesAndDescriptions");
2096 }
2097
2098 $form->setValuesByPost();
2099 $main_tpl->setContent($form->getHtml());
2100 }
$result
static fixFilename($a_name)
Fix filename of uploaded file.
static _getRelativeDirectory($a_mob_id)
Get relative (to webspace dir) directory.
$log
Definition: result.php:15

References $_GET, $_POST, ilObjectGUI\$ctrl, Vendor\Package\$e, $format, ilObjectGUI\$lng, $location, $log, $main_tpl, $mep_log, $result, ilObject2GUI\$tree, $upload, ilObjMediaObject\_getRelativeDirectory(), ilObject2GUI\checkPermission(), ilObjMediaObject\fixFilename(), ilObjMediaObject\getMimeType(), initBulkUploadForm(), and ilUtil\stripSlashes().

+ Here is the call graph for this function:

◆ remove()

ilObjMediaPoolGUI::remove ( )

confirm deletion of

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

1033 {
1034 $ilAccess = $this->access;
1035
1036 $this->checkPermission("write");
1037
1038 foreach ($_POST["id"] as $obj_id) {
1039 $this->object->deleteChild($obj_id);
1040 }
1041
1042 ilUtil::sendSuccess($this->lng->txt("cont_obj_removed"), true);
1043 $this->ctrl->redirect($this, $_GET["mep_mode"] ? $_GET["mep_mode"] : "listMedia");
1044 }

References $_GET, $_POST, ilObjectGUI\$access, ilObjectGUI\$obj_id, and ilObject2GUI\checkPermission().

+ Here is the call graph for this function:

◆ resetFilter()

ilObjMediaPoolGUI::resetFilter ( )

Reset filter.

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

711 {
712 include_once("./Modules/MediaPool/classes/class.ilMediaPoolTableGUI.php");
713 $mtab = new ilMediaPoolTableGUI(
714 $this,
715 "allMedia",
716 $this->object,
717 "mepitem_id",
719 true
720 );
721 $mtab->resetFilter();
722 $mtab->resetOffset();
723 $this->allMedia();
724 }

References allMedia(), and ilMediaPoolTableGUI\IL_MEP_EDIT.

+ Here is the call graph for this function:

◆ saveFolder()

ilObjMediaPoolGUI::saveFolder ( )

Save folder form.

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

1164 {
1165 $tpl = $this->tpl;
1166 $lng = $this->lng;
1168
1169 $this->checkPermission("write");
1170
1171 $this->initFolderForm("create");
1172 if ($this->form->checkInput()) {
1173 if ($this->object->createFolder($_POST["title"], (int) $_GET["mepitem_id"])) {
1174 ilUtil::sendSuccess($lng->txt("mep_folder_created"), true);
1175 }
1176 $ilCtrl->redirect($this, "listMedia");
1177 }
1178
1179 $this->form->setValuesByPost();
1180 $tpl->setContent($this->form->getHtml());
1181 }

References $_GET, $_POST, ilObjectGUI\$ctrl, $ilCtrl, ilObjectGUI\$lng, ilObjectGUI\$tpl, ilObject2GUI\checkPermission(), and initFolderForm().

+ Here is the call graph for this function:

◆ saveMediaPoolPage()

ilObjMediaPoolGUI::saveMediaPoolPage ( )

Save media pool page.

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

1315 {
1316 $tpl = $this->tpl;
1317 $lng = $this->lng;
1319
1320 $this->checkPermission("write");
1321
1322 $this->initMediaPoolPageForm("create");
1323 if ($this->form->checkInput()) {
1324 // create media pool item
1325 include_once("./Modules/MediaPool/classes/class.ilMediaPoolItem.php");
1326 $item = new ilMediaPoolItem();
1327 $item->setTitle($_POST["title"]);
1328 $item->setType("pg");
1329 $item->create();
1330
1331 if ($item->getId() > 0) {
1332 // put in tree
1333 $tree = $this->object->getTree();
1334 $parent = $_GET["mepitem_id"] > 0
1335 ? $_GET["mepitem_id"]
1336 : $tree->getRootId();
1337 $this->object->insertInTree($item->getId(), $parent);
1338
1339 // create page
1340 include_once("./Modules/MediaPool/classes/class.ilMediaPoolPage.php");
1341 $page = new ilMediaPoolPage();
1342 $page->setId($item->getId());
1343 $page->setParentId($this->object->getId());
1344 $page->create();
1345
1346 $ilCtrl->setParameterByClass("ilmediapoolpagegui", "mepitem_id", $item->getId());
1347 $ilCtrl->redirectByClass("ilmediapoolpagegui", "edit");
1348 }
1349 $ilCtrl->redirect($this, "listMedia");
1350 }
1351
1352 $this->form->setValuesByPost();
1353 $tpl->setContent($this->form->getHtml());
1354 }

References $_GET, $_POST, ilObjectGUI\$ctrl, $ilCtrl, ilObjectGUI\$lng, ilObjectGUI\$tpl, ilObject2GUI\$tree, ilObject2GUI\checkPermission(), and initMediaPoolPageForm().

+ Here is the call graph for this function:

◆ saveTitlesAndDescriptions()

ilObjMediaPoolGUI::saveTitlesAndDescriptions ( )
protected

Save titles and descriptions.

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

2176 {
2177 $lng = $this->lng;
2179
2180 $this->checkPermission("write");
2181 //var_dump(_$POST); exit;
2182
2183 $media_items = ilMediaItem::getMediaItemsForUploadHash($_GET["mep_hash"]);
2184 include_once("./Services/Accordion/classes/class.ilAccordionGUI.php");
2185
2186 foreach ($media_items as $mi) {
2187 $mob = new ilObjMediaObject($mi["mob_id"]);
2188 $form = $this->initMediaBulkForm($mi["mob_id"], $mob->getTitle());
2189 $form->checkInput();
2190 $title = $form->getInput("title_" . $mi["mob_id"]);
2191 $desc = $form->getInput("description_" . $mi["mob_id"]);
2192 if (trim($title) != "") {
2193 $mob->setTitle($title);
2194 }
2195 $mob->setDescription($desc);
2196 $mob->update();
2197 }
2198 ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
2199 $ctrl->redirect($this, "listMedia");
2200 }

References $_GET, ilObjectGUI\$ctrl, ilObjectGUI\$lng, ilObject2GUI\checkPermission(), ilMediaItem\getMediaItemsForUploadHash(), and initMediaBulkForm().

+ Here is the call graph for this function:

◆ selectUploadDirFiles()

ilObjMediaPoolGUI::selectUploadDirFiles (   $a_files = null)

Select files from upload directory.

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

1772 {
1773 $tpl = $this->tpl;
1774 $ilTabs = $this->tabs;
1775 $lng = $this->lng;
1777 $ilToolbar = $this->toolbar;
1778
1779 if (!$a_files) {
1780 $a_files = $_POST["file"];
1781 }
1782
1783 $ilTabs->clearTargets();
1784 $ilTabs->setBackTarget(
1785 $lng->txt("back"),
1786 $ilCtrl->getLinkTarget($this, "listMedia")
1787 );
1788
1789 $this->checkPermission("write");
1790
1792
1793 // action type
1794 include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
1795 $options = array(
1796 "rename" => $lng->txt("mep_up_dir_move"),
1797 "copy" => $lng->txt("mep_up_dir_copy"),
1798 );
1799 $si = new ilSelectInputGUI("", "action");
1800 $si->setOptions($options);
1801 $ilToolbar->addInputItem($si);
1802 $ilToolbar->setCloseFormTag(false);
1803 $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
1804 $ilToolbar->setFormName("mep_up_form");
1805
1806 include_once("./Modules/MediaPool/classes/class.ilUploadDirFilesTableGUI.php");
1808 $this,
1809 "selectUploadDirFiles",
1810 $a_files
1811 );
1812 $tab->setFormName("mep_up_form");
1813 $tpl->setContent($tab->getHTML());
1814 }
1815 }
This class represents a selection list property in a property form.

References $_POST, ilObjectGUI\$ctrl, $ilCtrl, ilObjectGUI\$lng, $si, $tab, $tabs, ilObjectGUI\$toolbar, ilObjectGUI\$tpl, ilMainMenuGUI\_checkAdministrationPermission(), and ilObject2GUI\checkPermission().

+ Here is the call graph for this function:

◆ setContentSubTabs()

ilObjMediaPoolGUI::setContentSubTabs (   $a_active)

Set sub tabs for content tab.

Parameters
string

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

1523 {
1524 $ilAccess = $this->access;
1525 $ilTabs = $this->tabs;
1527
1528 $ilTabs->addSubTab("content", $this->lng->txt("objs_fold"), $this->ctrl->getLinkTarget($this, ""));
1529
1530 $ilCtrl->setParameter($this, "mepitem_id", "");
1531 $ilTabs->addSubTab("mep_all_mobs", $this->lng->txt("mep_all_mobs"), $this->ctrl->getLinkTarget($this, "allMedia"));
1532 $ilCtrl->setParameter($this, "mepitem_id", $_GET["mepitem_id"]);
1533
1534 if ($ilAccess->checkAccess('write', '', $this->ref_id)) {
1535 $ilTabs->addSubtab(
1536 "srt_files",
1537 $this->lng->txt("mep_media_subtitles"),
1538 $ilCtrl->getLinkTargetByClass("ilmobmultisrtuploadgui", "")
1539 );
1540 }
1541
1542 $ilTabs->activateSubTab($a_active);
1543 }

References $_GET, ilObjectGUI\$access, ilObjectGUI\$ctrl, $ilCtrl, and $tabs.

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

+ Here is the caller graph for this function:

◆ setMediaPoolPageTabs()

ilObjMediaPoolGUI::setMediaPoolPageTabs ( )

Set media pool page tabs.

Parameters

return

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

1431 {
1432 $ilTabs = $this->tabs;
1434 $lng = $this->lng;
1435
1436 $ilTabs->addTarget(
1437 "cont_usage",
1438 $ilCtrl->getLinkTarget($this, "showMediaPoolPageUsages"),
1439 array("showMediaPoolPageUsages", "showAllMediaPoolPageUsages"),
1440 get_class($this)
1441 );
1442 $ilTabs->addTarget(
1443 "settings",
1444 $ilCtrl->getLinkTarget($this, "editMediaPoolPage"),
1445 "editMediaPoolPage",
1446 get_class($this)
1447 );
1448 $ilCtrl->setParameter($this, "mepitem_id", $this->object->getPoolTree()->getParentId($_GET["mepitem_id"]));
1449 $ilTabs->setBackTarget($lng->txt("mep_folder"), $ilCtrl->getLinkTarget($this, "listMedia"));
1450 $ilCtrl->setParameter($this, "mepitem_id", $_GET["mepitem_id"]);
1451 }

References $_GET, ilObjectGUI\$ctrl, $ilCtrl, ilObjectGUI\$lng, and $tabs.

Referenced by editMediaPoolPage(), executeCommand(), and showMediaPoolPageUsages().

+ Here is the caller graph for this function:

◆ setSettingsSubTabs()

ilObjMediaPoolGUI::setSettingsSubTabs (   $a_active)

Set setting sub tabs.

Parameters

return

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

1651 {
1652 $ilTabs = $this->tabs;
1653 $lng = $this->lng;
1654 $ilAccess = $this->access;
1655
1656 if ($ilAccess->checkAccess("write", "", $this->object->getRefId())) {
1657 $ilTabs->addSubTab(
1658 "settings",
1659 $lng->txt("settings"),
1660 $this->ctrl->getLinkTarget($this, "edit")
1661 );
1662
1663 $mset = new ilSetting("mobs");
1664 if ($mset->get("mep_activate_pages")) {
1665 $ilTabs->addSubTabTarget(
1666 "obj_multilinguality",
1667 $this->ctrl->getLinkTargetByClass("ilobjecttranslationgui", "")
1668 );
1669 }
1670 }
1671
1672 $ilTabs->setSubTabActive($a_active);
1673 }

References ilObjectGUI\$access, ilObjectGUI\$lng, and $tabs.

Referenced by edit(), and executeCommand().

+ Here is the caller graph for this function:

◆ setTabs()

ilObjMediaPoolGUI::setTabs ( )

Set tabs.

Reimplemented from ilObject2GUI.

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

1550 {
1551 $ilAccess = $this->access;
1552 $ilTabs = $this->tabs;
1554 $ilHelp = $this->help;
1555
1556 $ilHelp->setScreenIdComponent("mep");
1557
1558 if ($ilAccess->checkAccess('read', '', $this->ref_id) ||
1559 $ilAccess->checkAccess('write', '', $this->ref_id)) {
1560 $ilTabs->addTab("content", $this->lng->txt("mep_content"), $this->ctrl->getLinkTarget($this, ""));
1561 }
1562
1563 // info tab
1564 if ($ilAccess->checkAccess('visible', '', $this->ref_id) ||
1565 $ilAccess->checkAccess('read', '', $this->ref_id) ||
1566 $ilAccess->checkAccess('write', '', $this->ref_id)) {
1567 $force_active = ($this->ctrl->getNextClass() == "ilinfoscreengui"
1568 || strtolower($_GET["cmdClass"]) == "ilnotegui")
1569 ? true
1570 : false;
1571 $ilTabs->addTarget(
1572 "info_short",
1573 $this->ctrl->getLinkTargetByClass(
1574 array("ilobjmediapoolgui", "ilinfoscreengui"),
1575 "showSummary"
1576 ),
1577 array("showSummary", "infoScreen"),
1578 "",
1579 "",
1580 $force_active
1581 );
1582 }
1583
1584 if ($ilAccess->checkAccess("write", "", $this->object->getRefId())) {
1585 $ilTabs->addTarget(
1586 "settings",
1587 $this->ctrl->getLinkTarget($this, "edit"),
1588 "edit",
1589 array("", "ilobjmediapoolgui")
1590 );
1591 }
1592
1593 if ($ilAccess->checkAccess("write", "", $this->object->getRefId())) {
1594 $ilTabs->addTarget(
1595 "clipboard",
1596 $this->ctrl->getLinkTarget($this, "openClipboard"),
1597 "view",
1598 "ileditclipboardgui"
1599 );
1600 }
1601
1602 // properties
1603 if ($ilAccess->checkAccess("write", "", $this->object->getRefId())) {
1604 // meta data
1605 include_once "Services/Object/classes/class.ilObjectMetaDataGUI.php";
1606 $mdgui = new ilObjectMetaDataGUI($this->object, "mob");
1607 $mdtab = $mdgui->getTab();
1608 if ($mdtab) {
1609 $ilTabs->addTarget(
1610 "meta_data",
1611 $mdtab,
1612 "",
1613 "ilobjectmetadatagui"
1614 );
1615 }
1616 }
1617
1618 if ($ilAccess->checkAccess("write", "", $this->object->getRefId())) {
1619 $ilTabs->addTarget(
1620 "export",
1621 $this->ctrl->getLinkTargetByClass("ilexportgui", ""),
1622 "",
1623 "ilexportgui"
1624 );
1625
1626 $ilTabs->addTarget(
1627 "import",
1628 $this->ctrl->getLinkTargetByClass("ilmediapoolimportgui", ""),
1629 "",
1630 "ilmediapoolimportgui"
1631 );
1632 }
1633
1634 if ($ilAccess->checkAccess("edit_permission", "", $this->object->getRefId())) {
1635 $ilTabs->addTarget(
1636 "perm_settings",
1637 $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm"),
1638 array("perm","info","owner"),
1639 'ilpermissiongui'
1640 );
1641 }
1642 }

References $_GET, ilObjectGUI\$access, ilObjectGUI\$ctrl, $help, $ilCtrl, and $tabs.

◆ showAllMediaPoolPageUsages()

ilObjMediaPoolGUI::showAllMediaPoolPageUsages ( )

List usages of the contnet snippet.

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

1457 {
1458 $this->showMediaPoolPageUsages(true);
1459 }
showMediaPoolPageUsages($a_all=false)
List usages of the contnet snippet.

References showMediaPoolPageUsages().

+ Here is the call graph for this function:

◆ showFullscreen()

ilObjMediaPoolGUI::showFullscreen ( )

show fullscreen

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

867 {
868 $this->showMedia();
869 }
showMedia()
show media object

References showMedia().

+ Here is the call graph for this function:

◆ showMedia()

ilObjMediaPoolGUI::showMedia ( )
protected

show media object

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

755 {
756 $this->checkPermission("read");
757
758 $item = new ilMediaPoolItem((int) $_GET["mepitem_id"]);
759 $mob_id = $item->getForeignId();
760
761 $this->tpl = new ilGlobalTemplate("tpl.fullscreen.html", true, true, "Services/COPage");
762 include_once("Services/Style/Content/classes/class.ilObjStyleSheet.php");
763 $this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
764 $this->tpl->setVariable(
765 "LOCATION_CONTENT_STYLESHEET",
767 );
768
769
770 require_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
771 require_once("./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
773 $media_obj = new ilObjMediaObject((int) $mob_id);
774
775
776 $this->tpl->setVariable("TITLE", " - " . $media_obj->getTitle());
777
778 $xml = "<dummy>";
779 // todo: we get always the first alias now (problem if mob is used multiple
780 // times in page)
781 $xml .= $media_obj->getXML(IL_MODE_ALIAS);
782 $xml .= $media_obj->getXML(IL_MODE_OUTPUT);
783 $xml .= $link_xml;
784 $xml .= "</dummy>";
785
786 $xsl = file_get_contents("./Services/COPage/xsl/page.xsl");
787 $args = array( '/_xml' => $xml, '/_xsl' => $xsl );
788 $xh = xslt_create();
789
790 $wb_path = ilUtil::getWebspaceDir("output") . "/";
791
792 $mode = ($_GET["cmd"] != "showPreview")
793 ? "fullscreen"
794 : "media";
795 $enlarge_path = ilUtil::getImagePath("enlarge.svg", false, "output");
796 $fullscreen_link =
797 $this->ctrl->getLinkTarget($this, "showFullscreen", "", false, false);
798 $params = array('mode' => $mode, 'enlarge_path' => $enlarge_path,
799 'link_params' => "ref_id=" . $_GET["ref_id"],'fullscreen_link' => $fullscreen_link,
800 'ref_id' => $_GET["ref_id"], 'pg_frame' => $pg_frame, 'webspace_path' => $wb_path);
801 $output = xslt_process($xh, "arg:/_xml", "arg:/_xsl", null, $args, $params);
802 echo xslt_error($xh);
803 xslt_free($xh);
804 // unmask user html
805 $this->tpl->setVariable("MEDIA_CONTENT", $output);
806 }
const IL_MODE_ALIAS
const IL_MODE_OUTPUT
special template class to simplify handling of ITX/PEAR
static getContentStylePath($a_style_id, $add_random=true, $add_token=true)
get content style path
static getWebspaceDir($mode="filesystem")
get webspace directory
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
xslt_error(&$proc)
xslt_free(&$proc)
xslt_create()
$xml
Definition: metadata.php:332

References $_GET, $xml, ilObject2GUI\checkPermission(), ilObjStyleSheet\getContentStylePath(), ilUtil\getImagePath(), ilUtil\getStyleSheetLocation(), ilUtil\getWebspaceDir(), IL_MODE_ALIAS, IL_MODE_OUTPUT, ilObjMediaObjectGUI\includePresentationJS(), xslt_create(), xslt_error(), and xslt_free().

Referenced by showFullscreen(), and showPreview().

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

◆ showMediaPoolPageUsages()

ilObjMediaPoolGUI::showMediaPoolPageUsages (   $a_all = false)

List usages of the contnet snippet.

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

1466 {
1467 $ilTabs = $this->tabs;
1469 $lng = $this->lng;
1470 $tpl = $this->tpl;
1471
1472 $this->checkPermission("write");
1473
1474 $ilTabs->clearTargets();
1475
1476 $ilTabs->addSubTab(
1477 "current_usages",
1478 $lng->txt("cont_current_usages"),
1479 $ilCtrl->getLinkTarget($this, "showMediaPoolPageUsages")
1480 );
1481
1482 $ilTabs->addSubTab(
1483 "all_usages",
1484 $lng->txt("cont_all_usages"),
1485 $ilCtrl->getLinkTarget($this, "showAllMediaPoolPageUsages")
1486 );
1487
1488 if ($a_all) {
1489 $ilTabs->activateSubTab("all_usages");
1490 $cmd = "showAllMediaPoolPageUsages";
1491 } else {
1492 $ilTabs->activateSubTab("current_usages");
1493 $cmd = "showMediaPoolPageUsages";
1494 }
1495
1496
1497 include_once("./Modules/MediaPool/classes/class.ilMediaPoolPageGUI.php");
1498 $mep_page_gui = new ilMediaPoolPageGUI($_GET["mepitem_id"], $_GET["old_nr"]);
1499 $mep_page_gui->getTabs();
1500
1501 $this->setMediaPoolPageTabs();
1502
1503 include_once("./Modules/MediaPool/classes/class.ilMediaPoolPage.php");
1504 $page = new ilMediaPoolPage((int) $_GET["mepitem_id"]);
1505
1506 include_once("./Modules/MediaPool/classes/class.ilMediaPoolPageUsagesTableGUI.php");
1507 $table = new ilMediaPoolPageUsagesTableGUI($this, $cmd, $page, $a_all);
1508
1509 $tpl->setContent($table->getHTML());
1510 }
TableGUI class for media pool page usages listing.

References $_GET, ilObjectGUI\$ctrl, $ilCtrl, ilObjectGUI\$lng, $tabs, ilObjectGUI\$tpl, ilObject2GUI\checkPermission(), and setMediaPoolPageTabs().

Referenced by showAllMediaPoolPageUsages().

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

◆ showPage()

ilObjMediaPoolGUI::showPage ( )

Show page.

Parameters

return

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

815 {
817
818 //$tpl = new \ilGlobalPageTemplate($DIC->globalScreen(), $DIC->ui(), $DIC->http());
819 $tpl = new ilGlobalTemplate("tpl.fullscreen.html", true, true, "Services/COPage");
820
824
825 // get page object
826 $page_gui = new ilMediaPoolPageGUI((int) $_GET["mepitem_id"]);
827 $page_gui->setTemplate($tpl);
828
829 $page_gui->setTemplateOutput(false);
830 $page_gui->setHeader("");
831 $ret = $page_gui->showPage(true);
832
833 //$tpl->setBodyClass("ilMediaPoolPagePreviewBody");
834 $tpl->setVariable("MEDIA_CONTENT", "<div>" . $ret . "</div>");
835
836
837 $tpl->printToStdout();
838 exit;
839 }
static getSyntaxStylePath()
get syntax style path

References $_GET, $ret, ilObjectGUI\$tpl, exit, ilObjStyleSheet\getContentStylePath(), ilUtil\getStyleSheetLocation(), and ilObjStyleSheet\getSyntaxStylePath().

Referenced by showPreview().

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

◆ showPreview()

ilObjMediaPoolGUI::showPreview ( )

Show content snippet.

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

846 {
847 $this->checkPermission("read");
848
849 $item = new ilMediaPoolItem((int) $_GET["mepitem_id"]);
850
851 switch ($item->getType()) {
852 case "mob":
853 $this->showMedia();
854 break;
855
856 case "pg":
857 $this->showPage();
858 break;
859 }
860 }

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

+ Here is the call graph for this function:

◆ toggleExplorerNodeState()

ilObjMediaPoolGUI::toggleExplorerNodeState ( )
protected

Toggle explorer node.

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

625 : void
626 {
627 $exp = new ilMediaPoolExplorerGUI($this, "listMedia", $this->object);
628 $exp->toggleExplorerNodeState();
629 }
Media pool explorer GUI class.

◆ updateCustom()

ilObjMediaPoolGUI::updateCustom ( ilPropertyFormGUI  $a_form)
protected

Insert custom update form values into object.

Parameters
ilPropertyFormGUI$a_form

Reimplemented from ilObjectGUI.

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

546 {
547 $obj_service = $this->object_service;
548
549 $this->object->setDefaultWidth($a_form->getInput("default_width"));
550 $this->object->setDefaultHeight($a_form->getInput("default_height"));
551
552
553 // additional features
554 include_once './Services/Object/classes/class.ilObjectServiceSettingsGUI.php';
556 $this->object->getId(),
557 $a_form,
558 array(
560 )
561 );
562
563 // tile image
564 $obj_service->commonSettings()->legacyForm($a_form, $this->object)->saveTileImage();
565 }
static updateServiceSettingsForm($a_obj_id, ilPropertyFormGUI $form, $services)
Update service settings.
getInput($a_post_var, $ensureValidation=true)
Returns the value of a HTTP-POST variable, identified by the passed id.

References ilObjectGUI\$object_service, ilObjectServiceSettingsGUI\CUSTOM_METADATA, ilPropertyFormGUI\getInput(), and ilObjectServiceSettingsGUI\updateServiceSettingsForm().

+ Here is the call graph for this function:

◆ updateFolder()

ilObjMediaPoolGUI::updateFolder ( )

Update folder.

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

1187 {
1188 $lng = $this->lng;
1190 $tpl = $this->tpl;
1191
1192 $this->checkPermission("write");
1193
1194 $this->initFolderForm("edit");
1195 if ($this->form->checkInput()) {
1196 $item = new ilMediaPoolItem($_GET["mepitem_id"]);
1197 $item->setTitle($_POST["title"]);
1198 $item->update();
1199 ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
1200 $ilCtrl->setParameter(
1201 $this,
1202 "mepitem_id",
1203 $this->object->getTree()->getParentId($_GET["mepitem_id"])
1204 );
1205 $ilCtrl->redirect($this, "listMedia");
1206 }
1207
1208 $this->form->setValuesByPost();
1209 $tpl->setContent($this->form->getHtml());
1210 }

References $_GET, $_POST, ilObjectGUI\$ctrl, $ilCtrl, ilObjectGUI\$lng, ilObjectGUI\$tpl, ilObject2GUI\checkPermission(), and initFolderForm().

+ Here is the call graph for this function:

◆ updateMediaPoolPage()

ilObjMediaPoolGUI::updateMediaPoolPage ( )

Update media pool page.

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

1360 {
1361 $lng = $this->lng;
1363 $tpl = $this->tpl;
1364
1365 $this->checkPermission("write");
1366
1367 $this->initMediaPoolPageForm("edit");
1368 if ($this->form->checkInput()) {
1369 $item = new ilMediaPoolItem($_GET["mepitem_id"]);
1370 $item->setTitle($_POST["title"]);
1371 $item->update();
1372 ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
1373 $ilCtrl->redirect($this, "editMediaPoolPage");
1374 }
1375
1376 $this->form->setValuesByPost();
1377 $tpl->setContent($this->form->getHtml());
1378 }

References $_GET, $_POST, ilObjectGUI\$ctrl, $ilCtrl, ilObjectGUI\$lng, ilObjectGUI\$tpl, ilObject2GUI\checkPermission(), and initMediaPoolPageForm().

+ Here is the call graph for this function:

Field Documentation

◆ $error

ilObjMediaPoolGUI::$error
protected

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

Referenced by confirmRemove(), and infoScreen().

◆ $help

ilObjMediaPoolGUI::$help
protected

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

Referenced by setTabs().

◆ $main_tpl

ilObjMediaPoolGUI::$main_tpl
protected

◆ $mep_log

ilObjMediaPoolGUI::$mep_log
protected

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

Referenced by performBulkUpload().

◆ $output_prepared

ilObjMediaPoolGUI::$output_prepared

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

◆ $tabs

◆ $upload

ilObjMediaPoolGUI::$upload
protected

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

Referenced by performBulkUpload().


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