ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 (ilObject $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...
 
 prepareOutput ($a_show_subobjects=true)
 prepare output More...
 
 isVisible ($a_ref_id, $a_type)
 
 trash ()
 
 undelete ()
 
 cancelDelete ()
 
 removeFromSystem ()
 
 cloneAll ()
 
 view ()
 view object content (repository/workspace switch) More...
 
 getType ()
 Functions that must be overwritten. More...
 
 create ()
 Deleted in ilObject. More...
 
 save ()
 
 edit ()
 
 update ()
 
 cancel ()
 
 importFile ()
 Import. More...
 
- Public Member Functions inherited from ilObjectGUI
 executeCommand ()
 execute command More...
 
 withReferences ()
 determines wether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode ($a_mode=true)
 if true, a creation screen is displayed the current $_GET[ref_id] don't belong to the current class! the mode is determined in ilrepositorygui More...
 
 getCreationMode ()
 get creation mode More...
 
 prepareOutput ($a_show_subobjects=true)
 prepare output More...
 
 getAdminTabs ()
 administration tabs show only permissions and trash folder More...
 
 getHTML ()
 
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled More...
 
 cancelDeleteObject ()
 cancel deletion of object More...
 
 cancelObject ()
 cancel action and go back to previous page @access public More...
 
 createObject ()
 create new object form More...
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 save object More...
 
 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...
 
 setTitleAndDescription ()
 called by prepare output More...
 
 showUpperIcon ()
 
 omitLocator ($a_omit=true)
 
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame ($a_cmd, $a_target_frame)
 set specific target frame for command More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 setColumnSettings (ilColumnGUI $column_gui)
 May be overwritten in subclasses. More...
 
 checkPermission ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission and redirect on error. More...
 
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu) More...
 
 redirectToRefId ($a_ref_id, $a_cmd="")
 redirects to (repository) view per ref id usually to a container and usually used at the end of a save/import method where the object gui type (of the new object) doesn't match with the type of the current $_GET["ref_id"] value More...
 
 fillCloneTemplate ($a_tpl_varname, $a_type)
 Fill object clone template This method can be called from any object GUI class that wants to offer object cloning. More...
 
 fillCloneSearchTemplate ($a_tpl_varname, $a_type)
 
 searchCloneSource ()
 
 buildCloneSelect ($existing_objs)
 
 addAdminLocatorItems ($a_do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 setTabs ()
 create tabs (repository/workspace switch) More...
 
 getReturnLocation ($a_cmd, $a_location="")
 Deprecated functions. More...
 
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command More...
 
 showActions ()
 
 getTabs ()
 get tabs abstract method. More...
 
 __showButton ($a_cmd, $a_text, $a_target='')
 
 hitsperpageObject ()
 
__initTableGUI ()
 
 __setTableGUIBasicData (&$tbl, &$result_set, $a_from="")
 standard implementation for tables use 'from' variable use different initial setting of table More...
 
 addLocatorItems ()
 Functions to be overwritten. More...
 
 initCreationForms ($a_new_type)
 Init creation froms. More...
 
 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 ()
 
 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...
 
 getTabs ()
 get tabs abstract method. More...
 
 __showButton ($a_cmd, $a_text, $a_target='')
 
 hitsperpageObject ()
 
__initTableGUI ()
 
 __setTableGUIBasicData (&$tbl, &$result_set, $a_from="")
 standard implementation for tables use 'from' variable use different initial setting of table More...
 
 redirectToRefId ($a_ref_id, $a_cmd="")
 redirects to (repository) view per ref id usually to a container and usually used at the end of a save/import method where the object gui type (of the new object) doesn't match with the type of the current $_GET["ref_id"] value More...
 
 fillCloneTemplate ($a_tpl_varname, $a_type)
 Fill object clone template This method can be called from any object GUI class that wants to offer object cloning. More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 setColumnSettings (ilColumnGUI $column_gui)
 May be overwritten in subclasses. More...
 
 checkPermission ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission and redirect on error. More...
 
 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission. More...
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 handleAutoRating (ilObject $a_new_obj)
 Activate rating automatically if parent container setting. More...
 

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
 
 $tabs_gui = null
 
 $ctrl
 

Detailed Description

Member Function Documentation

◆ _goto()

static ilObjMediaPoolGUI::_goto (   $a_target)
static

goto target media pool

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

1471 {
1472 global $ilAccess, $ilErr, $lng;
1473
1474 $targets = explode('_',$a_target);
1475 if(count((array) $targets) > 1)
1476 {
1477 $ref_id = $targets[0];
1478 $subitem_id = $targets[1];
1479 }
1480 else
1481 {
1482 $ref_id = $targets[0];
1483 }
1484
1485 if ($ilAccess->checkAccess("read", "", $ref_id))
1486 {
1487 $_GET["baseClass"] = "ilMediaPoolPresentationGUI";
1488 $_GET["ref_id"] = $ref_id;
1489 $_GET['mepitem_id'] = $subitem_id;
1490 include("ilias.php");
1491 exit;
1492 } else if ($ilAccess->checkAccess("visible", "", $ref_id))
1493 {
1494 $_GET["baseClass"] = "ilMediaPoolPresentationGUI";
1495 $_GET["ref_id"] = $ref_id;
1496 $_GET["cmd"] = "infoScreen";
1497 include("ilias.php");
1498 exit;
1499 }
1500 else if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID))
1501 {
1502 ilUtil::sendFailure(sprintf($lng->txt("msg_no_perm_read_item"),
1505 }
1506
1507 $ilErr->raiseError($lng->txt("msg_no_perm_read"), $ilErr->FATAL);
1508 }
sprintf('%.4f', $callTime)
$_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.
global $ilErr
Definition: raiseError.php:16

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

+ Here is the call graph for this function:

◆ addLocatorItems()

ilObjMediaPoolGUI::addLocatorItems ( )

add locator items for media pool

Reimplemented from ilObject2GUI.

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

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

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

+ Here is the call graph for this function:

◆ afterConstructor()

ilObjMediaPoolGUI::afterConstructor ( )
protected

Initialisation.

Reimplemented from ilObject2GUI.

Definition at line 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 ( ilObject  $newObj)

save object

Reimplemented from ilObjectGUI.

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

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

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

+ Here is the call graph for this function:

◆ allMedia()

ilObjMediaPoolGUI::allMedia ( )

list all objects

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

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

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

529 {
530 include_once("./Modules/MediaPool/classes/class.ilMediaPoolTableGUI.php");
531 $mtab = new ilMediaPoolTableGUI($this, "allMedia", $this->object,
532 "mepitem_id", ilMediaPoolTableGUI::IL_MEP_EDIT, true);
533 $mtab->writeFilterToSession();
534 $mtab->resetOffset();
535 $this->allMedia();
536 }
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 1121 of file class.ilObjMediaPoolGUI.php.

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

References $_GET, and $ilCtrl.

◆ cancelRemove()

ilObjMediaPoolGUI::cancelRemove ( )

cancel deletion of media objects/folders

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

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

References $_GET.

◆ cancelSave()

ilObjMediaPoolGUI::cancelSave ( )

Cancel save.

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

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

References $ilCtrl.

◆ confirmRemove()

ilObjMediaPoolGUI::confirmRemove ( )

confirm remove of mobs

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

719 {
720 global $ilAccess, $ilCtrl, $lng, $ilErr;
721
722
723 $this->checkPermission("write");
724
725 if(!isset($_POST["id"]))
726 {
727 $ilErr->raiseError($this->lng->txt("no_checkbox"), $ilErr->MESSAGE);
728 }
729
730 // display confirmation message
731 include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
732 $cgui = new ilConfirmationGUI();
733 $cgui->setFormAction($this->ctrl->getFormAction($this));
734 $cgui->setHeaderText($this->lng->txt("info_delete_sure"));
735 $cgui->setCancel($this->lng->txt("cancel"), "cancelRemove");
736 $cgui->setConfirm($this->lng->txt("confirm"), "remove");
737
738 foreach($_POST["id"] as $obj_id)
739 {
742
743 // check whether page can be removed
744 $add = "";
745 if ($type == "pg")
746 {
747 include_once("./Services/COPage/classes/class.ilPageContentUsage.php");
748 $usages = ilPageContentUsage::getUsages("incl", $obj_id, false);
749 if (count($usages) > 0)
750 {
751 ilUtil::sendFailure(sprintf($lng->txt("mep_content_snippet_in_use"), $title), true);
752 $ilCtrl->redirect($this, "listMedia");
753 }
754 else
755 {
756 // check whether the snippet is used in older versions of pages
757 $usages = ilPageContentUsage::getUsages("incl", $obj_id, true);
758 if (count($usages) > 0)
759 {
760 $add = "<div class='small'>".$lng->txt("mep_content_snippet_used_in_older_versions")."</div>";
761 }
762 }
763 }
764
765 $caption = ilUtil::getImageTagByType($type, $this->tpl->tplPath).
766 " ".$title.$add;
767
768 $cgui->addItem("id[]", $obj_id, $caption);
769 }
770
771 $this->tpl->setContent($cgui->getHTML());
772 }
Confirmation screen class.
static lookupType($a_id)
Lookup type.
static getUsages($a_pc_type, $a_pc_id, $a_incl_hist=true)
Get usages.
static getImageTagByType($a_type, $a_path, $a_big=false)
Builds an html image tag TODO: function still in use, but in future use getImagePath and move HTML-Co...

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

+ Here is the call graph for this function:

◆ copyToClipboard()

ilObjMediaPoolGUI::copyToClipboard ( )

copy media objects to clipboard

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

910 {
911 global $ilUser, $ilAccess;
912
913 $this->checkPermission("write");
914
915 if(!isset($_POST["id"]))
916 {
917 ilUtil::sendFailure($this->lng->txt("no_checkbox"), true);
918 $this->ctrl->redirect($this, $_GET["mep_mode"] ? $_GET["mep_mode"] : "listMedia");
919 }
920
921 foreach ($_POST["id"] as $obj_id)
922 {
924 if ($type == "fold")
925 {
926 ilUtil::sendFailure($this->lng->txt("cont_cant_copy_folders"), true);
927 $this->ctrl->redirect($this, $_GET["mep_mode"] ? $_GET["mep_mode"] : "listMedia");
928 }
929 }
930 foreach ($_POST["id"] as $obj_id)
931 {
934 if ($type == "mob")
935 {
936 $ilUser->addObjectToClipboard($fid, "mob", "");
937 }
938 if ($type == "pg")
939 {
940 $ilUser->addObjectToClipboard($obj_id, "incl", "");
941 }
942 }
943 ilUtil::sendSuccess($this->lng->txt("copied_to_clipboard"),true);
944 $this->ctrl->redirect($this, $_GET["mep_mode"] ? $_GET["mep_mode"] : "listMedia");
945 }
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 989 of file class.ilObjMediaPoolGUI.php.

990 {
991 global $ilAccess, $tpl;
992
993 $this->checkPermission("write");
994
995 $this->initFolderForm("create");
996 $tpl->setContent($this->form->getHTML());
997
998/* $folder_gui = new ilObjFolderGUI("", 0, false, false);
999 $this->ctrl->setParameterByClass("ilobjfoldergui", "obj_id", $_GET["obj_id"]);
1000 $folder_gui->setFormAction("save",
1001 $this->ctrl->getFormActionByClass("ilobjfoldergui"));
1002 $folder_gui->createObject();*/
1003// $this->tpl->show();
1004 }
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 1626 of file class.ilObjMediaPoolGUI.php.

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

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

354 {
355 $this->ctrl->redirectByClass("ilobjmediaobjectgui", "create");
356 }

◆ createMediaPoolPage()

ilObjMediaPoolGUI::createMediaPoolPage ( )

Create new content snippet.

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

1146 {
1147 global $tpl;
1148
1149 $this->checkPermission("write");
1150
1151 $this->initMediaPoolPageForm("create");
1152 $tpl->setContent($this->form->getHTML());
1153 }
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 404 of file class.ilObjMediaPoolGUI.php.

405 {
406 $this->setSettingsSubTabs("settings");
407 parent::edit();
408 }
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 1012 of file class.ilObjMediaPoolGUI.php.

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

1162 {
1163 global $tpl;
1164
1165 $this->checkPermission("write");
1166
1167 $this->setMediaPoolPageTabs();
1168
1169 include_once("./Modules/MediaPool/classes/class.ilMediaPoolPageGUI.php");
1170 $mep_page_gui = new ilMediaPoolPageGUI($_GET["mepitem_id"], $_GET["old_nr"]);
1171 $mep_page_gui->getTabs();
1172
1173 $this->initMediaPoolPageForm("edit");
1174 $this->getMediaPoolPageValues();
1175 $tpl->setContent($this->form->getHTML());
1176 }
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 = $this->ctrl->forwardCommand($ilObjMediaObjectGUI);
163
164 if ($cmd == "save" && $ret != false)
165 {
166 $mep_item = new ilMediaPoolItem();
167 $mep_item->setTitle($ret->getTitle());
168 $mep_item->setType("mob");
169 $mep_item->setForeignId($ret->getId());
170 $mep_item->create();
171
172 $parent = ($_GET["mepitem_id"] == "")
173 ? $tree->getRootId()
174 : $_GET["mepitem_id"];
175 $tree->insertNode($mep_item->getId(), $parent);
176 ilUtil::redirect("ilias.php?baseClass=ilMediaPoolPresentationGUI&cmd=listMedia&ref_id=".
177 $_GET["ref_id"]."&mepitem_id=".$_GET["mepitem_id"]);
178 }
179 else
180 {
181 $this->tpl->show();
182 }
183 break;
184
185 case "ilobjfoldergui":
186 $this->checkPermission("write");
187 $this->addHeaderAction();
188 $folder_gui = new ilObjFolderGUI("", 0, false, false);
189 $this->ctrl->setReturn($this, "listMedia");
190 $cmd.="Object";
191 switch($cmd)
192 {
193 case "createObject":
194 $this->prepareOutput();
195 $folder_gui = new ilObjFolderGUI("", 0, false, false);
196 $folder_gui->setFormAction("save",
197 $this->ctrl->getFormActionByClass("ilobjfoldergui"));
198 $folder_gui->createObject();
199 $this->tpl->show();
200 break;
201
202 case "saveObject":
203 //$folder_gui->setReturnLocation("save", $this->ctrl->getLinkTarget($this, "listMedia"));
204 $parent = ($_GET["mepitem_id"] == "")
205 ? $tree->getRootId()
206 : $_GET["mepitem_id"];
207 $folder_gui->setFolderTree($tree);
208 $folder_gui->saveObject($parent);
209 //$this->ctrl->redirect($this, "listMedia");
210 break;
211
212 case "editObject":
213 $this->prepareOutput();
214 $folder_gui = new ilObjFolderGUI("", ilMediaPoolItem::lookupForeignId($_GET["mepitem_id"]), false, false);
215 $this->ctrl->setParameter($this, "foldereditmode", "1");
216 $folder_gui->setFormAction("update", $this->ctrl->getFormActionByClass("ilobjfoldergui"));
217 $folder_gui->editObject();
218 $this->tpl->show();
219 break;
220
221 case "updateObject":
222 $folder_gui = new ilObjFolderGUI("", ilMediaPoolItem::lookupForeignId($_GET["mepitem_id"]), false, false);
223 $this->ctrl->setParameter($this, "mepitem_id", $this->getParentFolderId());
224 $this->ctrl->setReturn($this, "listMedia");
225 $folder_gui->updateObject(true); // this returns to parent
226 break;
227
228 case "cancelObject":
229 if ($_GET["foldereditmode"])
230 {
231 $this->ctrl->setParameter($this, "mepitem_id", $this->getParentFolderId());
232 }
233 $this->ctrl->redirect($this, "listMedia");
234 break;
235 }
236 break;
237
238 case "ileditclipboardgui":
239 $this->prepareOutput();
240 $this->addHeaderAction();
241 $this->ctrl->setReturn($this, $_GET["mep_mode"] ? $_GET["mep_mode"] : "listMedia");
242 $clip_gui = new ilEditClipboardGUI();
243 $clip_gui->setMultipleSelections(true);
244 $clip_gui->setInsertButtonTitle($lng->txt("mep_copy_to_mep"));
245 $ilTabs->setTabActive("clipboard");
246 $this->ctrl->forwardCommand($clip_gui);
247 $this->tpl->show();
248 break;
249
250 case 'ilinfoscreengui':
251 $this->prepareOutput();
252 $this->addHeaderAction();
253 $this->infoScreen();
254 $this->tpl->show();
255 break;
256
257 case 'ilpermissiongui':
258 $this->checkPermission("edit_permission");
259 $this->prepareOutput();
260 $this->addHeaderAction();
261 include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
262 $perm_gui = new ilPermissionGUI($this);
263 $this->ctrl->forwardCommand($perm_gui);
264 $this->tpl->show();
265 break;
266
267 case "ilexportgui":
268 $this->checkPermission("write");
269 $this->prepareOutput();
270 $this->addHeaderAction();
271 include_once("./Services/Export/classes/class.ilExportGUI.php");
272 $exp_gui = new ilExportGUI($this);
273 $exp_gui->addFormat("xml");
274 include_once("./Services/Object/classes/class.ilObjectTranslation.php");
275 $ot = ilObjectTranslation::getInstance($this->object->getId());
276 if ($ot->getContentActivated())
277 {
278 $exp_gui->addFormat("xml_master", "XML (".$lng->txt("mep_master_language_only").")", $this, "export");
279 }
280 $this->ctrl->forwardCommand($exp_gui);
281 $this->tpl->show();
282 break;
283
284 case "ilfilesystemgui":
285 $this->checkPermission("write");
286 $this->prepareOutput();
287 $this->addHeaderAction();
288 $ilTabs->clearTargets();
289 $ilTabs->setBackTarget($lng->txt("back"),
290 $ilCtrl->getLinkTarget($this, "listMedia"));
291 $mset = new ilSetting("mobs");
292 if (trim($mset->get("upload_dir")) != "")
293 {
294 include_once("./Services/FileSystem/classes/class.ilFileSystemGUI.php");
295 $fs_gui = new ilFileSystemGUI($mset->get("upload_dir"));
296 $fs_gui->setPostDirPath(true);
297 $fs_gui->setTableId("mepud".$this->object->getId());
298 $fs_gui->setAllowFileCreation(false);
299 $fs_gui->setAllowDirectoryCreation(false);
300 $fs_gui->clearCommands();
301 $fs_gui->addCommand($this, "selectUploadDirFiles", $this->lng->txt("mep_sel_upload_dir_files"),
302 false, true);
303 $this->ctrl->forwardCommand($fs_gui);
304 }
305 $this->tpl->show();
306 break;
307
308 case "ilcommonactiondispatchergui":
309 include_once("Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
311 $this->ctrl->forwardCommand($gui);
312 break;
313
314 case 'ilobjecttranslationgui':
315 $this->prepareOutput();
316 $this->addHeaderAction();
317 //$this->setTabs("settings");
318 $ilTabs->activateTab("settings");
319 $this->setSettingsSubTabs("obj_multilinguality");
320 include_once("./Services/Object/classes/class.ilObjectTranslationGUI.php");
321 $transgui = new ilObjectTranslationGUI($this);
322 $transgui->setTitleDescrOnlyMode(false);
323 $this->ctrl->forwardCommand($transgui);
324 $this->tpl->show();
325 break;
326
327 case "ilmediapoolimportgui":
328 $this->prepareOutput();
329 $this->addHeaderAction();
330 $ilTabs->activateTab("import");
331 include_once("./Modules/MediaPool/classes/class.ilMediaPoolImportGUI.php");
332 $gui = new ilMediaPoolImportGUI($this->object);
333 $this->ctrl->forwardCommand($gui);
334 $this->tpl->show();
335 break;
336
337 default:
338 $this->prepareOutput();
339 $this->addHeaderAction();
340 $cmd = $this->ctrl->getCmd("listMedia");
341 $this->$cmd();
342 if (!$this->getCreationMode())
343 {
344 $this->tpl->show();
345 }
346 break;
347 }
348 }
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($a_show_subobjects=true)
prepare output
setCreationMode($a_mode=true)
if true, a creation screen is displayed the current $_GET[ref_id] don't belong to the current class!...
setLocator()
set Locator
addHeaderAction()
Add header action menu.
GUI class for object translation handling.
static getInstance($a_obj_id)
Get instance.
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
$ret
Definition: parser.php:6
$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 1736 of file class.ilObjMediaPoolGUI.php.

1737 {
1738 $ot = ilObjectTranslation::getInstance($this->object->getId());
1739 $opt = "";
1740 if ($ot->getContentActivated())
1741 {
1742 $format = explode("_", $_POST["format"]);
1743 $opt = ilUtil::stripSlashes($format[1]);
1744 }
1745
1746 $this->object->exportXML(($opt == "master"));
1747 }
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 411 of file class.ilObjMediaPoolGUI.php.

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

◆ getFolderValues()

ilObjMediaPoolGUI::getFolderValues ( )

Get current values for folder from.

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

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

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

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

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

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

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

1709 {
1710 global $tpl, $ilCtrl, $lng;
1711
1712 require_once("./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
1714
1715 $tpl->addJavaScript("./Modules/MediaPool/js/ilMediaPool.js");
1716
1717 $ilCtrl->setParameterByClass("ilobjmediapoolgui", "mepitem_id", "");
1718 $ilCtrl->setParameterByClass("ilobjmediapoolgui", "ref_id", $a_mpool_ref_id);
1719 $tpl->addOnloadCode("il.MediaPool.setPreviewUrl('".$ilCtrl->getLinkTargetByClass(array("ilmediapoolpresentationgui", "ilobjmediapoolgui"), "showPreview", "", false, false)."');");
1720 $ilCtrl->setParameterByClass("ilobjmediapoolgui", "mepitem_id", $_GET["mepitem_id"]);
1721 $ilCtrl->setParameterByClass("ilobjmediapoolgui", "ref_id", $_GET["red_id"]);
1722
1723 include_once("./Services/UIComponent/Modal/classes/class.ilModalGUI.php");
1724 $modal = ilModalGUI::getInstance();
1725 $modal->setHeading($lng->txt("preview"));
1726 $modal->setId("ilMepPreview");
1727 $modal->setType(ilModalGUI::TYPE_LARGE);
1728 $modal->setBody("<iframe id='ilMepPreviewContent'></iframe>");
1729
1730 return $modal->getHTML();
1731 }
static getInstance()
Get instance.
static 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 554 of file class.ilObjMediaPoolGUI.php.

555 {
556 $this->tpl->getStandardTemplate();
557 }

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

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

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

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

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

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

379 {
380 // default width
381 $ni = new ilNumberInputGUI($this->lng->txt("mep_default_width"), "default_width");
382 $ni->setMinValue(0);
383 $ni->setSuffix("px");
384 $ni->setMaxLength(5);
385 $ni->setSize(5);
386 $a_form->addItem($ni);
387
388 // default height
389 $ni = new ilNumberInputGUI($this->lng->txt("mep_default_height"), "default_height");
390 $ni->setSuffix("px");
391 $ni->setMinValue(0);
392 $ni->setMaxLength(5);
393 $ni->setSize(5);
394 $ni->setInfo($this->lng->txt("mep_default_width_height_info"));
395 $a_form->addItem($ni);
396 }
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 1088 of file class.ilObjMediaPoolGUI.php.

1089 {
1090 global $lng, $ilCtrl;
1091
1092 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
1093 $this->form = new ilPropertyFormGUI();
1094
1095 // desc
1096 $ti = new ilTextInputGUI($lng->txt("title"), "title");
1097 $ti->setMaxLength(128);
1098 $ti->setRequired(true);
1099 $this->form->addItem($ti);
1100
1101 // save and cancel commands
1102 if ($a_mode == "create")
1103 {
1104 $this->form->addCommandButton("saveFolder", $lng->txt("save"));
1105 $this->form->addCommandButton("cancelSave", $lng->txt("cancel"));
1106 $this->form->setTitle($lng->txt("mep_new_folder"));
1107 }
1108 else
1109 {
1110 $this->form->addCommandButton("updateFolder", $lng->txt("save"));
1111 $this->form->addCommandButton("cancelFolderUpdate", $lng->txt("cancel"));
1112 $this->form->setTitle($lng->txt("mep_edit_folder"));
1113 }
1114
1115 $this->form->setFormAction($ilCtrl->getFormAction($this));
1116 }
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 1251 of file class.ilObjMediaPoolGUI.php.

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

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

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

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

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

References $ilCtrl, and ilObject2GUI\checkPermission().

+ Here is the call graph for this function:

◆ remove()

ilObjMediaPoolGUI::remove ( )

confirm deletion of

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

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

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

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

References allMedia(), and ilMediaPoolTableGUI\IL_MEP_EDIT.

+ Here is the call graph for this function:

◆ saveFolder()

ilObjMediaPoolGUI::saveFolder ( )

Save folder form.

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

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

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

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

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

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

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

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

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

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

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

References $_GET, and $ilCtrl.

◆ showAllMediaPoolPageUsages()

ilObjMediaPoolGUI::showAllMediaPoolPageUsages ( )

List usages of the contnet snippet.

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

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

711 {
712 $this->showMedia();
713 }
showMedia()
show media object

References showMedia().

+ Here is the call graph for this function:

◆ showMedia()

ilObjMediaPoolGUI::showMedia ( )
protected

show media object

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

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

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

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

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

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

Referenced by showPreview().

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

◆ showPreview()

ilObjMediaPoolGUI::showPreview ( )

Show content snippet.

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

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

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

424 {
425 $this->object->setDefaultWidth($a_form->getInput("default_width"));
426 $this->object->setDefaultHeight($a_form->getInput("default_height"));
427 }
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 1061 of file class.ilObjMediaPoolGUI.php.

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

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

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

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: