ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
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...
 
 showMedia ()
 show media object 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...
 
 _goto ($a_target)
 goto target media pool 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)
 
 getCreationMode ()
 
 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 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 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...
 

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)
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 
 getEditFormCustomValues (array &$a_values)
 
 updateCustom (ilPropertyFormGUI $a_form)
 
- 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 ()
 
 setTitleAndDescription ()
 
 showUpperIcon ()
 
 omitLocator ($a_omit=true)
 
 getTargetFrame ($a_cmd, $a_target_frame="")
 
 setTargetFrame ($a_cmd, $a_target_frame)
 
 getCenterColumnHTML ()
 
 getRightColumnHTML ()
 
 setColumnSettings ($column_gui)
 
 checkPermission ($a_perm, $a_cmd="")
 
 showPossibleSubObjects ()
 
 redirectToRefId ()
 
 fillCloneTemplate ($a_tpl_varname, $a_type)
 
 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)
 
- 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 public More...
 
 setAdminTabs ()
 set admin tabs 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...
 
 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

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

ilObjMediaPoolGUI::_goto (   $a_target)

goto target media pool

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

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

1328  {
1329  global $ilAccess, $ilErr, $lng;
1330 
1331  $targets = explode('_',$a_target);
1332  if(count((array) $targets) > 1)
1333  {
1334  $ref_id = $targets[0];
1335  $subitem_id = $targets[1];
1336  }
1337  else
1338  {
1339  $ref_id = $targets[0];
1340  }
1341 
1342  if ($ilAccess->checkAccess("read", "", $ref_id))
1343  {
1344  $_GET["baseClass"] = "ilMediaPoolPresentationGUI";
1345  $_GET["ref_id"] = $ref_id;
1346  $_GET['mepitem_id'] = $subitem_id;
1347  include("ilias.php");
1348  exit;
1349  }
1350  else if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID))
1351  {
1352  ilUtil::sendFailure(sprintf($lng->txt("msg_no_perm_read_item"),
1353  ilObject::_lookupTitle(ilObject::_lookupObjId($a_target))), true);
1355  }
1356 
1357  $ilErr->raiseError($lng->txt("msg_no_perm_read"), $ilErr->FATAL);
1358  }
exit
Definition: login.php:54
$_GET["client_id"]
static _gotoRepositoryRoot($a_raise_error=false)
Goto repository root.
static _lookupTitle($a_id)
lookup object title
static _lookupObjId($a_id)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:

◆ addLocatorItems()

ilObjMediaPoolGUI::addLocatorItems ( )

add locator items for media pool

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

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

856  {
857  global $ilLocator;
858 
859  if (!$this->getCreationMode() && $this->ctrl->getCmd() != "explorer")
860  {
861  $tree =& $this->object->getTree();
862  $obj_id = ($_GET["mepitem_id"] == "")
863  ? $tree->getRootId()
864  : $_GET["mepitem_id"];
865  $path = $tree->getPathFull($obj_id);
866  foreach($path as $node)
867  {
868  if ($node["child"] == $tree->getRootId())
869  {
870  $this->ctrl->setParameter($this, "mepitem_id", "");
871  $link = $this->ctrl->getLinkTarget($this, "listMedia");
872  $title = $this->object->getTitle();
873  $this->ctrl->setParameter($this, "mepitem_id", $_GET["mepitem_id"]);
874  $ilLocator->addItem($title, $link, "", $_GET["ref_id"]);
875  }
876  else
877  {
878  $this->ctrl->setParameter($this, "mepitem_id", $node["child"]);
879  $link = $this->ctrl->getLinkTarget($this, "listMedia");
880  $title = $node["title"];
881  $this->ctrl->setParameter($this, "mepitem_id", $_GET["mepitem_id"]);
882  $ilLocator->addItem($title, $link);
883  }
884  }
885  }
886  }
$_GET["client_id"]
$path
Definition: index.php:22
+ Here is the call graph for this function:

◆ afterConstructor()

ilObjMediaPoolGUI::afterConstructor ( )
protected

Initialisation.

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

References ilObjectGUI\$lng.

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  }

◆ afterSave()

ilObjMediaPoolGUI::afterSave (   $newObj)

save object

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

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

340  {
341  // always send a message
342  ilUtil::sendSuccess($this->lng->txt("object_added"),true);
343 
344  //ilUtil::redirect($this->getReturnLocation("save","adm_object.php?".$this->link_params));
345  ilUtil::redirect("ilias.php?baseClass=ilMediaPoolPresentationGUI&ref_id=".$newObj->getRefId()."&cmd=edit");
346  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static redirect($a_script)
http redirect to other script
+ Here is the call graph for this function:

◆ allMedia()

ilObjMediaPoolGUI::allMedia ( )

list all objects

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

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

Referenced by applyFilter(), and resetFilter().

444  {
445  global $tree, $ilAccess, $tpl, $ilTabs, $ilCtrl,$ilUser;
446 
447  $ilCtrl->setParameter($this, "mep_mode", "allMedia");
448 
449  if (!$ilAccess->checkAccess("read", "", $this->object->getRefId()))
450  {
451  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
452  }
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  }
$_POST['username']
Definition: cron.php:12
$_GET["client_id"]
Saves (mostly asynchronously) user properties of tables (e.g.
global $ilCtrl
Definition: ilias.php:18
redirection script todo: (a better solution should control the processing via a xml file) ...
static lookupTitle($a_id)
Lookup title.
global $ilUser
Definition: imgupload.php:15
TableGUI class for recent changes in wiki.
+ 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.

References allMedia(), and ilMediaPoolTableGUI\IL_MEP_EDIT.

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
TableGUI class for recent changes in wiki.
+ Here is the call graph for this function:

◆ cancelFolderUpdate()

ilObjMediaPoolGUI::cancelFolderUpdate ( )

Cancel save.

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

References $_GET, and $ilCtrl.

1025  {
1026  global $ilCtrl;
1027  $ilCtrl->setParameter($this, "mepitem_id",
1028  $this->object->getTree()->getParentId($_GET["mepitem_id"]));
1029  $ilCtrl->redirect($this, "listMedia");
1030  }
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18

◆ cancelRemove()

ilObjMediaPoolGUI::cancelRemove ( )

cancel deletion of media objects/folders

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

References $_GET.

785  {
786  $this->ctrl->redirect($this, $_GET["mep_mode"] ? $_GET["mep_mode"] : "listMedia");
787  }
$_GET["client_id"]

◆ cancelSave()

ilObjMediaPoolGUI::cancelSave ( )

Cancel save.

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

References $ilCtrl.

1036  {
1037  global $ilCtrl;
1038  $ilCtrl->redirect($this, "listMedia");
1039  }
global $ilCtrl
Definition: ilias.php:18

◆ confirmRemove()

ilObjMediaPoolGUI::confirmRemove ( )

confirm remove of mobs

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

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

614  {
615  global $ilAccess, $ilCtrl, $lng;
616 
617  if (!$ilAccess->checkAccess("write", "", $this->object->getRefId()))
618  {
619  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
620  }
621 
622  if(!isset($_POST["id"]))
623  {
624  $this->ilias->raiseError($this->lng->txt("no_checkbox"),$this->ilias->error_obj->MESSAGE);
625  }
626 
627  // display confirmation message
628  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
629  $cgui = new ilConfirmationGUI();
630  $cgui->setFormAction($this->ctrl->getFormAction($this));
631  $cgui->setHeaderText($this->lng->txt("info_delete_sure"));
632  $cgui->setCancel($this->lng->txt("cancel"), "cancelRemove");
633  $cgui->setConfirm($this->lng->txt("confirm"), "remove");
634 
635  foreach($_POST["id"] as $obj_id)
636  {
637  $type = ilMediaPoolItem::lookupType($obj_id);
638  $title = ilMediaPoolItem::lookupTitle($obj_id);
639 
640  // check whether page can be removed
641  $add = "";
642  if ($type == "pg")
643  {
644  include_once("./Services/COPage/classes/class.ilPageContentUsage.php");
645  $usages = ilPageContentUsage::getUsages("incl", $obj_id, false);
646  if (count($usages) > 0)
647  {
648  ilUtil::sendFailure(sprintf($lng->txt("mep_content_snippet_in_use"), $title), true);
649  $ilCtrl->redirect($this, "listMedia");
650  }
651  else
652  {
653  // check whether the snippet is used in older versions of pages
654  $usages = ilPageContentUsage::getUsages("incl", $obj_id, true);
655  if (count($usages) > 0)
656  {
657  $add = "<div class='small'>".$lng->txt("mep_content_snippet_used_in_older_versions")."</div>";
658  }
659  }
660  }
661 
662  $caption = ilUtil::getImageTagByType($type, $this->tpl->tplPath).
663  " ".$title.$add;
664 
665  $cgui->addItem("id[]", $obj_id, $caption);
666  }
667 
668  $this->tpl->setContent($cgui->getHTML());
669  }
static lookupType($a_id)
Lookup type.
$_POST['username']
Definition: cron.php:12
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...
global $ilCtrl
Definition: ilias.php:18
redirection script todo: (a better solution should control the processing via a xml file) ...
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static lookupTitle($a_id)
Lookup title.
getUsages($a_pc_type, $a_pc_id, $a_incl_hist=true)
Get usages.
Confirmation screen class.
+ Here is the call graph for this function:

◆ copyToClipboard()

ilObjMediaPoolGUI::copyToClipboard ( )

copy media objects to clipboard

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

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

815  {
816  global $ilUser, $ilAccess;
817 
818  $this->checkPermission("write");
819 
820  if(!isset($_POST["id"]))
821  {
822  ilUtil::sendFailure($this->lng->txt("no_checkbox"), true);
823  $this->ctrl->redirect($this, $_GET["mep_mode"] ? $_GET["mep_mode"] : "listMedia");
824  }
825 
826  foreach ($_POST["id"] as $obj_id)
827  {
828  $type = ilMediaPoolItem::lookupType($obj_id);
829  if ($type == "fold")
830  {
831  ilUtil::sendFailure($this->lng->txt("cont_cant_copy_folders"), true);
832  $this->ctrl->redirect($this, $_GET["mep_mode"] ? $_GET["mep_mode"] : "listMedia");
833  }
834  }
835  foreach ($_POST["id"] as $obj_id)
836  {
837  $fid = ilMediaPoolItem::lookupForeignId($obj_id);
838  $type = ilMediaPoolItem::lookupType($obj_id);
839  if ($type == "mob")
840  {
841  $ilUser->addObjectToClipboard($fid, "mob", "");
842  }
843  if ($type == "pg")
844  {
845  $ilUser->addObjectToClipboard($obj_id, "incl", "");
846  }
847  }
848  ilUtil::sendSuccess($this->lng->txt("copied_to_clipboard"),true);
849  $this->ctrl->redirect($this, $_GET["mep_mode"] ? $_GET["mep_mode"] : "listMedia");
850  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static lookupType($a_id)
Lookup type.
$_POST['username']
Definition: cron.php:12
$_GET["client_id"]
static lookupForeignId($a_id)
Lookup Foreign Id.
checkPermission($a_perm, $a_cmd="")
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
global $ilUser
Definition: imgupload.php:15
+ Here is the call graph for this function:

◆ createFolderForm()

ilObjMediaPoolGUI::createFolderForm ( )

create folder form

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

References ilObjectGUI\$tpl, and initFolderForm().

896  {
897  global $ilAccess, $tpl;
898 
899  if (!$ilAccess->checkAccess("write", "", $this->object->getRefId()))
900  {
901  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
902  }
903 
904  $this->initFolderForm("create");
905  $tpl->setContent($this->form->getHTML());
906 
907 /* $folder_gui =& new ilObjFolderGUI("", 0, false, false);
908  $this->ctrl->setParameterByClass("ilobjfoldergui", "obj_id", $_GET["obj_id"]);
909  $folder_gui->setFormAction("save",
910  $this->ctrl->getFormActionByClass("ilobjfoldergui"));
911  $folder_gui->createObject();*/
912 // $this->tpl->show();
913  }
initFolderForm($a_mode="edit")
Init folder form.
redirection script todo: (a better solution should control the processing via a xml file) ...
+ Here is the call graph for this function:

◆ createMediaFromUploadDir()

ilObjMediaPoolGUI::createMediaFromUploadDir ( )

Create media object from upload directory.

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

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

1468  {
1469  $mset = new ilSetting("mobs");
1470  $upload_dir = trim($mset->get("upload_dir"));
1471 
1472  include_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
1473 
1474  if (is_array($_POST["file"]) && ilMainMenuGUI::_checkAdministrationPermission())
1475  {
1476  foreach ($_POST["file"] as $f)
1477  {
1478  $f = str_replace("..", "", $f);
1479  $fullpath = $upload_dir."/".$f;
1480  $mob = new ilObjMediaObject();
1481  $mob->setTitle(basename($fullpath));
1482  $mob->setDescription("");
1483  $mob->create();
1484 
1485  // determine and create mob directory, move uploaded file to directory
1486  //$mob_dir = ilUtil::getWebspaceDir()."/mobs/mm_".$a_mob->getId();
1487  $mob->createDirectory();
1488  $mob_dir = ilObjMediaObject::_getDirectory($mob->getId());
1489 
1490  $media_item = new ilMediaItem();
1491  $mob->addMediaItem($media_item);
1492  $media_item->setPurpose("Standard");
1493 
1494  $file = $mob_dir."/".basename($fullpath);
1495  ilUtil::moveUploadedFile($fullpath,
1496  basename($fullpath), $file, false, $_POST["action"]);
1497 
1498  // get mime type
1500  $location = basename($fullpath);
1501 
1502  // set real meta and object data
1503  $media_item->setFormat($format);
1504  $media_item->setLocation($location);
1505  $media_item->setLocationType("LocalFile");
1506 
1507  $mob->setDescription($format);
1508 
1509  // determine width and height of known image types
1510  $wh = ilObjMediaObject::_determineWidthHeight(500, 400, $format,
1511  "File", $mob_dir."/".$location, $media_item->getLocation(),
1512  true, true, "", "");
1513  $media_item->setWidth($wh["width"]);
1514  $media_item->setHeight($wh["height"]);
1515  if ($wh["info"] != "")
1516  {
1517  // ilUtil::sendInfo($wh["info"], true);
1518  }
1519 
1520  $media_item->setHAlign("Left");
1521  ilUtil::renameExecutables($mob_dir);
1522  $mob->update();
1523 
1524 
1525  // put it into current folder
1526  $mep_item = new ilMediaPoolItem();
1527  $mep_item->setTitle($mob->getTitle());
1528  $mep_item->setType("mob");
1529  $mep_item->setForeignId($mob->getId());
1530  $mep_item->create();
1531 
1532  $tree = $this->object->getTree();
1533  $parent = ($_GET["mepitem_id"] == "")
1534  ? $tree->getRootId()
1535  : $_GET["mepitem_id"];
1536  $tree->insertNode($mep_item->getId(), $parent);
1537  }
1538  }
1539  ilUtil::redirect("ilias.php?baseClass=ilMediaPoolPresentationGUI&cmd=listMedia&ref_id=".
1540  $_GET["ref_id"]."&mepitem_id=".$_GET["mepitem_id"]);
1541 
1542  }
ILIAS Setting Class.
print $file
$_POST['username']
Definition: cron.php:12
$_GET["client_id"]
$location
Definition: buildRTE.php:44
static getMimeType($a_file)
get mime type for file
static moveUploadedFile($a_file, $a_name, $a_target, $a_raise_errors=true, $a_mode="move_uploaded")
move uploaded file
Class ilMediaItem.
Class ilObjMediaObject.
Media Pool Item.
static renameExecutables($a_dir)
Rename uploaded executables for security reasons.
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 redirect($a_script)
http redirect to other script
_getDirectory($a_mob_id)
get directory for files of media object (static)
+ Here is the call graph for this function:

◆ createMediaObject()

ilObjMediaPoolGUI::createMediaObject ( )

obsolete?

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

324  {
325  $this->ctrl->redirectByClass("ilobjmediaobjectgui", "create");
326  }

◆ createMediaPoolPage()

ilObjMediaPoolGUI::createMediaPoolPage ( )

Create new content snippet.

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

References ilObjectGUI\$tpl, and initMediaPoolPageForm().

1049  {
1050  global $tpl;
1051  $this->initMediaPoolPageForm("create");
1052  $tpl->setContent($this->form->getHTML());
1053  }
initMediaPoolPageForm($a_mode="edit")
Init page form.
+ Here is the call graph for this function:

◆ editFolder()

ilObjMediaPoolGUI::editFolder ( )

Edit folder.

Parameters

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

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

922  {
923  global $tpl;
924 
925  $this->initFolderForm();
926  $this->getFolderValues();
927  $tpl->setContent($this->form->getHTML());
928  }
getFolderValues()
Get current values for folder from.
initFolderForm($a_mode="edit")
Init folder form.
+ Here is the call graph for this function:

◆ editMediaPoolPage()

ilObjMediaPoolGUI::editMediaPoolPage ( )

Edit media pool page.

Parameters

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

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

1062  {
1063  global $tpl;
1064 
1065  $this->setMediaPoolPageTabs();
1066 
1067  include_once("./Modules/MediaPool/classes/class.ilMediaPoolPageGUI.php");
1068  $mep_page_gui = new ilMediaPoolPageGUI($_GET["mepitem_id"], $_GET["old_nr"]);
1069  $mep_page_gui->getTabs();
1070 
1071  $this->initMediaPoolPageForm("edit");
1072  $this->getMediaPoolPageValues();
1073  $tpl->setContent($this->form->getHTML());
1074  }
$_GET["client_id"]
initMediaPoolPageForm($a_mode="edit")
Init page form.
setMediaPoolPageTabs()
Set media pool page tabs.
getMediaPoolPageValues()
Get current values for media pool page from.
Class ilMediaPoolPage GUI class.
+ Here is the call graph for this function:

◆ executeCommand()

& ilObjMediaPoolGUI::executeCommand ( )

execute command

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

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

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 // todo
102  $this->ctrl->redirectByClass("ilobjfoldergui", "create");
103  break;
104  }
105  }
106 
107  switch($next_class)
108  {
109  case 'ilmediapoolpagegui':
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  //$cmd.="Object";
130  if ($cmd == "create" || $cmd == "save" || $cmd == "cancel")
131  {
132  $ret_obj = $_GET["mepitem_id"];
133  $ilObjMediaObjectGUI =& new ilObjMediaObjectGUI("", 0, false, false);
134  $ilObjMediaObjectGUI->setWidthPreset($this->object->getDefaultWidth());
135  $ilObjMediaObjectGUI->setHeightPreset($this->object->getDefaultHeight());
136  }
137  else
138  {
139  $ret_obj = $tree->getParentId($_GET["mepitem_id"]);
140  $ilObjMediaObjectGUI =& new ilObjMediaObjectGUI("", ilMediaPoolItem::lookupForeignId($_GET["mepitem_id"]), false, false);
141  $this->ctrl->setParameter($this, "mepitem_id", $this->getParentFolderId());
142  $ilTabs->setBackTarget($lng->txt("back"),
143  $this->ctrl->getLinkTarget($this,
144  $_GET["mep_mode"] ? $_GET["mep_mode"] : "listMedia"));
145  }
146  if ($this->ctrl->getCmdClass() == "ilinternallinkgui")
147  {
148  $this->ctrl->setReturn($this, "explorer");
149  }
150  else
151  {
152  $this->ctrl->setParameter($this, "mepitem_id", $ret_obj);
153  $this->ctrl->setReturn($this,
154  $_GET["mep_mode"] ? $_GET["mep_mode"] : "listMedia");
155  $this->ctrl->setParameter($this, "mepitem_id", $_GET["mepitem_id"]);
156  }
157  $this->getTemplate();
158  $ilObjMediaObjectGUI->setTabs();
159  $this->setLocator();
160 
161  //$ret =& $ilObjMediaObjectGUI->executeCommand();
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 // todo
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  //$ret =& $clip_gui->executeCommand();
247  $ret =& $this->ctrl->forwardCommand($clip_gui);
248  $this->tpl->show();
249  break;
250 
251  case 'ilinfoscreengui':
252  $this->prepareOutput();
253  $this->addHeaderAction();
254  $this->infoScreen();
255  $this->tpl->show();
256  break;
257 
258  case 'ilpermissiongui':
259  $this->prepareOutput();
260  $this->addHeaderAction();
261  include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
262  $perm_gui =& new ilPermissionGUI($this);
263  $ret =& $this->ctrl->forwardCommand($perm_gui);
264  $this->tpl->show();
265  break;
266 
267  case "ilexportgui":
268  $this->prepareOutput();
269  $this->addHeaderAction();
270  include_once("./Services/Export/classes/class.ilExportGUI.php");
271  $exp_gui = new ilExportGUI($this);
272  $exp_gui->addFormat("xml");
273  $ret = $this->ctrl->forwardCommand($exp_gui);
274  $this->tpl->show();
275  break;
276 
277  case "ilfilesystemgui":
278  $this->prepareOutput();
279  $this->addHeaderAction();
280  $ilTabs->clearTargets();
281  $ilTabs->setBackTarget($lng->txt("back"),
282  $ilCtrl->getLinkTarget($this, "listMedia"));
283  $mset = new ilSetting("mobs");
284  if (trim($mset->get("upload_dir")) != "")
285  {
286  include_once("./Services/FileSystem/classes/class.ilFileSystemGUI.php");
287  $fs_gui = new ilFileSystemGUI($mset->get("upload_dir"));
288  $fs_gui->setPostDirPath(true);
289  $fs_gui->setTableId("mepud".$this->object->getId());
290  $fs_gui->setAllowFileCreation(false);
291  $fs_gui->setAllowDirectoryCreation(false);
292  $fs_gui->clearCommands();
293  $fs_gui->addCommand($this, "selectUploadDirFiles", $this->lng->txt("mep_sel_upload_dir_files"),
294  false, true);
295  //$fs_gui->addCommand($this, "assignFullscreenObject", $this->lng->txt("cont_assign_full"));
296  $ret =& $this->ctrl->forwardCommand($fs_gui);
297  }
298  $this->tpl->show();
299  break;
300 
301  case "ilcommonactiondispatchergui":
302  include_once("Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
304  $this->ctrl->forwardCommand($gui);
305  break;
306 
307  default:
308  $this->prepareOutput();
309  $this->addHeaderAction();
310  $cmd = $this->ctrl->getCmd("listMedia");
311  $this->$cmd();
312  if (!$this->getCreationMode())
313  {
314  $this->tpl->show();
315  }
316  break;
317  }
318  }
setLocator()
set Locator
ILIAS Setting Class.
Class ilObjFolderGUI.
$_POST['username']
Definition: cron.php:12
Class ilEditClipboardGUI.
setPostDirPath($a_val)
Set post dir path.
$_GET["client_id"]
infoScreen()
show information screen
$cmd
Definition: sahs_server.php:35
getTemplate()
Get standard template.
setMediaPoolPageTabs()
Set media pool page tabs.
global $ilCtrl
Definition: ilias.php:18
setCreationMode($a_mode=true)
static lookupForeignId($a_id)
Lookup Foreign Id.
Export User Interface Class.
Media Pool Item.
Class ilObjMediaObjectGUI.
getParentFolderId()
Get folder parent ID.
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
File System Explorer GUI class.
static redirect($a_script)
http redirect to other script
addHeaderAction()
Add header action menu.
Class ilMediaPoolPage GUI class.
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
+ Here is the call graph for this function:

◆ getEditFormCustomValues()

ilObjMediaPoolGUI::getEditFormCustomValues ( array &  $a_values)
protected

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

367  {
368  if ($this->object->getDefaultWidth() > 0)
369  {
370  $a_values["default_width"] = $this->object->getDefaultWidth();
371  }
372  if ($this->object->getDefaultHeight() > 0)
373  {
374  $a_values["default_height"] = $this->object->getDefaultHeight();
375  }
376  }

◆ getFolderValues()

ilObjMediaPoolGUI::getFolderValues ( )

Get current values for folder from.

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

References $_GET, and ilMediaPoolItem\lookupTitle().

Referenced by editFolder().

934  {
935  $values = array();
936 
937  $values["title"] = ilMediaPoolItem::lookupTitle($_GET["mepitem_id"]);
938 
939  $this->form->setValuesByArray($values);
940  }
$_GET["client_id"]
static lookupTitle($a_id)
Lookup title.
+ 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 1174 of file class.ilObjMediaPoolGUI.php.

References $_GET, and ilMediaPoolItem\lookupTitle().

Referenced by editMediaPoolPage().

1175  {
1176  $values = array();
1177 
1178  include_once("./Modules/MediaPool/classes/class.ilMediaPoolItem.php");
1179  $values["title"] = ilMediaPoolItem::lookupTitle($_GET["mepitem_id"]);
1180 
1181  $this->form->setValuesByArray($values);
1182  }
$_GET["client_id"]
static lookupTitle($a_id)
Lookup title.
+ 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.

References $_GET.

Referenced by executeCommand().

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  }
$_GET["client_id"]
+ Here is the caller graph for this function:

◆ getTemplate()

ilObjMediaPoolGUI::getTemplate ( )

Get standard template.

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

Referenced by executeCommand().

516  {
517  $this->tpl->getStandardTemplate();
518  }
+ Here is the caller graph for this function:

◆ getType()

ilObjMediaPoolGUI::getType ( )
final

Get type.

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

55  {
56  return "mep";
57  }

◆ infoScreen()

ilObjMediaPoolGUI::infoScreen ( )

show information screen

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

References $_GET.

Referenced by executeCommand(), and infoScreenObject().

1376  {
1377  global $ilAccess;
1378 
1379  if (!$ilAccess->checkAccess("visible", "", $this->ref_id))
1380  {
1381  $this->ilias->raiseError($this->lng->txt("msg_no_perm_read"),$this->ilias->error_obj->MESSAGE);
1382  }
1383 
1384  if ($this->ctrl->getCmd() == "infoScreen")
1385  {
1386  $this->ctrl->setCmd("showSummary");
1387  $this->ctrl->setCmdClass("ilinfoscreengui");
1388  }
1389 
1390  include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
1391  $info = new ilInfoScreenGUI($this);
1392 
1393  $info->enablePrivateNotes();
1394 
1395  if ($ilAccess->checkAccess("read", "", $_GET["ref_id"]))
1396  {
1397  //$info->enableNews();
1398  }
1399 
1400  // no news editing for files, just notifications
1401 // $info->enableNewsEditing(false);
1402  if ($ilAccess->checkAccess("write", "", $_GET["ref_id"]))
1403  {
1404 // $news_set = new ilSetting("news");
1405 // $enable_internal_rss = $news_set->get("enable_rss_for_internal");
1406 
1407 // if ($enable_internal_rss)
1408 // {
1409 // $info->setBlockProperty("news", "settings", true);
1410 // $info->setBlockProperty("news", "public_notifications_option", true);
1411 // }
1412  }
1413 
1414 
1415  // standard meta data
1416  $info->addMetaDataSections($this->object->getId(),0, $this->object->getType());
1417 
1418  // forward the command
1419  $this->ctrl->forwardCommand($info);
1420 
1421 // $this->tpl->show();
1422  }
Class ilInfoScreenGUI.
$_GET["client_id"]
redirection script todo: (a better solution should control the processing via a xml file) ...
+ 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 1365 of file class.ilObjMediaPoolGUI.php.

References infoScreen().

1366  {
1367  $this->ctrl->setCmd("showSummary");
1368  $this->ctrl->setCmdClass("ilinfoscreengui");
1369  $this->infoScreen();
1370  }
infoScreen()
show information screen
+ Here is the call graph for this function:

◆ initCreationForms()

ilObjMediaPoolGUI::initCreationForms (   $a_new_type)
protected

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

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

329  {
330  $forms = array(self::CFORM_NEW => $this->initCreateForm($a_new_type),
331  self::CFORM_IMPORT => $this->initImportForm($a_new_type));
332 
333  return $forms;
334  }
initImportForm($a_new_type)
Init object import form.
initCreateForm($a_new_type)
Init object creation form.
+ Here is the call graph for this function:

◆ initEditCustomForm()

ilObjMediaPoolGUI::initEditCustomForm ( ilPropertyFormGUI  $a_form)
protected

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

References ilPropertyFormGUI\addItem(), and ilNumberInputGUI\setMinValue().

349  {
350  // default width
351  $ni = new ilNumberInputGUI($this->lng->txt("mep_default_width"), "default_width");
352  $ni->setMinValue(0);
353  $ni->setMaxLength(5);
354  $ni->setSize(5);
355  $a_form->addItem($ni);
356 
357  // default height
358  $ni = new ilNumberInputGUI($this->lng->txt("mep_default_height"), "default_height");
359  $ni->setMinValue(0);
360  $ni->setMaxLength(5);
361  $ni->setSize(5);
362  $ni->setInfo($this->lng->txt("mep_default_width_height_info"));
363  $a_form->addItem($ni);
364  }
addItem($a_item)
Add Item (Property, SectionHeader).
This class represents a number property in a property form.
setMinValue($a_minvalue)
Set Minimum Value.
+ 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 991 of file class.ilObjMediaPoolGUI.php.

References $ilCtrl, ilObjectGUI\$lng, and ilTextInputGUI\setMaxLength().

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

992  {
993  global $lng, $ilCtrl;
994 
995  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
996  $this->form = new ilPropertyFormGUI();
997 
998  // desc
999  $ti = new ilTextInputGUI($lng->txt("title"), "title");
1000  $ti->setMaxLength(128);
1001  $ti->setRequired(true);
1002  $this->form->addItem($ti);
1003 
1004  // save and cancel commands
1005  if ($a_mode == "create")
1006  {
1007  $this->form->addCommandButton("saveFolder", $lng->txt("save"));
1008  $this->form->addCommandButton("cancelSave", $lng->txt("cancel"));
1009  $this->form->setTitle($lng->txt("mep_new_folder"));
1010  }
1011  else
1012  {
1013  $this->form->addCommandButton("updateFolder", $lng->txt("save"));
1014  $this->form->addCommandButton("cancelFolderUpdate", $lng->txt("cancel"));
1015  $this->form->setTitle($lng->txt("mep_edit_folder"));
1016  }
1017 
1018  $this->form->setFormAction($ilCtrl->getFormAction($this));
1019  }
This class represents a property form user interface.
global $ilCtrl
Definition: ilias.php:18
This class represents a text property in a property form.
setMaxLength($a_maxlength)
Set Max Length.
+ Here is the call graph for this function:
+ 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 1142 of file class.ilObjMediaPoolGUI.php.

References $ilCtrl, ilObjectGUI\$lng, and ilTextInputGUI\setMaxLength().

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

1143  {
1144  global $lng, $ilCtrl;
1145 
1146  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
1147  $this->form = new ilPropertyFormGUI();
1148 
1149  // title
1150  $ti = new ilTextInputGUI($lng->txt("title"), "title");
1151  $ti->setMaxLength(128);
1152  $ti->setRequired(true);
1153  $this->form->addItem($ti);
1154 
1155  // save and cancel commands
1156  if ($a_mode == "create")
1157  {
1158  $this->form->addCommandButton("saveMediaPoolPage", $lng->txt("save"));
1159  $this->form->addCommandButton("cancelSave", $lng->txt("cancel"));
1160  $this->form->setTitle($lng->txt("mep_new_content_snippet"));
1161  }
1162  else
1163  {
1164  $this->form->addCommandButton("updateMediaPoolPage", $lng->txt("save"));
1165  $this->form->setTitle($lng->txt("mep_edit_content_snippet"));
1166  }
1167 
1168  $this->form->setFormAction($ilCtrl->getFormAction($this));
1169  }
This class represents a property form user interface.
global $ilCtrl
Definition: ilias.php:18
This class represents a text property in a property form.
setMaxLength($a_maxlength)
Set Max Length.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ insertFromClipboard()

ilObjMediaPoolGUI::insertFromClipboard ( )

insert media object from clipboard

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

References $_GET, ilEditClipboardGUI\_getSelectedIDs(), ilObject\_lookupTitle(), ilMediaPoolPage\lookupTitle(), ilMediaPoolItem\lookupTitle(), and ilUtil\sendInfo().

694  {
695  global $ilAccess;
696 
697  if (!$ilAccess->checkAccess("write", "", $this->object->getRefId()))
698  {
699  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
700  }
701 
702  include_once("./Services/Clipboard/classes/class.ilEditClipboardGUI.php");
704  $not_inserted = array();
705  if (is_array($ids))
706  {
707  foreach ($ids as $id2)
708  {
709  $id = explode(":", $id2);
710  $type = $id[0];
711  $id = $id[1];
712 
713  if ($type == "mob") // media object
714  {
715  if (ilObjMEdiaPool::isForeignIdInTree($this->object->getId(), $id))
716  {
717  $not_inserted[] = ilObject::_lookupTitle($id)." [".
718  $id."]";
719  }
720  else
721  {
722  $item = new ilMediaPoolItem();
723  $item->setType("mob");
724  $item->setForeignId($id);
725  $item->setTitle(ilObject::_lookupTitle($id));
726  $item->create();
727  if ($item->getId() > 0)
728  {
729  $this->object->insertInTree($item->getId(), $_GET["mepitem_id"]);
730  }
731  }
732  }
733  if ($type == "incl") // content snippet
734  {
735  include_once("./Modules/MediaPool/classes/class.ilMediaPoolPage.php");
736  include_once("./Modules/MediaPool/classes/class.ilMediaPoolItem.php");
737  if (ilObjMEdiaPool::isItemIdInTree($this->object->getId(), $id))
738  {
739  $not_inserted[] = ilMediaPoolPage::lookupTitle($id)." [".
740  $id."]";
741  }
742  else
743  {
744  $original = new ilMediaPoolPage($id);
745 
746  // copy the page into the pool
747  $item = new ilMediaPoolItem();
748  $item->setType("pg");
749  $item->setTitle(ilMediaPoolItem::lookupTitle($id));
750  $item->create();
751  if ($item->getId() > 0)
752  {
753  $this->object->insertInTree($item->getId(), $_GET["mepitem_id"]);
754 
755  // create page
756  include_once("./Modules/MediaPool/classes/class.ilMediaPoolPage.php");
757  $page = new ilMediaPoolPage();
758  $page->setId($item->getId());
759  $page->create();
760 
761  // copy content
762  $original->copy($page->getId(), $page->getParentType(), $page->getParentId(), true);
763 
764  //$page->setXMLContent($original->copyXMLContent());
765  //$page->buildDom();
766  //$page->update();
767  }
768  }
769  }
770  }
771  }
772  if (count($not_inserted) > 0)
773  {
774  ilUtil::sendInfo($this->lng->txt("mep_not_insert_already_exist")."<br>".
775  implode($not_inserted,"<br>"), true);
776  }
777  $this->ctrl->redirect($this, $_GET["mep_mode"] ? $_GET["mep_mode"] : "listMedia");
778  }
$_GET["client_id"]
static _lookupTitle($a_id)
lookup object title
Class ilMediaPoolPage.
static lookupTitle($a_page_id)
Lookup title.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
redirection script todo: (a better solution should control the processing via a xml file) ...
Media Pool Item.
static lookupTitle($a_id)
Lookup title.
+ Here is the call graph for this function:

◆ listMedia()

ilObjMediaPoolGUI::listMedia ( )

list media objects

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

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

388  {
389  global $tree, $ilAccess, $tpl, $ilTabs, $ilCtrl, $ilToolbar, $lng;
390 
391  $ilCtrl->setParameter($this, "mep_mode", "listMedia");
392 
393  if (!$ilAccess->checkAccess("read", "", $this->object->getRefId()))
394  {
395  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
396  }
397  $ilTabs->setTabActive("objs_fold");
398 
399  if ($ilAccess->checkAccess("write", "", $this->object->getRefId()))
400  {
401  $ilToolbar->addButton($lng->txt("mep_create_mob"),
402  $ilCtrl->getLinkTarget($this, "createMediaObject"));
403 
404  $mset = new ilSetting("mobs");
405  if ($mset->get("mep_activate_pages"))
406  {
407  $ilToolbar->addButton($lng->txt("mep_create_content_snippet"),
408  $ilCtrl->getLinkTarget($this, "createMediaPoolPage"));
409  }
410 
411  $ilToolbar->addButton($lng->txt("mep_create_folder"),
412  $ilCtrl->getLinkTarget($this, "createFolderForm"));
413 
414  if (trim($mset->get("upload_dir")) != "" && ilMainMenuGUI::_checkAdministrationPermission())
415  {
416  $ilToolbar->addButton($lng->txt("mep_create_from_upload_dir"),
417  $ilCtrl->getLinkTargetByClass("ilfilesystemgui", "listFiles"));
418  }
419  }
420 
421  // tree
422  include_once("./Modules/MediaPool/classes/class.ilMediaPoolExplorerGUI.php");
423  $exp = new ilMediaPoolExplorerGUI($this, "listMedia", $this->object);
424  if (!$exp->handleCommand())
425  {
426  $this->tpl->setLeftNavContent($exp->getHTML());
427  }
428  else
429  {
430  return;
431  }
432 
433 
434  include_once("./Modules/MediaPool/classes/class.ilMediaPoolTableGUI.php");
435  $mep_table_gui = new ilMediaPoolTableGUI($this, "listMedia", $this->object, "mepitem_id");
436  $tpl->setContent($mep_table_gui->getHTML());
437 // $this->tpl->show();
438  }
ILIAS Setting Class.
Media pool explorer GUI class.
global $ilCtrl
Definition: ilias.php:18
redirection script todo: (a better solution should control the processing via a xml file) ...
TableGUI class for recent changes in wiki.
+ Here is the call graph for this function:

◆ openClipboard()

ilObjMediaPoolGUI::openClipboard ( )

paste from clipboard

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

References $ilCtrl.

675  {
676  global $ilCtrl, $ilAccess;
677 
678  if (!$ilAccess->checkAccess("write", "", $this->object->getRefId()))
679  {
680  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
681  }
682 
683  $ilCtrl->setParameterByClass("ileditclipboardgui", "returnCommand",
684  rawurlencode($ilCtrl->getLinkTarget($this,
685  "insertFromClipboard", "", false, false)));
686  $ilCtrl->redirectByClass("ilEditClipboardGUI", "getObject");
687  }
global $ilCtrl
Definition: ilias.php:18
redirection script todo: (a better solution should control the processing via a xml file) ...

◆ remove()

ilObjMediaPoolGUI::remove ( )

confirm deletion of

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

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

793  {
794  global $ilAccess;
795 
796  if (!$ilAccess->checkAccess("write", "", $this->object->getRefId()))
797  {
798  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
799  }
800 
801  foreach($_POST["id"] as $obj_id)
802  {
803  $this->object->deleteChild($obj_id);
804  }
805 
806  ilUtil::sendSuccess($this->lng->txt("cont_obj_removed"),true);
807  $this->ctrl->redirect($this, $_GET["mep_mode"] ? $_GET["mep_mode"] : "listMedia");
808  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
$_GET["client_id"]
redirection script todo: (a better solution should control the processing via a xml file) ...
+ Here is the call graph for this function:

◆ resetFilter()

ilObjMediaPoolGUI::resetFilter ( )

Reset filter.

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

References allMedia(), and ilMediaPoolTableGUI\IL_MEP_EDIT.

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  }
allMedia()
list all objects
TableGUI class for recent changes in wiki.
+ Here is the call graph for this function:

◆ saveFolder()

ilObjMediaPoolGUI::saveFolder ( )

Save folder form.

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

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

946  {
947  global $tpl, $lng, $ilCtrl;
948 
949  $this->initFolderForm("create");
950  if ($this->form->checkInput())
951  {
952  if ($this->object->createFolder($_POST["title"], (int) $_GET["mepitem_id"]))
953  {
954  ilUtil::sendSuccess($lng->txt("mep_folder_created"), true);
955  }
956  $ilCtrl->redirect($this, "listMedia");
957  }
958 
959  $this->form->setValuesByPost();
960  $tpl->setContent($this->form->getHtml());
961  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
$_GET["client_id"]
initFolderForm($a_mode="edit")
Init folder form.
global $ilCtrl
Definition: ilias.php:18
+ Here is the call graph for this function:

◆ saveMediaPoolPage()

ilObjMediaPoolGUI::saveMediaPoolPage ( )

Save media pool page.

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

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

1080  {
1081  global $tpl, $lng, $ilCtrl;
1082 
1083  $this->initMediaPoolPageForm("create");
1084  if ($this->form->checkInput())
1085  {
1086  // create media pool item
1087  include_once("./Modules/MediaPool/classes/class.ilMediaPoolItem.php");
1088  $item = new ilMediaPoolItem();
1089  $item->setTitle($_POST["title"]);
1090  $item->setType("pg");
1091  $item->create();
1092 
1093  if ($item->getId() > 0)
1094  {
1095  // put in tree
1096  $tree = $this->object->getTree();
1097  $parent = $_GET["mepitem_id"] > 0
1098  ? $_GET["mepitem_id"]
1099  : $tree->getRootId();
1100  $this->object->insertInTree($item->getId(), $parent);
1101 
1102  // create page
1103  include_once("./Modules/MediaPool/classes/class.ilMediaPoolPage.php");
1104  $page = new ilMediaPoolPage();
1105  $page->setId($item->getId());
1106  $page->create();
1107 
1108  ilUtil::sendSuccess($lng->txt("mep_page_created"), true);
1109  }
1110  $ilCtrl->redirect($this, "listMedia");
1111  }
1112 
1113  $this->form->setValuesByPost();
1114  $tpl->setContent($this->form->getHtml());
1115  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
$_GET["client_id"]
Class ilMediaPoolPage.
initMediaPoolPageForm($a_mode="edit")
Init page form.
global $ilCtrl
Definition: ilias.php:18
Media Pool Item.
+ Here is the call graph for this function:

◆ selectUploadDirFiles()

ilObjMediaPoolGUI::selectUploadDirFiles ( )

Select files from upload directory.

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

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

1433  {
1434  global $tpl, $ilTabs, $lng, $ilCtrl, $ilToolbar;
1435 
1436  $ilTabs->clearTargets();
1437  $ilTabs->setBackTarget($lng->txt("back"),
1438  $ilCtrl->getLinkTarget($this, "listMedia"));
1439 
1441  {
1442 
1443  // action type
1444  include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
1445  $options = array(
1446  "rename" => $lng->txt("mep_up_dir_move"),
1447  "copy" => $lng->txt("mep_up_dir_copy"),
1448  );
1449  $si = new ilSelectInputGUI("", "action");
1450  $si->setOptions($options);
1451  $ilToolbar->addInputItem($si);
1452  $ilToolbar->setCloseFormTag(false);
1453  $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
1454  $ilToolbar->setFormName("mep_up_form");
1455 
1456  include_once("./Modules/MediaPool/classes/class.ilUploadDirFilesTableGUI.php");
1457  $tab = new ilUploadDirFilesTableGUI($this, "selectUploadDirFiles",
1458  $_POST["file"]);
1459  $tab->setFormName("mep_up_form");
1460  $tpl->setContent($tab->getHTML());
1461  }
1462  }
$_POST['username']
Definition: cron.php:12
This class represents a selection list property in a property form.
global $ilCtrl
Definition: ilias.php:18
if(!is_array($argv)) $options
+ Here is the call graph for this function:

◆ setMediaPoolPageTabs()

ilObjMediaPoolGUI::setMediaPoolPageTabs ( )

Set media pool page tabs.

Parameters

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

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

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

1191  {
1192  global $ilTabs, $ilCtrl, $lng;
1193 
1194  $ilTabs->clearTargets();
1195  //$ilTabs->addTab("mep_pg_prop", $lng->txt("mep_page_properties"),
1196  // $ilCtrl->getLinkTarget($this, "editMediaPoolPage"));
1197  $ilTabs->addTarget("mep_page_properties", $ilCtrl->getLinkTarget($this, "editMediaPoolPage"),
1198  "editMediaPoolPage", get_class($this));
1199  $ilTabs->addTarget("cont_usage", $ilCtrl->getLinkTarget($this, "showMediaPoolPageUsages"),
1200  array("showMediaPoolPageUsages", "showAllMediaPoolPageUsages"), get_class($this));
1201  $ilCtrl->setParameter($this, "mepitem_id", $this->object->tree->getParentId($_GET["mepitem_id"]));
1202  $ilTabs->setBackTarget($lng->txt("mep_folder"), $ilCtrl->getLinkTarget($this, "listMedia"));
1203  $ilCtrl->setParameter($this, "mepitem_id", $_GET["mepitem_id"]);
1204  }
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
+ Here is the caller graph for this function:

◆ setTabs()

ilObjMediaPoolGUI::setTabs ( )

Set tabs.

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

References $_GET, and $ilCtrl.

1265  {
1266  global $ilAccess, $ilTabs, $ilCtrl, $ilHelp;
1267 
1268  $ilHelp->setScreenIdComponent("mep");
1269 
1270  if ($ilAccess->checkAccess('read', '', $this->ref_id) ||
1271  $ilAccess->checkAccess('write', '', $this->ref_id))
1272  {
1273  $ilTabs->addTarget("objs_fold", $this->ctrl->getLinkTarget($this, ""),
1274  "listMedia", "", "_top");
1275 
1276  $ilCtrl->setParameter($this, "mepitem_id", "");
1277  $ilTabs->addTarget("mep_all_mobs", $this->ctrl->getLinkTarget($this, "allMedia"),
1278  "allMedia", "", "_top");
1279  $ilCtrl->setParameter($this, "mepitem_id", $_GET["mepitem_id"]);
1280  }
1281 
1282  // info tab
1283  if ($ilAccess->checkAccess('visible', '', $this->ref_id))
1284  {
1285  $force_active = ($this->ctrl->getNextClass() == "ilinfoscreengui"
1286  || strtolower($_GET["cmdClass"]) == "ilnotegui")
1287  ? true
1288  : false;
1289  //echo "-$force_active-";
1290  $ilTabs->addTarget("info_short",
1291  $this->ctrl->getLinkTargetByClass(
1292  array("ilobjmediapoolgui", "ilinfoscreengui"), "showSummary"),
1293  array("showSummary", "infoScreen"),
1294  "", "", $force_active);
1295  }
1296 
1297  if ($ilAccess->checkAccess("write", "", $this->object->getRefId()))
1298  {
1299  $ilTabs->addTarget("settings", $this->ctrl->getLinkTarget($this, "edit"),
1300  "edit", array("", "ilobjmediapoolgui"));
1301  }
1302 
1303  if ($ilAccess->checkAccess("write", "", $this->object->getRefId()))
1304  {
1305  $ilTabs->addTarget("clipboard", $this->ctrl->getLinkTarget($this, "openClipboard"),
1306  "view", "ileditclipboardgui");
1307  }
1308 
1309  if ($ilAccess->checkAccess("write", "", $this->object->getRefId()))
1310  {
1311  $ilTabs->addTarget("export", $this->ctrl->getLinkTargetByClass("ilexportgui", ""),
1312  "", "ilexportgui");
1313  }
1314 
1315  if ($ilAccess->checkAccess("edit_permission", "", $this->object->getRefId()))
1316  {
1317  $ilTabs->addTarget("perm_settings",
1318  $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm"), array("perm","info","owner"), 'ilpermissiongui');
1319  }
1320 
1321  }
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18

◆ showAllMediaPoolPageUsages()

ilObjMediaPoolGUI::showAllMediaPoolPageUsages ( )

List usages of the contnet snippet.

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

References showMediaPoolPageUsages().

1210  {
1211  $this->showMediaPoolPageUsages(true);
1212  }
showMediaPoolPageUsages($a_all=false)
List usages of the contnet snippet.
+ Here is the call graph for this function:

◆ showFullscreen()

ilObjMediaPoolGUI::showFullscreen ( )

show fullscreen

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

References showMedia().

606  {
607  $this->showMedia();
608  }
showMedia()
show media object
+ Here is the call graph for this function:

◆ showMedia()

ilObjMediaPoolGUI::showMedia ( )

show media object

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

References $_GET, ilMediaItem\_getMapAreasIntLinks(), ilObjStyleSheet\getContentStylePath(), ilUtil\getImagePath(), ilUtil\getStyleSheetLocation(), ilUtil\getWebspaceDir(), IL_MODE_ALIAS, IL_MODE_OUTPUT, ilObjMediaObjectGUI\includePresentationJS(), xslt_create(), xslt_error(), xslt_free(), and xslt_process().

Referenced by showFullscreen().

545  {
546  global $ilAccess;
547 
548  if (!$ilAccess->checkAccess("read", "", $this->object->getRefId()))
549  {
550  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
551  }
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  //$int_links = $page_object->getInternalLinks();
560  $med_links = ilMediaItem::_getMapAreasIntLinks($_GET["mob_id"]);
561 
562  // later
563  //$link_xml = $this->getLinkXML($med_links, $this->getLayoutLinkTargets());
564 
565  $link_xlm = "";
566 
567  require_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
568  require_once("./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
570  $media_obj =& new ilObjMediaObject($_GET["mob_id"]);
571 
572  $xml = "<dummy>";
573  // todo: we get always the first alias now (problem if mob is used multiple
574  // times in page)
575  $xml.= $media_obj->getXML(IL_MODE_ALIAS);
576  $xml.= $media_obj->getXML(IL_MODE_OUTPUT);
577  $xml.= $link_xml;
578  $xml.="</dummy>";
579 
580  $xsl = file_get_contents("./Services/COPage/xsl/page.xsl");
581  $args = array( '/_xml' => $xml, '/_xsl' => $xsl );
582  $xh = xslt_create();
583 
584  $wb_path = ilUtil::getWebspaceDir("output")."/";
585 
586  $mode = ($_GET["cmd"] != "showMedia")
587  ? "fullscreen"
588  : "media";
589  $enlarge_path = ilUtil::getImagePath("enlarge.png", false, "output");
590  $fullscreen_link =
591  $this->ctrl->getLinkTarget($this, "showFullscreen", "", false, false);
592  $params = array ('mode' => $mode, 'enlarge_path' => $enlarge_path,
593  'link_params' => "ref_id=".$_GET["ref_id"],'fullscreen_link' => $fullscreen_link,
594  'ref_id' => $_GET["ref_id"], 'pg_frame' => $pg_frame, 'webspace_path' => $wb_path);
595  $output = xslt_process($xh,"arg:/_xml","arg:/_xsl",NULL,$args, $params);
596  echo xslt_error($xh);
597  xslt_free($xh);
598  // unmask user html
599  $this->tpl->setVariable("MEDIA_CONTENT", $output);
600  }
xslt_create()
static getStyleSheetLocation($mode="output", $a_css_name="", $a_css_location="")
get full style sheet file name (path inclusive) of current user
$_GET["client_id"]
xslt_free(&$proc)
xslt_error(&$proc)
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
xslt_process(&$proc, $xml_var, $xslt_var, $dummy, $args, $params, $a_no_warnings=false)
special template class to simplify handling of ITX/PEAR
redirection script todo: (a better solution should control the processing via a xml file) ...
Class ilObjMediaObject.
_getMapAreasIntLinks($a_mob_id)
get all internal links of map areas of a mob
const IL_MODE_ALIAS
getContentStylePath($a_style_id)
get content style path
const IL_MODE_OUTPUT
static getWebspaceDir($mode="filesystem")
get webspace directory
includePresentationJS($a_tpl=null)
Include media object presentation JS.
+ 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 1218 of file class.ilObjMediaPoolGUI.php.

References $_GET, $cmd, $ilCtrl, ilObjectGUI\$lng, ilObjectGUI\$tpl, and setMediaPoolPageTabs().

Referenced by showAllMediaPoolPageUsages().

1219  {
1220  global $ilTabs, $ilCtrl, $lng, $tpl;
1221 
1222  $this->setMediaPoolPageTabs();
1223 
1224  $ilTabs->addSubTab("current_usages", $lng->txt("cont_current_usages"),
1225  $ilCtrl->getLinkTarget($this, "showMediaPoolPageUsages"));
1226 
1227  $ilTabs->addSubTab("all_usages", $lng->txt("cont_all_usages"),
1228  $ilCtrl->getLinkTarget($this, "showAllMediaPoolPageUsages"));
1229 
1230  if ($a_all)
1231  {
1232  $ilTabs->activateSubTab("all_usages");
1233  $cmd = "showAllMediaPoolPageUsages";
1234  }
1235  else
1236  {
1237  $ilTabs->activateSubTab("current_usages");
1238  $cmd = "showMediaPoolPageUsages";
1239  }
1240 
1241 
1242  include_once("./Modules/MediaPool/classes/class.ilMediaPoolPageGUI.php");
1243  $mep_page_gui = new ilMediaPoolPageGUI($_GET["mepitem_id"], $_GET["old_nr"]);
1244  $mep_page_gui->getTabs();
1245 
1246  include_once("./Modules/MediaPool/classes/class.ilMediaPoolPage.php");
1247  $page = new ilMediaPoolPage((int) $_GET["mepitem_id"]);
1248 
1249  include_once("./Modules/MediaPool/classes/class.ilMediaPoolPageUsagesTableGUI.php");
1250  $table = new ilMediaPoolPageUsagesTableGUI($this, $cmd, $page, $a_all);
1251 
1252  $tpl->setContent($table->getHTML());
1253 
1254  }
$_GET["client_id"]
$cmd
Definition: sahs_server.php:35
Class ilMediaPoolPage.
TableGUI class for media pool page usages listing.
setMediaPoolPageTabs()
Set media pool page tabs.
global $ilCtrl
Definition: ilias.php:18
Class ilMediaPoolPage GUI class.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateCustom()

ilObjMediaPoolGUI::updateCustom ( ilPropertyFormGUI  $a_form)
protected

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

References ilPropertyFormGUI\getInput().

379  {
380  $this->object->setDefaultWidth($a_form->getInput("default_width"));
381  $this->object->setDefaultHeight($a_form->getInput("default_height"));
382  }
getInput($a_post_var, $ensureValidation=true)
Returns the value of a HTTP-POST variable, identified by the passed id.
+ Here is the call graph for this function:

◆ updateFolder()

ilObjMediaPoolGUI::updateFolder ( )

Update folder.

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

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

967  {
968  global $lng, $ilCtrl, $tpl;
969 
970  $this->initFolderForm("edit");
971  if ($this->form->checkInput())
972  {
973  $item = new ilMediaPoolItem($_GET["mepitem_id"]);
974  $item->setTitle($_POST["title"]);
975  $item->update();
976  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
977  $ilCtrl->setParameter($this, "mepitem_id",
978  $this->object->getTree()->getParentId($_GET["mepitem_id"]));
979  $ilCtrl->redirect($this, "listMedia");
980  }
981 
982  $this->form->setValuesByPost();
983  $tpl->setContent($this->form->getHtml());
984  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
$_GET["client_id"]
initFolderForm($a_mode="edit")
Init folder form.
global $ilCtrl
Definition: ilias.php:18
Media Pool Item.
+ Here is the call graph for this function:

◆ updateMediaPoolPage()

ilObjMediaPoolGUI::updateMediaPoolPage ( )

Update media pool page.

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

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

1121  {
1122  global $lng, $ilCtrl, $tpl;
1123 
1124  $this->initMediaPoolPageForm("edit");
1125  if ($this->form->checkInput())
1126  {
1127  $item = new ilMediaPoolItem($_GET["mepitem_id"]);
1128  $item->setTitle($_POST["title"]);
1129  $item->update();
1130  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
1131  $ilCtrl->redirect($this, "editMediaPoolPage");
1132  }
1133 
1134  $this->form->setValuesByPost();
1135  $tpl->setContent($this->form->getHtml());
1136  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
$_GET["client_id"]
initMediaPoolPageForm($a_mode="edit")
Init page form.
global $ilCtrl
Definition: ilias.php:18
Media Pool Item.
+ 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: