ILIAS  Release_4_1_x_branch Revision 61804
 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

 __construct ($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=false)
 Constructor.
 getType ()
 Get type.
executeCommand ()
 execute command
 initCreationForms ()
 Init creation forms.
 createMediaObject ()
 view ()
 initEditForm ($a_mode="edit", $a_new_type="")
 Init object creation form.
 getEditFormValues ()
 Get values for edit form.
 afterSave ($newObj)
 save object public
 editObject ()
 edit properties of object (admin form)
 edit ()
 edit properties of object (module form)
 update ()
 update properties
 updateObject ()
 updates object entry in object_data
 afterUpdate ()
 listMedia ()
 list media objects
 allMedia ()
 list all objects
 applyFilter ()
 Apply filter.
 resetFilter ()
 Reset filter.
 getTemplate ()
 Get standard template.
 getParentFolderId ()
 Get folder parent ID.
 frameset ()
 show upper icon (standard procedure will work, if no obj_id is given)
 infoScreenFrameset ()
 output main frameset of media pool left frame: explorer tree of folders right frame: media pool content
 explorer ()
 output explorer tree
 showMedia ()
 show media object
 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.
 showMediaPoolPageUsages ()
 List all usages of the contnet snippet.
 setTabs ()
 Set tabs.
 _goto ($a_target)
 goto target media pool
 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
- Public Member Functions inherited from ilObject2GUI
 __construct ($a_id=0, $a_call_by_reference=true)
 Constructor.
 performCommand ($cmd)
 Handles all commmands of this class, centralizes permission checks.
 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
 getHTML ()
 isVisible ()
 deleteObject ()
 trashObject ()
 Show trash content of object.
 undeleteObject ()
 Get objects back from trash.
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled
 cancelDeleteObject ()
 cancel deletion of object
 removeFromSystemObject ()
 remove objects from trash bin and all entries therefore every object needs a specific deleteObject() method
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI.
 viewObject ()
 list childs of current object
 getAdminTabs ($a)
 getTemplateFile ()
 copyWizardHasOptions ($a_mode)
 Check if there is any modules specific option.
 deactivateCreationForm ($a_type)
 Deleted in ilObject.
 addCreationForm ($a_header, $a_form)
 Add creation form.
 create ()
 Create new object form.
 getCreationFormsHTML ()
 Get HTML for creation forms.
 save ()
 Save object.
 cancelCreation ($in_rep=false)
 cancel action and go back to previous page public
 cancelUpdate ()
 cancel action and go back to previous page public
 initImportForm ($a_new_type="")
 Init object import form.
 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
 createObject ()
 create new object form
 cancelObject ($in_rep=false)
 cancel action and go back to previous page public
 saveObject ()
 save object
 getFormAction ($a_cmd, $a_formaction="")
 get form action for command (command is method name without "Object", e.g.
 isVisible ($a_ref_id, $a_type)
 deleteObject ($a_error=false)
 Display deletion confirmation screen.
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl.

Data Fields

 $output_prepared
- Data Fields inherited from ilObject2GUI
const CFORM_NEW = "new"
const CFORM_CLONE = "clone"
const CFORM_IMPORT = "import"
- 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

Protected Member Functions

 afterConstructor ()
 Initialisation.
 cancel ()
 cancel editing
- Protected Member Functions inherited from ilObject2GUI
 assignObject ()
 prepareOutput ()
 prepare output
 setTitleAndDescription ()
 called by prepare output
 showUpperIcon ()
 setLocator ()
 set Locator
 omitLocator ($a_omit=true)
 getTargetFrame ()
 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)
 searchCloneSourceObject ()
 buildCloneSelect ($existing_objs)
 addAdminLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded)
 getReturnLocation ()
 Deprecated functions.
 setReturnLocation ()
 showActions ()
 getTitlesByRefId ()
 getTabs ()
 __showButton ()
 hitsperpageObject ()
 __initTableGUI ()
 __setTableGUIBasicData ()
 __showClipboardTable ()
- Protected Member Functions inherited from ilObjectGUI
 setAdminTabs ()
 set admin tabs public
 displayEditForm ($fields)
 display edit form (usually called by editObject)
 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
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g.
 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
 __showClipboardTable ($a_result_set, $a_from="")
 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

Additional Inherited Members

- Protected Attributes inherited from ilObject2GUI
 $creation_forms = array()

Detailed Description

Constructor & Destructor Documentation

ilObjMediaPoolGUI::__construct (   $a_data,
  $a_id = 0,
  $a_call_by_reference = true,
  $a_prepare_output = false 
)

Constructor.

public

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

{
parent::__construct($a_id, $a_call_by_reference);
}

Member Function Documentation

ilObjMediaPoolGUI::_goto (   $a_target)

goto target media pool

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

References $_GET, $ilErr, ilObjectGUI\$lng, ilObjectGUI\$ref_id, 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["cmd"] = "frameset";
$_GET["baseClass"] = "ilMediaPoolPresentationGUI";
$_GET["ref_id"] = $ref_id;
$_GET['mepitem_id'] = $subitem_id;
include("ilias.php");
}
else if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID))
{
$_GET["cmd"] = "frameset";
$_GET["target"] = "";
$_GET["ref_id"] = ROOT_FOLDER_ID;
ilUtil::sendFailure(sprintf($lng->txt("msg_no_perm_read_item"),
include("repository.php");
}
$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 1087 of file class.ilObjMediaPoolGUI.php.

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

{
global $ilLocator;
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", "");
$link = $this->ctrl->getLinkTarget($this, "listMedia");
$title = $this->object->getTitle();
$this->ctrl->setParameter($this, "mepitem_id", $_GET["mepitem_id"]);
$ilLocator->addItem($title, $link, "", $_GET["ref_id"]);
}
else
{
$this->ctrl->setParameter($this, "mepitem_id", $node["child"]);
$link = $this->ctrl->getLinkTarget($this, "listMedia");
$title = $node["title"];
$this->ctrl->setParameter($this, "mepitem_id", $_GET["mepitem_id"]);
$ilLocator->addItem($title, $link);
}
}
}
}

+ Here is the call graph for this function:

ilObjMediaPoolGUI::afterConstructor ( )
protected

Initialisation.

Reimplemented from ilObject2GUI.

Definition at line 41 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 public

Definition at line 404 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=edit");
}

+ Here is the call graph for this function:

ilObjMediaPoolGUI::afterUpdate ( )

Reimplemented from ilObject2GUI.

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

Referenced by updateObject().

{
$this->ctrl->redirect($this, "edit");
}

+ Here is the caller graph for this function:

ilObjMediaPoolGUI::allMedia ( )

list all objects

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

References $_GET, $_POST, $ilCtrl, ilObjectGUI\$tpl, ilObjectGUI\$tree, 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");
if (!$ilAccess->checkAccess("read", "", $this->object->getRefId()))
{
$this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
}
$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 581 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::cancel ( )
protected

cancel editing

Reimplemented from ilObject2GUI.

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

References $_GET.

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

Cancel save.

Definition at line 1256 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 1014 of file class.ilObjMediaPoolGUI.php.

References $_GET.

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

Cancel save.

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

References $ilCtrl.

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

confirm remove of mobs

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

References $_POST, $_SESSION, $ilCtrl, ilObjectGUI\$lng, ilObjectGUI\$obj_id, $title, ilUtil\getImagePath(), ilPageContentUsage\getUsages(), ilMediaPoolItem\lookupTitle(), ilMediaPoolItem\lookupType(), ilUtil\sendFailure(), ilUtil\sendQuestion(), and ilUtil\switchColor().

{
global $ilAccess, $ilCtrl, $lng;
if (!$ilAccess->checkAccess("write", "", $this->object->getRefId()))
{
$this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
}
if(!isset($_POST["id"]))
{
$this->ilias->raiseError($this->lng->txt("no_checkbox"),$this->ilias->error_obj->MESSAGE);
}
//$this->prepareOutput();
// SAVE POST VALUES
$_SESSION["ilMepRemove"] = $_POST["id"];
$this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.confirm_deletion.html", "Modules/MediaPool");
ilUtil::sendQuestion($this->lng->txt("info_delete_sure"));
$this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
// BEGIN TABLE HEADER
$this->tpl->setCurrentBlock("table_header");
$this->tpl->setVariable("TEXT",$this->lng->txt("objects"));
$this->tpl->parseCurrentBlock();
// BEGIN TABLE DATA
$counter = 0;
foreach($_POST["id"] as $obj_id)
{
$type = ilMediaPoolItem::lookupType($obj_id);
// check whether page can be removed
if ($type == "pg")
{
include_once("./Services/COPage/classes/class.ilPageContentUsage.php");
$usages = ilPageContentUsage::getUsages("incl", $obj_id);
if (count($usages) > 0)
{
ilUtil::sendFailure(sprintf($lng->txt("mep_content_snippet_in_use"), $title), true);
$ilCtrl->redirect($this, "listMedia");
}
}
$this->tpl->setCurrentBlock("table_row");
$this->tpl->setVariable("CSS_ROW",ilUtil::switchColor(++$counter,"tblrow1","tblrow2"));
$this->tpl->setVariable("TEXT_CONTENT", $title);
$this->tpl->setVariable("IMG_OBJ", ilUtil::getImagePath("icon_".$type.".gif"));
$this->tpl->parseCurrentBlock();
}
// cancel/confirm button
$this->tpl->setVariable("IMG_ARROW",ilUtil::getImagePath("arrow_downright.gif"));
$buttons = array( "cancelRemove" => $this->lng->txt("cancel"),
"remove" => $this->lng->txt("confirm"));
foreach ($buttons as $name => $value)
{
$this->tpl->setCurrentBlock("operation_btn");
$this->tpl->setVariable("BTN_NAME",$name);
$this->tpl->setVariable("BTN_VALUE",$value);
$this->tpl->parseCurrentBlock();
}
// $this->tpl->show();
}

+ Here is the call graph for this function:

ilObjMediaPoolGUI::copyToClipboard ( )

copy media objects to clipboard

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

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

References ilObjectGUI\$tpl, and initFolderForm().

{
global $ilAccess, $tpl;
if (!$ilAccess->checkAccess("write", "", $this->object->getRefId()))
{
$this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
}
$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::createMediaObject ( )

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

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

Create new content snippet.

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

References ilObjectGUI\$tpl, and initMediaPoolPageForm().

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

+ Here is the call graph for this function:

ilObjMediaPoolGUI::edit ( )

edit properties of object (module form)

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

References editObject().

{
$this->editObject();
// $this->tpl->show();
}

+ Here is the call graph for this function:

ilObjMediaPoolGUI::editFolder ( )

Edit folder.

Parameters
@return

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

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

{
global $tpl;
$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 1293 of file class.ilObjMediaPoolGUI.php.

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

{
global $tpl;
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::editObject ( )

edit properties of object (admin form)

public

Reimplemented from ilObject2GUI.

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

References ilObjectGUI\$tpl, and ilObjectGUI\$tree.

Referenced by edit().

{
global $ilAccess, $tree, $tpl;
if (!$ilAccess->checkAccess("write", "", $this->object->getRefId()))
{
$this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
}
// edit button
$this->tpl->addBlockfile("BUTTONS", "buttons", "tpl.buttons.html");
}

+ Here is the caller graph for this function:

& ilObjMediaPoolGUI::executeCommand ( )

execute command

Reimplemented from ilObject2GUI.

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

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

{
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":
// todo
$this->ctrl->redirectByClass("ilobjfoldergui", "create");
break;
}
}
switch($next_class)
{
case 'ilmediapoolpagegui':
$this->prepareOutput();
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":
//$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);
switch($cmd)
{
case "save":
$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"]);
break;
default:
$this->tpl->show();
break;
}
break;
case "ilobjfoldergui":
// todo
$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->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->infoScreen();
$this->tpl->show();
break;
case 'ilpermissiongui':
$this->prepareOutput();
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->prepareOutput();
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;
default:
$this->prepareOutput();
$cmd = $this->ctrl->getCmd("frameset");
$this->$cmd();
if (!$this->getCreationMode())
{
$this->tpl->show();
}
break;
}
}

+ Here is the call graph for this function:

ilObjMediaPoolGUI::explorer ( )

output explorer tree

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

References $_GET, $ilCtrl, ilObjectGUI\$object, exit, IL_FM_POSITIVE, and ilExplorer\setUseStandardFrame().

Referenced by executeCommand().

{
global $ilAccess, $ilCtrl;
$ilCtrl->setParameter($this, "obj_id", "");
$ilCtrl->setParameter($this, "mepitem_id", "");
if (!$ilAccess->checkAccess("read", "", $this->object->getRefId()) &&
!$ilAccess->checkAccess("write", "", $this->object->getRefId()))
{
return;
}
require_once ("./Modules/MediaPool/classes/class.ilMediaPoolExplorer.php");
$exp = new ilMediaPoolExplorer($this->ctrl->getLinkTarget($this, "listMedia"), $this->object);
$exp->setUseStandardFrame(true);
$exp->setTargetGet("mepitem_id");
$exp->setExpandTarget($this->ctrl->getLinkTarget($this, "explorer"));
$exp->setTitle($this->lng->txt("cont_mep_structure"));
$exp->addFilter("dummy");
$exp->addFilter("fold");
$exp->setFiltered(true);
$exp->setFilterMode(IL_FM_POSITIVE);
if ($_GET["mepexpand"] == "")
{
$mep_tree =& $this->object->getTree();
$expanded = $mep_tree->readRootId();
}
else
{
$expanded = $_GET["mepexpand"];
}
$exp->setExpand($expanded);
// build html-output
$exp->setOutput(0);
$output = $exp->getOutput();
echo $output;
/* $this->tpl->setCurrentBlock("content");
$this->tpl->setVariable("TXT_EXPLORER_HEADER", $this->lng->txt("cont_mep_structure"));
$this->tpl->setVariable("EXP_REFRESH", $this->lng->txt("refresh"));
$this->tpl->setVariable("EXPLORER",$output);
$this->ctrl->setParameter($this, "mepexpand", $_GET["mepexpand"]);
$this->tpl->setVariable("ACTION",
$this->ctrl->getLinkTarget($this, "explorer"));
$this->tpl->parseCurrentBlock();
$this->tpl->show(false);
*/
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjMediaPoolGUI::frameset ( )

show upper icon (standard procedure will work, if no obj_id is given)

output main frameset of media pool left frame: explorer tree of folders right frame: media pool content

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

References exit.

{
include_once("Services/Frameset/classes/class.ilFramesetGUI.php");
$fs_gui = new ilFramesetGUI();
$fs_gui->setMainFrameName("content");
$fs_gui->setSideFrameName("tree");
$fs_gui->setMainFrameSource(
$this->ctrl->getLinkTarget($this, "listMedia"));
$this->ctrl->setParameter($this, "expand", "1");
$fs_gui->setSideFrameSource(
$this->ctrl->getLinkTarget($this, "explorer"));
$fs_gui->setFramesetTitle($this->object->getTitle());
$fs_gui->show();
}
ilObjMediaPoolGUI::getEditFormValues ( )

Get values for edit form.

Reimplemented from ilObject2GUI.

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

{
$values["title"] = $this->object->getTitle();
$values["desc"] = $this->object->getDescription();
if ($this->object->getDefaultWidth() > 0)
{
$values["default_width"] = $this->object->getDefaultWidth();
}
if ($this->object->getDefaultHeight() > 0)
{
$values["default_height"] = $this->object->getDefaultHeight();
}
$this->form->setValuesByArray($values);
}
ilObjMediaPoolGUI::getFolderValues ( )

Get current values for folder from.

Definition at line 1165 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 1406 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 616 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:

ilObjMediaPoolGUI::getTemplate ( )

Get standard template.

Definition at line 607 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 63 of file class.ilObjMediaPoolGUI.php.

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

show information screen

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

References $_GET.

Referenced by executeCommand(), and infoScreenObject().

{
global $ilAccess;
if (!$ilAccess->checkAccess("visible", "", $this->ref_id))
{
$this->ilias->raiseError($this->lng->txt("msg_no_perm_read"),$this->ilias->error_obj->MESSAGE);
}
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::infoScreenFrameset ( )

output main frameset of media pool left frame: explorer tree of folders right frame: media pool content

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

References exit.

{
include_once("Services/Frameset/classes/class.ilFramesetGUI.php");
$fs_gui = new ilFramesetGUI();
$fs_gui->setMainFrameName("content");
$fs_gui->setSideFrameName("tree");
$fs_gui->setMainFrameSource(
$this->ctrl->getLinkTargetByClass("ilinfoscreengui", "showSummary"));
$this->ctrl->setParameter($this, "expand", "1");
$fs_gui->setSideFrameSource(
$this->ctrl->getLinkTarget($this, "explorer"));
$fs_gui->setFramesetTitle($this->object->getTitle());
$fs_gui->show();
}
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 1573 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 ( )

Init creation forms.

Reimplemented from ilObject2GUI.

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

References ilObject2GUI\CFORM_CLONE, and ilObject2GUI\deactivateCreationForm().

+ Here is the call graph for this function:

ilObjMediaPoolGUI::initEditForm (   $a_mode = "edit",
  $a_new_type = "" 
)

Init object creation form.

Parameters
int$a_modeEdit Mode

Reimplemented from ilObject2GUI.

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

References $ilCtrl, ilObjectGUI\$lng, ilTextAreaInputGUI\setCols(), ilTextInputGUI\setMaxLength(), and ilNumberInputGUI\setMinValue().

Referenced by updateObject().

{
global $lng, $ilCtrl;
include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
$this->form = new ilPropertyFormGUI();
if ($a_mode != "edit")
{
$this->form->setTarget("_top");
}
// title
$ti = new ilTextInputGUI($this->lng->txt("title"), "title");
$ti->setMaxLength(128);
$ti->setSize(40);
$ti->setRequired(true);
$this->form->addItem($ti);
// description
$ta = new ilTextAreaInputGUI($this->lng->txt("description"), "desc");
$ta->setCols(40);
$ta->setRows(2);
$this->form->addItem($ta);
if ($a_mode == "edit")
{
// default width
$ni = new ilNumberInputGUI($this->lng->txt("mep_default_width"), "default_width");
$ni->setMinValue(0);
$ni->setMaxLength(5);
$ni->setSize(5);
$this->form->addItem($ni);
// default height
$ni = new ilNumberInputGUI($this->lng->txt("mep_default_height"), "default_height");
$ni->setMinValue(0);
$ni->setMaxLength(5);
$ni->setSize(5);
$ni->setInfo($this->lng->txt("mep_default_width_height_info"));
$this->form->addItem($ni);
}
// save and cancel commands
if ($a_mode == "create")
{
$this->form->addCommandButton("save", $lng->txt($a_new_type."_add"));
$this->form->addCommandButton("cancelCreation", $lng->txt("cancel"));
$this->form->setTitle($lng->txt($a_new_type."_new"));
}
else
{
$this->form->addCommandButton("update", $lng->txt("save"));
//$this->form->addCommandButton("cancelUpdate", $lng->txt("cancel"));
$this->form->setTitle($lng->txt("edit"));
}
$this->form->setFormAction($ilCtrl->getFormAction($this));
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Init folder form.

Parameters
int$a_modeEdit Mode

Definition at line 1223 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 1374 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 925 of file class.ilObjMediaPoolGUI.php.

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

{
global $ilAccess;
if (!$ilAccess->checkAccess("write", "", $this->object->getRefId()))
{
$this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
}
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
$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 498 of file class.ilObjMediaPoolGUI.php.

References $ilCtrl, ilObjectGUI\$lng, ilObjectGUI\$tpl, and ilObjectGUI\$tree.

{
global $tree, $ilAccess, $tpl, $ilTabs, $ilCtrl, $ilToolbar, $lng;
$ilCtrl->setParameter($this, "mep_mode", "listMedia");
if (!$ilAccess->checkAccess("read", "", $this->object->getRefId()))
{
$this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
}
$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"));
}
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();
}
ilObjMediaPoolGUI::openClipboard ( )

paste from clipboard

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

References $ilCtrl.

{
global $ilCtrl, $ilAccess;
if (!$ilAccess->checkAccess("write", "", $this->object->getRefId()))
{
$this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
}
$ilCtrl->setParameterByClass("ileditclipboardgui", "returnCommand",
rawurlencode($ilCtrl->getLinkTarget($this,
"insertFromClipboard", "", false, false)));
$ilCtrl->redirectByClass("ilEditClipboardGUI", "getObject");
}
ilObjMediaPoolGUI::remove ( )

confirm deletion of

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

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

{
global $ilAccess;
if (!$ilAccess->checkAccess("write", "", $this->object->getRefId()))
{
$this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
}
foreach($_SESSION["ilMepRemove"] as $obj_id)
{
$this->object->deleteChild($obj_id);
}
ilUtil::sendSuccess($this->lng->txt("cont_obj_removed"),true);
session_unregister("ilMepRemove");
$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 594 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 1177 of file class.ilObjMediaPoolGUI.php.

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

{
global $tpl, $lng, $ilCtrl;
$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 1311 of file class.ilObjMediaPoolGUI.php.

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

{
global $tpl, $lng, $ilCtrl;
$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();
ilUtil::sendSuccess($lng->txt("mep_page_created"), true);
}
$ilCtrl->redirect($this, "listMedia");
}
$this->form->setValuesByPost();
$tpl->setContent($this->form->getHtml());
}

+ Here is the call graph for this function:

ilObjMediaPoolGUI::setMediaPoolPageTabs ( )

Set media pool page tabs.

Parameters
@return

Definition at line 1422 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"),
"showMediaPoolPageUsages", 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 1469 of file class.ilObjMediaPoolGUI.php.

References $_GET, and $ilCtrl.

{
global $ilAccess, $ilTabs, $ilCtrl;
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))
{
$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::showFullscreen ( )

show fullscreen

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

References showMedia().

{
$this->showMedia();
}

+ Here is the call graph for this function:

ilObjMediaPoolGUI::showMedia ( )

show media object

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

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

Referenced by showFullscreen().

{
global $ilAccess;
if (!$ilAccess->checkAccess("read", "", $this->object->getRefId()))
{
$this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
}
$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",
//$int_links = $page_object->getInternalLinks();
$med_links = ilMediaItem::_getMapAreasIntLinks($_GET["mob_id"]);
// later
//$link_xml = $this->getLinkXML($med_links, $this->getLayoutLinkTargets());
$link_xlm = "";
require_once("./Services/MediaObjects/classes/class.ilObjMediaObject.php");
$media_obj =& new ilObjMediaObject($_GET["mob_id"]);
$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"] != "showMedia")
? "fullscreen"
: "media";
$enlarge_path = ilUtil::getImagePath("enlarge.gif", 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);
$this->tpl->parseCurrentBlock();
// $this->tpl->show();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjMediaPoolGUI::showMediaPoolPageUsages ( )

List all usages of the contnet snippet.

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

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

{
global $ilTabs, $ilCtrl, $lng, $tpl;
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, "showMediaPoolPageUsages", $page);
$tpl->setContent($table->getHTML());
}

+ Here is the call graph for this function:

ilObjMediaPoolGUI::update ( )

update properties

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

References updateObject().

Referenced by updateObject().

{
global $ilAccess;
if (!$ilAccess->checkAccess("write", "", $this->object->getRefId()))
{
$this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
}
$this->updateObject();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjMediaPoolGUI::updateFolder ( )

Update folder.

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

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

{
global $lng, $ilCtrl, $tpl;
$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 1352 of file class.ilObjMediaPoolGUI.php.

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

{
global $lng, $ilCtrl, $tpl;
$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:

ilObjMediaPoolGUI::updateObject ( )

updates object entry in object_data

public

Reimplemented from ilObject2GUI.

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

References $_POST, ilObjectGUI\$lng, ilObjectGUI\$tpl, afterUpdate(), initEditForm(), ilUtil\sendSuccess(), and update().

Referenced by update().

{
global $lng, $tpl;
$this->initEditForm("edit");
if ($this->form->checkInput())
{
$this->object->setTitle($_POST["title"]);
$this->object->setDescription($_POST["desc"]);
$this->object->setDefaultWidth($_POST["default_width"]);
$this->object->setDefaultHeight($_POST["default_height"]);
$this->update = $this->object->update();
ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
$this->afterUpdate();
return;
}
$this->form->setValuesByPost();
$tpl->setContent($this->form->getHtml());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjMediaPoolGUI::view ( )

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

References ilObject2GUI\viewObject().

{
$this->viewObject();
}

+ Here is the call graph for this function:

Field Documentation

ilObjMediaPoolGUI::$output_prepared

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


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