ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilObjMediaPoolGUI Class Reference

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

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

Public Member Functions

 getType ()
 Get type. More...
 
executeCommand ()
 execute command More...
 
 createMediaObject ()
 obsolete? More...
 
 afterSave ($newObj)
 save object More...
 
 edit ()
 Edit. 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...
 
 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...
 
- 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...
 
 isVisible ()
 
 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...
 
- Public Member Functions inherited from ilObjectGUI
 ilObjectGUI ($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
 Constructor @access public. More...
 
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...
 
 getAdminTabs (&$tabs_gui)
 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 ($in_rep=false)
 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...
 
 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...
 

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
 
 $ilias
 
 $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...
 
- 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...
 
 prepareOutput ()
 prepare output 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 ($column_gui)
 May be overwritten in subclasses. More...
 
 checkPermission ($a_perm, $a_cmd="")
 
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu) More...
 
 redirectToRefId ()
 
 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 ()
 
 setTabs ()
 create tabs (repository/workspace switch) More...
 
 getReturnLocation ()
 Deprecated functions. More...
 
 setReturnLocation ()
 
 showActions ()
 
 getTitlesByRefId ()
 
 getTabs ()
 
 __showButton ()
 
 hitsperpageObject ()
 
 __initTableGUI ()
 
 __setTableGUIBasicData ()
 
 addLocatorItems ()
 Functions to be overwritten. More...
 
 initCreationForms ($a_new_type)
 Init creation froms. More...
 
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position. 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)
 Activate rating automatically if parent container setting. More...
 
- Protected Member Functions inherited from ilObjectGUI
 assignObject ()
 
 prepareOutput ()
 prepare output More...
 
 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...
 
 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...
 
 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...
 
 getTitlesByRefId ($a_ref_ids)
 get Titles of objects this method is used for error messages in methods cut/copy/paste More...
 
 getTabs (&$tabs_gui)
 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 ($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...
 

Additional Inherited Members

- Protected Attributes inherited from ilObject2GUI
 $object_id
 
 $node_id
 
 $creation_forms = array()
 
 $id_type = array()
 
 $parent_id
 
 $access_handler
 
- Protected Attributes inherited from ilObjectGUI
 $tmp_import_dir
 

Detailed Description

Member Function Documentation

◆ _goto()

static ilObjMediaPoolGUI::_goto (   $a_target)
static

goto target media pool

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

1473 {
1474 global $ilAccess, $ilErr, $lng;
1475
1476 $targets = explode('_',$a_target);
1477 if(count((array) $targets) > 1)
1478 {
1479 $ref_id = $targets[0];
1480 $subitem_id = $targets[1];
1481 }
1482 else
1483 {
1484 $ref_id = $targets[0];
1485 }
1486
1487 if ($ilAccess->checkAccess("read", "", $ref_id))
1488 {
1489 $_GET["baseClass"] = "ilMediaPoolPresentationGUI";
1490 $_GET["ref_id"] = $ref_id;
1491 $_GET['mepitem_id'] = $subitem_id;
1492 include("ilias.php");
1493 exit;
1494 } else if ($ilAccess->checkAccess("visible", "", $ref_id))
1495 {
1496 $_GET["baseClass"] = "ilMediaPoolPresentationGUI";
1497 $_GET["ref_id"] = $ref_id;
1498 $_GET["cmd"] = "infoScreen";
1499 include("ilias.php");
1500 exit;
1501 }
1502 else if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID))
1503 {
1504 ilUtil::sendFailure(sprintf($lng->txt("msg_no_perm_read_item"),
1507 }
1508
1509 $ilErr->raiseError($lng->txt("msg_no_perm_read"), $ilErr->FATAL);
1510 }
$_GET["client_id"]
static _gotoRepositoryRoot($a_raise_error=false)
Goto repository root.
static _lookupObjId($a_id)
static _lookupTitle($a_id)
lookup object title
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
exit
Definition: login.php:54

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

953 {
954 global $ilLocator, $ilAccess;
955
956 if (!$this->getCreationMode() && $this->ctrl->getCmd() != "explorer")
957 {
958 $tree =& $this->object->getTree();
959 $obj_id = ($_GET["mepitem_id"] == "")
960 ? $tree->getRootId()
961 : $_GET["mepitem_id"];
962 $path = $tree->getPathFull($obj_id);
963 foreach($path as $node)
964 {
965 if ($node["child"] == $tree->getRootId())
966 {
967 $this->ctrl->setParameter($this, "mepitem_id", "");
968 if ($ilAccess->checkAccess("read", "", $this->object->getRefId()))
969 {
970 $link = $this->ctrl->getLinkTarget($this, "listMedia");
971 }
972 else if ($ilAccess->checkAccess("visible", "", $this->object->getRefId()))
973 {
974 $link = $this->ctrl->getLinkTarget($this, "infoScreen");
975 }
976 $title = $this->object->getTitle();
977 $this->ctrl->setParameter($this, "mepitem_id", $_GET["mepitem_id"]);
978 $ilLocator->addItem($title, $link, "", $_GET["ref_id"]);
979 }
980 }
981 }
982 }
getCreationMode()
get creation mode
$path
Definition: index.php:22

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

+ Here is the call graph for this function:

◆ afterConstructor()

ilObjMediaPoolGUI::afterConstructor ( )
protected

Initialisation.

Reimplemented from ilObject2GUI.

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

33 {
34 global $lng;
35
36 $lng->loadLanguageModule("mep");
37
38 if ($this->ctrl->getCmd() == "explorer")
39 {
40 $this->ctrl->saveParameter($this, array("ref_id"));
41 }
42 else
43 {
44 $this->ctrl->saveParameter($this, array("ref_id", "mepitem_id"));
45 }
46 $this->ctrl->saveParameter($this, array("mep_mode"));
47
48 $lng->loadLanguageModule("content");
49 }

References ilObjectGUI\$lng.

◆ afterSave()

ilObjMediaPoolGUI::afterSave (   $newObj)

save object

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

373 {
374 // always send a message
375 ilUtil::sendSuccess($this->lng->txt("object_added"),true);
376
377 //ilUtil::redirect($this->getReturnLocation("save","adm_object.php?".$this->link_params));
378 ilUtil::redirect("ilias.php?baseClass=ilMediaPoolPresentationGUI&ref_id=".$newObj->getRefId()."&cmd=listMedia");
379 }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static redirect($a_script)
http redirect to other script

References ilUtil\redirect(), and ilUtil\sendSuccess().

+ Here is the call graph for this function:

◆ allMedia()

ilObjMediaPoolGUI::allMedia ( )

list all objects

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

489 {
490 global $tree, $ilAccess, $tpl, $ilTabs, $ilCtrl,$ilUser;
491
492 $ilCtrl->setParameter($this, "mep_mode", "allMedia");
493
494 $this->checkPermission("read");
495 $ilTabs->setTabActive("mep_all_mobs");
496
497
498 include_once("./Modules/MediaPool/classes/class.ilMediaPoolTableGUI.php");
499 $mep_table_gui = new ilMediaPoolTableGUI($this, "allMedia", $this->object,
500 "mepitem_id", ilMediaPoolTableGUI::IL_MEP_EDIT, true);
501
502
503 if(isset($_GET['force_filter']) and $_GET['force_filter'])
504 {
505 $_POST['title'] = ilMediaPoolItem::lookupTitle((int) $_GET['force_filter']);
506
507 include_once("./Services/Table/classes/class.ilTablePropertiesStorage.php");
508 $tprop = new ilTablePropertiesStorage();
509 $tprop->storeProperty(
510 $mep_table_gui->getId(),
511 $ilUser->getId(),
512 'filter',
513 1
514 );
515 $mep_table_gui->resetFilter();
516 $mep_table_gui->resetOffset();
517 $mep_table_gui->writeFilterToSession();
518
519 // Read again
520 $mep_table_gui = new ilMediaPoolTableGUI($this, "allMedia", $this->object,
521 "mepitem_id", ilMediaPoolTableGUI::IL_MEP_EDIT, true);
522 }
523
524 $tpl->setContent($mep_table_gui->getHTML());
525// $this->tpl->show();
526 }
static lookupTitle($a_id)
Lookup title.
TableGUI class for recent changes in wiki.
checkPermission($a_perm, $a_cmd="")
Saves (mostly asynchronously) user properties of tables (e.g.
$_POST['username']
Definition: cron.php:12
global $ilCtrl
Definition: ilias.php:18
global $ilUser
Definition: imgupload.php:15

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

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

532 {
533 include_once("./Modules/MediaPool/classes/class.ilMediaPoolTableGUI.php");
534 $mtab = new ilMediaPoolTableGUI($this, "allMedia", $this->object,
535 "mepitem_id", ilMediaPoolTableGUI::IL_MEP_EDIT, true);
536 $mtab->writeFilterToSession();
537 $mtab->resetOffset();
538 $this->allMedia();
539 }
allMedia()
list all objects

References allMedia(), and ilMediaPoolTableGUI\IL_MEP_EDIT.

+ Here is the call graph for this function:

◆ cancelFolderUpdate()

ilObjMediaPoolGUI::cancelFolderUpdate ( )

Cancel save.

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

1124 {
1125 global $ilCtrl;
1126 $ilCtrl->setParameter($this, "mepitem_id",
1127 $this->object->getTree()->getParentId($_GET["mepitem_id"]));
1128 $ilCtrl->redirect($this, "listMedia");
1129 }

References $_GET, and $ilCtrl.

◆ cancelRemove()

ilObjMediaPoolGUI::cancelRemove ( )

cancel deletion of media objects/folders

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

885 {
886 $this->ctrl->redirect($this, $_GET["mep_mode"] ? $_GET["mep_mode"] : "listMedia");
887 }

References $_GET.

◆ cancelSave()

ilObjMediaPoolGUI::cancelSave ( )

Cancel save.

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

1135 {
1136 global $ilCtrl;
1137 $ilCtrl->redirect($this, "listMedia");
1138 }

References $ilCtrl.

◆ confirmRemove()

ilObjMediaPoolGUI::confirmRemove ( )

confirm remove of mobs

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

722 {
723 global $ilAccess, $ilCtrl, $lng;
724
725 $this->checkPermission("write");
726
727 if(!isset($_POST["id"]))
728 {
729 $this->ilias->raiseError($this->lng->txt("no_checkbox"),$this->ilias->error_obj->MESSAGE);
730 }
731
732 // display confirmation message
733 include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
734 $cgui = new ilConfirmationGUI();
735 $cgui->setFormAction($this->ctrl->getFormAction($this));
736 $cgui->setHeaderText($this->lng->txt("info_delete_sure"));
737 $cgui->setCancel($this->lng->txt("cancel"), "cancelRemove");
738 $cgui->setConfirm($this->lng->txt("confirm"), "remove");
739
740 foreach($_POST["id"] as $obj_id)
741 {
744
745 // check whether page can be removed
746 $add = "";
747 if ($type == "pg")
748 {
749 include_once("./Services/COPage/classes/class.ilPageContentUsage.php");
750 $usages = ilPageContentUsage::getUsages("incl", $obj_id, false);
751 if (count($usages) > 0)
752 {
753 ilUtil::sendFailure(sprintf($lng->txt("mep_content_snippet_in_use"), $title), true);
754 $ilCtrl->redirect($this, "listMedia");
755 }
756 else
757 {
758 // check whether the snippet is used in older versions of pages
759 $usages = ilPageContentUsage::getUsages("incl", $obj_id, true);
760 if (count($usages) > 0)
761 {
762 $add = "<div class='small'>".$lng->txt("mep_content_snippet_used_in_older_versions")."</div>";
763 }
764 }
765 }
766
767 $caption = ilUtil::getImageTagByType($type, $this->tpl->tplPath).
768 " ".$title.$add;
769
770 $cgui->addItem("id[]", $obj_id, $caption);
771 }
772
773 $this->tpl->setContent($cgui->getHTML());
774 }
Confirmation screen class.
static lookupType($a_id)
Lookup type.
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...
redirection script todo: (a better solution should control the processing via a xml file)

References $_POST, $ilCtrl, ilObjectGUI\$lng, ilObjectGUI\$obj_id, 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 911 of file class.ilObjMediaPoolGUI.php.

912 {
913 global $ilUser, $ilAccess;
914
915 $this->checkPermission("write");
916
917 if(!isset($_POST["id"]))
918 {
919 ilUtil::sendFailure($this->lng->txt("no_checkbox"), true);
920 $this->ctrl->redirect($this, $_GET["mep_mode"] ? $_GET["mep_mode"] : "listMedia");
921 }
922
923 foreach ($_POST["id"] as $obj_id)
924 {
926 if ($type == "fold")
927 {
928 ilUtil::sendFailure($this->lng->txt("cont_cant_copy_folders"), true);
929 $this->ctrl->redirect($this, $_GET["mep_mode"] ? $_GET["mep_mode"] : "listMedia");
930 }
931 }
932 foreach ($_POST["id"] as $obj_id)
933 {
936 if ($type == "mob")
937 {
938 $ilUser->addObjectToClipboard($fid, "mob", "");
939 }
940 if ($type == "pg")
941 {
942 $ilUser->addObjectToClipboard($obj_id, "incl", "");
943 }
944 }
945 ilUtil::sendSuccess($this->lng->txt("copied_to_clipboard"),true);
946 $this->ctrl->redirect($this, $_GET["mep_mode"] ? $_GET["mep_mode"] : "listMedia");
947 }
static lookupForeignId($a_id)
Lookup Foreign Id.

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

+ Here is the call graph for this function:

◆ createFolderForm()

ilObjMediaPoolGUI::createFolderForm ( )

create folder form

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

992 {
993 global $ilAccess, $tpl;
994
995 $this->checkPermission("write");
996
997 $this->initFolderForm("create");
998 $tpl->setContent($this->form->getHTML());
999
1000/* $folder_gui =& new ilObjFolderGUI("", 0, false, false);
1001 $this->ctrl->setParameterByClass("ilobjfoldergui", "obj_id", $_GET["obj_id"]);
1002 $folder_gui->setFormAction("save",
1003 $this->ctrl->getFormActionByClass("ilobjfoldergui"));
1004 $folder_gui->createObject();*/
1005// $this->tpl->show();
1006 }
initFolderForm($a_mode="edit")
Init folder form.

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

1629 {
1630 $this->checkPermission("write");
1631
1632 $mset = new ilSetting("mobs");
1633 $upload_dir = trim($mset->get("upload_dir"));
1634
1635 include_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
1636
1637 if (is_array($_POST["file"]) && ilMainMenuGUI::_checkAdministrationPermission())
1638 {
1639 foreach ($_POST["file"] as $f)
1640 {
1641 $f = str_replace("..", "", $f);
1642 $fullpath = $upload_dir."/".$f;
1643 $mob = new ilObjMediaObject();
1644 $mob->setTitle(basename($fullpath));
1645 $mob->setDescription("");
1646 $mob->create();
1647
1648 // determine and create mob directory, move uploaded file to directory
1649 //$mob_dir = ilUtil::getWebspaceDir()."/mobs/mm_".$a_mob->getId();
1650 $mob->createDirectory();
1651 $mob_dir = ilObjMediaObject::_getDirectory($mob->getId());
1652
1653 $media_item = new ilMediaItem();
1654 $mob->addMediaItem($media_item);
1655 $media_item->setPurpose("Standard");
1656
1657 $file = $mob_dir."/".basename($fullpath);
1658 ilUtil::moveUploadedFile($fullpath,
1659 basename($fullpath), $file, false, $_POST["action"]);
1660
1661 // get mime type
1663 $location = basename($fullpath);
1664
1665 // set real meta and object data
1666 $media_item->setFormat($format);
1667 $media_item->setLocation($location);
1668 $media_item->setLocationType("LocalFile");
1669
1670 $mob->setDescription($format);
1671
1672 // determine width and height of known image types
1674 "File", $mob_dir."/".$location, $media_item->getLocation(),
1675 true, true, "", "");
1676 $media_item->setWidth($wh["width"]);
1677 $media_item->setHeight($wh["height"]);
1678 if ($wh["info"] != "")
1679 {
1680 // ilUtil::sendInfo($wh["info"], true);
1681 }
1682
1683 $media_item->setHAlign("Left");
1684 ilUtil::renameExecutables($mob_dir);
1685 $mob->update();
1686
1687
1688 // put it into current folder
1689 $mep_item = new ilMediaPoolItem();
1690 $mep_item->setTitle($mob->getTitle());
1691 $mep_item->setType("mob");
1692 $mep_item->setForeignId($mob->getId());
1693 $mep_item->create();
1694
1695 $tree = $this->object->getTree();
1696 $parent = ($_GET["mepitem_id"] == "")
1697 ? $tree->getRootId()
1698 : $_GET["mepitem_id"];
1699 $tree->insertNode($mep_item->getId(), $parent);
1700 }
1701 }
1702 ilUtil::redirect("ilias.php?baseClass=ilMediaPoolPresentationGUI&cmd=listMedia&ref_id=".
1703 $_GET["ref_id"]."&mepitem_id=".$_GET["mepitem_id"]);
1704
1705 }
print $file
$location
Definition: buildRTE.php:44
Class ilMediaItem.
Class ilObjMediaObject.
_getDirectory($a_mob_id)
get directory for files of media object (static)
static getMimeType($a_file, $a_external=false)
get mime type for file
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 moveUploadedFile($a_file, $a_name, $a_target, $a_raise_errors=true, $a_mode="move_uploaded")
move uploaded file
static renameExecutables($a_dir)
Rename uploaded executables for security reasons.

References $_GET, $_POST, $file, $location, ilObject2GUI\$tree, ilMainMenuGUI\_checkAdministrationPermission(), ilObjMediaObject\_determineWidthHeight(), ilObjMediaObject\_getDirectory(), ilObject2GUI\checkPermission(), ilObjMediaObject\getMimeType(), ilUtil\moveUploadedFile(), ilUtil\redirect(), and ilUtil\renameExecutables().

+ Here is the call graph for this function:

◆ createMediaObject()

ilObjMediaPoolGUI::createMediaObject ( )

obsolete?

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

357 {
358 $this->ctrl->redirectByClass("ilobjmediaobjectgui", "create");
359 }

◆ createMediaPoolPage()

ilObjMediaPoolGUI::createMediaPoolPage ( )

Create new content snippet.

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

1148 {
1149 global $tpl;
1150
1151 $this->checkPermission("write");
1152
1153 $this->initMediaPoolPageForm("create");
1154 $tpl->setContent($this->form->getHTML());
1155 }
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.

Parameters

return

Reimplemented from ilObject2GUI.

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

408 {
409 $this->setSettingsSubTabs("settings");
410 parent::edit();
411 }
setSettingsSubTabs($a_active)
Set setting sub tabs.

References setSettingsSubTabs().

+ Here is the call graph for this function:

◆ editFolder()

ilObjMediaPoolGUI::editFolder ( )

Edit folder.

Parameters

return

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

1015 {
1016 global $tpl;
1017
1018 $this->checkPermission("write");
1019
1020 $this->initFolderForm();
1021 $this->getFolderValues();
1022 $tpl->setContent($this->form->getHTML());
1023 }
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 1163 of file class.ilObjMediaPoolGUI.php.

1164 {
1165 global $tpl;
1166
1167 $this->checkPermission("write");
1168
1169 $this->setMediaPoolPageTabs();
1170
1171 include_once("./Modules/MediaPool/classes/class.ilMediaPoolPageGUI.php");
1172 $mep_page_gui = new ilMediaPoolPageGUI($_GET["mepitem_id"], $_GET["old_nr"]);
1173 $mep_page_gui->getTabs();
1174
1175 $this->initMediaPoolPageForm("edit");
1176 $this->getMediaPoolPageValues();
1177 $tpl->setContent($this->form->getHTML());
1178 }
Class ilMediaPoolPage GUI class.
getMediaPoolPageValues()
Get current values for media pool page from.
setMediaPoolPageTabs()
Set media pool page tabs.

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

+ Here is the call graph for this function:

◆ executeCommand()

& ilObjMediaPoolGUI::executeCommand ( )

execute command

Reimplemented from ilObject2GUI.

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

63 {
64 global $ilTabs, $lng, $ilAccess, $tpl, $ilCtrl;
65
66 if ($this->ctrl->getRedirectSource() == "ilinternallinkgui")
67 {
68 $this->explorer();
69 return;
70 }
71
72 $next_class = $this->ctrl->getNextClass($this);
73 $cmd = $this->ctrl->getCmd();
74 $new_type = $_POST["new_type"]
75 ? $_POST["new_type"]
76 : $_GET["new_type"];
77
78 if ($new_type != "" && ($cmd != "confirmRemove" && $cmd != "copyToClipboard"
79 && $cmd != "pasteFromClipboard"))
80 {
81 $this->setCreationMode(true);
82 }
83
84 if (!$this->getCreationMode())
85 {
86 $tree =& $this->object->getTree();
87 if ($_GET["mepitem_id"] == "")
88 {
89 $_GET["mepitem_id"] = $tree->getRootId();
90 }
91 }
92 if ($cmd == "create")
93 {
94 switch($_POST["new_type"])
95 {
96 case "mob":
97 $this->ctrl->redirectByClass("ilobjmediaobjectgui", "create");
98 break;
99
100 case "fold":
101 $this->ctrl->redirectByClass("ilobjfoldergui", "create");
102 break;
103 }
104 }
105
106 switch($next_class)
107 {
108 case 'ilmediapoolpagegui':
109 $this->checkPermission("write");
110 $this->prepareOutput();
111 $this->addHeaderAction();
112 $this->setMediaPoolPageTabs();
113 include_once("./Modules/MediaPool/classes/class.ilMediaPoolPageGUI.php");
114 $mep_page_gui = new ilMediaPoolPageGUI($_GET["mepitem_id"], $_GET["old_nr"]);
115
116 if (!$ilAccess->checkAccess("write", "", $this->object->getRefId()))
117 {
118 $mep_page_gui->setEnableEditing(false);
119 }
120 $ret = $this->ctrl->forwardCommand($mep_page_gui);
121 if ($ret != "")
122 {
123 $tpl->setContent($ret);
124 }
125 $this->tpl->show();
126 break;
127
128 case "ilobjmediaobjectgui":
129 $this->checkPermission("write");
130 //$cmd.="Object";
131 if ($cmd == "create" || $cmd == "save" || $cmd == "cancel")
132 {
133 $ret_obj = $_GET["mepitem_id"];
134 $ilObjMediaObjectGUI =& new ilObjMediaObjectGUI("", 0, false, false);
135 $ilObjMediaObjectGUI->setWidthPreset($this->object->getDefaultWidth());
136 $ilObjMediaObjectGUI->setHeightPreset($this->object->getDefaultHeight());
137 }
138 else
139 {
140 $ret_obj = $tree->getParentId($_GET["mepitem_id"]);
141 $ilObjMediaObjectGUI =& new ilObjMediaObjectGUI("", ilMediaPoolItem::lookupForeignId($_GET["mepitem_id"]), false, false);
142 $this->ctrl->setParameter($this, "mepitem_id", $this->getParentFolderId());
143 $ilTabs->setBackTarget($lng->txt("back"),
144 $this->ctrl->getLinkTarget($this,
145 $_GET["mep_mode"] ? $_GET["mep_mode"] : "listMedia"));
146 }
147 if ($this->ctrl->getCmdClass() == "ilinternallinkgui")
148 {
149 $this->ctrl->setReturn($this, "explorer");
150 }
151 else
152 {
153 $this->ctrl->setParameter($this, "mepitem_id", $ret_obj);
154 $this->ctrl->setReturn($this,
155 $_GET["mep_mode"] ? $_GET["mep_mode"] : "listMedia");
156 $this->ctrl->setParameter($this, "mepitem_id", $_GET["mepitem_id"]);
157 }
158 $this->getTemplate();
159 $ilObjMediaObjectGUI->setTabs();
160 $this->setLocator();
161
162 //$ret =& $ilObjMediaObjectGUI->executeCommand();
163 $ret = $this->ctrl->forwardCommand($ilObjMediaObjectGUI);
164
165 if ($cmd == "save" && $ret != false)
166 {
167 $mep_item = new ilMediaPoolItem();
168 $mep_item->setTitle($ret->getTitle());
169 $mep_item->setType("mob");
170 $mep_item->setForeignId($ret->getId());
171 $mep_item->create();
172
173 $parent = ($_GET["mepitem_id"] == "")
174 ? $tree->getRootId()
175 : $_GET["mepitem_id"];
176 $tree->insertNode($mep_item->getId(), $parent);
177 ilUtil::redirect("ilias.php?baseClass=ilMediaPoolPresentationGUI&cmd=listMedia&ref_id=".
178 $_GET["ref_id"]."&mepitem_id=".$_GET["mepitem_id"]);
179 }
180 else
181 {
182 $this->tpl->show();
183 }
184 break;
185
186 case "ilobjfoldergui":
187 $this->checkPermission("write");
188 $this->addHeaderAction();
189 $folder_gui = new ilObjFolderGUI("", 0, false, false);
190 $this->ctrl->setReturn($this, "listMedia");
191 $cmd.="Object";
192 switch($cmd)
193 {
194 case "createObject":
195 $this->prepareOutput();
196 $folder_gui =& new ilObjFolderGUI("", 0, false, false);
197 $folder_gui->setFormAction("save",
198 $this->ctrl->getFormActionByClass("ilobjfoldergui"));
199 $folder_gui->createObject();
200 $this->tpl->show();
201 break;
202
203 case "saveObject":
204 //$folder_gui->setReturnLocation("save", $this->ctrl->getLinkTarget($this, "listMedia"));
205 $parent = ($_GET["mepitem_id"] == "")
206 ? $tree->getRootId()
207 : $_GET["mepitem_id"];
208 $folder_gui->setFolderTree($tree);
209 $folder_gui->saveObject($parent);
210 //$this->ctrl->redirect($this, "listMedia");
211 break;
212
213 case "editObject":
214 $this->prepareOutput();
215 $folder_gui =& new ilObjFolderGUI("", ilMediaPoolItem::lookupForeignId($_GET["mepitem_id"]), false, false);
216 $this->ctrl->setParameter($this, "foldereditmode", "1");
217 $folder_gui->setFormAction("update", $this->ctrl->getFormActionByClass("ilobjfoldergui"));
218 $folder_gui->editObject();
219 $this->tpl->show();
220 break;
221
222 case "updateObject":
223 $folder_gui =& new ilObjFolderGUI("", ilMediaPoolItem::lookupForeignId($_GET["mepitem_id"]), false, false);
224 $this->ctrl->setParameter($this, "mepitem_id", $this->getParentFolderId());
225 $this->ctrl->setReturn($this, "listMedia");
226 $folder_gui->updateObject(true); // this returns to parent
227 break;
228
229 case "cancelObject":
230 if ($_GET["foldereditmode"])
231 {
232 $this->ctrl->setParameter($this, "mepitem_id", $this->getParentFolderId());
233 }
234 $this->ctrl->redirect($this, "listMedia");
235 break;
236 }
237 break;
238
239 case "ileditclipboardgui":
240 $this->prepareOutput();
241 $this->addHeaderAction();
242 $this->ctrl->setReturn($this, $_GET["mep_mode"] ? $_GET["mep_mode"] : "listMedia");
243 $clip_gui = new ilEditClipboardGUI();
244 $clip_gui->setMultipleSelections(true);
245 $clip_gui->setInsertButtonTitle($lng->txt("mep_copy_to_mep"));
246 $ilTabs->setTabActive("clipboard");
247 //$ret =& $clip_gui->executeCommand();
248 $ret =& $this->ctrl->forwardCommand($clip_gui);
249 $this->tpl->show();
250 break;
251
252 case 'ilinfoscreengui':
253 $this->prepareOutput();
254 $this->addHeaderAction();
255 $this->infoScreen();
256 $this->tpl->show();
257 break;
258
259 case 'ilpermissiongui':
260 $this->checkPermission("edit_permission");
261 $this->prepareOutput();
262 $this->addHeaderAction();
263 include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
264 $perm_gui =& new ilPermissionGUI($this);
265 $ret =& $this->ctrl->forwardCommand($perm_gui);
266 $this->tpl->show();
267 break;
268
269 case "ilexportgui":
270 $this->checkPermission("write");
271 $this->prepareOutput();
272 $this->addHeaderAction();
273 include_once("./Services/Export/classes/class.ilExportGUI.php");
274 $exp_gui = new ilExportGUI($this);
275 $exp_gui->addFormat("xml");
276 include_once("./Services/Object/classes/class.ilObjectTranslation.php");
277 $ot = ilObjectTranslation::getInstance($this->object->getId());
278 if ($ot->getContentActivated())
279 {
280 $exp_gui->addFormat("xml_master", "XML (".$lng->txt("mep_master_language_only").")", $this, "export");
281 }
282 $ret = $this->ctrl->forwardCommand($exp_gui);
283 $this->tpl->show();
284 break;
285
286 case "ilfilesystemgui":
287 $this->checkPermission("write");
288 $this->prepareOutput();
289 $this->addHeaderAction();
290 $ilTabs->clearTargets();
291 $ilTabs->setBackTarget($lng->txt("back"),
292 $ilCtrl->getLinkTarget($this, "listMedia"));
293 $mset = new ilSetting("mobs");
294 if (trim($mset->get("upload_dir")) != "")
295 {
296 include_once("./Services/FileSystem/classes/class.ilFileSystemGUI.php");
297 $fs_gui = new ilFileSystemGUI($mset->get("upload_dir"));
298 $fs_gui->setPostDirPath(true);
299 $fs_gui->setTableId("mepud".$this->object->getId());
300 $fs_gui->setAllowFileCreation(false);
301 $fs_gui->setAllowDirectoryCreation(false);
302 $fs_gui->clearCommands();
303 $fs_gui->addCommand($this, "selectUploadDirFiles", $this->lng->txt("mep_sel_upload_dir_files"),
304 false, true);
305 //$fs_gui->addCommand($this, "assignFullscreenObject", $this->lng->txt("cont_assign_full"));
306 $ret =& $this->ctrl->forwardCommand($fs_gui);
307 }
308 $this->tpl->show();
309 break;
310
311 case "ilcommonactiondispatchergui":
312 include_once("Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
314 $this->ctrl->forwardCommand($gui);
315 break;
316
317 case 'ilobjecttranslationgui':
318 $this->prepareOutput();
319 $this->addHeaderAction();
320 //$this->setTabs("settings");
321 $ilTabs->activateTab("settings");
322 $this->setSettingsSubTabs("obj_multilinguality");
323 include_once("./Services/Object/classes/class.ilObjectTranslationGUI.php");
324 $transgui = new ilObjectTranslationGUI($this);
325 $transgui->setTitleDescrOnlyMode(false);
326 $this->ctrl->forwardCommand($transgui);
327 $this->tpl->show();
328 break;
329
330 case "ilmediapoolimportgui":
331 $this->prepareOutput();
332 $this->addHeaderAction();
333 $ilTabs->activateTab("import");
334 include_once("./Modules/MediaPool/classes/class.ilMediaPoolImportGUI.php");
335 $gui = new ilMediaPoolImportGUI($this->object);
336 $this->ctrl->forwardCommand($gui);
337 $this->tpl->show();
338 break;
339
340 default:
341 $this->prepareOutput();
342 $this->addHeaderAction();
343 $cmd = $this->ctrl->getCmd("listMedia");
344 $this->$cmd();
345 if (!$this->getCreationMode())
346 {
347 $this->tpl->show();
348 }
349 break;
350 }
351 }
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)
Class ilObjFolderGUI.
Class ilObjMediaObjectGUI.
getTemplate()
Get standard template.
getParentFolderId()
Get folder parent ID.
infoScreen()
show information screen
prepareOutput()
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.
GUI class for object translation handling.
static getInstance($a_obj_id)
Get instance.
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
$cmd
Definition: sahs_server.php:35

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

+ Here is the call graph for this function:

◆ export()

ilObjMediaPoolGUI::export ( )

export content object

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

1739 {
1740 $ot = ilObjectTranslation::getInstance($this->object->getId());
1741 $opt = "";
1742 if ($ot->getContentActivated())
1743 {
1744 $format = explode("_", $_POST["format"]);
1745 $opt = ilUtil::stripSlashes($format[1]);
1746 }
1747
1748 $this->object->exportXML(($opt == "master"));
1749 }
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled

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

415 {
416 if ($this->object->getDefaultWidth() > 0)
417 {
418 $a_values["default_width"] = $this->object->getDefaultWidth();
419 }
420 if ($this->object->getDefaultHeight() > 0)
421 {
422 $a_values["default_height"] = $this->object->getDefaultHeight();
423 }
424 }

◆ getFolderValues()

ilObjMediaPoolGUI::getFolderValues ( )

Get current values for folder from.

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

1029 {
1030 $values = array();
1031
1032 $values["title"] = ilMediaPoolItem::lookupTitle($_GET["mepitem_id"]);
1033
1034 $this->form->setValuesByArray($values);
1035 }

References $_GET, and ilMediaPoolItem\lookupTitle().

Referenced by editFolder().

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

◆ getMediaPoolPageValues()

ilObjMediaPoolGUI::getMediaPoolPageValues ( )

Get current values for media pool page from.

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

1286 {
1287 $values = array();
1288
1289 include_once("./Modules/MediaPool/classes/class.ilMediaPoolItem.php");
1290 $values["title"] = ilMediaPoolItem::lookupTitle($_GET["mepitem_id"]);
1291
1292 $this->form->setValuesByArray($values);
1293 }

References $_GET, and ilMediaPoolItem\lookupTitle().

Referenced by editMediaPoolPage().

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

◆ getParentFolderId()

ilObjMediaPoolGUI::getParentFolderId ( )

Get folder parent ID.

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

567 {
568 if ($_GET["mepitem_id"] == "")
569 {
570 return "";
571 }
572 $par_id = $this->object->tree->getParentId($_GET["mepitem_id"]);
573 if ($par_id != $this->object->tree->getRootId())
574 {
575 return $par_id;
576 }
577 else
578 {
579 return "";
580 }
581 }

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

1711 {
1712 global $tpl, $ilCtrl, $lng;
1713
1714 require_once("./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
1716
1717 $tpl->addJavaScript("./Modules/MediaPool/js/ilMediaPool.js");
1718
1719 $ilCtrl->setParameterByClass("ilobjmediapoolgui", "mepitem_id", "");
1720 $ilCtrl->setParameterByClass("ilobjmediapoolgui", "ref_id", $a_mpool_ref_id);
1721 $tpl->addOnloadCode("il.MediaPool.setPreviewUrl('".$ilCtrl->getLinkTargetByClass(array("ilmediapoolpresentationgui", "ilobjmediapoolgui"), "showPreview", "", false, false)."');");
1722 $ilCtrl->setParameterByClass("ilobjmediapoolgui", "mepitem_id", $_GET["mepitem_id"]);
1723 $ilCtrl->setParameterByClass("ilobjmediapoolgui", "ref_id", $_GET["red_id"]);
1724
1725 include_once("./Services/UIComponent/Modal/classes/class.ilModalGUI.php");
1726 $modal = ilModalGUI::getInstance();
1727 $modal->setHeading($lng->txt("preview"));
1728 $modal->setId("ilMepPreview");
1729 $modal->setType(ilModalGUI::TYPE_LARGE);
1730 $modal->setBody("<iframe id='ilMepPreviewContent'></iframe>");
1731
1732 return $modal->getHTML();
1733 }
static getInstance()
Get instance.
includePresentationJS($a_tpl=null)
Include media object presentation JS.

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

558 {
559 $this->tpl->getStandardTemplate();
560 }

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ getType()

ilObjMediaPoolGUI::getType ( )
final

Get type.

Reimplemented from ilObject2GUI.

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

55 {
56 return "mep";
57 }

◆ infoScreen()

ilObjMediaPoolGUI::infoScreen ( )

show information screen

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

1528 {
1529 global $ilAccess;
1530
1531 if (!$ilAccess->checkAccess("visible", "", $this->ref_id) &&
1532 !$ilAccess->checkAccess("read", "", $this->ref_id) &&
1533 !$ilAccess->checkAccess("write", "", $this->ref_id))
1534 {
1535 $this->ilias->raiseError($this->lng->txt("msg_no_perm_read"),$this->ilias->error_obj->MESSAGE);
1536 }
1537
1538 if ($this->ctrl->getCmd() == "infoScreen")
1539 {
1540 $this->ctrl->setCmd("showSummary");
1541 $this->ctrl->setCmdClass("ilinfoscreengui");
1542 }
1543
1544 include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
1545 $info = new ilInfoScreenGUI($this);
1546
1547 $info->enablePrivateNotes();
1548
1549 if ($ilAccess->checkAccess("read", "", $_GET["ref_id"]))
1550 {
1551 //$info->enableNews();
1552 }
1553
1554 // no news editing for files, just notifications
1555// $info->enableNewsEditing(false);
1556 if ($ilAccess->checkAccess("write", "", $_GET["ref_id"]))
1557 {
1558// $news_set = new ilSetting("news");
1559// $enable_internal_rss = $news_set->get("enable_rss_for_internal");
1560
1561// if ($enable_internal_rss)
1562// {
1563// $info->setBlockProperty("news", "settings", true);
1564// $info->setBlockProperty("news", "public_notifications_option", true);
1565// }
1566 }
1567
1568
1569 // standard meta data
1570 $info->addMetaDataSections($this->object->getId(),0, $this->object->getType());
1571
1572 // forward the command
1573 $this->ctrl->forwardCommand($info);
1574
1575// $this->tpl->show();
1576 }
Class ilInfoScreenGUI.
$info
Definition: example_052.php:80

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

1518 {
1519 $this->ctrl->setCmd("showSummary");
1520 $this->ctrl->setCmdClass("ilinfoscreengui");
1521 $this->infoScreen();
1522 }

References infoScreen().

+ Here is the call 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 361 of file class.ilObjMediaPoolGUI.php.

362 {
363 $forms = array(self::CFORM_NEW => $this->initCreateForm($a_new_type),
364 self::CFORM_IMPORT => $this->initImportForm($a_new_type));
365
366 return $forms;
367 }
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 381 of file class.ilObjMediaPoolGUI.php.

382 {
383 // default width
384 $ni = new ilNumberInputGUI($this->lng->txt("mep_default_width"), "default_width");
385 $ni->setMinValue(0);
386 $ni->setSuffix("px");
387 $ni->setMaxLength(5);
388 $ni->setSize(5);
389 $a_form->addItem($ni);
390
391 // default height
392 $ni = new ilNumberInputGUI($this->lng->txt("mep_default_height"), "default_height");
393 $ni->setSuffix("px");
394 $ni->setMinValue(0);
395 $ni->setMaxLength(5);
396 $ni->setSize(5);
397 $ni->setInfo($this->lng->txt("mep_default_width_height_info"));
398 $a_form->addItem($ni);
399 }
This class represents a number property in a property form.
addItem($a_item)
Add Item (Property, SectionHeader).

References ilPropertyFormGUI\addItem().

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

1091 {
1092 global $lng, $ilCtrl;
1093
1094 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
1095 $this->form = new ilPropertyFormGUI();
1096
1097 // desc
1098 $ti = new ilTextInputGUI($lng->txt("title"), "title");
1099 $ti->setMaxLength(128);
1100 $ti->setRequired(true);
1101 $this->form->addItem($ti);
1102
1103 // save and cancel commands
1104 if ($a_mode == "create")
1105 {
1106 $this->form->addCommandButton("saveFolder", $lng->txt("save"));
1107 $this->form->addCommandButton("cancelSave", $lng->txt("cancel"));
1108 $this->form->setTitle($lng->txt("mep_new_folder"));
1109 }
1110 else
1111 {
1112 $this->form->addCommandButton("updateFolder", $lng->txt("save"));
1113 $this->form->addCommandButton("cancelFolderUpdate", $lng->txt("cancel"));
1114 $this->form->setTitle($lng->txt("mep_edit_folder"));
1115 }
1116
1117 $this->form->setFormAction($ilCtrl->getFormAction($this));
1118 }
This class represents a property form user interface.
This class represents a text property in a property form.

References $ilCtrl, and ilObjectGUI\$lng.

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

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

1254 {
1255 global $lng, $ilCtrl;
1256
1257 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
1258 $this->form = new ilPropertyFormGUI();
1259
1260 // title
1261 $ti = new ilTextInputGUI($lng->txt("title"), "title");
1262 $ti->setMaxLength(128);
1263 $ti->setRequired(true);
1264 $this->form->addItem($ti);
1265
1266 // save and cancel commands
1267 if ($a_mode == "create")
1268 {
1269 $this->form->addCommandButton("saveMediaPoolPage", $lng->txt("save"));
1270 $this->form->addCommandButton("cancelSave", $lng->txt("cancel"));
1271 $this->form->setTitle($lng->txt("mep_new_content_snippet"));
1272 }
1273 else
1274 {
1275 $this->form->addCommandButton("updateMediaPoolPage", $lng->txt("save"));
1276 $this->form->setTitle($lng->txt("mep_edit_content_snippet"));
1277 }
1278
1279 $this->form->setFormAction($ilCtrl->getFormAction($this));
1280 }

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

796 {
797 global $ilAccess;
798
799 $this->checkPermission("write");
800
801 include_once("./Services/Clipboard/classes/class.ilEditClipboardGUI.php");
803 $not_inserted = array();
804 if (is_array($ids))
805 {
806 foreach ($ids as $id2)
807 {
808 $id = explode(":", $id2);
809 $type = $id[0];
810 $id = $id[1];
811
812 if ($type == "mob") // media object
813 {
814 if (ilObjMEdiaPool::isForeignIdInTree($this->object->getId(), $id))
815 {
816 $not_inserted[] = ilObject::_lookupTitle($id)." [".
817 $id."]";
818 }
819 else
820 {
821 $item = new ilMediaPoolItem();
822 $item->setType("mob");
823 $item->setForeignId($id);
824 $item->setTitle(ilObject::_lookupTitle($id));
825 $item->create();
826 if ($item->getId() > 0)
827 {
828 $this->object->insertInTree($item->getId(), $_GET["mepitem_id"]);
829 }
830 }
831 }
832 if ($type == "incl") // content snippet
833 {
834 include_once("./Modules/MediaPool/classes/class.ilMediaPoolPage.php");
835 include_once("./Modules/MediaPool/classes/class.ilMediaPoolItem.php");
836 if (ilObjMEdiaPool::isItemIdInTree($this->object->getId(), $id))
837 {
838 $not_inserted[] = ilMediaPoolPage::lookupTitle($id)." [".
839 $id."]";
840 }
841 else
842 {
843 $original = new ilMediaPoolPage($id);
844
845 // copy the page into the pool
846 $item = new ilMediaPoolItem();
847 $item->setType("pg");
848 $item->setTitle(ilMediaPoolItem::lookupTitle($id));
849 $item->create();
850 if ($item->getId() > 0)
851 {
852 $this->object->insertInTree($item->getId(), $_GET["mepitem_id"]);
853
854 // create page
855 include_once("./Modules/MediaPool/classes/class.ilMediaPoolPage.php");
856 $page = new ilMediaPoolPage();
857 $page->setId($item->getId());
858 $page->setParentId($this->object->getId());
859 $page->create();
860
861 // copy content
862 $original->copy($page->getId(), $page->getParentType(), $page->getParentId(), true);
863
864 //$page->setXMLContent($original->copyXMLContent());
865 //$page->buildDom();
866 //$page->update();
867 }
868 }
869 }
870 }
871 }
872 if (count($not_inserted) > 0)
873 {
874 ilUtil::sendInfo($this->lng->txt("mep_not_insert_already_exist")."<br>".
875 implode($not_inserted,"<br>"), true);
876 }
877 $this->ctrl->redirect($this, $_GET["mep_mode"] ? $_GET["mep_mode"] : "listMedia");
878 }
Class ilMediaPoolPage.
static lookupTitle($a_page_id)
Lookup title.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.

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

436 {
437 global $tree, $ilAccess, $tpl, $ilTabs, $ilCtrl, $ilToolbar, $lng, $ilErr;
438
439 $ilCtrl->setParameter($this, "mep_mode", "listMedia");
440
441 $this->checkPermission("read");
442
443 $ilTabs->setTabActive("objs_fold");
444
445 if ($ilAccess->checkAccess("write", "", $this->object->getRefId()))
446 {
447 $ilToolbar->addButton($lng->txt("mep_create_mob"),
448 $ilCtrl->getLinkTarget($this, "createMediaObject"));
449
450 $mset = new ilSetting("mobs");
451 if ($mset->get("mep_activate_pages"))
452 {
453 $ilToolbar->addButton($lng->txt("mep_create_content_snippet"),
454 $ilCtrl->getLinkTarget($this, "createMediaPoolPage"));
455 }
456
457 $ilToolbar->addButton($lng->txt("mep_create_folder"),
458 $ilCtrl->getLinkTarget($this, "createFolderForm"));
459
460 if (trim($mset->get("upload_dir")) != "" && ilMainMenuGUI::_checkAdministrationPermission())
461 {
462 $ilToolbar->addButton($lng->txt("mep_create_from_upload_dir"),
463 $ilCtrl->getLinkTargetByClass("ilfilesystemgui", "listFiles"));
464 }
465 }
466
467 // tree
468 include_once("./Modules/MediaPool/classes/class.ilMediaPoolExplorerGUI.php");
469 $exp = new ilMediaPoolExplorerGUI($this, "listMedia", $this->object);
470 if (!$exp->handleCommand())
471 {
472 $this->tpl->setLeftNavContent($exp->getHTML());
473 }
474 else
475 {
476 return;
477 }
478
479 include_once("./Modules/MediaPool/classes/class.ilMediaPoolTableGUI.php");
480 $mep_table_gui = new ilMediaPoolTableGUI($this, "listMedia", $this->object, "mepitem_id");
481 $tpl->setContent($mep_table_gui->getHTML());
482// $this->tpl->show();
483 }
Media pool explorer GUI class.

References $ilCtrl, $ilErr, ilObjectGUI\$lng, ilObjectGUI\$tpl, ilObject2GUI\$tree, ilMainMenuGUI\_checkAdministrationPermission(), and ilObject2GUI\checkPermission().

+ Here is the call graph for this function:

◆ openClipboard()

ilObjMediaPoolGUI::openClipboard ( )

paste from clipboard

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

780 {
781 global $ilCtrl, $ilAccess;
782
783 $this->checkPermission("write");
784
785 $ilCtrl->setParameterByClass("ileditclipboardgui", "returnCommand",
786 rawurlencode($ilCtrl->getLinkTarget($this,
787 "insertFromClipboard", "", false, false)));
788 $ilCtrl->redirectByClass("ilEditClipboardGUI", "getObject");
789 }

References $ilCtrl, and ilObject2GUI\checkPermission().

+ Here is the call graph for this function:

◆ remove()

ilObjMediaPoolGUI::remove ( )

confirm deletion of

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

893 {
894 global $ilAccess;
895
896 $this->checkPermission("write");
897
898 foreach($_POST["id"] as $obj_id)
899 {
900 $this->object->deleteChild($obj_id);
901 }
902
903 ilUtil::sendSuccess($this->lng->txt("cont_obj_removed"),true);
904 $this->ctrl->redirect($this, $_GET["mep_mode"] ? $_GET["mep_mode"] : "listMedia");
905 }

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

+ Here is the call graph for this function:

◆ resetFilter()

ilObjMediaPoolGUI::resetFilter ( )

Reset filter.

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

545 {
546 include_once("./Modules/MediaPool/classes/class.ilMediaPoolTableGUI.php");
547 $mtab = new ilMediaPoolTableGUI($this, "allMedia", $this->object,
548 "mepitem_id", ilMediaPoolTableGUI::IL_MEP_EDIT, true);
549 $mtab->resetFilter();
550 $mtab->resetOffset();
551 $this->allMedia();
552 }

References allMedia(), and ilMediaPoolTableGUI\IL_MEP_EDIT.

+ Here is the call graph for this function:

◆ saveFolder()

ilObjMediaPoolGUI::saveFolder ( )

Save folder form.

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

1041 {
1042 global $tpl, $lng, $ilCtrl;
1043
1044 $this->checkPermission("write");
1045
1046 $this->initFolderForm("create");
1047 if ($this->form->checkInput())
1048 {
1049 if ($this->object->createFolder($_POST["title"], (int) $_GET["mepitem_id"]))
1050 {
1051 ilUtil::sendSuccess($lng->txt("mep_folder_created"), true);
1052 }
1053 $ilCtrl->redirect($this, "listMedia");
1054 }
1055
1056 $this->form->setValuesByPost();
1057 $tpl->setContent($this->form->getHtml());
1058 }

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

+ Here is the call graph for this function:

◆ saveMediaPoolPage()

ilObjMediaPoolGUI::saveMediaPoolPage ( )

Save media pool page.

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

1184 {
1185 global $tpl, $lng, $ilCtrl;
1186
1187 $this->checkPermission("write");
1188
1189 $this->initMediaPoolPageForm("create");
1190 if ($this->form->checkInput())
1191 {
1192 // create media pool item
1193 include_once("./Modules/MediaPool/classes/class.ilMediaPoolItem.php");
1194 $item = new ilMediaPoolItem();
1195 $item->setTitle($_POST["title"]);
1196 $item->setType("pg");
1197 $item->create();
1198
1199 if ($item->getId() > 0)
1200 {
1201 // put in tree
1202 $tree = $this->object->getTree();
1203 $parent = $_GET["mepitem_id"] > 0
1204 ? $_GET["mepitem_id"]
1205 : $tree->getRootId();
1206 $this->object->insertInTree($item->getId(), $parent);
1207
1208 // create page
1209 include_once("./Modules/MediaPool/classes/class.ilMediaPoolPage.php");
1210 $page = new ilMediaPoolPage();
1211 $page->setId($item->getId());
1212 $page->setParentId($this->object->getId());
1213 $page->create();
1214
1215 $ilCtrl->setParameterByClass("ilmediapoolpagegui", "mepitem_id", $item->getId());
1216 $ilCtrl->redirectByClass("ilmediapoolpagegui", "edit");
1217
1218 }
1219 $ilCtrl->redirect($this, "listMedia");
1220 }
1221
1222 $this->form->setValuesByPost();
1223 $tpl->setContent($this->form->getHtml());
1224 }

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

+ Here is the call graph for this function:

◆ selectUploadDirFiles()

ilObjMediaPoolGUI::selectUploadDirFiles (   $a_files = null)

Select files from upload directory.

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

1587 {
1588 global $tpl, $ilTabs, $lng, $ilCtrl, $ilToolbar;
1589
1590 if(!$a_files)
1591 {
1592 $a_files = $_POST["file"];
1593 }
1594
1595 $ilTabs->clearTargets();
1596 $ilTabs->setBackTarget($lng->txt("back"),
1597 $ilCtrl->getLinkTarget($this, "listMedia"));
1598
1599 $this->checkPermission("write");
1600
1602 {
1603
1604 // action type
1605 include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
1606 $options = array(
1607 "rename" => $lng->txt("mep_up_dir_move"),
1608 "copy" => $lng->txt("mep_up_dir_copy"),
1609 );
1610 $si = new ilSelectInputGUI("", "action");
1611 $si->setOptions($options);
1612 $ilToolbar->addInputItem($si);
1613 $ilToolbar->setCloseFormTag(false);
1614 $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
1615 $ilToolbar->setFormName("mep_up_form");
1616
1617 include_once("./Modules/MediaPool/classes/class.ilUploadDirFilesTableGUI.php");
1618 $tab = new ilUploadDirFilesTableGUI($this, "selectUploadDirFiles",
1619 $a_files);
1620 $tab->setFormName("mep_up_form");
1621 $tpl->setContent($tab->getHTML());
1622 }
1623 }
This class represents a selection list property in a property form.
if(!is_array($argv)) $options

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

+ Here is the call graph for this function:

◆ setMediaPoolPageTabs()

ilObjMediaPoolGUI::setMediaPoolPageTabs ( )

Set media pool page tabs.

Parameters

return

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

1302 {
1303 global $ilTabs, $ilCtrl, $lng;
1304
1305 $ilTabs->clearTargets();
1306 //$ilTabs->addTab("mep_pg_prop", $lng->txt("mep_page_properties"),
1307 // $ilCtrl->getLinkTarget($this, "editMediaPoolPage"));
1308 $ilTabs->addTarget("mep_page_properties", $ilCtrl->getLinkTarget($this, "editMediaPoolPage"),
1309 "editMediaPoolPage", get_class($this));
1310 $ilTabs->addTarget("cont_usage", $ilCtrl->getLinkTarget($this, "showMediaPoolPageUsages"),
1311 array("showMediaPoolPageUsages", "showAllMediaPoolPageUsages"), get_class($this));
1312 $ilCtrl->setParameter($this, "mepitem_id", $this->object->tree->getParentId($_GET["mepitem_id"]));
1313 $ilTabs->setBackTarget($lng->txt("mep_folder"), $ilCtrl->getLinkTarget($this, "listMedia"));
1314 $ilCtrl->setParameter($this, "mepitem_id", $_GET["mepitem_id"]);
1315 }

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

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

1448 {
1449 global $ilTabs, $lng, $ilAccess;
1450
1451 if ($ilAccess->checkAccess("write", "", $this->object->getRefId()))
1452 {
1453 $ilTabs->addSubTab("settings",
1454 $lng->txt("settings"),
1455 $this->ctrl->getLinkTarget($this, "edit"));
1456
1457 $mset = new ilSetting("mobs");
1458 if ($mset->get("mep_activate_pages"))
1459 {
1460 $ilTabs->addSubTabTarget("obj_multilinguality",
1461 $this->ctrl->getLinkTargetByClass("ilobjecttranslationgui", ""));
1462 }
1463 }
1464
1465 $ilTabs->setSubTabActive($a_active);
1466 }

References ilObjectGUI\$lng.

Referenced by edit(), and executeCommand().

+ Here is the caller graph for this function:

◆ setTabs()

ilObjMediaPoolGUI::setTabs ( )

Set tabs.

Reimplemented from ilObject2GUI.

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

1378 {
1379 global $ilAccess, $ilTabs, $ilCtrl, $ilHelp;
1380
1381 $ilHelp->setScreenIdComponent("mep");
1382
1383 if ($ilAccess->checkAccess('read', '', $this->ref_id) ||
1384 $ilAccess->checkAccess('write', '', $this->ref_id))
1385 {
1386 $ilTabs->addTarget("objs_fold", $this->ctrl->getLinkTarget($this, ""),
1387 "listMedia", "", "_top");
1388
1389 $ilCtrl->setParameter($this, "mepitem_id", "");
1390 $ilTabs->addTarget("mep_all_mobs", $this->ctrl->getLinkTarget($this, "allMedia"),
1391 "allMedia", "", "_top");
1392 $ilCtrl->setParameter($this, "mepitem_id", $_GET["mepitem_id"]);
1393 }
1394
1395 // info tab
1396 if ($ilAccess->checkAccess('visible', '', $this->ref_id) ||
1397 $ilAccess->checkAccess('read', '', $this->ref_id) ||
1398 $ilAccess->checkAccess('write', '', $this->ref_id))
1399 {
1400 $force_active = ($this->ctrl->getNextClass() == "ilinfoscreengui"
1401 || strtolower($_GET["cmdClass"]) == "ilnotegui")
1402 ? true
1403 : false;
1404 //echo "-$force_active-";
1405 $ilTabs->addTarget("info_short",
1406 $this->ctrl->getLinkTargetByClass(
1407 array("ilobjmediapoolgui", "ilinfoscreengui"), "showSummary"),
1408 array("showSummary", "infoScreen"),
1409 "", "", $force_active);
1410 }
1411
1412 if ($ilAccess->checkAccess("write", "", $this->object->getRefId()))
1413 {
1414 $ilTabs->addTarget("settings", $this->ctrl->getLinkTarget($this, "edit"),
1415 "edit", array("", "ilobjmediapoolgui"));
1416 }
1417
1418 if ($ilAccess->checkAccess("write", "", $this->object->getRefId()))
1419 {
1420 $ilTabs->addTarget("clipboard", $this->ctrl->getLinkTarget($this, "openClipboard"),
1421 "view", "ileditclipboardgui");
1422 }
1423
1424 if ($ilAccess->checkAccess("write", "", $this->object->getRefId()))
1425 {
1426 $ilTabs->addTarget("export", $this->ctrl->getLinkTargetByClass("ilexportgui", ""),
1427 "", "ilexportgui");
1428
1429 $ilTabs->addTarget("import", $this->ctrl->getLinkTargetByClass("ilmediapoolimportgui", ""),
1430 "", "ilmediapoolimportgui");
1431 }
1432
1433 if ($ilAccess->checkAccess("edit_permission", "", $this->object->getRefId()))
1434 {
1435 $ilTabs->addTarget("perm_settings",
1436 $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm"), array("perm","info","owner"), 'ilpermissiongui');
1437 }
1438
1439 }

References $_GET, and $ilCtrl.

◆ showAllMediaPoolPageUsages()

ilObjMediaPoolGUI::showAllMediaPoolPageUsages ( )

List usages of the contnet snippet.

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

1321 {
1322 $this->showMediaPoolPageUsages(true);
1323 }
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 713 of file class.ilObjMediaPoolGUI.php.

714 {
715 $this->showMedia();
716 }
showMedia()
show media object

References showMedia().

+ Here is the call graph for this function:

◆ showMedia()

ilObjMediaPoolGUI::showMedia ( )
protected

show media object

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

587 {
588 global $ilAccess;
589
590 $this->checkPermission("read");
591
592 $item = new ilMediaPoolItem((int) $_GET["mepitem_id"]);
593 $mob_id = $item->getForeignId();
594
595 $this->tpl = new ilTemplate("tpl.fullscreen.html", true, true, "Services/COPage");
596 include_once("Services/Style/classes/class.ilObjStyleSheet.php");
597 $this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
598 $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET",
600
601
602 require_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
603 require_once("./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
605 $media_obj = new ilObjMediaObject((int) $mob_id);
606
607
608 $this->tpl->setVariable("TITLE", " - ".$media_obj->getTitle());
609
610 $xml = "<dummy>";
611 // todo: we get always the first alias now (problem if mob is used multiple
612 // times in page)
613 $xml.= $media_obj->getXML(IL_MODE_ALIAS);
614 $xml.= $media_obj->getXML(IL_MODE_OUTPUT);
615 $xml.= $link_xml;
616 $xml.="</dummy>";
617
618 $xsl = file_get_contents("./Services/COPage/xsl/page.xsl");
619 $args = array( '/_xml' => $xml, '/_xsl' => $xsl );
620 $xh = xslt_create();
621
622 $wb_path = ilUtil::getWebspaceDir("output")."/";
623
624 $mode = ($_GET["cmd"] != "showPreview")
625 ? "fullscreen"
626 : "media";
627 $enlarge_path = ilUtil::getImagePath("enlarge.svg", false, "output");
628 $fullscreen_link =
629 $this->ctrl->getLinkTarget($this, "showFullscreen", "", false, false);
630 $params = array ('mode' => $mode, 'enlarge_path' => $enlarge_path,
631 'link_params' => "ref_id=".$_GET["ref_id"],'fullscreen_link' => $fullscreen_link,
632 'ref_id' => $_GET["ref_id"], 'pg_frame' => $pg_frame, 'webspace_path' => $wb_path);
633 $output = xslt_process($xh,"arg:/_xml","arg:/_xsl",NULL,$args, $params);
634 echo xslt_error($xh);
635 xslt_free($xh);
636 // unmask user html
637 $this->tpl->setVariable("MEDIA_CONTENT", $output);
638 }
const IL_MODE_ALIAS
const IL_MODE_OUTPUT
getContentStylePath($a_style_id)
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)
$params
Definition: example_049.php:96
xslt_error(&$proc)
xslt_free(&$proc)
xslt_create()

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

1330 {
1331 global $ilTabs, $ilCtrl, $lng, $tpl;
1332
1333 $this->checkPermission("write");
1334
1335 $this->setMediaPoolPageTabs();
1336
1337 $ilTabs->addSubTab("current_usages", $lng->txt("cont_current_usages"),
1338 $ilCtrl->getLinkTarget($this, "showMediaPoolPageUsages"));
1339
1340 $ilTabs->addSubTab("all_usages", $lng->txt("cont_all_usages"),
1341 $ilCtrl->getLinkTarget($this, "showAllMediaPoolPageUsages"));
1342
1343 if ($a_all)
1344 {
1345 $ilTabs->activateSubTab("all_usages");
1346 $cmd = "showAllMediaPoolPageUsages";
1347 }
1348 else
1349 {
1350 $ilTabs->activateSubTab("current_usages");
1351 $cmd = "showMediaPoolPageUsages";
1352 }
1353
1354
1355 include_once("./Modules/MediaPool/classes/class.ilMediaPoolPageGUI.php");
1356 $mep_page_gui = new ilMediaPoolPageGUI($_GET["mepitem_id"], $_GET["old_nr"]);
1357 $mep_page_gui->getTabs();
1358
1359 include_once("./Modules/MediaPool/classes/class.ilMediaPoolPage.php");
1360 $page = new ilMediaPoolPage((int) $_GET["mepitem_id"]);
1361
1362 include_once("./Modules/MediaPool/classes/class.ilMediaPoolPageUsagesTableGUI.php");
1363 $table = new ilMediaPoolPageUsagesTableGUI($this, $cmd, $page, $a_all);
1364
1365 $tpl->setContent($table->getHTML());
1366
1367 }
TableGUI class for media pool page usages listing.

References $_GET, $cmd, $ilCtrl, ilObjectGUI\$lng, 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 646 of file class.ilObjMediaPoolGUI.php.

647 {
648 global $tpl;
649
650 $tpl = new ilTemplate("tpl.main.html", true, true);
651
652 include_once("./Services/Container/classes/class.ilContainerPage.php");
653 include_once("./Services/Container/classes/class.ilContainerPageGUI.php");
654
655 include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
656 $tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
657 $tpl->setVariable("LOCATION_CONTENT_STYLESHEET",
659 $tpl->setCurrentBlock("SyntaxStyle");
660 $tpl->setVariable("LOCATION_SYNTAX_STYLESHEET",
662 $tpl->parseCurrentBlock();
663
664 // get page object
665 //include_once("./Services/Object/classes/class.ilObjectTranslation.php");
666 //$ot = ilObjectTranslation::getInstance($this->object->getId());
667 //$lang = $ot->getEffectiveContentLang($ilUser->getCurrentLanguage(), "cont");
668 include_once("./Modules/MediaPool/classes/class.ilMediaPoolPageGUI.php");
669 $page_gui = new ilMediaPoolPageGUI((int) $_GET["mepitem_id"]);
670 include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
671 //$page_gui->setStyleId(ilObjStyleSheet::getEffectiveContentStyleId(
672 // $this->object->getStyleSheetId(), $this->object->getType()));
673
674 $page_gui->setTemplateOutput(false);
675 $page_gui->setHeader("");
676 $ret = $page_gui->showPage(true);
677
678 $tpl->setBodyClass("ilMediaPoolPagePreviewBody");
679 $tpl->setVariable("CONTENT", $ret);
680 //$ret = "<div style='background-color: white; padding:5px; margin-bottom: 30px;'>".$ret."</div>";
681
682 //$ret =& $page_gui->executeCommand();
683 $tpl->show();
684 exit;
685 }
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 691 of file class.ilObjMediaPoolGUI.php.

692 {
693 $this->checkPermission("read");
694
695 $item = new ilMediaPoolItem((int) $_GET["mepitem_id"]);
696
697 switch ($item->getType())
698 {
699 case "mob":
700 $this->showMedia();
701 break;
702
703 case "pg":
704 $this->showPage();
705 break;
706 }
707 }

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

427 {
428 $this->object->setDefaultWidth($a_form->getInput("default_width"));
429 $this->object->setDefaultHeight($a_form->getInput("default_height"));
430 }
getInput($a_post_var, $ensureValidation=true)
Returns the value of a HTTP-POST variable, identified by the passed id.

References ilPropertyFormGUI\getInput().

+ Here is the call graph for this function:

◆ updateFolder()

ilObjMediaPoolGUI::updateFolder ( )

Update folder.

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

1064 {
1065 global $lng, $ilCtrl, $tpl;
1066
1067 $this->checkPermission("write");
1068
1069 $this->initFolderForm("edit");
1070 if ($this->form->checkInput())
1071 {
1072 $item = new ilMediaPoolItem($_GET["mepitem_id"]);
1073 $item->setTitle($_POST["title"]);
1074 $item->update();
1075 ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
1076 $ilCtrl->setParameter($this, "mepitem_id",
1077 $this->object->getTree()->getParentId($_GET["mepitem_id"]));
1078 $ilCtrl->redirect($this, "listMedia");
1079 }
1080
1081 $this->form->setValuesByPost();
1082 $tpl->setContent($this->form->getHtml());
1083 }

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

+ Here is the call graph for this function:

◆ updateMediaPoolPage()

ilObjMediaPoolGUI::updateMediaPoolPage ( )

Update media pool page.

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

1230 {
1231 global $lng, $ilCtrl, $tpl;
1232
1233 $this->checkPermission("write");
1234
1235 $this->initMediaPoolPageForm("edit");
1236 if ($this->form->checkInput())
1237 {
1238 $item = new ilMediaPoolItem($_GET["mepitem_id"]);
1239 $item->setTitle($_POST["title"]);
1240 $item->update();
1241 ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
1242 $ilCtrl->redirect($this, "editMediaPoolPage");
1243 }
1244
1245 $this->form->setValuesByPost();
1246 $tpl->setContent($this->form->getHtml());
1247 }

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

+ Here is the call graph for this function:

Field Documentation

◆ $output_prepared

ilObjMediaPoolGUI::$output_prepared

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


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