ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
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...
 
 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...
 
 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 ()
 Select files from upload directory. More...
 
 createMediaFromUploadDir ()
 Create media object from upload directory. 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...
 
 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)
 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
 

Detailed Description

Member Function Documentation

◆ _goto()

static ilObjMediaPoolGUI::_goto (   $a_target)
static

goto target media pool

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

1399 {
1400 global $ilAccess, $ilErr, $lng;
1401
1402 $targets = explode('_',$a_target);
1403 if(count((array) $targets) > 1)
1404 {
1405 $ref_id = $targets[0];
1406 $subitem_id = $targets[1];
1407 }
1408 else
1409 {
1410 $ref_id = $targets[0];
1411 }
1412
1413 if ($ilAccess->checkAccess("read", "", $ref_id))
1414 {
1415 $_GET["baseClass"] = "ilMediaPoolPresentationGUI";
1416 $_GET["ref_id"] = $ref_id;
1417 $_GET['mepitem_id'] = $subitem_id;
1418 include("ilias.php");
1419 exit;
1420 } else if ($ilAccess->checkAccess("visible", "", $ref_id))
1421 {
1422 $_GET["baseClass"] = "ilMediaPoolPresentationGUI";
1423 $_GET["ref_id"] = $ref_id;
1424 $_GET["cmd"] = "infoScreen";
1425 include("ilias.php");
1426 exit;
1427 }
1428 else if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID))
1429 {
1430 ilUtil::sendFailure(sprintf($lng->txt("msg_no_perm_read_item"),
1433 }
1434
1435 $ilErr->raiseError($lng->txt("msg_no_perm_read"), $ilErr->FATAL);
1436 }
$_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 909 of file class.ilObjMediaPoolGUI.php.

910 {
911 global $ilLocator, $ilAccess;
912
913 if (!$this->getCreationMode() && $this->ctrl->getCmd() != "explorer")
914 {
915 $tree =& $this->object->getTree();
916 $obj_id = ($_GET["mepitem_id"] == "")
917 ? $tree->getRootId()
918 : $_GET["mepitem_id"];
919 $path = $tree->getPathFull($obj_id);
920 foreach($path as $node)
921 {
922 if ($node["child"] == $tree->getRootId())
923 {
924 $this->ctrl->setParameter($this, "mepitem_id", "");
925 if ($ilAccess->checkAccess("read", "", $this->object->getRefId()))
926 {
927 $link = $this->ctrl->getLinkTarget($this, "listMedia");
928 }
929 else if ($ilAccess->checkAccess("visible", "", $this->object->getRefId()))
930 {
931 $link = $this->ctrl->getLinkTarget($this, "infoScreen");
932 }
933 $title = $this->object->getTitle();
934 $this->ctrl->setParameter($this, "mepitem_id", $_GET["mepitem_id"]);
935 $ilLocator->addItem($title, $link, "", $_GET["ref_id"]);
936 }
937 }
938 }
939 }
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 343 of file class.ilObjMediaPoolGUI.php.

344 {
345 // always send a message
346 ilUtil::sendSuccess($this->lng->txt("object_added"),true);
347
348 //ilUtil::redirect($this->getReturnLocation("save","adm_object.php?".$this->link_params));
349 ilUtil::redirect("ilias.php?baseClass=ilMediaPoolPresentationGUI&ref_id=".$newObj->getRefId()."&cmd=listMedia");
350 }
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 446 of file class.ilObjMediaPoolGUI.php.

447 {
448 global $tree, $ilAccess, $tpl, $ilTabs, $ilCtrl,$ilUser;
449
450 $ilCtrl->setParameter($this, "mep_mode", "allMedia");
451
452 $this->checkPermission("read");
453 $ilTabs->setTabActive("mep_all_mobs");
454
455
456 include_once("./Modules/MediaPool/classes/class.ilMediaPoolTableGUI.php");
457 $mep_table_gui = new ilMediaPoolTableGUI($this, "allMedia", $this->object,
458 "mepitem_id", ilMediaPoolTableGUI::IL_MEP_EDIT, true);
459
460
461 if(isset($_GET['force_filter']) and $_GET['force_filter'])
462 {
463 $_POST['title'] = ilMediaPoolItem::lookupTitle((int) $_GET['force_filter']);
464
465 include_once("./Services/Table/classes/class.ilTablePropertiesStorage.php");
466 $tprop = new ilTablePropertiesStorage();
467 $tprop->storeProperty(
468 $mep_table_gui->getId(),
469 $ilUser->getId(),
470 'filter',
471 1
472 );
473 $mep_table_gui->resetFilter();
474 $mep_table_gui->resetOffset();
475 $mep_table_gui->writeFilterToSession();
476
477 // Read again
478 $mep_table_gui = new ilMediaPoolTableGUI($this, "allMedia", $this->object,
479 "mepitem_id", ilMediaPoolTableGUI::IL_MEP_EDIT, true);
480 }
481
482 $tpl->setContent($mep_table_gui->getHTML());
483// $this->tpl->show();
484 }
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 489 of file class.ilObjMediaPoolGUI.php.

490 {
491 include_once("./Modules/MediaPool/classes/class.ilMediaPoolTableGUI.php");
492 $mtab = new ilMediaPoolTableGUI($this, "allMedia", $this->object,
493 "mepitem_id", ilMediaPoolTableGUI::IL_MEP_EDIT, true);
494 $mtab->writeFilterToSession();
495 $mtab->resetOffset();
496 $this->allMedia();
497 }
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 1080 of file class.ilObjMediaPoolGUI.php.

1081 {
1082 global $ilCtrl;
1083 $ilCtrl->setParameter($this, "mepitem_id",
1084 $this->object->getTree()->getParentId($_GET["mepitem_id"]));
1085 $ilCtrl->redirect($this, "listMedia");
1086 }

References $_GET, and $ilCtrl.

◆ cancelRemove()

ilObjMediaPoolGUI::cancelRemove ( )

cancel deletion of media objects/folders

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

842 {
843 $this->ctrl->redirect($this, $_GET["mep_mode"] ? $_GET["mep_mode"] : "listMedia");
844 }

References $_GET.

◆ cancelSave()

ilObjMediaPoolGUI::cancelSave ( )

Cancel save.

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

1092 {
1093 global $ilCtrl;
1094 $ilCtrl->redirect($this, "listMedia");
1095 }

References $ilCtrl.

◆ confirmRemove()

ilObjMediaPoolGUI::confirmRemove ( )

confirm remove of mobs

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

680 {
681 global $ilAccess, $ilCtrl, $lng;
682
683 $this->checkPermission("write");
684
685 if(!isset($_POST["id"]))
686 {
687 $this->ilias->raiseError($this->lng->txt("no_checkbox"),$this->ilias->error_obj->MESSAGE);
688 }
689
690 // display confirmation message
691 include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
692 $cgui = new ilConfirmationGUI();
693 $cgui->setFormAction($this->ctrl->getFormAction($this));
694 $cgui->setHeaderText($this->lng->txt("info_delete_sure"));
695 $cgui->setCancel($this->lng->txt("cancel"), "cancelRemove");
696 $cgui->setConfirm($this->lng->txt("confirm"), "remove");
697
698 foreach($_POST["id"] as $obj_id)
699 {
702
703 // check whether page can be removed
704 $add = "";
705 if ($type == "pg")
706 {
707 include_once("./Services/COPage/classes/class.ilPageContentUsage.php");
708 $usages = ilPageContentUsage::getUsages("incl", $obj_id, false);
709 if (count($usages) > 0)
710 {
711 ilUtil::sendFailure(sprintf($lng->txt("mep_content_snippet_in_use"), $title), true);
712 $ilCtrl->redirect($this, "listMedia");
713 }
714 else
715 {
716 // check whether the snippet is used in older versions of pages
717 $usages = ilPageContentUsage::getUsages("incl", $obj_id, true);
718 if (count($usages) > 0)
719 {
720 $add = "<div class='small'>".$lng->txt("mep_content_snippet_used_in_older_versions")."</div>";
721 }
722 }
723 }
724
725 $caption = ilUtil::getImageTagByType($type, $this->tpl->tplPath).
726 " ".$title.$add;
727
728 $cgui->addItem("id[]", $obj_id, $caption);
729 }
730
731 $this->tpl->setContent($cgui->getHTML());
732 }
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 868 of file class.ilObjMediaPoolGUI.php.

869 {
870 global $ilUser, $ilAccess;
871
872 $this->checkPermission("write");
873
874 if(!isset($_POST["id"]))
875 {
876 ilUtil::sendFailure($this->lng->txt("no_checkbox"), true);
877 $this->ctrl->redirect($this, $_GET["mep_mode"] ? $_GET["mep_mode"] : "listMedia");
878 }
879
880 foreach ($_POST["id"] as $obj_id)
881 {
883 if ($type == "fold")
884 {
885 ilUtil::sendFailure($this->lng->txt("cont_cant_copy_folders"), true);
886 $this->ctrl->redirect($this, $_GET["mep_mode"] ? $_GET["mep_mode"] : "listMedia");
887 }
888 }
889 foreach ($_POST["id"] as $obj_id)
890 {
893 if ($type == "mob")
894 {
895 $ilUser->addObjectToClipboard($fid, "mob", "");
896 }
897 if ($type == "pg")
898 {
899 $ilUser->addObjectToClipboard($obj_id, "incl", "");
900 }
901 }
902 ilUtil::sendSuccess($this->lng->txt("copied_to_clipboard"),true);
903 $this->ctrl->redirect($this, $_GET["mep_mode"] ? $_GET["mep_mode"] : "listMedia");
904 }
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 948 of file class.ilObjMediaPoolGUI.php.

949 {
950 global $ilAccess, $tpl;
951
952 $this->checkPermission("write");
953
954 $this->initFolderForm("create");
955 $tpl->setContent($this->form->getHTML());
956
957/* $folder_gui =& new ilObjFolderGUI("", 0, false, false);
958 $this->ctrl->setParameterByClass("ilobjfoldergui", "obj_id", $_GET["obj_id"]);
959 $folder_gui->setFormAction("save",
960 $this->ctrl->getFormActionByClass("ilobjfoldergui"));
961 $folder_gui->createObject();*/
962// $this->tpl->show();
963 }
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 1549 of file class.ilObjMediaPoolGUI.php.

1550 {
1551 $this->checkPermission("write");
1552
1553 $mset = new ilSetting("mobs");
1554 $upload_dir = trim($mset->get("upload_dir"));
1555
1556 include_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
1557
1558 if (is_array($_POST["file"]) && ilMainMenuGUI::_checkAdministrationPermission())
1559 {
1560 foreach ($_POST["file"] as $f)
1561 {
1562 $f = str_replace("..", "", $f);
1563 $fullpath = $upload_dir."/".$f;
1564 $mob = new ilObjMediaObject();
1565 $mob->setTitle(basename($fullpath));
1566 $mob->setDescription("");
1567 $mob->create();
1568
1569 // determine and create mob directory, move uploaded file to directory
1570 //$mob_dir = ilUtil::getWebspaceDir()."/mobs/mm_".$a_mob->getId();
1571 $mob->createDirectory();
1572 $mob_dir = ilObjMediaObject::_getDirectory($mob->getId());
1573
1574 $media_item = new ilMediaItem();
1575 $mob->addMediaItem($media_item);
1576 $media_item->setPurpose("Standard");
1577
1578 $file = $mob_dir."/".basename($fullpath);
1579 ilUtil::moveUploadedFile($fullpath,
1580 basename($fullpath), $file, false, $_POST["action"]);
1581
1582 // get mime type
1584 $location = basename($fullpath);
1585
1586 // set real meta and object data
1587 $media_item->setFormat($format);
1588 $media_item->setLocation($location);
1589 $media_item->setLocationType("LocalFile");
1590
1591 $mob->setDescription($format);
1592
1593 // determine width and height of known image types
1594 $wh = ilObjMediaObject::_determineWidthHeight(500, 400, $format,
1595 "File", $mob_dir."/".$location, $media_item->getLocation(),
1596 true, true, "", "");
1597 $media_item->setWidth($wh["width"]);
1598 $media_item->setHeight($wh["height"]);
1599 if ($wh["info"] != "")
1600 {
1601 // ilUtil::sendInfo($wh["info"], true);
1602 }
1603
1604 $media_item->setHAlign("Left");
1605 ilUtil::renameExecutables($mob_dir);
1606 $mob->update();
1607
1608
1609 // put it into current folder
1610 $mep_item = new ilMediaPoolItem();
1611 $mep_item->setTitle($mob->getTitle());
1612 $mep_item->setType("mob");
1613 $mep_item->setForeignId($mob->getId());
1614 $mep_item->create();
1615
1616 $tree = $this->object->getTree();
1617 $parent = ($_GET["mepitem_id"] == "")
1618 ? $tree->getRootId()
1619 : $_GET["mepitem_id"];
1620 $tree->insertNode($mep_item->getId(), $parent);
1621 }
1622 }
1623 ilUtil::redirect("ilias.php?baseClass=ilMediaPoolPresentationGUI&cmd=listMedia&ref_id=".
1624 $_GET["ref_id"]."&mepitem_id=".$_GET["mepitem_id"]);
1625
1626 }
print $file
$location
Definition: buildRTE.php:44
Class ilMediaItem.
Class ilObjMediaObject.
_getDirectory($a_mob_id)
get directory for files of media object (static)
static _determineWidthHeight($a_def_width, $a_def_height, $a_format, $a_type, $a_file, $a_reference, $a_constrain_proportions, $a_use_original, $a_user_width, $a_user_height)
Determine width and height.
static getMimeType($a_file)
get mime type for file
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 327 of file class.ilObjMediaPoolGUI.php.

328 {
329 $this->ctrl->redirectByClass("ilobjmediaobjectgui", "create");
330 }

◆ createMediaPoolPage()

ilObjMediaPoolGUI::createMediaPoolPage ( )

Create new content snippet.

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

1105 {
1106 global $tpl;
1107
1108 $this->checkPermission("write");
1109
1110 $this->initMediaPoolPageForm("create");
1111 $tpl->setContent($this->form->getHTML());
1112 }
initMediaPoolPageForm($a_mode="edit")
Init page form.

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

+ Here is the call graph for this function:

◆ editFolder()

ilObjMediaPoolGUI::editFolder ( )

Edit folder.

Parameters

return

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

972 {
973 global $tpl;
974
975 $this->checkPermission("write");
976
977 $this->initFolderForm();
978 $this->getFolderValues();
979 $tpl->setContent($this->form->getHTML());
980 }
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 1120 of file class.ilObjMediaPoolGUI.php.

1121 {
1122 global $tpl;
1123
1124 $this->checkPermission("write");
1125
1126 $this->setMediaPoolPageTabs();
1127
1128 include_once("./Modules/MediaPool/classes/class.ilMediaPoolPageGUI.php");
1129 $mep_page_gui = new ilMediaPoolPageGUI($_GET["mepitem_id"], $_GET["old_nr"]);
1130 $mep_page_gui->getTabs();
1131
1132 $this->initMediaPoolPageForm("edit");
1133 $this->getMediaPoolPageValues();
1134 $tpl->setContent($this->form->getHTML());
1135 }
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 $ret = $this->ctrl->forwardCommand($exp_gui);
277 $this->tpl->show();
278 break;
279
280 case "ilfilesystemgui":
281 $this->checkPermission("write");
282 $this->prepareOutput();
283 $this->addHeaderAction();
284 $ilTabs->clearTargets();
285 $ilTabs->setBackTarget($lng->txt("back"),
286 $ilCtrl->getLinkTarget($this, "listMedia"));
287 $mset = new ilSetting("mobs");
288 if (trim($mset->get("upload_dir")) != "")
289 {
290 include_once("./Services/FileSystem/classes/class.ilFileSystemGUI.php");
291 $fs_gui = new ilFileSystemGUI($mset->get("upload_dir"));
292 $fs_gui->setPostDirPath(true);
293 $fs_gui->setTableId("mepud".$this->object->getId());
294 $fs_gui->setAllowFileCreation(false);
295 $fs_gui->setAllowDirectoryCreation(false);
296 $fs_gui->clearCommands();
297 $fs_gui->addCommand($this, "selectUploadDirFiles", $this->lng->txt("mep_sel_upload_dir_files"),
298 false, true);
299 //$fs_gui->addCommand($this, "assignFullscreenObject", $this->lng->txt("cont_assign_full"));
300 $ret =& $this->ctrl->forwardCommand($fs_gui);
301 }
302 $this->tpl->show();
303 break;
304
305 case "ilcommonactiondispatchergui":
306 include_once("Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
308 $this->ctrl->forwardCommand($gui);
309 break;
310
311 default:
312 $this->prepareOutput();
313 $this->addHeaderAction();
314 $cmd = $this->ctrl->getCmd("listMedia");
315 $this->$cmd();
316 if (!$this->getCreationMode())
317 {
318 $this->tpl->show();
319 }
320 break;
321 }
322 }
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
Class ilEditClipboardGUI.
Export User Interface Class.
File System Explorer GUI class.
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.
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(), ilCommonActionDispatcherGUI\getInstanceFromAjaxCall(), getParentFolderId(), getTemplate(), infoScreen(), ilMediaPoolItem\lookupForeignId(), ilObject2GUI\prepareOutput(), ilUtil\redirect(), ilObject2GUI\setCreationMode(), ilObject2GUI\setLocator(), and setMediaPoolPageTabs().

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

373 {
374 if ($this->object->getDefaultWidth() > 0)
375 {
376 $a_values["default_width"] = $this->object->getDefaultWidth();
377 }
378 if ($this->object->getDefaultHeight() > 0)
379 {
380 $a_values["default_height"] = $this->object->getDefaultHeight();
381 }
382 }

◆ getFolderValues()

ilObjMediaPoolGUI::getFolderValues ( )

Get current values for folder from.

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

986 {
987 $values = array();
988
989 $values["title"] = ilMediaPoolItem::lookupTitle($_GET["mepitem_id"]);
990
991 $this->form->setValuesByArray($values);
992 }

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

1242 {
1243 $values = array();
1244
1245 include_once("./Modules/MediaPool/classes/class.ilMediaPoolItem.php");
1246 $values["title"] = ilMediaPoolItem::lookupTitle($_GET["mepitem_id"]);
1247
1248 $this->form->setValuesByArray($values);
1249 }

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

525 {
526 if ($_GET["mepitem_id"] == "")
527 {
528 return "";
529 }
530 $par_id = $this->object->tree->getParentId($_GET["mepitem_id"]);
531 if ($par_id != $this->object->tree->getRootId())
532 {
533 return $par_id;
534 }
535 else
536 {
537 return "";
538 }
539 }

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

1632 {
1633 global $tpl, $ilCtrl, $lng;
1634
1635 require_once("./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
1637
1638 $tpl->addJavaScript("./Modules/MediaPool/js/ilMediaPool.js");
1639
1640 $ilCtrl->setParameterByClass("ilobjmediapoolgui", "mepitem_id", "");
1641 $ilCtrl->setParameterByClass("ilobjmediapoolgui", "ref_id", $a_mpool_ref_id);
1642 $tpl->addOnloadCode("il.MediaPool.setPreviewUrl('".$ilCtrl->getLinkTargetByClass(array("ilmediapoolpresentationgui", "ilobjmediapoolgui"), "showPreview", "", false, false)."');");
1643 $ilCtrl->setParameterByClass("ilobjmediapoolgui", "mepitem_id", $_GET["mepitem_id"]);
1644 $ilCtrl->setParameterByClass("ilobjmediapoolgui", "ref_id", $_GET["red_id"]);
1645
1646 include_once("./Services/UIComponent/Modal/classes/class.ilModalGUI.php");
1647 $modal = ilModalGUI::getInstance();
1648 $modal->setHeading($lng->txt("preview"));
1649 $modal->setId("ilMepPreview");
1650 $modal->setType(ilModalGUI::TYPE_LARGE);
1651 $modal->setBody("<iframe id='ilMepPreviewContent'></iframe>");
1652
1653 return $modal->getHTML();
1654 }
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 515 of file class.ilObjMediaPoolGUI.php.

516 {
517 $this->tpl->getStandardTemplate();
518 }

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

1454 {
1455 global $ilAccess;
1456
1457 if (!$ilAccess->checkAccess("visible", "", $this->ref_id) &&
1458 !$ilAccess->checkAccess("read", "", $this->ref_id) &&
1459 !$ilAccess->checkAccess("write", "", $this->ref_id))
1460 {
1461 $this->ilias->raiseError($this->lng->txt("msg_no_perm_read"),$this->ilias->error_obj->MESSAGE);
1462 }
1463
1464 if ($this->ctrl->getCmd() == "infoScreen")
1465 {
1466 $this->ctrl->setCmd("showSummary");
1467 $this->ctrl->setCmdClass("ilinfoscreengui");
1468 }
1469
1470 include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
1471 $info = new ilInfoScreenGUI($this);
1472
1473 $info->enablePrivateNotes();
1474
1475 if ($ilAccess->checkAccess("read", "", $_GET["ref_id"]))
1476 {
1477 //$info->enableNews();
1478 }
1479
1480 // no news editing for files, just notifications
1481// $info->enableNewsEditing(false);
1482 if ($ilAccess->checkAccess("write", "", $_GET["ref_id"]))
1483 {
1484// $news_set = new ilSetting("news");
1485// $enable_internal_rss = $news_set->get("enable_rss_for_internal");
1486
1487// if ($enable_internal_rss)
1488// {
1489// $info->setBlockProperty("news", "settings", true);
1490// $info->setBlockProperty("news", "public_notifications_option", true);
1491// }
1492 }
1493
1494
1495 // standard meta data
1496 $info->addMetaDataSections($this->object->getId(),0, $this->object->getType());
1497
1498 // forward the command
1499 $this->ctrl->forwardCommand($info);
1500
1501// $this->tpl->show();
1502 }
Class ilInfoScreenGUI.

References $_GET.

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

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

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

333 {
334 $forms = array(self::CFORM_NEW => $this->initCreateForm($a_new_type),
335 self::CFORM_IMPORT => $this->initImportForm($a_new_type));
336
337 return $forms;
338 }
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 352 of file class.ilObjMediaPoolGUI.php.

353 {
354 // default width
355 $ni = new ilNumberInputGUI($this->lng->txt("mep_default_width"), "default_width");
356 $ni->setMinValue(0);
357 $ni->setSuffix("px");
358 $ni->setMaxLength(5);
359 $ni->setSize(5);
360 $a_form->addItem($ni);
361
362 // default height
363 $ni = new ilNumberInputGUI($this->lng->txt("mep_default_height"), "default_height");
364 $ni->setSuffix("px");
365 $ni->setMinValue(0);
366 $ni->setMaxLength(5);
367 $ni->setSize(5);
368 $ni->setInfo($this->lng->txt("mep_default_width_height_info"));
369 $a_form->addItem($ni);
370 }
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 1047 of file class.ilObjMediaPoolGUI.php.

1048 {
1049 global $lng, $ilCtrl;
1050
1051 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
1052 $this->form = new ilPropertyFormGUI();
1053
1054 // desc
1055 $ti = new ilTextInputGUI($lng->txt("title"), "title");
1056 $ti->setMaxLength(128);
1057 $ti->setRequired(true);
1058 $this->form->addItem($ti);
1059
1060 // save and cancel commands
1061 if ($a_mode == "create")
1062 {
1063 $this->form->addCommandButton("saveFolder", $lng->txt("save"));
1064 $this->form->addCommandButton("cancelSave", $lng->txt("cancel"));
1065 $this->form->setTitle($lng->txt("mep_new_folder"));
1066 }
1067 else
1068 {
1069 $this->form->addCommandButton("updateFolder", $lng->txt("save"));
1070 $this->form->addCommandButton("cancelFolderUpdate", $lng->txt("cancel"));
1071 $this->form->setTitle($lng->txt("mep_edit_folder"));
1072 }
1073
1074 $this->form->setFormAction($ilCtrl->getFormAction($this));
1075 }
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 1209 of file class.ilObjMediaPoolGUI.php.

1210 {
1211 global $lng, $ilCtrl;
1212
1213 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
1214 $this->form = new ilPropertyFormGUI();
1215
1216 // title
1217 $ti = new ilTextInputGUI($lng->txt("title"), "title");
1218 $ti->setMaxLength(128);
1219 $ti->setRequired(true);
1220 $this->form->addItem($ti);
1221
1222 // save and cancel commands
1223 if ($a_mode == "create")
1224 {
1225 $this->form->addCommandButton("saveMediaPoolPage", $lng->txt("save"));
1226 $this->form->addCommandButton("cancelSave", $lng->txt("cancel"));
1227 $this->form->setTitle($lng->txt("mep_new_content_snippet"));
1228 }
1229 else
1230 {
1231 $this->form->addCommandButton("updateMediaPoolPage", $lng->txt("save"));
1232 $this->form->setTitle($lng->txt("mep_edit_content_snippet"));
1233 }
1234
1235 $this->form->setFormAction($ilCtrl->getFormAction($this));
1236 }

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

754 {
755 global $ilAccess;
756
757 $this->checkPermission("write");
758
759 include_once("./Services/Clipboard/classes/class.ilEditClipboardGUI.php");
761 $not_inserted = array();
762 if (is_array($ids))
763 {
764 foreach ($ids as $id2)
765 {
766 $id = explode(":", $id2);
767 $type = $id[0];
768 $id = $id[1];
769
770 if ($type == "mob") // media object
771 {
772 if (ilObjMEdiaPool::isForeignIdInTree($this->object->getId(), $id))
773 {
774 $not_inserted[] = ilObject::_lookupTitle($id)." [".
775 $id."]";
776 }
777 else
778 {
779 $item = new ilMediaPoolItem();
780 $item->setType("mob");
781 $item->setForeignId($id);
782 $item->setTitle(ilObject::_lookupTitle($id));
783 $item->create();
784 if ($item->getId() > 0)
785 {
786 $this->object->insertInTree($item->getId(), $_GET["mepitem_id"]);
787 }
788 }
789 }
790 if ($type == "incl") // content snippet
791 {
792 include_once("./Modules/MediaPool/classes/class.ilMediaPoolPage.php");
793 include_once("./Modules/MediaPool/classes/class.ilMediaPoolItem.php");
794 if (ilObjMEdiaPool::isItemIdInTree($this->object->getId(), $id))
795 {
796 $not_inserted[] = ilMediaPoolPage::lookupTitle($id)." [".
797 $id."]";
798 }
799 else
800 {
801 $original = new ilMediaPoolPage($id);
802
803 // copy the page into the pool
804 $item = new ilMediaPoolItem();
805 $item->setType("pg");
806 $item->setTitle(ilMediaPoolItem::lookupTitle($id));
807 $item->create();
808 if ($item->getId() > 0)
809 {
810 $this->object->insertInTree($item->getId(), $_GET["mepitem_id"]);
811
812 // create page
813 include_once("./Modules/MediaPool/classes/class.ilMediaPoolPage.php");
814 $page = new ilMediaPoolPage();
815 $page->setId($item->getId());
816 $page->create();
817
818 // copy content
819 $original->copy($page->getId(), $page->getParentType(), $page->getParentId(), true);
820
821 //$page->setXMLContent($original->copyXMLContent());
822 //$page->buildDom();
823 //$page->update();
824 }
825 }
826 }
827 }
828 }
829 if (count($not_inserted) > 0)
830 {
831 ilUtil::sendInfo($this->lng->txt("mep_not_insert_already_exist")."<br>".
832 implode($not_inserted,"<br>"), true);
833 }
834 $this->ctrl->redirect($this, $_GET["mep_mode"] ? $_GET["mep_mode"] : "listMedia");
835 }
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 393 of file class.ilObjMediaPoolGUI.php.

394 {
395 global $tree, $ilAccess, $tpl, $ilTabs, $ilCtrl, $ilToolbar, $lng, $ilErr;
396
397 $ilCtrl->setParameter($this, "mep_mode", "listMedia");
398
399 $this->checkPermission("read");
400
401 $ilTabs->setTabActive("objs_fold");
402
403 if ($ilAccess->checkAccess("write", "", $this->object->getRefId()))
404 {
405 $ilToolbar->addButton($lng->txt("mep_create_mob"),
406 $ilCtrl->getLinkTarget($this, "createMediaObject"));
407
408 $mset = new ilSetting("mobs");
409 if ($mset->get("mep_activate_pages"))
410 {
411 $ilToolbar->addButton($lng->txt("mep_create_content_snippet"),
412 $ilCtrl->getLinkTarget($this, "createMediaPoolPage"));
413 }
414
415 $ilToolbar->addButton($lng->txt("mep_create_folder"),
416 $ilCtrl->getLinkTarget($this, "createFolderForm"));
417
418 if (trim($mset->get("upload_dir")) != "" && ilMainMenuGUI::_checkAdministrationPermission())
419 {
420 $ilToolbar->addButton($lng->txt("mep_create_from_upload_dir"),
421 $ilCtrl->getLinkTargetByClass("ilfilesystemgui", "listFiles"));
422 }
423 }
424
425 // tree
426 include_once("./Modules/MediaPool/classes/class.ilMediaPoolExplorerGUI.php");
427 $exp = new ilMediaPoolExplorerGUI($this, "listMedia", $this->object);
428 if (!$exp->handleCommand())
429 {
430 $this->tpl->setLeftNavContent($exp->getHTML());
431 }
432 else
433 {
434 return;
435 }
436
437 include_once("./Modules/MediaPool/classes/class.ilMediaPoolTableGUI.php");
438 $mep_table_gui = new ilMediaPoolTableGUI($this, "listMedia", $this->object, "mepitem_id");
439 $tpl->setContent($mep_table_gui->getHTML());
440// $this->tpl->show();
441 }
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 737 of file class.ilObjMediaPoolGUI.php.

738 {
739 global $ilCtrl, $ilAccess;
740
741 $this->checkPermission("write");
742
743 $ilCtrl->setParameterByClass("ileditclipboardgui", "returnCommand",
744 rawurlencode($ilCtrl->getLinkTarget($this,
745 "insertFromClipboard", "", false, false)));
746 $ilCtrl->redirectByClass("ilEditClipboardGUI", "getObject");
747 }

References $ilCtrl, and ilObject2GUI\checkPermission().

+ Here is the call graph for this function:

◆ remove()

ilObjMediaPoolGUI::remove ( )

confirm deletion of

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

850 {
851 global $ilAccess;
852
853 $this->checkPermission("write");
854
855 foreach($_POST["id"] as $obj_id)
856 {
857 $this->object->deleteChild($obj_id);
858 }
859
860 ilUtil::sendSuccess($this->lng->txt("cont_obj_removed"),true);
861 $this->ctrl->redirect($this, $_GET["mep_mode"] ? $_GET["mep_mode"] : "listMedia");
862 }

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

503 {
504 include_once("./Modules/MediaPool/classes/class.ilMediaPoolTableGUI.php");
505 $mtab = new ilMediaPoolTableGUI($this, "allMedia", $this->object,
506 "mepitem_id", ilMediaPoolTableGUI::IL_MEP_EDIT, true);
507 $mtab->resetFilter();
508 $mtab->resetOffset();
509 $this->allMedia();
510 }

References allMedia(), and ilMediaPoolTableGUI\IL_MEP_EDIT.

+ Here is the call graph for this function:

◆ saveFolder()

ilObjMediaPoolGUI::saveFolder ( )

Save folder form.

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

998 {
999 global $tpl, $lng, $ilCtrl;
1000
1001 $this->checkPermission("write");
1002
1003 $this->initFolderForm("create");
1004 if ($this->form->checkInput())
1005 {
1006 if ($this->object->createFolder($_POST["title"], (int) $_GET["mepitem_id"]))
1007 {
1008 ilUtil::sendSuccess($lng->txt("mep_folder_created"), true);
1009 }
1010 $ilCtrl->redirect($this, "listMedia");
1011 }
1012
1013 $this->form->setValuesByPost();
1014 $tpl->setContent($this->form->getHtml());
1015 }

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

1141 {
1142 global $tpl, $lng, $ilCtrl;
1143
1144 $this->checkPermission("write");
1145
1146 $this->initMediaPoolPageForm("create");
1147 if ($this->form->checkInput())
1148 {
1149 // create media pool item
1150 include_once("./Modules/MediaPool/classes/class.ilMediaPoolItem.php");
1151 $item = new ilMediaPoolItem();
1152 $item->setTitle($_POST["title"]);
1153 $item->setType("pg");
1154 $item->create();
1155
1156 if ($item->getId() > 0)
1157 {
1158 // put in tree
1159 $tree = $this->object->getTree();
1160 $parent = $_GET["mepitem_id"] > 0
1161 ? $_GET["mepitem_id"]
1162 : $tree->getRootId();
1163 $this->object->insertInTree($item->getId(), $parent);
1164
1165 // create page
1166 include_once("./Modules/MediaPool/classes/class.ilMediaPoolPage.php");
1167 $page = new ilMediaPoolPage();
1168 $page->setId($item->getId());
1169 $page->create();
1170
1171 $ilCtrl->setParameterByClass("ilmediapoolpagegui", "mepitem_id", $item->getId());
1172 $ilCtrl->redirectByClass("ilmediapoolpagegui", "edit");
1173
1174 }
1175 $ilCtrl->redirect($this, "listMedia");
1176 }
1177
1178 $this->form->setValuesByPost();
1179 $tpl->setContent($this->form->getHtml());
1180 }

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

Select files from upload directory.

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

1513 {
1514 global $tpl, $ilTabs, $lng, $ilCtrl, $ilToolbar;
1515
1516 $ilTabs->clearTargets();
1517 $ilTabs->setBackTarget($lng->txt("back"),
1518 $ilCtrl->getLinkTarget($this, "listMedia"));
1519
1520 $this->checkPermission("write");
1521
1523 {
1524
1525 // action type
1526 include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
1527 $options = array(
1528 "rename" => $lng->txt("mep_up_dir_move"),
1529 "copy" => $lng->txt("mep_up_dir_copy"),
1530 );
1531 $si = new ilSelectInputGUI("", "action");
1532 $si->setOptions($options);
1533 $ilToolbar->addInputItem($si);
1534 $ilToolbar->setCloseFormTag(false);
1535 $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
1536 $ilToolbar->setFormName("mep_up_form");
1537
1538 include_once("./Modules/MediaPool/classes/class.ilUploadDirFilesTableGUI.php");
1539 $tab = new ilUploadDirFilesTableGUI($this, "selectUploadDirFiles",
1540 $_POST["file"]);
1541 $tab->setFormName("mep_up_form");
1542 $tpl->setContent($tab->getHTML());
1543 }
1544 }
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 1257 of file class.ilObjMediaPoolGUI.php.

1258 {
1259 global $ilTabs, $ilCtrl, $lng;
1260
1261 $ilTabs->clearTargets();
1262 //$ilTabs->addTab("mep_pg_prop", $lng->txt("mep_page_properties"),
1263 // $ilCtrl->getLinkTarget($this, "editMediaPoolPage"));
1264 $ilTabs->addTarget("mep_page_properties", $ilCtrl->getLinkTarget($this, "editMediaPoolPage"),
1265 "editMediaPoolPage", get_class($this));
1266 $ilTabs->addTarget("cont_usage", $ilCtrl->getLinkTarget($this, "showMediaPoolPageUsages"),
1267 array("showMediaPoolPageUsages", "showAllMediaPoolPageUsages"), get_class($this));
1268 $ilCtrl->setParameter($this, "mepitem_id", $this->object->tree->getParentId($_GET["mepitem_id"]));
1269 $ilTabs->setBackTarget($lng->txt("mep_folder"), $ilCtrl->getLinkTarget($this, "listMedia"));
1270 $ilCtrl->setParameter($this, "mepitem_id", $_GET["mepitem_id"]);
1271 }

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

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

+ Here is the caller graph for this function:

◆ setTabs()

ilObjMediaPoolGUI::setTabs ( )

Set tabs.

Reimplemented from ilObject2GUI.

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

1334 {
1335 global $ilAccess, $ilTabs, $ilCtrl, $ilHelp;
1336
1337 $ilHelp->setScreenIdComponent("mep");
1338
1339 if ($ilAccess->checkAccess('read', '', $this->ref_id) ||
1340 $ilAccess->checkAccess('write', '', $this->ref_id))
1341 {
1342 $ilTabs->addTarget("objs_fold", $this->ctrl->getLinkTarget($this, ""),
1343 "listMedia", "", "_top");
1344
1345 $ilCtrl->setParameter($this, "mepitem_id", "");
1346 $ilTabs->addTarget("mep_all_mobs", $this->ctrl->getLinkTarget($this, "allMedia"),
1347 "allMedia", "", "_top");
1348 $ilCtrl->setParameter($this, "mepitem_id", $_GET["mepitem_id"]);
1349 }
1350
1351 // info tab
1352 if ($ilAccess->checkAccess('visible', '', $this->ref_id) ||
1353 $ilAccess->checkAccess('read', '', $this->ref_id) ||
1354 $ilAccess->checkAccess('write', '', $this->ref_id))
1355 {
1356 $force_active = ($this->ctrl->getNextClass() == "ilinfoscreengui"
1357 || strtolower($_GET["cmdClass"]) == "ilnotegui")
1358 ? true
1359 : false;
1360 //echo "-$force_active-";
1361 $ilTabs->addTarget("info_short",
1362 $this->ctrl->getLinkTargetByClass(
1363 array("ilobjmediapoolgui", "ilinfoscreengui"), "showSummary"),
1364 array("showSummary", "infoScreen"),
1365 "", "", $force_active);
1366 }
1367
1368 if ($ilAccess->checkAccess("write", "", $this->object->getRefId()))
1369 {
1370 $ilTabs->addTarget("settings", $this->ctrl->getLinkTarget($this, "edit"),
1371 "edit", array("", "ilobjmediapoolgui"));
1372 }
1373
1374 if ($ilAccess->checkAccess("write", "", $this->object->getRefId()))
1375 {
1376 $ilTabs->addTarget("clipboard", $this->ctrl->getLinkTarget($this, "openClipboard"),
1377 "view", "ileditclipboardgui");
1378 }
1379
1380 if ($ilAccess->checkAccess("write", "", $this->object->getRefId()))
1381 {
1382 $ilTabs->addTarget("export", $this->ctrl->getLinkTargetByClass("ilexportgui", ""),
1383 "", "ilexportgui");
1384 }
1385
1386 if ($ilAccess->checkAccess("edit_permission", "", $this->object->getRefId()))
1387 {
1388 $ilTabs->addTarget("perm_settings",
1389 $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm"), array("perm","info","owner"), 'ilpermissiongui');
1390 }
1391
1392 }

References $_GET, and $ilCtrl.

◆ showAllMediaPoolPageUsages()

ilObjMediaPoolGUI::showAllMediaPoolPageUsages ( )

List usages of the contnet snippet.

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

1277 {
1278 $this->showMediaPoolPageUsages(true);
1279 }
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 671 of file class.ilObjMediaPoolGUI.php.

672 {
673 $this->showMedia();
674 }
showMedia()
show media object

References showMedia().

+ Here is the call graph for this function:

◆ showMedia()

ilObjMediaPoolGUI::showMedia ( )
protected

show media object

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

545 {
546 global $ilAccess;
547
548 $this->checkPermission("read");
549
550 $item = new ilMediaPoolItem((int) $_GET["mepitem_id"]);
551 $mob_id = $item->getForeignId();
552
553 $this->tpl = new ilTemplate("tpl.fullscreen.html", true, true, "Services/COPage");
554 include_once("Services/Style/classes/class.ilObjStyleSheet.php");
555 $this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
556 $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET",
558
559
560 require_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
561 require_once("./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
563 $media_obj = new ilObjMediaObject((int) $mob_id);
564
565
566 $this->tpl->setVariable("TITLE", " - ".$media_obj->getTitle());
567
568 $xml = "<dummy>";
569 // todo: we get always the first alias now (problem if mob is used multiple
570 // times in page)
571 $xml.= $media_obj->getXML(IL_MODE_ALIAS);
572 $xml.= $media_obj->getXML(IL_MODE_OUTPUT);
573 $xml.= $link_xml;
574 $xml.="</dummy>";
575
576 $xsl = file_get_contents("./Services/COPage/xsl/page.xsl");
577 $args = array( '/_xml' => $xml, '/_xsl' => $xsl );
578 $xh = xslt_create();
579
580 $wb_path = ilUtil::getWebspaceDir("output")."/";
581
582 $mode = ($_GET["cmd"] != "showPreview")
583 ? "fullscreen"
584 : "media";
585 $enlarge_path = ilUtil::getImagePath("enlarge.svg", false, "output");
586 $fullscreen_link =
587 $this->ctrl->getLinkTarget($this, "showFullscreen", "", false, false);
588 $params = array ('mode' => $mode, 'enlarge_path' => $enlarge_path,
589 'link_params' => "ref_id=".$_GET["ref_id"],'fullscreen_link' => $fullscreen_link,
590 'ref_id' => $_GET["ref_id"], 'pg_frame' => $pg_frame, 'webspace_path' => $wb_path);
591 $output = xslt_process($xh,"arg:/_xml","arg:/_xsl",NULL,$args, $params);
592 echo xslt_error($xh);
593 xslt_free($xh);
594 // unmask user html
595 $this->tpl->setVariable("MEDIA_CONTENT", $output);
596 }
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)
xslt_error(&$proc)
xslt_free(&$proc)
xslt_create()

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

1286 {
1287 global $ilTabs, $ilCtrl, $lng, $tpl;
1288
1289 $this->checkPermission("write");
1290
1291 $this->setMediaPoolPageTabs();
1292
1293 $ilTabs->addSubTab("current_usages", $lng->txt("cont_current_usages"),
1294 $ilCtrl->getLinkTarget($this, "showMediaPoolPageUsages"));
1295
1296 $ilTabs->addSubTab("all_usages", $lng->txt("cont_all_usages"),
1297 $ilCtrl->getLinkTarget($this, "showAllMediaPoolPageUsages"));
1298
1299 if ($a_all)
1300 {
1301 $ilTabs->activateSubTab("all_usages");
1302 $cmd = "showAllMediaPoolPageUsages";
1303 }
1304 else
1305 {
1306 $ilTabs->activateSubTab("current_usages");
1307 $cmd = "showMediaPoolPageUsages";
1308 }
1309
1310
1311 include_once("./Modules/MediaPool/classes/class.ilMediaPoolPageGUI.php");
1312 $mep_page_gui = new ilMediaPoolPageGUI($_GET["mepitem_id"], $_GET["old_nr"]);
1313 $mep_page_gui->getTabs();
1314
1315 include_once("./Modules/MediaPool/classes/class.ilMediaPoolPage.php");
1316 $page = new ilMediaPoolPage((int) $_GET["mepitem_id"]);
1317
1318 include_once("./Modules/MediaPool/classes/class.ilMediaPoolPageUsagesTableGUI.php");
1319 $table = new ilMediaPoolPageUsagesTableGUI($this, $cmd, $page, $a_all);
1320
1321 $tpl->setContent($table->getHTML());
1322
1323 }
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 604 of file class.ilObjMediaPoolGUI.php.

605 {
606 global $tpl;
607
608 $tpl = new ilTemplate("tpl.main.html", true, true);
609
610 include_once("./Services/Container/classes/class.ilContainerPage.php");
611 include_once("./Services/Container/classes/class.ilContainerPageGUI.php");
612
613 include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
614 $tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
615 $tpl->setVariable("LOCATION_CONTENT_STYLESHEET",
617 $tpl->setCurrentBlock("SyntaxStyle");
618 $tpl->setVariable("LOCATION_SYNTAX_STYLESHEET",
620 $tpl->parseCurrentBlock();
621
622 // get page object
623 //include_once("./Services/Object/classes/class.ilObjectTranslation.php");
624 //$ot = ilObjectTranslation::getInstance($this->object->getId());
625 //$lang = $ot->getEffectiveContentLang($ilUser->getCurrentLanguage(), "cont");
626 include_once("./Modules/MediaPool/classes/class.ilMediaPoolPageGUI.php");
627 $page_gui = new ilMediaPoolPageGUI((int) $_GET["mepitem_id"]);
628 include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
629 //$page_gui->setStyleId(ilObjStyleSheet::getEffectiveContentStyleId(
630 // $this->object->getStyleSheetId(), $this->object->getType()));
631
632 $page_gui->setTemplateOutput(false);
633 $page_gui->setHeader("");
634 $ret = $page_gui->showPage(true);
635
636 $tpl->setBodyClass("ilMediaPoolPagePreviewBody");
637 $tpl->setVariable("CONTENT", $ret);
638 //$ret = "<div style='background-color: white; padding:5px; margin-bottom: 30px;'>".$ret."</div>";
639
640 //$ret =& $page_gui->executeCommand();
641 $tpl->show();
642 exit;
643 }
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 649 of file class.ilObjMediaPoolGUI.php.

650 {
651 $this->checkPermission("read");
652
653 $item = new ilMediaPoolItem((int) $_GET["mepitem_id"]);
654
655 switch ($item->getType())
656 {
657 case "mob":
658 $this->showMedia();
659 break;
660
661 case "pg":
662 $this->showPage();
663 break;
664 }
665 }

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

385 {
386 $this->object->setDefaultWidth($a_form->getInput("default_width"));
387 $this->object->setDefaultHeight($a_form->getInput("default_height"));
388 }
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 1020 of file class.ilObjMediaPoolGUI.php.

1021 {
1022 global $lng, $ilCtrl, $tpl;
1023
1024 $this->checkPermission("write");
1025
1026 $this->initFolderForm("edit");
1027 if ($this->form->checkInput())
1028 {
1029 $item = new ilMediaPoolItem($_GET["mepitem_id"]);
1030 $item->setTitle($_POST["title"]);
1031 $item->update();
1032 ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
1033 $ilCtrl->setParameter($this, "mepitem_id",
1034 $this->object->getTree()->getParentId($_GET["mepitem_id"]));
1035 $ilCtrl->redirect($this, "listMedia");
1036 }
1037
1038 $this->form->setValuesByPost();
1039 $tpl->setContent($this->form->getHtml());
1040 }

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

1186 {
1187 global $lng, $ilCtrl, $tpl;
1188
1189 $this->checkPermission("write");
1190
1191 $this->initMediaPoolPageForm("edit");
1192 if ($this->form->checkInput())
1193 {
1194 $item = new ilMediaPoolItem($_GET["mepitem_id"]);
1195 $item->setTitle($_POST["title"]);
1196 $item->update();
1197 ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
1198 $ilCtrl->redirect($this, "editMediaPoolPage");
1199 }
1200
1201 $this->form->setValuesByPost();
1202 $tpl->setContent($this->form->getHtml());
1203 }

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: