ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 ()
 list childs of current object 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...
 

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...
 
 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...
 
 deleteConfirmation ()
 Display delete confirmation form (workspace specific) 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...
 
 showMountWebfolderIcon ()
 
 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
 
 $settings
 
 $rbacreview
 
 $toolbar
 
 $tmp_import_dir
 
 $tabs_gui = null
 
 $ctrl
 
 $object_service
 

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.
global $DIC
Definition: saml.php:7

References $DIC, error(), and ilLoggerFactory\getLogger().

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

1698 {
1699 global $DIC;
1700
1701 $ilAccess = $DIC->access();
1702 $ilErr = $DIC["ilErr"];
1703 $lng = $DIC->language();
1704
1705 $targets = explode('_', $a_target);
1706 if (count((array) $targets) > 1) {
1707 $ref_id = $targets[0];
1708 $subitem_id = $targets[1];
1709 } else {
1710 $ref_id = $targets[0];
1711 }
1712
1713 if ($ilAccess->checkAccess("read", "", $ref_id)) {
1714 $_GET["baseClass"] = "ilMediaPoolPresentationGUI";
1715 $_GET["ref_id"] = $ref_id;
1716 $_GET['mepitem_id'] = $subitem_id;
1717 include("ilias.php");
1718 exit;
1719 } elseif ($ilAccess->checkAccess("visible", "", $ref_id)) {
1720 $_GET["baseClass"] = "ilMediaPoolPresentationGUI";
1721 $_GET["ref_id"] = $ref_id;
1722 $_GET["cmd"] = "infoScreen";
1723 include("ilias.php");
1724 exit;
1725 } elseif ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID)) {
1726 ilUtil::sendFailure(sprintf(
1727 $lng->txt("msg_no_perm_read_item"),
1729 ), true);
1731 }
1732
1733 $ilErr->raiseError($lng->txt("msg_no_perm_read"), $ilErr->FATAL);
1734 }
exit
Definition: backend.php:16
$_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.

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

1105 {
1106 $ilLocator = $this->locator;
1107 $ilAccess = $this->access;
1108
1109 if (!$this->getCreationMode() && $this->ctrl->getCmd() != "explorer") {
1110 $tree = $this->object->getTree();
1111 $obj_id = ($_GET["mepitem_id"] == "")
1112 ? $tree->getRootId()
1113 : $_GET["mepitem_id"];
1114 $path = $tree->getPathFull($obj_id);
1115 foreach ($path as $node) {
1116 if ($node["child"] == $tree->getRootId()) {
1117 $this->ctrl->setParameter($this, "mepitem_id", "");
1118 if ($ilAccess->checkAccess("read", "", $this->object->getRefId())) {
1119 $link = $this->ctrl->getLinkTarget($this, "listMedia");
1120 } elseif ($ilAccess->checkAccess("visible", "", $this->object->getRefId())) {
1121 $link = $this->ctrl->getLinkTarget($this, "infoScreen");
1122 }
1123 $title = $this->object->getTitle();
1124 $this->ctrl->setParameter($this, "mepitem_id", $_GET["mepitem_id"]);
1125 $ilLocator->addItem($title, $link, "", $_GET["ref_id"]);
1126 }
1127 }
1128 }
1129 }
$path
Definition: aliased.php:25
getCreationMode()
get creation mode

References $_GET, ilObjectGUI\$access, ilObjectGUI\$locator, ilObjectGUI\$obj_id, $path, $title, 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 449 of file class.ilObjMediaPoolGUI.php.

450 {
451 // always send a message
452 ilUtil::sendSuccess($this->lng->txt("object_added"), true);
453
454 //ilUtil::redirect($this->getReturnLocation("save","adm_object.php?".$this->link_params));
455 ilUtil::redirect("ilias.php?baseClass=ilMediaPoolPresentationGUI&ref_id=" . $newObj->getRefId() . "&cmd=listMedia");
456 }
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 1990 of file class.ilObjMediaPoolGUI.php.

1991 {
1992 $this->checkPermission("write");
1993
1995
1996 $form = $this->initBulkUploadForm();
1997 $main_tpl->setContent($form->getHTML());
1998 }
initBulkUploadForm()
Init bulk upload form.
if(isset($_POST['submit'])) $form

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

+ Here is the call graph for this function:

◆ cancelFolderUpdate()

ilObjMediaPoolGUI::cancelFolderUpdate ( )

Cancel save.

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

1267 {
1269 $ilCtrl->setParameter(
1270 $this,
1271 "mepitem_id",
1272 $this->object->getTree()->getParentId($_GET["mepitem_id"])
1273 );
1274 $ilCtrl->redirect($this, "listMedia");
1275 }

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

◆ cancelRemove()

ilObjMediaPoolGUI::cancelRemove ( )

cancel deletion of media objects/folders

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

1043 {
1044 $this->ctrl->redirect($this, $_GET["mep_mode"] ? $_GET["mep_mode"] : "listMedia");
1045 }

References $_GET.

◆ cancelSave()

ilObjMediaPoolGUI::cancelSave ( )

Cancel save.

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

1281 {
1283 $ilCtrl->redirect($this, "listMedia");
1284 }

References ilObjectGUI\$ctrl, and $ilCtrl.

◆ confirmRemove()

ilObjMediaPoolGUI::confirmRemove ( )

confirm remove of mobs

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

893 {
897
898 $this->checkPermission("write");
899
900 if (!isset($_POST["id"])) {
901 $ilErr->raiseError($this->lng->txt("no_checkbox"), $ilErr->MESSAGE);
902 }
903
904 // display confirmation message
905 include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
906 $cgui = new ilConfirmationGUI();
907 $cgui->setFormAction($this->ctrl->getFormAction($this));
908 $cgui->setHeaderText($this->lng->txt("info_remove_sure"));
909 $cgui->setCancel($this->lng->txt("cancel"), "cancelRemove");
910 $cgui->setConfirm($this->lng->txt("confirm"), "remove");
911
912 foreach ($_POST["id"] as $obj_id) {
915
916 // check whether page can be removed
917 $add = "";
918 if ($type == "pg") {
919 include_once("./Services/COPage/classes/class.ilPageContentUsage.php");
920 $usages = ilPageContentUsage::getUsages("incl", $obj_id, false);
921 if (count($usages) > 0) {
922 ilUtil::sendFailure(sprintf($lng->txt("mep_content_snippet_in_use"), $title), true);
923 $ilCtrl->redirect($this, "listMedia");
924 } else {
925 // check whether the snippet is used in older versions of pages
926 $usages = ilPageContentUsage::getUsages("incl", $obj_id, true);
927 if (count($usages) > 0) {
928 $add = "<div class='small'>" . $lng->txt("mep_content_snippet_used_in_older_versions") . "</div>";
929 }
930 }
931 }
932
933 $caption = ilUtil::getImageTagByType($type, $this->tpl->tplPath) .
934 " " . $title . $add;
935
936 $cgui->addItem("id[]", $obj_id, $caption);
937 }
938
939 $this->tpl->setContent($cgui->getHTML());
940 }
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, $title, $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 1068 of file class.ilObjMediaPoolGUI.php.

1069 {
1071 $ilAccess = $this->access;
1072
1073 $this->checkPermission("write");
1074
1075 if (!isset($_POST["id"])) {
1076 ilUtil::sendFailure($this->lng->txt("no_checkbox"), true);
1077 $this->ctrl->redirect($this, $_GET["mep_mode"] ? $_GET["mep_mode"] : "listMedia");
1078 }
1079
1080 foreach ($_POST["id"] as $obj_id) {
1082 if ($type == "fold") {
1083 ilUtil::sendFailure($this->lng->txt("cont_cant_copy_folders"), true);
1084 $this->ctrl->redirect($this, $_GET["mep_mode"] ? $_GET["mep_mode"] : "listMedia");
1085 }
1086 }
1087 foreach ($_POST["id"] as $obj_id) {
1090 if ($type == "mob") {
1091 $ilUser->addObjectToClipboard($fid, "mob", "");
1092 }
1093 if ($type == "pg") {
1094 $ilUser->addObjectToClipboard($obj_id, "incl", "");
1095 }
1096 }
1097 ilUtil::sendSuccess($this->lng->txt("copied_to_clipboard"), true);
1098 $this->ctrl->redirect($this, $_GET["mep_mode"] ? $_GET["mep_mode"] : "listMedia");
1099 }
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 1138 of file class.ilObjMediaPoolGUI.php.

1139 {
1140 $ilAccess = $this->access;
1141 $tpl = $this->tpl;
1142
1143 $this->checkPermission("write");
1144
1145 $this->initFolderForm("create");
1146 $tpl->setContent($this->form->getHTML());
1147 }
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 1838 of file class.ilObjMediaPoolGUI.php.

1839 {
1840 $this->checkPermission("write");
1841
1842 $mset = new ilSetting("mobs");
1843 $upload_dir = trim($mset->get("upload_dir"));
1844
1845 include_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
1846
1847 if (is_array($_POST["file"]) && ilMainMenuGUI::_checkAdministrationPermission()) {
1848 foreach ($_POST["file"] as $f) {
1849 $f = str_replace("..", "", $f);
1850 $fullpath = $upload_dir . "/" . $f;
1851 $mob = new ilObjMediaObject();
1852 $mob->setTitle(basename($fullpath));
1853 $mob->setDescription("");
1854 $mob->create();
1855
1856 // determine and create mob directory, move uploaded file to directory
1857 //$mob_dir = ilUtil::getWebspaceDir()."/mobs/mm_".$a_mob->getId();
1858 $mob->createDirectory();
1859 $mob_dir = ilObjMediaObject::_getDirectory($mob->getId());
1860
1861 $media_item = new ilMediaItem();
1862 $mob->addMediaItem($media_item);
1863 $media_item->setPurpose("Standard");
1864
1865 $file = $mob_dir . "/" . basename($fullpath);
1866
1867 // virus handling
1868 $vir = ilUtil::virusHandling($fullpath, basename($fullpath));
1869 if (!$vir[0]) {
1870 ilUtil::sendFailure($this->lng->txt("file_is_infected") . "<br />" . $vir[1], true);
1871 ilUtil::redirect("ilias.php?baseClass=ilMediaPoolPresentationGUI&cmd=listMedia&ref_id=" .
1872 $_GET["ref_id"] . "&mepitem_id=" . $_GET["mepitem_id"]);
1873 }
1874
1875 switch ($_POST["action"]) {
1876 case "rename":
1877 rename($fullpath, $file);
1878 break;
1879
1880 case "copy":
1881 copy($fullpath, $file);
1882 break;
1883 }
1884
1885 // get mime type
1887 $location = basename($fullpath);
1888
1889 // set real meta and object data
1890 $media_item->setFormat($format);
1891 $media_item->setLocation($location);
1892 $media_item->setLocationType("LocalFile");
1893
1894 $mob->setDescription($format);
1895
1896 // determine width and height of known image types
1898 $format,
1899 "File",
1900 $mob_dir . "/" . $location,
1901 $media_item->getLocation(),
1902 true,
1903 true,
1904 "",
1905 ""
1906 );
1907 $media_item->setWidth($wh["width"]);
1908 $media_item->setHeight($wh["height"]);
1909 if ($wh["info"] != "") {
1910 // ilUtil::sendInfo($wh["info"], true);
1911 }
1912
1913 $media_item->setHAlign("Left");
1914 ilUtil::renameExecutables($mob_dir);
1915 $mob->update();
1916
1917
1918 // put it into current folder
1919 $mep_item = new ilMediaPoolItem();
1920 $mep_item->setTitle($mob->getTitle());
1921 $mep_item->setType("mob");
1922 $mep_item->setForeignId($mob->getId());
1923 $mep_item->create();
1924
1925 $tree = $this->object->getTree();
1926 $parent = ($_GET["mepitem_id"] == "")
1927 ? $tree->getRootId()
1928 : $_GET["mepitem_id"];
1929 $tree->insertNode($mep_item->getId(), $parent);
1930 }
1931 }
1932 ilUtil::redirect("ilias.php?baseClass=ilMediaPoolPresentationGUI&cmd=listMedia&ref_id=" .
1933 $_GET["ref_id"] . "&mepitem_id=" . $_GET["mepitem_id"]);
1934 }
$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:141

References $_GET, $_POST, $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 433 of file class.ilObjMediaPoolGUI.php.

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

◆ createMediaPoolPage()

ilObjMediaPoolGUI::createMediaPoolPage ( )

Create new content snippet.

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

1294 {
1295 $tpl = $this->tpl;
1296
1297 $this->checkPermission("write");
1298
1299 $this->initMediaPoolPageForm("create");
1300 $tpl->setContent($this->form->getHTML());
1301 }
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 508 of file class.ilObjMediaPoolGUI.php.

509 {
511 $ilTabs = $this->tabs_gui;
513
514 $this->setSettingsSubTabs("settings");
515
516 if (!$this->checkPermissionBool("write")) {
517 $ilErr->raiseError($this->lng->txt("msg_no_perm_write"), $ilErr->MESSAGE);
518 }
519
520 $ilTabs->activateTab("settings");
521
522 $form = $this->initEditForm();
523 $values = $this->getEditFormValues();
524 if ($values) {
525 $form->setValuesByArray($values, true);
526 }
527
529
530 $tpl->setContent($form->getHTML());
531 }
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)
$values

References $form, ilObjectGUI\$ilErr, ilObjectGUI\$tabs_gui, ilObjectGUI\$tpl, $values, 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 1155 of file class.ilObjMediaPoolGUI.php.

1156 {
1157 $tpl = $this->tpl;
1158
1159 $this->checkPermission("write");
1160
1161 $this->initFolderForm();
1162 $this->getFolderValues();
1163 $tpl->setContent($this->form->getHTML());
1164 }
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 1309 of file class.ilObjMediaPoolGUI.php.

1310 {
1311 $tpl = $this->tpl;
1312 $ilTabs = $this->tabs;
1313
1314 $this->checkPermission("write");
1315
1316 $ilTabs->clearTargets();
1317
1318 include_once("./Modules/MediaPool/classes/class.ilMediaPoolPageGUI.php");
1319 $mep_page_gui = new ilMediaPoolPageGUI($_GET["mepitem_id"], $_GET["old_nr"]);
1320 $mep_page_gui->getTabs();
1321
1322 $this->setMediaPoolPageTabs();
1323
1324 $this->initMediaPoolPageForm("edit");
1325 $this->getMediaPoolPageValues();
1326 $tpl->setContent($this->form->getHTML());
1327 }
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 2123 of file class.ilObjMediaPoolGUI.php.

2124 {
2126 $lng = $this->lng;
2127
2128 $this->checkPermission("write");
2129 $ctrl->saveParameter($this, "mep_hash");
2130
2132
2133 include_once("./Services/MediaObjects/classes/class.ilMediaItem.php");
2134 $media_items = ilMediaItem::getMediaItemsForUploadHash($_GET["mep_hash"]);
2135
2136 include_once("./Services/Accordion/classes/class.ilAccordionGUI.php");
2137
2138 $tb = new ilToolbarGUI();
2139 $tb->setFormAction($ctrl->getFormAction($this));
2140 $tb->addFormButton($lng->txt("save"), "saveTitlesAndDescriptions");
2141 $tb->setOpenFormTag(true);
2142 $tb->setCloseFormTag(false);
2143 $tb->setId("tb_top");
2144
2145 $html = $tb->getHTML();
2146 foreach ($media_items as $mi) {
2147 $acc = new ilAccordionGUI();
2148 $acc->setBehaviour(ilAccordionGUI::ALL_CLOSED);
2149 $acc->setId("acc_" . $mi["mob_id"]);
2150
2151 $mob = new ilObjMediaObject($mi["mob_id"]);
2152 $form = $this->initMediaBulkForm($mi["mob_id"], $mob->getTitle());
2153 $acc->addItem($mob->getTitle(), $form->getHTML());
2154
2155 $html .= $acc->getHTML();
2156 }
2157
2158 $html .= $tb->getHTML();
2159 $tb->setOpenFormTag(false);
2160 $tb->setCloseFormTag(true);
2161 $tb->setId("tb_bottom");
2162
2163 $main_tpl->setContent($html);
2164 }
Accordion user interface class.
static getMediaItemsForUploadHash($a_hash)
Get media items for upload hash.
initMediaBulkForm($a_id, $a_title)
Init media bulk form.
$html
Definition: example_001.php:87

References $_GET, ilObjectGUI\$ctrl, $form, $html, 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->show();
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->show();
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->show();
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->show();
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->show();
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->show();
309 break;
310
311 case 'ilinfoscreengui':
312 $this->prepareOutput();
313 $this->addHeaderAction();
314 $this->infoScreen();
315 $this->tpl->show();
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->show();
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->show();
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->show();
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->show();
392 break;
393
394 case "ilmediapoolimportgui":
395 $this->prepareOutput();
396 $this->addHeaderAction();
397 $ilTabs->activateTab("import");
398 include_once("./Modules/MediaPool/classes/class.ilMediaPoolImportGUI.php");
399 $gui = new ilMediaPoolImportGUI($this->object);
400 $this->ctrl->forwardCommand($gui);
401 $this->tpl->show();
402 break;
403
404 case "ilmobmultisrtuploadgui":
405 $this->checkPermission("write");
406 $this->prepareOutput();
407 $this->addHeaderAction();
408 //$this->setTabs("content");
409 $this->setContentSubTabs("srt_files");
410 include_once("./Services/MediaObjects/classes/class.ilMobMultiSrtUploadGUI.php");
411 include_once("./Modules/MediaPool/classes/class.ilMepMultiSrt.php");
412 $gui = new ilMobMultiSrtUploadGUI(new ilMepMultiSrt($this->object));
413 $this->ctrl->forwardCommand($gui);
414 $this->tpl->show();
415 break;
416
417
418 default:
419 $this->prepareOutput();
420 $this->addHeaderAction();
421 $cmd = $this->ctrl->getCmd("listMedia");
422 $this->$cmd();
423 if (!$this->getCreationMode()) {
424 $this->tpl->show();
425 }
426 break;
427 }
428 }
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 1971 of file class.ilObjMediaPoolGUI.php.

1972 {
1973 $ot = ilObjectTranslation::getInstance($this->object->getId());
1974 $opt = "";
1975 if ($ot->getContentActivated()) {
1976 $format = explode("_", $_POST["format"]);
1977 $opt = ilUtil::stripSlashes($format[1]);
1978 }
1979
1980 $this->object->exportXML($opt);
1981 }
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 534 of file class.ilObjMediaPoolGUI.php.

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

◆ getFolderValues()

ilObjMediaPoolGUI::getFolderValues ( )

Get current values for folder from.

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

1170 {
1171 $values = array();
1172
1173 $values["title"] = ilMediaPoolItem::lookupTitle($_GET["mepitem_id"]);
1174
1175 $this->form->setValuesByArray($values);
1176 }

References $_GET, $values, 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 1432 of file class.ilObjMediaPoolGUI.php.

1433 {
1434 $values = array();
1435
1436 include_once("./Modules/MediaPool/classes/class.ilMediaPoolItem.php");
1437 $values["title"] = ilMediaPoolItem::lookupTitle($_GET["mepitem_id"]);
1438
1439 $this->form->setValuesByArray($values);
1440 }

References $_GET, $values, 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 1939 of file class.ilObjMediaPoolGUI.php.

1940 {
1941 global $DIC;
1942
1943 $tpl = $DIC["tpl"];
1944 $ilCtrl = $DIC->ctrl();
1945 $lng = $DIC->language();
1946
1947 require_once("./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
1949
1950 $tpl->addJavaScript("./Modules/MediaPool/js/ilMediaPool.js");
1951
1952 $ilCtrl->setParameterByClass("ilobjmediapoolgui", "mepitem_id", "");
1953 $ilCtrl->setParameterByClass("ilobjmediapoolgui", "ref_id", $a_mpool_ref_id);
1954 $tpl->addOnloadCode("il.MediaPool.setPreviewUrl('" . $ilCtrl->getLinkTargetByClass(array("ilmediapoolpresentationgui", "ilobjmediapoolgui"), "showPreview", "", false, false) . "');");
1955 $ilCtrl->setParameterByClass("ilobjmediapoolgui", "mepitem_id", $_GET["mepitem_id"]);
1956 $ilCtrl->setParameterByClass("ilobjmediapoolgui", "ref_id", $_GET["red_id"]);
1957
1958 include_once("./Services/UIComponent/Modal/classes/class.ilModalGUI.php");
1959 $modal = ilModalGUI::getInstance();
1960 $modal->setHeading($lng->txt("preview"));
1961 $modal->setId("ilMepPreview");
1962 $modal->setType(ilModalGUI::TYPE_LARGE);
1963 $modal->setBody("<iframe id='ilMepPreviewContent'></iframe>");
1964
1965 return $modal->getHTML();
1966 }
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->getStandardTemplate();
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 1751 of file class.ilObjMediaPoolGUI.php.

1752 {
1753 $this->tabs->activateTab("info_short");
1754 $ilAccess = $this->access;
1756
1757 if (!$ilAccess->checkAccess("visible", "", $this->ref_id) &&
1758 !$ilAccess->checkAccess("read", "", $this->ref_id) &&
1759 !$ilAccess->checkAccess("write", "", $this->ref_id)) {
1760 $ilErr->raiseError($this->lng->txt("msg_no_perm_read"), $ilErr->MESSAGE);
1761 }
1762
1763 if ($this->ctrl->getCmd() == "infoScreen") {
1764 $this->ctrl->setCmd("showSummary");
1765 $this->ctrl->setCmdClass("ilinfoscreengui");
1766 }
1767
1768 include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
1769 $info = new ilInfoScreenGUI($this);
1770
1771 $info->enablePrivateNotes();
1772
1773
1774 // standard meta data
1775 $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
1776
1777 // forward the command
1778 $this->ctrl->forwardCommand($info);
1779 }
Class ilInfoScreenGUI.
$info
Definition: index.php:5

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

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

1742 {
1743 $this->ctrl->setCmd("showSummary");
1744 $this->ctrl->setCmdClass("ilinfoscreengui");
1745 $this->infoScreen();
1746 }

References infoScreen().

+ Here is the call graph for this function:

◆ initBulkUploadForm()

ilObjMediaPoolGUI::initBulkUploadForm ( )

Init bulk upload form.

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

2004 {
2006 $lng = $this->lng;
2007
2008 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
2009 $form = new ilPropertyFormGUI();
2010
2011 $form->setFormAction($ctrl->getFormAction($this));
2012 $form->setPreventDoubleSubmission(false);
2013
2015 'cancel',
2016 $lng->txt("mep_media_files"),
2017 'media_files'
2018 );
2019 $item->setUploadUrl($ctrl->getLinkTarget($this, "performBulkUpload", "", true, true));
2020 $item->setMaxFiles(20);
2021 $form->addItem($item);
2022
2023 $form->addCommandButton("performBulkUpload", $lng->txt("upload"));
2024
2025 $form->setTitle($lng->txt("mep_bulk_upload"));
2026
2027 return $form;
2028 }
Class ilFileStandardDropzoneInputGUI.
This class represents a property form user interface.

References ilObjectGUI\$ctrl, $form, 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 438 of file class.ilObjMediaPoolGUI.php.

439 {
440 $forms = array(self::CFORM_NEW => $this->initCreateForm($a_new_type),
441 self::CFORM_IMPORT => $this->initImportForm($a_new_type));
442
443 return $forms;
444 }
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 458 of file class.ilObjMediaPoolGUI.php.

459 {
460 $obj_service = $this->object_service;
461
462 // default width
463 $ni = new ilNumberInputGUI($this->lng->txt("mep_default_width"), "default_width");
464 $ni->setMinValue(0);
465 $ni->setSuffix("px");
466 $ni->setMaxLength(5);
467 $ni->setSize(5);
468 $a_form->addItem($ni);
469
470 // default height
471 $ni = new ilNumberInputGUI($this->lng->txt("mep_default_height"), "default_height");
472 $ni->setSuffix("px");
473 $ni->setMinValue(0);
474 $ni->setMaxLength(5);
475 $ni->setSize(5);
476 $ni->setInfo($this->lng->txt("mep_default_width_height_info"));
477 $a_form->addItem($ni);
478
479 // presentation
480 $pres = new ilFormSectionHeaderGUI();
481 $pres->setTitle($this->lng->txt('obj_presentation'));
482 $a_form->addItem($pres);
483
484 // tile image
485 $obj_service->commonSettings()->legacyForm($a_form, $this->object)->addTileImage();
486
487 // additional features
488 $feat = new ilFormSectionHeaderGUI();
489 $feat->setTitle($this->lng->txt('obj_features'));
490 $a_form->addItem($feat);
491
492 include_once './Services/Container/classes/class.ilContainer.php';
493 include_once './Services/Object/classes/class.ilObjectServiceSettingsGUI.php';
495 $this->object->getId(),
496 $a_form,
497 array(
499 )
500 );
501 }
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 1235 of file class.ilObjMediaPoolGUI.php.

1236 {
1237 $lng = $this->lng;
1239
1240 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
1241 $this->form = new ilPropertyFormGUI();
1242
1243 // desc
1244 $ti = new ilTextInputGUI($lng->txt("title"), "title");
1245 $ti->setMaxLength(128);
1246 $ti->setRequired(true);
1247 $this->form->addItem($ti);
1248
1249 // save and cancel commands
1250 if ($a_mode == "create") {
1251 $this->form->addCommandButton("saveFolder", $lng->txt("save"));
1252 $this->form->addCommandButton("cancelSave", $lng->txt("cancel"));
1253 $this->form->setTitle($lng->txt("mep_new_folder"));
1254 } else {
1255 $this->form->addCommandButton("updateFolder", $lng->txt("save"));
1256 $this->form->addCommandButton("cancelFolderUpdate", $lng->txt("cancel"));
1257 $this->form->setTitle($lng->txt("mep_edit_folder"));
1258 }
1259
1260 $this->form->setFormAction($ilCtrl->getFormAction($this));
1261 }
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 2169 of file class.ilObjMediaPoolGUI.php.

2170 {
2171 $lng = $this->lng;
2172
2173 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
2174 $form = new ilPropertyFormGUI();
2175 $form->setOpenTag(false);
2176 $form->setCloseTag(false);
2177
2178 // title
2179 $ti = new ilTextInputGUI($lng->txt("title"), "title_" . $a_id);
2180 $ti->setValue($a_title);
2181 $form->addItem($ti);
2182
2183 // description
2184 $ti = new ilTextAreaInputGUI($lng->txt("description"), "description_" . $a_id);
2185 $form->addItem($ti);
2186
2187 return $form;
2188 }
This class represents a text area property in a property form.

References $form, and 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 1402 of file class.ilObjMediaPoolGUI.php.

1403 {
1404 $lng = $this->lng;
1406
1407 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
1408 $this->form = new ilPropertyFormGUI();
1409
1410 // title
1411 $ti = new ilTextInputGUI($lng->txt("title"), "title");
1412 $ti->setMaxLength(128);
1413 $ti->setRequired(true);
1414 $this->form->addItem($ti);
1415
1416 // save and cancel commands
1417 if ($a_mode == "create") {
1418 $this->form->addCommandButton("saveMediaPoolPage", $lng->txt("save"));
1419 $this->form->addCommandButton("cancelSave", $lng->txt("cancel"));
1420 $this->form->setTitle($lng->txt("mep_new_content_snippet"));
1421 } else {
1422 $this->form->addCommandButton("updateMediaPoolPage", $lng->txt("save"));
1423 $this->form->setTitle($lng->txt("mep_edit_content_snippet"));
1424 }
1425
1426 $this->form->setFormAction($ilCtrl->getFormAction($this));
1427 }

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

971 {
972 $ilAccess = $this->access;
973
974 $this->checkPermission("write");
975
976 include_once("./Services/Clipboard/classes/class.ilEditClipboardGUI.php");
978 $not_inserted = array();
979 if (is_array($ids)) {
980 foreach ($ids as $id2) {
981 $id = explode(":", $id2);
982 $type = $id[0];
983 $id = $id[1];
984
985 if ($type == "mob") { // media object
986 if (ilObjMEdiaPool::isForeignIdInTree($this->object->getId(), $id)) {
987 $not_inserted[] = ilObject::_lookupTitle($id) . " [" .
988 $id . "]";
989 } else {
990 $item = new ilMediaPoolItem();
991 $item->setType("mob");
992 $item->setForeignId($id);
993 $item->setTitle(ilObject::_lookupTitle($id));
994 $item->create();
995 if ($item->getId() > 0) {
996 $this->object->insertInTree($item->getId(), $_GET["mepitem_id"]);
997 }
998 }
999 }
1000 if ($type == "incl") { // content snippet
1001 include_once("./Modules/MediaPool/classes/class.ilMediaPoolPage.php");
1002 include_once("./Modules/MediaPool/classes/class.ilMediaPoolItem.php");
1003 if (ilObjMEdiaPool::isItemIdInTree($this->object->getId(), $id)) {
1004 $not_inserted[] = ilMediaPoolPage::lookupTitle($id) . " [" .
1005 $id . "]";
1006 } else {
1007 $original = new ilMediaPoolPage($id);
1008
1009 // copy the page into the pool
1010 $item = new ilMediaPoolItem();
1011 $item->setType("pg");
1012 $item->setTitle(ilMediaPoolItem::lookupTitle($id));
1013 $item->create();
1014 if ($item->getId() > 0) {
1015 $this->object->insertInTree($item->getId(), $_GET["mepitem_id"]);
1016
1017 // create page
1018 include_once("./Modules/MediaPool/classes/class.ilMediaPoolPage.php");
1019 $page = new ilMediaPoolPage();
1020 $page->setId($item->getId());
1021 $page->setParentId($this->object->getId());
1022 $page->create();
1023
1024 // copy content
1025 $original->copy($page->getId(), $page->getParentType(), $page->getParentId(), true);
1026 }
1027 }
1028 }
1029 }
1030 }
1031 if (count($not_inserted) > 0) {
1032 ilUtil::sendInfo($this->lng->txt("mep_not_insert_already_exist") . "<br>" .
1033 implode($not_inserted, "<br>"), true);
1034 }
1035 $this->ctrl->redirect($this, $_GET["mep_mode"] ? $_GET["mep_mode"] : "listMedia");
1036 }
Class ilMediaPoolPage.
static lookupTitle($a_page_id)
Lookup title.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
if(!array_key_exists('StateId', $_REQUEST)) $id

References $_GET, ilObjectGUI\$access, $id, $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 569 of file class.ilObjMediaPoolGUI.php.

570 {
571 $ilAccess = $this->access;
573 $ilTabs = $this->tabs;
575 $ilToolbar = $this->toolbar;
577
578 $ilCtrl->setParameter($this, "mep_mode", "listMedia");
579
580 $this->checkPermission("read");
581
582 $ilTabs->setTabActive("content");
583 $this->setContentSubTabs("content");
584
585 if ($ilAccess->checkAccess("write", "", $this->object->getRefId())) {
586 $ilToolbar->addButton(
587 $lng->txt("mep_create_mob"),
588 $ilCtrl->getLinkTarget($this, "createMediaObject")
589 );
590
591 $mset = new ilSetting("mobs");
592 if ($mset->get("mep_activate_pages")) {
593 $ilToolbar->addButton(
594 $lng->txt("mep_create_content_snippet"),
595 $ilCtrl->getLinkTarget($this, "createMediaPoolPage")
596 );
597 }
598
599 $ilToolbar->addButton(
600 $lng->txt("mep_create_folder"),
601 $ilCtrl->getLinkTarget($this, "createFolderForm")
602 );
603
604 if (trim($mset->get("upload_dir")) != "" && ilMainMenuGUI::_checkAdministrationPermission()) {
605 $ilToolbar->addButton(
606 $lng->txt("mep_create_from_upload_dir"),
607 $ilCtrl->getLinkTargetByClass("ilfilesystemgui", "listFiles")
608 );
609 }
610
611 $ilToolbar->addButton(
612 $lng->txt("mep_bulk_upload"),
613 $ilCtrl->getLinkTarget($this, "bulkUpload")
614 );
615 }
616
617 // tree
618 include_once("./Modules/MediaPool/classes/class.ilMediaPoolExplorerGUI.php");
619 $exp = new ilMediaPoolExplorerGUI($this, "listMedia", $this->object);
620 if (!$exp->handleCommand()) {
621 $this->tpl->setLeftNavContent($exp->getHTML());
622 } else {
623 return;
624 }
625
626 include_once("./Modules/MediaPool/classes/class.ilMediaPoolTableGUI.php");
627 $mep_table_gui = new ilMediaPoolTableGUI($this, "listMedia", $this->object, "mepitem_id");
628 $tpl->setContent($mep_table_gui->getHTML());
629 }
Media pool explorer GUI class.

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

946 {
948 $ilAccess = $this->access;
949
950 $this->checkPermission("write");
951
952 $ilCtrl->setParameterByClass(
953 "ileditclipboardgui",
954 "returnCommand",
955 rawurlencode($ilCtrl->getLinkTarget(
956 $this,
957 "insertFromClipboard",
958 "",
959 false,
960 false
961 ))
962 );
963 $ilCtrl->redirectByClass("ilEditClipboardGUI", "getObject");
964 }

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

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

References $_GET, $_POST, ilObjectGUI\$ctrl, $form, $format, ilObjectGUI\$lng, $location, $log, $main_tpl, $mep_log, $result, $title, 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 1050 of file class.ilObjMediaPoolGUI.php.

1051 {
1052 $ilAccess = $this->access;
1053
1054 $this->checkPermission("write");
1055
1056 foreach ($_POST["id"] as $obj_id) {
1057 $this->object->deleteChild($obj_id);
1058 }
1059
1060 ilUtil::sendSuccess($this->lng->txt("cont_obj_removed"), true);
1061 $this->ctrl->redirect($this, $_GET["mep_mode"] ? $_GET["mep_mode"] : "listMedia");
1062 }

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

1182 {
1183 $tpl = $this->tpl;
1184 $lng = $this->lng;
1186
1187 $this->checkPermission("write");
1188
1189 $this->initFolderForm("create");
1190 if ($this->form->checkInput()) {
1191 if ($this->object->createFolder($_POST["title"], (int) $_GET["mepitem_id"])) {
1192 ilUtil::sendSuccess($lng->txt("mep_folder_created"), true);
1193 }
1194 $ilCtrl->redirect($this, "listMedia");
1195 }
1196
1197 $this->form->setValuesByPost();
1198 $tpl->setContent($this->form->getHtml());
1199 }

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

1333 {
1334 $tpl = $this->tpl;
1335 $lng = $this->lng;
1337
1338 $this->checkPermission("write");
1339
1340 $this->initMediaPoolPageForm("create");
1341 if ($this->form->checkInput()) {
1342 // create media pool item
1343 include_once("./Modules/MediaPool/classes/class.ilMediaPoolItem.php");
1344 $item = new ilMediaPoolItem();
1345 $item->setTitle($_POST["title"]);
1346 $item->setType("pg");
1347 $item->create();
1348
1349 if ($item->getId() > 0) {
1350 // put in tree
1351 $tree = $this->object->getTree();
1352 $parent = $_GET["mepitem_id"] > 0
1353 ? $_GET["mepitem_id"]
1354 : $tree->getRootId();
1355 $this->object->insertInTree($item->getId(), $parent);
1356
1357 // create page
1358 include_once("./Modules/MediaPool/classes/class.ilMediaPoolPage.php");
1359 $page = new ilMediaPoolPage();
1360 $page->setId($item->getId());
1361 $page->setParentId($this->object->getId());
1362 $page->create();
1363
1364 $ilCtrl->setParameterByClass("ilmediapoolpagegui", "mepitem_id", $item->getId());
1365 $ilCtrl->redirectByClass("ilmediapoolpagegui", "edit");
1366 }
1367 $ilCtrl->redirect($this, "listMedia");
1368 }
1369
1370 $this->form->setValuesByPost();
1371 $tpl->setContent($this->form->getHtml());
1372 }

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

2194 {
2195 $lng = $this->lng;
2197
2198 $this->checkPermission("write");
2199 //var_dump(_$POST); exit;
2200
2201 $media_items = ilMediaItem::getMediaItemsForUploadHash($_GET["mep_hash"]);
2202 include_once("./Services/Accordion/classes/class.ilAccordionGUI.php");
2203
2204 foreach ($media_items as $mi) {
2205 $mob = new ilObjMediaObject($mi["mob_id"]);
2206 $form = $this->initMediaBulkForm($mi["mob_id"], $mob->getTitle());
2207 $form->checkInput();
2208 $title = $form->getInput("title_" . $mi["mob_id"]);
2209 $desc = $form->getInput("description_" . $mi["mob_id"]);
2210 if (trim($title) != "") {
2211 $mob->setTitle($title);
2212 }
2213 $mob->setDescription($desc);
2214 $mob->update();
2215 }
2216 ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
2217 $ctrl->redirect($this, "listMedia");
2218 }

References $_GET, ilObjectGUI\$ctrl, $form, ilObjectGUI\$lng, $title, 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 1789 of file class.ilObjMediaPoolGUI.php.

1790 {
1791 $tpl = $this->tpl;
1792 $ilTabs = $this->tabs;
1793 $lng = $this->lng;
1795 $ilToolbar = $this->toolbar;
1796
1797 if (!$a_files) {
1798 $a_files = $_POST["file"];
1799 }
1800
1801 $ilTabs->clearTargets();
1802 $ilTabs->setBackTarget(
1803 $lng->txt("back"),
1804 $ilCtrl->getLinkTarget($this, "listMedia")
1805 );
1806
1807 $this->checkPermission("write");
1808
1810
1811 // action type
1812 include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
1813 $options = array(
1814 "rename" => $lng->txt("mep_up_dir_move"),
1815 "copy" => $lng->txt("mep_up_dir_copy"),
1816 );
1817 $si = new ilSelectInputGUI("", "action");
1818 $si->setOptions($options);
1819 $ilToolbar->addInputItem($si);
1820 $ilToolbar->setCloseFormTag(false);
1821 $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
1822 $ilToolbar->setFormName("mep_up_form");
1823
1824 include_once("./Modules/MediaPool/classes/class.ilUploadDirFilesTableGUI.php");
1826 $this,
1827 "selectUploadDirFiles",
1828 $a_files
1829 );
1830 $tab->setFormName("mep_up_form");
1831 $tpl->setContent($tab->getHTML());
1832 }
1833 }
This class represents a selection list property in a property form.

References $_POST, ilObjectGUI\$ctrl, $ilCtrl, ilObjectGUI\$lng, PHPMailer\PHPMailer\$options, $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 1540 of file class.ilObjMediaPoolGUI.php.

1541 {
1542 $ilAccess = $this->access;
1543 $ilTabs = $this->tabs;
1545
1546 $ilTabs->addSubTab("content", $this->lng->txt("objs_fold"), $this->ctrl->getLinkTarget($this, ""));
1547
1548 $ilCtrl->setParameter($this, "mepitem_id", "");
1549 $ilTabs->addSubTab("mep_all_mobs", $this->lng->txt("mep_all_mobs"), $this->ctrl->getLinkTarget($this, "allMedia"));
1550 $ilCtrl->setParameter($this, "mepitem_id", $_GET["mepitem_id"]);
1551
1552 if ($ilAccess->checkAccess('write', '', $this->ref_id)) {
1553 $ilTabs->addSubtab(
1554 "srt_files",
1555 $this->lng->txt("mep_media_subtitles"),
1556 $ilCtrl->getLinkTargetByClass("ilmobmultisrtuploadgui", "")
1557 );
1558 }
1559
1560 $ilTabs->activateSubTab($a_active);
1561 }

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

1449 {
1450 $ilTabs = $this->tabs;
1452 $lng = $this->lng;
1453
1454 $ilTabs->addTarget(
1455 "cont_usage",
1456 $ilCtrl->getLinkTarget($this, "showMediaPoolPageUsages"),
1457 array("showMediaPoolPageUsages", "showAllMediaPoolPageUsages"),
1458 get_class($this)
1459 );
1460 $ilTabs->addTarget(
1461 "settings",
1462 $ilCtrl->getLinkTarget($this, "editMediaPoolPage"),
1463 "editMediaPoolPage",
1464 get_class($this)
1465 );
1466 $ilCtrl->setParameter($this, "mepitem_id", $this->object->getPoolTree()->getParentId($_GET["mepitem_id"]));
1467 $ilTabs->setBackTarget($lng->txt("mep_folder"), $ilCtrl->getLinkTarget($this, "listMedia"));
1468 $ilCtrl->setParameter($this, "mepitem_id", $_GET["mepitem_id"]);
1469 }

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

1669 {
1670 $ilTabs = $this->tabs;
1671 $lng = $this->lng;
1672 $ilAccess = $this->access;
1673
1674 if ($ilAccess->checkAccess("write", "", $this->object->getRefId())) {
1675 $ilTabs->addSubTab(
1676 "settings",
1677 $lng->txt("settings"),
1678 $this->ctrl->getLinkTarget($this, "edit")
1679 );
1680
1681 $mset = new ilSetting("mobs");
1682 if ($mset->get("mep_activate_pages")) {
1683 $ilTabs->addSubTabTarget(
1684 "obj_multilinguality",
1685 $this->ctrl->getLinkTargetByClass("ilobjecttranslationgui", "")
1686 );
1687 }
1688 }
1689
1690 $ilTabs->setSubTabActive($a_active);
1691 }

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

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

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

◆ showAllMediaPoolPageUsages()

ilObjMediaPoolGUI::showAllMediaPoolPageUsages ( )

List usages of the contnet snippet.

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

1475 {
1476 $this->showMediaPoolPageUsages(true);
1477 }
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 884 of file class.ilObjMediaPoolGUI.php.

885 {
886 $this->showMedia();
887 }
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 ilTemplate("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
static getContentStylePath($a_style_id, $add_random=true)
get content style path
special template class to simplify handling of ITX/PEAR
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()

References $_GET, Sabre\VObject\$output, PHPMailer\PHPMailer\$params, $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 1483 of file class.ilObjMediaPoolGUI.php.

1484 {
1485 $ilTabs = $this->tabs;
1487 $lng = $this->lng;
1488 $tpl = $this->tpl;
1489
1490 $this->checkPermission("write");
1491
1492 $ilTabs->clearTargets();
1493
1494 $ilTabs->addSubTab(
1495 "current_usages",
1496 $lng->txt("cont_current_usages"),
1497 $ilCtrl->getLinkTarget($this, "showMediaPoolPageUsages")
1498 );
1499
1500 $ilTabs->addSubTab(
1501 "all_usages",
1502 $lng->txt("cont_all_usages"),
1503 $ilCtrl->getLinkTarget($this, "showAllMediaPoolPageUsages")
1504 );
1505
1506 if ($a_all) {
1507 $ilTabs->activateSubTab("all_usages");
1508 $cmd = "showAllMediaPoolPageUsages";
1509 } else {
1510 $ilTabs->activateSubTab("current_usages");
1511 $cmd = "showMediaPoolPageUsages";
1512 }
1513
1514
1515 include_once("./Modules/MediaPool/classes/class.ilMediaPoolPageGUI.php");
1516 $mep_page_gui = new ilMediaPoolPageGUI($_GET["mepitem_id"], $_GET["old_nr"]);
1517 $mep_page_gui->getTabs();
1518
1519 $this->setMediaPoolPageTabs();
1520
1521 include_once("./Modules/MediaPool/classes/class.ilMediaPoolPage.php");
1522 $page = new ilMediaPoolPage((int) $_GET["mepitem_id"]);
1523
1524 include_once("./Modules/MediaPool/classes/class.ilMediaPoolPageUsagesTableGUI.php");
1525 $table = new ilMediaPoolPageUsagesTableGUI($this, $cmd, $page, $a_all);
1526
1527 $tpl->setContent($table->getHTML());
1528 }
TableGUI class for media pool page usages listing.
if(empty($password)) $table
Definition: pwgen.php:24

References $_GET, ilObjectGUI\$ctrl, $ilCtrl, ilObjectGUI\$lng, $table, $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 ilTemplate("tpl.main.html", true, true);
819
820 include_once("./Services/Container/classes/class.ilContainerPage.php");
821 include_once("./Services/Container/classes/class.ilContainerPageGUI.php");
822
823 include_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
824 $tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
825 $tpl->setVariable(
826 "LOCATION_CONTENT_STYLESHEET",
828 );
829 $tpl->setCurrentBlock("SyntaxStyle");
830 $tpl->setVariable(
831 "LOCATION_SYNTAX_STYLESHEET",
833 );
834 $tpl->parseCurrentBlock();
835
836 // get page object
837 //include_once("./Services/Object/classes/class.ilObjectTranslation.php");
838 //$ot = ilObjectTranslation::getInstance($this->object->getId());
839 //$lang = $ot->getEffectiveContentLang($ilUser->getCurrentLanguage(), "cont");
840 include_once("./Modules/MediaPool/classes/class.ilMediaPoolPageGUI.php");
841 $page_gui = new ilMediaPoolPageGUI((int) $_GET["mepitem_id"]);
842 include_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
843 //$page_gui->setStyleId(ilObjStyleSheet::getEffectiveContentStyleId(
844 // $this->object->getStyleSheetId(), $this->object->getType()));
845
846 $page_gui->setTemplateOutput(false);
847 $page_gui->setHeader("");
848 $ret = $page_gui->showPage(true);
849
850 $tpl->setBodyClass("ilMediaPoolPagePreviewBody");
851 $tpl->setVariable("CONTENT", $ret);
852 //$ret = "<div style='background-color: white; padding:5px; margin-bottom: 30px;'>".$ret."</div>";
853
854
855 $tpl->show();
856 exit;
857 }
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 863 of file class.ilObjMediaPoolGUI.php.

864 {
865 $this->checkPermission("read");
866
867 $item = new ilMediaPoolItem((int) $_GET["mepitem_id"]);
868
869 switch ($item->getType()) {
870 case "mob":
871 $this->showMedia();
872 break;
873
874 case "pg":
875 $this->showPage();
876 break;
877 }
878 }

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

+ Here is the call graph for this function:

◆ updateCustom()

ilObjMediaPoolGUI::updateCustom ( ilPropertyFormGUI  $a_form)
protected

Insert custom update form values into object.

Parameters
ilPropertyFormGUI$a_form

Reimplemented from ilObjectGUI.

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

545 {
546 $obj_service = $this->object_service;
547
548 $this->object->setDefaultWidth($a_form->getInput("default_width"));
549 $this->object->setDefaultHeight($a_form->getInput("default_height"));
550
551
552 // additional features
553 include_once './Services/Object/classes/class.ilObjectServiceSettingsGUI.php';
555 $this->object->getId(),
556 $a_form,
557 array(
559 )
560 );
561
562 // tile image
563 $obj_service->commonSettings()->legacyForm($a_form, $this->object)->saveTileImage();
564 }
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 1204 of file class.ilObjMediaPoolGUI.php.

1205 {
1206 $lng = $this->lng;
1208 $tpl = $this->tpl;
1209
1210 $this->checkPermission("write");
1211
1212 $this->initFolderForm("edit");
1213 if ($this->form->checkInput()) {
1214 $item = new ilMediaPoolItem($_GET["mepitem_id"]);
1215 $item->setTitle($_POST["title"]);
1216 $item->update();
1217 ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
1218 $ilCtrl->setParameter(
1219 $this,
1220 "mepitem_id",
1221 $this->object->getTree()->getParentId($_GET["mepitem_id"])
1222 );
1223 $ilCtrl->redirect($this, "listMedia");
1224 }
1225
1226 $this->form->setValuesByPost();
1227 $tpl->setContent($this->form->getHtml());
1228 }

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

1378 {
1379 $lng = $this->lng;
1381 $tpl = $this->tpl;
1382
1383 $this->checkPermission("write");
1384
1385 $this->initMediaPoolPageForm("edit");
1386 if ($this->form->checkInput()) {
1387 $item = new ilMediaPoolItem($_GET["mepitem_id"]);
1388 $item->setTitle($_POST["title"]);
1389 $item->update();
1390 ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
1391 $ilCtrl->redirect($this, "editMediaPoolPage");
1392 }
1393
1394 $this->form->setValuesByPost();
1395 $tpl->setContent($this->form->getHtml());
1396 }

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: