ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups 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.
executeCommand ()
 execute command
 createMediaObject ()
 obsolete?
 afterSave ($newObj)
 save object
 listMedia ()
 list media objects
 allMedia ()
 list all objects
 applyFilter ()
 Apply filter.
 resetFilter ()
 Reset filter.
 getTemplate ()
 Get standard template.
 getParentFolderId ()
 Get folder parent ID.
 showPage ()
 Show page.
 showPreview ()
 Show content snippet.
 showFullscreen ()
 show fullscreen
 confirmRemove ()
 confirm remove of mobs
 openClipboard ()
 paste from clipboard
 insertFromClipboard ()
 insert media object from clipboard
 cancelRemove ()
 cancel deletion of media objects/folders
 remove ()
 confirm deletion of
 copyToClipboard ()
 copy media objects to clipboard
 addLocatorItems ()
 add locator items for media pool
 createFolderForm ()
 create folder form
 editFolder ()
 Edit folder.
 getFolderValues ()
 Get current values for folder from.
 saveFolder ()
 Save folder form.
 updateFolder ()
 Update folder.
 initFolderForm ($a_mode="edit")
 Init folder form.
 cancelFolderUpdate ()
 Cancel save.
 cancelSave ()
 Cancel save.
 createMediaPoolPage ()
 Create new content snippet.
 editMediaPoolPage ()
 Edit media pool page.
 saveMediaPoolPage ()
 Save media pool page.
 updateMediaPoolPage ()
 Update media pool page.
 initMediaPoolPageForm ($a_mode="edit")
 Init page form.
 getMediaPoolPageValues ()
 Get current values for media pool page from.
 setMediaPoolPageTabs ()
 Set media pool page tabs.
 showAllMediaPoolPageUsages ()
 List usages of the contnet snippet.
 showMediaPoolPageUsages ($a_all=false)
 List usages of the contnet snippet.
 setTabs ()
 Set tabs.
 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
 infoScreen ()
 show information screen
 selectUploadDirFiles ()
 Select files from upload directory.
 createMediaFromUploadDir ()
 Create media object from upload directory.
- Public Member Functions inherited from ilObject2GUI
 __construct ($a_id=0, $a_id_type=self::REPOSITORY_NODE_ID, $a_parent_node_id=0)
 Constructor.
 delete ()
 Display delete confirmation form (repository/workspace switch)
 confirmedDelete ()
 Delete objects (repository/workspace switch)
 getHTML ()
 withReferences ()
 Final/Private declaration of unchanged parent methods.
 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
 getCreationMode ()
 get creation mode
 isVisible ()
 trash ()
 undelete ()
 cancelDelete ()
 removeFromSystem ()
 cloneAll ()
 view ()
 view object content (repository/workspace switch)
 create ()
 Deleted in ilObject.
 save ()
 edit ()
 update ()
 cancel ()
 importFile ()
 Import.
- Public Member Functions inherited from ilObjectGUI
 ilObjectGUI ($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
 Constructor public.
 getAdminTabs (&$tabs_gui)
 administration tabs show only permissions and trash folder
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled
 cancelDeleteObject ()
 cancel deletion of object
 cancelObject ($in_rep=false)
 cancel action and go back to previous page public
 createObject ()
 create new object form
 cancelCreation ()
 cancel create action and go back to repository parent
 saveObject ()
 save object
 editObject ()
 edit object
 updateObject ()
 updates object entry in object_data
 getFormAction ($a_cmd, $a_formaction="")
 get form action for command (command is method name without "Object", e.g.
 isVisible ($a_ref_id, $a_type)
 viewObject ()
 list childs of current object
 deleteObject ($a_error=false)
 Display deletion confirmation screen.
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI.

Static Public Member Functions

static _goto ($a_target)
 goto target media pool
static getPreviewModalHTML ($a_mpool_ref_id, $a_tpl)
 Get preview modal html.
- Static Public Member Functions inherited from ilObject2GUI
static handleAfterSaveCallback (ilObject $a_obj, $a_callback_ref_id)
 After creation callback.
- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot ($a_raise_error=false)
 Goto repository root.
static _gotoRepositoryNode ($a_ref_id, $a_cmd="frameset")
 Goto repository root.

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.
 initCreationForms ($a_new_type)
 Init creation froms.
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form.
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields.
 updateCustom (ilPropertyFormGUI $a_form)
 Insert custom update form values into object.
 showMedia ()
 show media object
- Protected Member Functions inherited from ilObject2GUI
 assignObject ()
 create object instance as internal property (repository/workspace switch)
 getAccessHandler ()
 Get access handler.
 setLocator ()
 set Locator
 deleteConfirmation ()
 Display delete confirmation form (workspace specific)
 deleteConfirmedObjects ()
 Delete objects (workspace specific)
 prepareOutput ()
 prepare output
 setTitleAndDescription ()
 called by prepare output
 showUpperIcon ()
 omitLocator ($a_omit=true)
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g.
 setTargetFrame ($a_cmd, $a_target_frame)
 set specific target frame for command
 getCenterColumnHTML ()
 Get center column.
 getRightColumnHTML ()
 Display right column.
 setColumnSettings ($column_gui)
 May be overwritten in subclasses.
 checkPermission ($a_perm, $a_cmd="")
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu)
 redirectToRefId ()
 fillCloneTemplate ($a_tpl_varname, $a_type)
 Fill object clone template This method can be called from any object GUI class that wants to offer object cloning.
 fillCloneSearchTemplate ($a_tpl_varname, $a_type)
 searchCloneSource ()
 buildCloneSelect ($existing_objs)
 addAdminLocatorItems ()
 getReturnLocation ()
 Deprecated functions.
 setReturnLocation ()
 showActions ()
 getTitlesByRefId ()
 getTabs ()
 __showButton ()
 hitsperpageObject ()
 __initTableGUI ()
 __setTableGUIBasicData ()
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position.
 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
 Check permission.
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 Add header action menu.
 redrawHeaderAction ()
 Updating icons after ajax call.
 getPermanentLinkWidget ($a_append=null, $a_center=false)
 handleAutoRating (ilObject $a_new_obj)
 Activate rating automatically if parent container setting.
- Protected Member Functions inherited from ilObjectGUI
 insertHeaderAction ($a_list_gui)
 Insert header action into main template.
 addHeaderAction ()
 Add header action menu.
 redrawHeaderActionObject ()
 Ajax call: redraw action header only.
 showMountWebfolderIcon ()
 setAdminTabs ()
 set admin tabs public
 addAdminLocatorItems ($a_do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded)
 getCreationFormsHTML (array $a_forms)
 Get HTML for creation forms (accordion)
 initCreateForm ($a_new_type)
 Init object creation form.
 initDidacticTemplate (ilPropertyFormGUI $form)
 Show didactic template types.
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates.
 getDidacticTemplateVar ($a_type)
 Get didactic template setting from creation screen.
 afterSave (ilObject $a_new_object)
 Post (successful) object creation hook.
 initEditForm ()
 Init object edit form.
 getEditFormValues ()
 Get values for edit form.
 validateCustom (ilPropertyFormGUI $a_form)
 Validate custom values (if not possible with checkInput())
 afterUpdate ()
 Post (successful) object update hook.
 initImportForm ($a_new_type)
 Init object import form.
 importFileObject ($parent_id=null)
 Import.
 afterImport (ilObject $a_new_object)
 Post (successful) object import hook.
 setFormAction ($a_cmd, $a_formaction)
 set specific form action for command
 getReturnLocation ($a_cmd, $a_location="")
 get return location for command (command is method name without "Object", e.g.
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl.
 getTitlesByRefId ($a_ref_ids)
 get Titles of objects this method is used for error messages in methods cut/copy/paste
 getTabs (&$tabs_gui)
 get tabs abstract method.
 __showButton ($a_cmd, $a_text, $a_target= '')
 __setTableGUIBasicData (&$tbl, &$result_set, $a_from="")
 standard implementation for tables use 'from' variable use different initial setting of table
 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
 checkPermission ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission and redirect on error.
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files.

Additional Inherited Members

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

Detailed Description

Member Function Documentation

static ilObjMediaPoolGUI::_goto (   $a_target)
static

goto target media pool

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

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

{
global $ilAccess, $ilErr, $lng;
$targets = explode('_',$a_target);
if(count((array) $targets) > 1)
{
$ref_id = $targets[0];
$subitem_id = $targets[1];
}
else
{
$ref_id = $targets[0];
}
if ($ilAccess->checkAccess("read", "", $ref_id))
{
$_GET["baseClass"] = "ilMediaPoolPresentationGUI";
$_GET["ref_id"] = $ref_id;
$_GET['mepitem_id'] = $subitem_id;
include("ilias.php");
} else if ($ilAccess->checkAccess("visible", "", $ref_id))
{
$_GET["baseClass"] = "ilMediaPoolPresentationGUI";
$_GET["ref_id"] = $ref_id;
$_GET["cmd"] = "infoScreen";
include("ilias.php");
}
else if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID))
{
ilUtil::sendFailure(sprintf($lng->txt("msg_no_perm_read_item"),
}
$ilErr->raiseError($lng->txt("msg_no_perm_read"), $ilErr->FATAL);
}

+ Here is the call graph for this function:

ilObjMediaPoolGUI::addLocatorItems ( )

add locator items for media pool

Reimplemented from ilObject2GUI.

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

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

{
global $ilLocator, $ilAccess;
if (!$this->getCreationMode() && $this->ctrl->getCmd() != "explorer")
{
$tree =& $this->object->getTree();
$obj_id = ($_GET["mepitem_id"] == "")
? $tree->getRootId()
: $_GET["mepitem_id"];
$path = $tree->getPathFull($obj_id);
foreach($path as $node)
{
if ($node["child"] == $tree->getRootId())
{
$this->ctrl->setParameter($this, "mepitem_id", "");
if ($ilAccess->checkAccess("read", "", $this->object->getRefId()))
{
$link = $this->ctrl->getLinkTarget($this, "listMedia");
}
else if ($ilAccess->checkAccess("visible", "", $this->object->getRefId()))
{
$link = $this->ctrl->getLinkTarget($this, "infoScreen");
}
$title = $this->object->getTitle();
$this->ctrl->setParameter($this, "mepitem_id", $_GET["mepitem_id"]);
$ilLocator->addItem($title, $link, "", $_GET["ref_id"]);
}
}
}
}

+ Here is the call graph for this function:

ilObjMediaPoolGUI::afterConstructor ( )
protected

Initialisation.

Reimplemented from ilObject2GUI.

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

References ilObjectGUI\$lng.

{
global $lng;
$lng->loadLanguageModule("mep");
if ($this->ctrl->getCmd() == "explorer")
{
$this->ctrl->saveParameter($this, array("ref_id"));
}
else
{
$this->ctrl->saveParameter($this, array("ref_id", "mepitem_id"));
}
$this->ctrl->saveParameter($this, array("mep_mode"));
$lng->loadLanguageModule("content");
}
ilObjMediaPoolGUI::afterSave (   $newObj)

save object

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

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

{
// always send a message
ilUtil::sendSuccess($this->lng->txt("object_added"),true);
//ilUtil::redirect($this->getReturnLocation("save","adm_object.php?".$this->link_params));
ilUtil::redirect("ilias.php?baseClass=ilMediaPoolPresentationGUI&ref_id=".$newObj->getRefId()."&cmd=listMedia");
}

+ Here is the call graph for this function:

ilObjMediaPoolGUI::allMedia ( )

list all objects

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

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

Referenced by applyFilter(), and resetFilter().

{
global $tree, $ilAccess, $tpl, $ilTabs, $ilCtrl,$ilUser;
$ilCtrl->setParameter($this, "mep_mode", "allMedia");
$this->checkPermission("read");
$ilTabs->setTabActive("mep_all_mobs");
include_once("./Modules/MediaPool/classes/class.ilMediaPoolTableGUI.php");
$mep_table_gui = new ilMediaPoolTableGUI($this, "allMedia", $this->object,
"mepitem_id", ilMediaPoolTableGUI::IL_MEP_EDIT, true);
if(isset($_GET['force_filter']) and $_GET['force_filter'])
{
$_POST['title'] = ilMediaPoolItem::lookupTitle((int) $_GET['force_filter']);
include_once("./Services/Table/classes/class.ilTablePropertiesStorage.php");
$tprop = new ilTablePropertiesStorage();
$tprop->storeProperty(
$mep_table_gui->getId(),
$ilUser->getId(),
'filter',
1
);
$mep_table_gui->resetFilter();
$mep_table_gui->resetOffset();
$mep_table_gui->writeFilterToSession();
// Read again
$mep_table_gui = new ilMediaPoolTableGUI($this, "allMedia", $this->object,
"mepitem_id", ilMediaPoolTableGUI::IL_MEP_EDIT, true);
}
$tpl->setContent($mep_table_gui->getHTML());
// $this->tpl->show();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjMediaPoolGUI::applyFilter ( )

Apply filter.

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

References allMedia(), and ilMediaPoolTableGUI\IL_MEP_EDIT.

{
include_once("./Modules/MediaPool/classes/class.ilMediaPoolTableGUI.php");
$mtab = new ilMediaPoolTableGUI($this, "allMedia", $this->object,
"mepitem_id", ilMediaPoolTableGUI::IL_MEP_EDIT, true);
$mtab->writeFilterToSession();
$mtab->resetOffset();
$this->allMedia();
}

+ Here is the call graph for this function:

ilObjMediaPoolGUI::cancelFolderUpdate ( )

Cancel save.

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

References $_GET, and $ilCtrl.

{
global $ilCtrl;
$ilCtrl->setParameter($this, "mepitem_id",
$this->object->getTree()->getParentId($_GET["mepitem_id"]));
$ilCtrl->redirect($this, "listMedia");
}
ilObjMediaPoolGUI::cancelRemove ( )

cancel deletion of media objects/folders

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

References $_GET.

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

Cancel save.

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

References $ilCtrl.

{
global $ilCtrl;
$ilCtrl->redirect($this, "listMedia");
}
ilObjMediaPoolGUI::confirmRemove ( )

confirm remove of mobs

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

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

{
global $ilAccess, $ilCtrl, $lng;
$this->checkPermission("write");
if(!isset($_POST["id"]))
{
$this->ilias->raiseError($this->lng->txt("no_checkbox"),$this->ilias->error_obj->MESSAGE);
}
// display confirmation message
include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
$cgui = new ilConfirmationGUI();
$cgui->setFormAction($this->ctrl->getFormAction($this));
$cgui->setHeaderText($this->lng->txt("info_delete_sure"));
$cgui->setCancel($this->lng->txt("cancel"), "cancelRemove");
$cgui->setConfirm($this->lng->txt("confirm"), "remove");
foreach($_POST["id"] as $obj_id)
{
$type = ilMediaPoolItem::lookupType($obj_id);
$title = ilMediaPoolItem::lookupTitle($obj_id);
// check whether page can be removed
$add = "";
if ($type == "pg")
{
include_once("./Services/COPage/classes/class.ilPageContentUsage.php");
$usages = ilPageContentUsage::getUsages("incl", $obj_id, false);
if (count($usages) > 0)
{
ilUtil::sendFailure(sprintf($lng->txt("mep_content_snippet_in_use"), $title), true);
$ilCtrl->redirect($this, "listMedia");
}
else
{
// check whether the snippet is used in older versions of pages
$usages = ilPageContentUsage::getUsages("incl", $obj_id, true);
if (count($usages) > 0)
{
$add = "<div class='small'>".$lng->txt("mep_content_snippet_used_in_older_versions")."</div>";
}
}
}
$caption = ilUtil::getImageTagByType($type, $this->tpl->tplPath).
" ".$title.$add;
$cgui->addItem("id[]", $obj_id, $caption);
}
$this->tpl->setContent($cgui->getHTML());
}

+ Here is the call graph for this function:

ilObjMediaPoolGUI::copyToClipboard ( )

copy media objects to clipboard

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

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

{
global $ilUser, $ilAccess;
$this->checkPermission("write");
if(!isset($_POST["id"]))
{
ilUtil::sendFailure($this->lng->txt("no_checkbox"), true);
$this->ctrl->redirect($this, $_GET["mep_mode"] ? $_GET["mep_mode"] : "listMedia");
}
foreach ($_POST["id"] as $obj_id)
{
$type = ilMediaPoolItem::lookupType($obj_id);
if ($type == "fold")
{
ilUtil::sendFailure($this->lng->txt("cont_cant_copy_folders"), true);
$this->ctrl->redirect($this, $_GET["mep_mode"] ? $_GET["mep_mode"] : "listMedia");
}
}
foreach ($_POST["id"] as $obj_id)
{
$type = ilMediaPoolItem::lookupType($obj_id);
if ($type == "mob")
{
$ilUser->addObjectToClipboard($fid, "mob", "");
}
if ($type == "pg")
{
$ilUser->addObjectToClipboard($obj_id, "incl", "");
}
}
ilUtil::sendSuccess($this->lng->txt("copied_to_clipboard"),true);
$this->ctrl->redirect($this, $_GET["mep_mode"] ? $_GET["mep_mode"] : "listMedia");
}

+ Here is the call graph for this function:

ilObjMediaPoolGUI::createFolderForm ( )

create folder form

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

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

{
global $ilAccess, $tpl;
$this->checkPermission("write");
$this->initFolderForm("create");
$tpl->setContent($this->form->getHTML());
/* $folder_gui =& new ilObjFolderGUI("", 0, false, false);
$this->ctrl->setParameterByClass("ilobjfoldergui", "obj_id", $_GET["obj_id"]);
$folder_gui->setFormAction("save",
$this->ctrl->getFormActionByClass("ilobjfoldergui"));
$folder_gui->createObject();*/
// $this->tpl->show();
}

+ Here is the call graph for this function:

ilObjMediaPoolGUI::createMediaFromUploadDir ( )

Create media object from upload directory.

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

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

{
$this->checkPermission("write");
$mset = new ilSetting("mobs");
$upload_dir = trim($mset->get("upload_dir"));
include_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
{
foreach ($_POST["file"] as $f)
{
$f = str_replace("..", "", $f);
$fullpath = $upload_dir."/".$f;
$mob = new ilObjMediaObject();
$mob->setTitle(basename($fullpath));
$mob->setDescription("");
$mob->create();
// determine and create mob directory, move uploaded file to directory
//$mob_dir = ilUtil::getWebspaceDir()."/mobs/mm_".$a_mob->getId();
$mob->createDirectory();
$mob_dir = ilObjMediaObject::_getDirectory($mob->getId());
$media_item = new ilMediaItem();
$mob->addMediaItem($media_item);
$media_item->setPurpose("Standard");
$file = $mob_dir."/".basename($fullpath);
basename($fullpath), $file, false, $_POST["action"]);
// get mime type
$location = basename($fullpath);
// set real meta and object data
$media_item->setFormat($format);
$media_item->setLocation($location);
$media_item->setLocationType("LocalFile");
$mob->setDescription($format);
// determine width and height of known image types
$wh = ilObjMediaObject::_determineWidthHeight(500, 400, $format,
"File", $mob_dir."/".$location, $media_item->getLocation(),
true, true, "", "");
$media_item->setWidth($wh["width"]);
$media_item->setHeight($wh["height"]);
if ($wh["info"] != "")
{
// ilUtil::sendInfo($wh["info"], true);
}
$media_item->setHAlign("Left");
$mob->update();
// put it into current folder
$mep_item = new ilMediaPoolItem();
$mep_item->setTitle($mob->getTitle());
$mep_item->setType("mob");
$mep_item->setForeignId($mob->getId());
$mep_item->create();
$tree = $this->object->getTree();
$parent = ($_GET["mepitem_id"] == "")
? $tree->getRootId()
: $_GET["mepitem_id"];
$tree->insertNode($mep_item->getId(), $parent);
}
}
ilUtil::redirect("ilias.php?baseClass=ilMediaPoolPresentationGUI&cmd=listMedia&ref_id=".
$_GET["ref_id"]."&mepitem_id=".$_GET["mepitem_id"]);
}

+ Here is the call graph for this function:

ilObjMediaPoolGUI::createMediaObject ( )

obsolete?

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

{
$this->ctrl->redirectByClass("ilobjmediaobjectgui", "create");
}
ilObjMediaPoolGUI::createMediaPoolPage ( )

Create new content snippet.

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

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

{
global $tpl;
$this->checkPermission("write");
$this->initMediaPoolPageForm("create");
$tpl->setContent($this->form->getHTML());
}

+ Here is the call graph for this function:

ilObjMediaPoolGUI::editFolder ( )

Edit folder.

Parameters
@return

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

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

{
global $tpl;
$this->checkPermission("write");
$this->initFolderForm();
$this->getFolderValues();
$tpl->setContent($this->form->getHTML());
}

+ Here is the call graph for this function:

ilObjMediaPoolGUI::editMediaPoolPage ( )

Edit media pool page.

Parameters
@return

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

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

{
global $tpl;
$this->checkPermission("write");
include_once("./Modules/MediaPool/classes/class.ilMediaPoolPageGUI.php");
$mep_page_gui = new ilMediaPoolPageGUI($_GET["mepitem_id"], $_GET["old_nr"]);
$mep_page_gui->getTabs();
$this->initMediaPoolPageForm("edit");
$tpl->setContent($this->form->getHTML());
}

+ Here is the call graph for this function:

& ilObjMediaPoolGUI::executeCommand ( )

execute command

Reimplemented from ilObject2GUI.

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

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

{
global $ilTabs, $lng, $ilAccess, $tpl, $ilCtrl;
if ($this->ctrl->getRedirectSource() == "ilinternallinkgui")
{
$this->explorer();
return;
}
$next_class = $this->ctrl->getNextClass($this);
$cmd = $this->ctrl->getCmd();
$new_type = $_POST["new_type"]
? $_POST["new_type"]
: $_GET["new_type"];
if ($new_type != "" && ($cmd != "confirmRemove" && $cmd != "copyToClipboard"
&& $cmd != "pasteFromClipboard"))
{
$this->setCreationMode(true);
}
if (!$this->getCreationMode())
{
$tree =& $this->object->getTree();
if ($_GET["mepitem_id"] == "")
{
$_GET["mepitem_id"] = $tree->getRootId();
}
}
if ($cmd == "create")
{
switch($_POST["new_type"])
{
case "mob":
$this->ctrl->redirectByClass("ilobjmediaobjectgui", "create");
break;
case "fold":
$this->ctrl->redirectByClass("ilobjfoldergui", "create");
break;
}
}
switch($next_class)
{
case 'ilmediapoolpagegui':
$this->checkPermission("write");
$this->prepareOutput();
$this->addHeaderAction();
include_once("./Modules/MediaPool/classes/class.ilMediaPoolPageGUI.php");
$mep_page_gui = new ilMediaPoolPageGUI($_GET["mepitem_id"], $_GET["old_nr"]);
if (!$ilAccess->checkAccess("write", "", $this->object->getRefId()))
{
$mep_page_gui->setEnableEditing(false);
}
$ret = $this->ctrl->forwardCommand($mep_page_gui);
if ($ret != "")
{
$tpl->setContent($ret);
}
$this->tpl->show();
break;
case "ilobjmediaobjectgui":
$this->checkPermission("write");
//$cmd.="Object";
if ($cmd == "create" || $cmd == "save" || $cmd == "cancel")
{
$ret_obj = $_GET["mepitem_id"];
$ilObjMediaObjectGUI =& new ilObjMediaObjectGUI("", 0, false, false);
$ilObjMediaObjectGUI->setWidthPreset($this->object->getDefaultWidth());
$ilObjMediaObjectGUI->setHeightPreset($this->object->getDefaultHeight());
}
else
{
$ret_obj = $tree->getParentId($_GET["mepitem_id"]);
$ilObjMediaObjectGUI =& new ilObjMediaObjectGUI("", ilMediaPoolItem::lookupForeignId($_GET["mepitem_id"]), false, false);
$this->ctrl->setParameter($this, "mepitem_id", $this->getParentFolderId());
$ilTabs->setBackTarget($lng->txt("back"),
$this->ctrl->getLinkTarget($this,
$_GET["mep_mode"] ? $_GET["mep_mode"] : "listMedia"));
}
if ($this->ctrl->getCmdClass() == "ilinternallinkgui")
{
$this->ctrl->setReturn($this, "explorer");
}
else
{
$this->ctrl->setParameter($this, "mepitem_id", $ret_obj);
$this->ctrl->setReturn($this,
$_GET["mep_mode"] ? $_GET["mep_mode"] : "listMedia");
$this->ctrl->setParameter($this, "mepitem_id", $_GET["mepitem_id"]);
}
$this->getTemplate();
$ilObjMediaObjectGUI->setTabs();
$this->setLocator();
//$ret =& $ilObjMediaObjectGUI->executeCommand();
$ret = $this->ctrl->forwardCommand($ilObjMediaObjectGUI);
if ($cmd == "save" && $ret != false)
{
$mep_item = new ilMediaPoolItem();
$mep_item->setTitle($ret->getTitle());
$mep_item->setType("mob");
$mep_item->setForeignId($ret->getId());
$mep_item->create();
$parent = ($_GET["mepitem_id"] == "")
? $tree->getRootId()
: $_GET["mepitem_id"];
$tree->insertNode($mep_item->getId(), $parent);
ilUtil::redirect("ilias.php?baseClass=ilMediaPoolPresentationGUI&cmd=listMedia&ref_id=".
$_GET["ref_id"]."&mepitem_id=".$_GET["mepitem_id"]);
}
else
{
$this->tpl->show();
}
break;
case "ilobjfoldergui":
$this->checkPermission("write");
$this->addHeaderAction();
$folder_gui = new ilObjFolderGUI("", 0, false, false);
$this->ctrl->setReturn($this, "listMedia");
$cmd.="Object";
switch($cmd)
{
case "createObject":
$this->prepareOutput();
$folder_gui =& new ilObjFolderGUI("", 0, false, false);
$folder_gui->setFormAction("save",
$this->ctrl->getFormActionByClass("ilobjfoldergui"));
$folder_gui->createObject();
$this->tpl->show();
break;
case "saveObject":
//$folder_gui->setReturnLocation("save", $this->ctrl->getLinkTarget($this, "listMedia"));
$parent = ($_GET["mepitem_id"] == "")
? $tree->getRootId()
: $_GET["mepitem_id"];
$folder_gui->setFolderTree($tree);
$folder_gui->saveObject($parent);
//$this->ctrl->redirect($this, "listMedia");
break;
case "editObject":
$this->prepareOutput();
$folder_gui =& new ilObjFolderGUI("", ilMediaPoolItem::lookupForeignId($_GET["mepitem_id"]), false, false);
$this->ctrl->setParameter($this, "foldereditmode", "1");
$folder_gui->setFormAction("update", $this->ctrl->getFormActionByClass("ilobjfoldergui"));
$folder_gui->editObject();
$this->tpl->show();
break;
case "updateObject":
$folder_gui =& new ilObjFolderGUI("", ilMediaPoolItem::lookupForeignId($_GET["mepitem_id"]), false, false);
$this->ctrl->setParameter($this, "mepitem_id", $this->getParentFolderId());
$this->ctrl->setReturn($this, "listMedia");
$folder_gui->updateObject(true); // this returns to parent
break;
case "cancelObject":
if ($_GET["foldereditmode"])
{
$this->ctrl->setParameter($this, "mepitem_id", $this->getParentFolderId());
}
$this->ctrl->redirect($this, "listMedia");
break;
}
break;
case "ileditclipboardgui":
$this->prepareOutput();
$this->addHeaderAction();
$this->ctrl->setReturn($this, $_GET["mep_mode"] ? $_GET["mep_mode"] : "listMedia");
$clip_gui = new ilEditClipboardGUI();
$clip_gui->setMultipleSelections(true);
$clip_gui->setInsertButtonTitle($lng->txt("mep_copy_to_mep"));
$ilTabs->setTabActive("clipboard");
//$ret =& $clip_gui->executeCommand();
$ret =& $this->ctrl->forwardCommand($clip_gui);
$this->tpl->show();
break;
case 'ilinfoscreengui':
$this->prepareOutput();
$this->addHeaderAction();
$this->infoScreen();
$this->tpl->show();
break;
case 'ilpermissiongui':
$this->checkPermission("edit_permission");
$this->prepareOutput();
$this->addHeaderAction();
include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
$perm_gui =& new ilPermissionGUI($this);
$ret =& $this->ctrl->forwardCommand($perm_gui);
$this->tpl->show();
break;
case "ilexportgui":
$this->checkPermission("write");
$this->prepareOutput();
$this->addHeaderAction();
include_once("./Services/Export/classes/class.ilExportGUI.php");
$exp_gui = new ilExportGUI($this);
$exp_gui->addFormat("xml");
$ret = $this->ctrl->forwardCommand($exp_gui);
$this->tpl->show();
break;
case "ilfilesystemgui":
$this->checkPermission("write");
$this->prepareOutput();
$this->addHeaderAction();
$ilTabs->clearTargets();
$ilTabs->setBackTarget($lng->txt("back"),
$ilCtrl->getLinkTarget($this, "listMedia"));
$mset = new ilSetting("mobs");
if (trim($mset->get("upload_dir")) != "")
{
include_once("./Services/FileSystem/classes/class.ilFileSystemGUI.php");
$fs_gui = new ilFileSystemGUI($mset->get("upload_dir"));
$fs_gui->setPostDirPath(true);
$fs_gui->setTableId("mepud".$this->object->getId());
$fs_gui->setAllowFileCreation(false);
$fs_gui->setAllowDirectoryCreation(false);
$fs_gui->clearCommands();
$fs_gui->addCommand($this, "selectUploadDirFiles", $this->lng->txt("mep_sel_upload_dir_files"),
false, true);
//$fs_gui->addCommand($this, "assignFullscreenObject", $this->lng->txt("cont_assign_full"));
$ret =& $this->ctrl->forwardCommand($fs_gui);
}
$this->tpl->show();
break;
case "ilcommonactiondispatchergui":
include_once("Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
$this->ctrl->forwardCommand($gui);
break;
default:
$this->prepareOutput();
$this->addHeaderAction();
$cmd = $this->ctrl->getCmd("listMedia");
$this->$cmd();
if (!$this->getCreationMode())
{
$this->tpl->show();
}
break;
}
}

+ Here is the call graph for this function:

ilObjMediaPoolGUI::getEditFormCustomValues ( array &  $a_values)
protected

Add values to custom edit fields.

Parameters
array$a_values

Reimplemented from ilObjectGUI.

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

{
if ($this->object->getDefaultWidth() > 0)
{
$a_values["default_width"] = $this->object->getDefaultWidth();
}
if ($this->object->getDefaultHeight() > 0)
{
$a_values["default_height"] = $this->object->getDefaultHeight();
}
}
ilObjMediaPoolGUI::getFolderValues ( )

Get current values for folder from.

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

References $_GET, and ilMediaPoolItem\lookupTitle().

Referenced by editFolder().

{
$values = array();
$values["title"] = ilMediaPoolItem::lookupTitle($_GET["mepitem_id"]);
$this->form->setValuesByArray($values);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjMediaPoolGUI::getMediaPoolPageValues ( )

Get current values for media pool page from.

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

References $_GET, and ilMediaPoolItem\lookupTitle().

Referenced by editMediaPoolPage().

{
$values = array();
include_once("./Modules/MediaPool/classes/class.ilMediaPoolItem.php");
$values["title"] = ilMediaPoolItem::lookupTitle($_GET["mepitem_id"]);
$this->form->setValuesByArray($values);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjMediaPoolGUI::getParentFolderId ( )

Get folder parent ID.

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

References $_GET.

Referenced by executeCommand().

{
if ($_GET["mepitem_id"] == "")
{
return "";
}
$par_id = $this->object->tree->getParentId($_GET["mepitem_id"]);
if ($par_id != $this->object->tree->getRootId())
{
return $par_id;
}
else
{
return "";
}
}

+ Here is the caller graph for this function:

static ilObjMediaPoolGUI::getPreviewModalHTML (   $a_mpool_ref_id,
  $a_tpl 
)
static

Get preview modal html.

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

References $_GET, $ilCtrl, ilObjectGUI\$lng, ilObjectGUI\$tpl, ilModalGUI\getInstance(), ilObjMediaObjectGUI\includePresentationJS(), and ilModalGUI\TYPE_LARGE.

Referenced by ilMediaPoolTableGUI\getHTML().

{
global $tpl, $ilCtrl, $lng;
require_once("./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
$tpl->addJavaScript("./Modules/MediaPool/js/ilMediaPool.js");
$ilCtrl->setParameterByClass("ilobjmediapoolgui", "mepitem_id", "");
$ilCtrl->setParameterByClass("ilobjmediapoolgui", "ref_id", $a_mpool_ref_id);
$tpl->addOnloadCode("il.MediaPool.setPreviewUrl('".$ilCtrl->getLinkTargetByClass(array("ilmediapoolpresentationgui", "ilobjmediapoolgui"), "showPreview", "", false, false)."');");
$ilCtrl->setParameterByClass("ilobjmediapoolgui", "mepitem_id", $_GET["mepitem_id"]);
$ilCtrl->setParameterByClass("ilobjmediapoolgui", "ref_id", $_GET["red_id"]);
include_once("./Services/UIComponent/Modal/classes/class.ilModalGUI.php");
$modal->setHeading($lng->txt("preview"));
$modal->setId("ilMepPreview");
$modal->setType(ilModalGUI::TYPE_LARGE);
$modal->setBody("<iframe id='ilMepPreviewContent'></iframe>");
return $modal->getHTML();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjMediaPoolGUI::getTemplate ( )

Get standard template.

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

Referenced by executeCommand().

{
$this->tpl->getStandardTemplate();
}

+ Here is the caller graph for this function:

ilObjMediaPoolGUI::getType ( )
final

Get type.

Reimplemented from ilObject2GUI.

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

{
return "mep";
}
ilObjMediaPoolGUI::infoScreen ( )

show information screen

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

References $_GET.

Referenced by executeCommand(), and infoScreenObject().

{
global $ilAccess;
if (!$ilAccess->checkAccess("visible", "", $this->ref_id) &&
!$ilAccess->checkAccess("read", "", $this->ref_id) &&
!$ilAccess->checkAccess("write", "", $this->ref_id))
{
$this->ilias->raiseError($this->lng->txt("msg_no_perm_read"),$this->ilias->error_obj->MESSAGE);
}
if ($this->ctrl->getCmd() == "infoScreen")
{
$this->ctrl->setCmd("showSummary");
$this->ctrl->setCmdClass("ilinfoscreengui");
}
include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
$info = new ilInfoScreenGUI($this);
$info->enablePrivateNotes();
if ($ilAccess->checkAccess("read", "", $_GET["ref_id"]))
{
//$info->enableNews();
}
// no news editing for files, just notifications
// $info->enableNewsEditing(false);
if ($ilAccess->checkAccess("write", "", $_GET["ref_id"]))
{
// $news_set = new ilSetting("news");
// $enable_internal_rss = $news_set->get("enable_rss_for_internal");
// if ($enable_internal_rss)
// {
// $info->setBlockProperty("news", "settings", true);
// $info->setBlockProperty("news", "public_notifications_option", true);
// }
}
// standard meta data
$info->addMetaDataSections($this->object->getId(),0, $this->object->getType());
// forward the command
$this->ctrl->forwardCommand($info);
// $this->tpl->show();
}

+ Here is the caller graph for this function:

ilObjMediaPoolGUI::infoScreenObject ( )

this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually, if everything works through ilCtrl in the future this may be changed

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

References infoScreen().

{
$this->ctrl->setCmd("showSummary");
$this->ctrl->setCmdClass("ilinfoscreengui");
$this->infoScreen();
}

+ Here is the call graph for this function:

ilObjMediaPoolGUI::initCreationForms (   $a_new_type)
protected

Init creation froms.

this will create the default creation forms: new, import, clone

Parameters
string$a_new_type
Returns
array

Reimplemented from ilObject2GUI.

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

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

{
$forms = array(self::CFORM_NEW => $this->initCreateForm($a_new_type),
self::CFORM_IMPORT => $this->initImportForm($a_new_type));
return $forms;
}

+ Here is the call graph for this function:

ilObjMediaPoolGUI::initEditCustomForm ( ilPropertyFormGUI  $a_form)
protected

Add custom fields to update form.

Parameters
ilPropertyFormGUI$a_form

Reimplemented from ilObjectGUI.

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

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

{
// default width
$ni = new ilNumberInputGUI($this->lng->txt("mep_default_width"), "default_width");
$ni->setMinValue(0);
$ni->setSuffix("px");
$ni->setMaxLength(5);
$ni->setSize(5);
$a_form->addItem($ni);
// default height
$ni = new ilNumberInputGUI($this->lng->txt("mep_default_height"), "default_height");
$ni->setSuffix("px");
$ni->setMinValue(0);
$ni->setMaxLength(5);
$ni->setSize(5);
$ni->setInfo($this->lng->txt("mep_default_width_height_info"));
$a_form->addItem($ni);
}

+ Here is the call graph for this function:

ilObjMediaPoolGUI::initFolderForm (   $a_mode = "edit")

Init folder form.

Parameters
int$a_modeEdit Mode

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

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

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

{
global $lng, $ilCtrl;
include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
$this->form = new ilPropertyFormGUI();
// desc
$ti = new ilTextInputGUI($lng->txt("title"), "title");
$ti->setMaxLength(128);
$ti->setRequired(true);
$this->form->addItem($ti);
// save and cancel commands
if ($a_mode == "create")
{
$this->form->addCommandButton("saveFolder", $lng->txt("save"));
$this->form->addCommandButton("cancelSave", $lng->txt("cancel"));
$this->form->setTitle($lng->txt("mep_new_folder"));
}
else
{
$this->form->addCommandButton("updateFolder", $lng->txt("save"));
$this->form->addCommandButton("cancelFolderUpdate", $lng->txt("cancel"));
$this->form->setTitle($lng->txt("mep_edit_folder"));
}
$this->form->setFormAction($ilCtrl->getFormAction($this));
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjMediaPoolGUI::initMediaPoolPageForm (   $a_mode = "edit")

Init page form.

Parameters
int$a_modeEdit Mode

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

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

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

{
global $lng, $ilCtrl;
include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
$this->form = new ilPropertyFormGUI();
// title
$ti = new ilTextInputGUI($lng->txt("title"), "title");
$ti->setMaxLength(128);
$ti->setRequired(true);
$this->form->addItem($ti);
// save and cancel commands
if ($a_mode == "create")
{
$this->form->addCommandButton("saveMediaPoolPage", $lng->txt("save"));
$this->form->addCommandButton("cancelSave", $lng->txt("cancel"));
$this->form->setTitle($lng->txt("mep_new_content_snippet"));
}
else
{
$this->form->addCommandButton("updateMediaPoolPage", $lng->txt("save"));
$this->form->setTitle($lng->txt("mep_edit_content_snippet"));
}
$this->form->setFormAction($ilCtrl->getFormAction($this));
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjMediaPoolGUI::insertFromClipboard ( )

insert media object from clipboard

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

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

{
global $ilAccess;
$this->checkPermission("write");
include_once("./Services/Clipboard/classes/class.ilEditClipboardGUI.php");
$not_inserted = array();
if (is_array($ids))
{
foreach ($ids as $id2)
{
$id = explode(":", $id2);
$type = $id[0];
$id = $id[1];
if ($type == "mob") // media object
{
if (ilObjMEdiaPool::isForeignIdInTree($this->object->getId(), $id))
{
$not_inserted[] = ilObject::_lookupTitle($id)." [".
$id."]";
}
else
{
$item = new ilMediaPoolItem();
$item->setType("mob");
$item->setForeignId($id);
$item->setTitle(ilObject::_lookupTitle($id));
$item->create();
if ($item->getId() > 0)
{
$this->object->insertInTree($item->getId(), $_GET["mepitem_id"]);
}
}
}
if ($type == "incl") // content snippet
{
include_once("./Modules/MediaPool/classes/class.ilMediaPoolPage.php");
include_once("./Modules/MediaPool/classes/class.ilMediaPoolItem.php");
if (ilObjMEdiaPool::isItemIdInTree($this->object->getId(), $id))
{
$not_inserted[] = ilMediaPoolPage::lookupTitle($id)." [".
$id."]";
}
else
{
$original = new ilMediaPoolPage($id);
// copy the page into the pool
$item = new ilMediaPoolItem();
$item->setType("pg");
$item->setTitle(ilMediaPoolItem::lookupTitle($id));
$item->create();
if ($item->getId() > 0)
{
$this->object->insertInTree($item->getId(), $_GET["mepitem_id"]);
// create page
include_once("./Modules/MediaPool/classes/class.ilMediaPoolPage.php");
$page = new ilMediaPoolPage();
$page->setId($item->getId());
$page->create();
// copy content
$original->copy($page->getId(), $page->getParentType(), $page->getParentId(), true);
//$page->setXMLContent($original->copyXMLContent());
//$page->buildDom();
//$page->update();
}
}
}
}
}
if (count($not_inserted) > 0)
{
ilUtil::sendInfo($this->lng->txt("mep_not_insert_already_exist")."<br>".
implode($not_inserted,"<br>"), true);
}
$this->ctrl->redirect($this, $_GET["mep_mode"] ? $_GET["mep_mode"] : "listMedia");
}

+ Here is the call graph for this function:

ilObjMediaPoolGUI::listMedia ( )

list media objects

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

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

{
global $tree, $ilAccess, $tpl, $ilTabs, $ilCtrl, $ilToolbar, $lng, $ilErr;
$ilCtrl->setParameter($this, "mep_mode", "listMedia");
$this->checkPermission("read");
$ilTabs->setTabActive("objs_fold");
if ($ilAccess->checkAccess("write", "", $this->object->getRefId()))
{
$ilToolbar->addButton($lng->txt("mep_create_mob"),
$ilCtrl->getLinkTarget($this, "createMediaObject"));
$mset = new ilSetting("mobs");
if ($mset->get("mep_activate_pages"))
{
$ilToolbar->addButton($lng->txt("mep_create_content_snippet"),
$ilCtrl->getLinkTarget($this, "createMediaPoolPage"));
}
$ilToolbar->addButton($lng->txt("mep_create_folder"),
$ilCtrl->getLinkTarget($this, "createFolderForm"));
if (trim($mset->get("upload_dir")) != "" && ilMainMenuGUI::_checkAdministrationPermission())
{
$ilToolbar->addButton($lng->txt("mep_create_from_upload_dir"),
$ilCtrl->getLinkTargetByClass("ilfilesystemgui", "listFiles"));
}
}
// tree
include_once("./Modules/MediaPool/classes/class.ilMediaPoolExplorerGUI.php");
$exp = new ilMediaPoolExplorerGUI($this, "listMedia", $this->object);
if (!$exp->handleCommand())
{
$this->tpl->setLeftNavContent($exp->getHTML());
}
else
{
return;
}
include_once("./Modules/MediaPool/classes/class.ilMediaPoolTableGUI.php");
$mep_table_gui = new ilMediaPoolTableGUI($this, "listMedia", $this->object, "mepitem_id");
$tpl->setContent($mep_table_gui->getHTML());
// $this->tpl->show();
}

+ Here is the call graph for this function:

ilObjMediaPoolGUI::openClipboard ( )

paste from clipboard

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

References $ilCtrl, and ilObject2GUI\checkPermission().

{
global $ilCtrl, $ilAccess;
$this->checkPermission("write");
$ilCtrl->setParameterByClass("ileditclipboardgui", "returnCommand",
rawurlencode($ilCtrl->getLinkTarget($this,
"insertFromClipboard", "", false, false)));
$ilCtrl->redirectByClass("ilEditClipboardGUI", "getObject");
}

+ Here is the call graph for this function:

ilObjMediaPoolGUI::remove ( )

confirm deletion of

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

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

{
global $ilAccess;
$this->checkPermission("write");
foreach($_POST["id"] as $obj_id)
{
$this->object->deleteChild($obj_id);
}
ilUtil::sendSuccess($this->lng->txt("cont_obj_removed"),true);
$this->ctrl->redirect($this, $_GET["mep_mode"] ? $_GET["mep_mode"] : "listMedia");
}

+ Here is the call graph for this function:

ilObjMediaPoolGUI::resetFilter ( )

Reset filter.

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

References allMedia(), and ilMediaPoolTableGUI\IL_MEP_EDIT.

{
include_once("./Modules/MediaPool/classes/class.ilMediaPoolTableGUI.php");
$mtab = new ilMediaPoolTableGUI($this, "allMedia", $this->object,
"mepitem_id", ilMediaPoolTableGUI::IL_MEP_EDIT, true);
$mtab->resetFilter();
$mtab->resetOffset();
$this->allMedia();
}

+ Here is the call graph for this function:

ilObjMediaPoolGUI::saveFolder ( )

Save folder form.

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

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

{
global $tpl, $lng, $ilCtrl;
$this->checkPermission("write");
$this->initFolderForm("create");
if ($this->form->checkInput())
{
if ($this->object->createFolder($_POST["title"], (int) $_GET["mepitem_id"]))
{
ilUtil::sendSuccess($lng->txt("mep_folder_created"), true);
}
$ilCtrl->redirect($this, "listMedia");
}
$this->form->setValuesByPost();
$tpl->setContent($this->form->getHtml());
}

+ Here is the call graph for this function:

ilObjMediaPoolGUI::saveMediaPoolPage ( )

Save media pool page.

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

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

{
global $tpl, $lng, $ilCtrl;
$this->checkPermission("write");
$this->initMediaPoolPageForm("create");
if ($this->form->checkInput())
{
// create media pool item
include_once("./Modules/MediaPool/classes/class.ilMediaPoolItem.php");
$item = new ilMediaPoolItem();
$item->setTitle($_POST["title"]);
$item->setType("pg");
$item->create();
if ($item->getId() > 0)
{
// put in tree
$tree = $this->object->getTree();
$parent = $_GET["mepitem_id"] > 0
? $_GET["mepitem_id"]
: $tree->getRootId();
$this->object->insertInTree($item->getId(), $parent);
// create page
include_once("./Modules/MediaPool/classes/class.ilMediaPoolPage.php");
$page = new ilMediaPoolPage();
$page->setId($item->getId());
$page->create();
$ilCtrl->setParameterByClass("ilmediapoolpagegui", "mepitem_id", $item->getId());
$ilCtrl->redirectByClass("ilmediapoolpagegui", "edit");
}
$ilCtrl->redirect($this, "listMedia");
}
$this->form->setValuesByPost();
$tpl->setContent($this->form->getHtml());
}

+ Here is the call graph for this function:

ilObjMediaPoolGUI::selectUploadDirFiles ( )

Select files from upload directory.

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

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

{
global $tpl, $ilTabs, $lng, $ilCtrl, $ilToolbar;
$ilTabs->clearTargets();
$ilTabs->setBackTarget($lng->txt("back"),
$ilCtrl->getLinkTarget($this, "listMedia"));
$this->checkPermission("write");
{
// action type
include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
$options = array(
"rename" => $lng->txt("mep_up_dir_move"),
"copy" => $lng->txt("mep_up_dir_copy"),
);
$si = new ilSelectInputGUI("", "action");
$si->setOptions($options);
$ilToolbar->addInputItem($si);
$ilToolbar->setCloseFormTag(false);
$ilToolbar->setFormAction($ilCtrl->getFormAction($this));
$ilToolbar->setFormName("mep_up_form");
include_once("./Modules/MediaPool/classes/class.ilUploadDirFilesTableGUI.php");
$tab = new ilUploadDirFilesTableGUI($this, "selectUploadDirFiles",
$_POST["file"]);
$tab->setFormName("mep_up_form");
$tpl->setContent($tab->getHTML());
}
}

+ Here is the call graph for this function:

ilObjMediaPoolGUI::setMediaPoolPageTabs ( )

Set media pool page tabs.

Parameters
@return

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

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

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

{
global $ilTabs, $ilCtrl, $lng;
$ilTabs->clearTargets();
//$ilTabs->addTab("mep_pg_prop", $lng->txt("mep_page_properties"),
// $ilCtrl->getLinkTarget($this, "editMediaPoolPage"));
$ilTabs->addTarget("mep_page_properties", $ilCtrl->getLinkTarget($this, "editMediaPoolPage"),
"editMediaPoolPage", get_class($this));
$ilTabs->addTarget("cont_usage", $ilCtrl->getLinkTarget($this, "showMediaPoolPageUsages"),
array("showMediaPoolPageUsages", "showAllMediaPoolPageUsages"), get_class($this));
$ilCtrl->setParameter($this, "mepitem_id", $this->object->tree->getParentId($_GET["mepitem_id"]));
$ilTabs->setBackTarget($lng->txt("mep_folder"), $ilCtrl->getLinkTarget($this, "listMedia"));
$ilCtrl->setParameter($this, "mepitem_id", $_GET["mepitem_id"]);
}

+ Here is the caller graph for this function:

ilObjMediaPoolGUI::setTabs ( )

Set tabs.

Reimplemented from ilObject2GUI.

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

References $_GET, and $ilCtrl.

{
global $ilAccess, $ilTabs, $ilCtrl, $ilHelp;
$ilHelp->setScreenIdComponent("mep");
if ($ilAccess->checkAccess('read', '', $this->ref_id) ||
$ilAccess->checkAccess('write', '', $this->ref_id))
{
$ilTabs->addTarget("objs_fold", $this->ctrl->getLinkTarget($this, ""),
"listMedia", "", "_top");
$ilCtrl->setParameter($this, "mepitem_id", "");
$ilTabs->addTarget("mep_all_mobs", $this->ctrl->getLinkTarget($this, "allMedia"),
"allMedia", "", "_top");
$ilCtrl->setParameter($this, "mepitem_id", $_GET["mepitem_id"]);
}
// info tab
if ($ilAccess->checkAccess('visible', '', $this->ref_id) ||
$ilAccess->checkAccess('read', '', $this->ref_id) ||
$ilAccess->checkAccess('write', '', $this->ref_id))
{
$force_active = ($this->ctrl->getNextClass() == "ilinfoscreengui"
|| strtolower($_GET["cmdClass"]) == "ilnotegui")
? true
: false;
//echo "-$force_active-";
$ilTabs->addTarget("info_short",
$this->ctrl->getLinkTargetByClass(
array("ilobjmediapoolgui", "ilinfoscreengui"), "showSummary"),
array("showSummary", "infoScreen"),
"", "", $force_active);
}
if ($ilAccess->checkAccess("write", "", $this->object->getRefId()))
{
$ilTabs->addTarget("settings", $this->ctrl->getLinkTarget($this, "edit"),
"edit", array("", "ilobjmediapoolgui"));
}
if ($ilAccess->checkAccess("write", "", $this->object->getRefId()))
{
$ilTabs->addTarget("clipboard", $this->ctrl->getLinkTarget($this, "openClipboard"),
"view", "ileditclipboardgui");
}
if ($ilAccess->checkAccess("write", "", $this->object->getRefId()))
{
$ilTabs->addTarget("export", $this->ctrl->getLinkTargetByClass("ilexportgui", ""),
"", "ilexportgui");
}
if ($ilAccess->checkAccess("edit_permission", "", $this->object->getRefId()))
{
$ilTabs->addTarget("perm_settings",
$this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm"), array("perm","info","owner"), 'ilpermissiongui');
}
}
ilObjMediaPoolGUI::showAllMediaPoolPageUsages ( )

List usages of the contnet snippet.

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

References showMediaPoolPageUsages().

{
}

+ Here is the call graph for this function:

ilObjMediaPoolGUI::showFullscreen ( )

show fullscreen

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

References showMedia().

{
$this->showMedia();
}

+ Here is the call graph for this function:

ilObjMediaPoolGUI::showMedia ( )
protected

show media object

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

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

Referenced by showFullscreen(), and showPreview().

{
global $ilAccess;
$this->checkPermission("read");
$item = new ilMediaPoolItem((int) $_GET["mepitem_id"]);
$mob_id = $item->getForeignId();
$this->tpl = new ilTemplate("tpl.fullscreen.html", true, true, "Services/COPage");
include_once("Services/Style/classes/class.ilObjStyleSheet.php");
$this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
$this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET",
require_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
require_once("./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php");
$media_obj = new ilObjMediaObject((int) $mob_id);
$this->tpl->setVariable("TITLE", " - ".$media_obj->getTitle());
$xml = "<dummy>";
// todo: we get always the first alias now (problem if mob is used multiple
// times in page)
$xml.= $media_obj->getXML(IL_MODE_ALIAS);
$xml.= $media_obj->getXML(IL_MODE_OUTPUT);
$xml.= $link_xml;
$xml.="</dummy>";
$xsl = file_get_contents("./Services/COPage/xsl/page.xsl");
$args = array( '/_xml' => $xml, '/_xsl' => $xsl );
$xh = xslt_create();
$wb_path = ilUtil::getWebspaceDir("output")."/";
$mode = ($_GET["cmd"] != "showPreview")
? "fullscreen"
: "media";
$enlarge_path = ilUtil::getImagePath("enlarge.svg", false, "output");
$fullscreen_link =
$this->ctrl->getLinkTarget($this, "showFullscreen", "", false, false);
$params = array ('mode' => $mode, 'enlarge_path' => $enlarge_path,
'link_params' => "ref_id=".$_GET["ref_id"],'fullscreen_link' => $fullscreen_link,
'ref_id' => $_GET["ref_id"], 'pg_frame' => $pg_frame, 'webspace_path' => $wb_path);
$output = xslt_process($xh,"arg:/_xml","arg:/_xsl",NULL,$args, $params);
echo xslt_error($xh);
xslt_free($xh);
// unmask user html
$this->tpl->setVariable("MEDIA_CONTENT", $output);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjMediaPoolGUI::showMediaPoolPageUsages (   $a_all = false)

List usages of the contnet snippet.

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

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

Referenced by showAllMediaPoolPageUsages().

{
global $ilTabs, $ilCtrl, $lng, $tpl;
$this->checkPermission("write");
$ilTabs->addSubTab("current_usages", $lng->txt("cont_current_usages"),
$ilCtrl->getLinkTarget($this, "showMediaPoolPageUsages"));
$ilTabs->addSubTab("all_usages", $lng->txt("cont_all_usages"),
$ilCtrl->getLinkTarget($this, "showAllMediaPoolPageUsages"));
if ($a_all)
{
$ilTabs->activateSubTab("all_usages");
$cmd = "showAllMediaPoolPageUsages";
}
else
{
$ilTabs->activateSubTab("current_usages");
$cmd = "showMediaPoolPageUsages";
}
include_once("./Modules/MediaPool/classes/class.ilMediaPoolPageGUI.php");
$mep_page_gui = new ilMediaPoolPageGUI($_GET["mepitem_id"], $_GET["old_nr"]);
$mep_page_gui->getTabs();
include_once("./Modules/MediaPool/classes/class.ilMediaPoolPage.php");
$page = new ilMediaPoolPage((int) $_GET["mepitem_id"]);
include_once("./Modules/MediaPool/classes/class.ilMediaPoolPageUsagesTableGUI.php");
$table = new ilMediaPoolPageUsagesTableGUI($this, $cmd, $page, $a_all);
$tpl->setContent($table->getHTML());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjMediaPoolGUI::showPage ( )

Show page.

Parameters
@return

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

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

Referenced by showPreview().

{
global $tpl;
$tpl = new ilTemplate("tpl.main.html", true, true);
include_once("./Services/Container/classes/class.ilContainerPage.php");
include_once("./Services/Container/classes/class.ilContainerPageGUI.php");
include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
$tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
$tpl->setVariable("LOCATION_CONTENT_STYLESHEET",
$tpl->setCurrentBlock("SyntaxStyle");
$tpl->setVariable("LOCATION_SYNTAX_STYLESHEET",
$tpl->parseCurrentBlock();
// get page object
//include_once("./Services/Object/classes/class.ilObjectTranslation.php");
//$ot = ilObjectTranslation::getInstance($this->object->getId());
//$lang = $ot->getEffectiveContentLang($ilUser->getCurrentLanguage(), "cont");
include_once("./Modules/MediaPool/classes/class.ilMediaPoolPageGUI.php");
$page_gui = new ilMediaPoolPageGUI((int) $_GET["mepitem_id"]);
include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
//$page_gui->setStyleId(ilObjStyleSheet::getEffectiveContentStyleId(
// $this->object->getStyleSheetId(), $this->object->getType()));
$page_gui->setTemplateOutput(false);
$page_gui->setHeader("");
$ret = $page_gui->showPage(true);
$tpl->setBodyClass("ilMediaPoolPagePreviewBody");
$tpl->setVariable("CONTENT", $ret);
//$ret = "<div style='background-color: white; padding:5px; margin-bottom: 30px;'>".$ret."</div>";
//$ret =& $page_gui->executeCommand();
$tpl->show();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjMediaPoolGUI::showPreview ( )

Show content snippet.

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

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

{
$this->checkPermission("read");
$item = new ilMediaPoolItem((int) $_GET["mepitem_id"]);
switch ($item->getType())
{
case "mob":
$this->showMedia();
break;
case "pg":
$this->showPage();
break;
}
}

+ Here is the call graph for this function:

ilObjMediaPoolGUI::updateCustom ( ilPropertyFormGUI  $a_form)
protected

Insert custom update form values into object.

Parameters
ilPropertyFormGUI$a_form

Reimplemented from ilObjectGUI.

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

References ilPropertyFormGUI\getInput().

{
$this->object->setDefaultWidth($a_form->getInput("default_width"));
$this->object->setDefaultHeight($a_form->getInput("default_height"));
}

+ Here is the call graph for this function:

ilObjMediaPoolGUI::updateFolder ( )

Update folder.

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

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

{
global $lng, $ilCtrl, $tpl;
$this->checkPermission("write");
$this->initFolderForm("edit");
if ($this->form->checkInput())
{
$item = new ilMediaPoolItem($_GET["mepitem_id"]);
$item->setTitle($_POST["title"]);
$item->update();
ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
$ilCtrl->setParameter($this, "mepitem_id",
$this->object->getTree()->getParentId($_GET["mepitem_id"]));
$ilCtrl->redirect($this, "listMedia");
}
$this->form->setValuesByPost();
$tpl->setContent($this->form->getHtml());
}

+ Here is the call graph for this function:

ilObjMediaPoolGUI::updateMediaPoolPage ( )

Update media pool page.

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

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

{
global $lng, $ilCtrl, $tpl;
$this->checkPermission("write");
$this->initMediaPoolPageForm("edit");
if ($this->form->checkInput())
{
$item = new ilMediaPoolItem($_GET["mepitem_id"]);
$item->setTitle($_POST["title"]);
$item->update();
ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
$ilCtrl->redirect($this, "editMediaPoolPage");
}
$this->form->setValuesByPost();
$tpl->setContent($this->form->getHtml());
}

+ Here is the call graph for this function:

Field Documentation

ilObjMediaPoolGUI::$output_prepared

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


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