Public Member Functions | Data Fields

ilObjMediaPoolGUI Class Reference

User Interface class for media pool objects. More...

Inheritance diagram for ilObjMediaPoolGUI:
Collaboration diagram for ilObjMediaPoolGUI:

Public Member Functions

 ilObjMediaPoolGUI ($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=false)
 Constructor.
executeCommand ()
 execute command
 createObject ()
 create new object form
 view ()
 saveObject ()
 save object public
 editObject ()
 edit properties of object (admin form)
 edit ()
 edit properties of object (module form)
 cancel ()
 cancel editing
 cancelObject ($in_rep=false)
 cancel action and go back to previous page public
 update ()
 update properties
 afterUpdate ()
 info ()
 info form
 permSave ()
 save permissions
 addRole ()
 add role
 listMedia ()
 list media objects
 getTemplate ()
 getParentFolderId ()
 showUpperIcon ()
 show upper icon (standard procedure will work, if no obj_id is given)
 frameset ()
 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
 pasteFromClipboard ()
 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
 setTabs ()
 prepare output
 getTabs (&$tabs_gui)
 adds tabs to tab gui object

Data Fields

 $output_prepared

Detailed Description

User Interface class for media pool objects.

Author:
Alex Killing <alex.killing@gmx.de>
Id:
class.ilObjMediaPoolGUI.php 12468 2006-11-07 20:18:03Z akill

ilObjMediaPoolGUI: ilObjMediaObjectGUI, ilObjFolderGUI, ilEditClipboardGUI, ilPermissionGUI

/

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


Member Function Documentation

ilObjMediaPoolGUI::addLocatorItems (  ) 

add locator items for media pool

Reimplemented from ilObjectGUI.

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

References $_GET, ilObjectGUI::$obj_id, $title, ilObjectGUI::$tree, and ilObjectGUI::getCreationMode().

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

Here is the call graph for this function:

ilObjMediaPoolGUI::addRole (  ) 

add role

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

References $_GET, ilObjectGUI::addRoleObject(), and ilObjectGUI::setReturnLocation().

        {
                $this->setReturnLocation("addRole",
                        "mep_edit.php?ref_id=".$_GET["ref_id"]."&obj_id=".$_GET["obj_id"]."&cmd=perm");
                $this->addRoleObject();
        }

Here is the call graph for this function:

ilObjMediaPoolGUI::afterUpdate (  ) 

Reimplemented from ilObjectGUI.

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

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

ilObjMediaPoolGUI::cancel (  ) 

cancel editing

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

        {
                //$this->setReturnLocation("cancel","mep_edit.php?cmd=listMedia&ref_id=".$_GET["ref_id"].
                //      "&obj_id=".$_GET["obj_id"]);
                //$this->cancelObject();
                $this->ctrl->redirect($this, "listMedia");
        }

ilObjMediaPoolGUI::cancelObject ( in_rep = false  ) 

cancel action and go back to previous page public

Reimplemented from ilObjectGUI.

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

References $_GET, ilUtil::redirect(), and sendInfo().

        {
                sendInfo($this->lng->txt("msg_cancel"),true);
                ilUtil::redirect("repository.php?cmd=frameset&ref_id=".$_GET["ref_id"]);
                //$this->ctrl->redirectByClass("ilrepositorygui", "frameset");
        }

Here is the call graph for this function:

ilObjMediaPoolGUI::cancelRemove (  ) 

cancel deletion of media objects/folders

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

        {
                session_unregister("ilMepRemove");
                $this->ctrl->redirect($this, "listMedia");
        }

ilObjMediaPoolGUI::confirmRemove (  ) 

confirm remove of mobs

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

References $_POST, $_SESSION, $counter, ilObjectGUI::$obj_id, $title, $type, ilObject::_lookupTitle(), ilObject::_lookupType(), ilUtil::getImagePath(), sendInfo(), and ilUtil::switchColor().

        {
                global $ilAccess;
                
                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", true);

                sendInfo($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 = ilObject::_lookupType($obj_id);
                        $title = ilObject::_lookupTitle($obj_id);
                        $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 972 of file class.ilObjMediaPoolGUI.php.

References $_POST, ilObjectGUI::$obj_id, $type, ilObject::_lookupType(), and sendInfo().

        {
                global $ilUser, $ilAccess;
                
                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);
                }

                foreach ($_POST["id"] as $obj_id)
                {
                        $type = ilObject::_lookupType($obj_id);
                        if ($type == "fold")
                        {
                                $this->ilias->raiseError($this->lng->txt("cont_cant_copy_folders"), $this->ilias->error_obj->MESSAGE);
                        }
                }

                foreach ($_POST["id"] as $obj_id)
                {
                        $ilUser->addObjectToClipboard($obj_id, "mob", "");
                }

                sendInfo($this->lng->txt("copied_to_clipboard"),true);
                $this->ctrl->redirect($this, "listMedia");
        }

Here is the call graph for this function:

ilObjMediaPoolGUI::createFolderForm (  ) 

create folder form

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

References $_GET.

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

                $folder_gui =& new ilObjFolderGUI("", 0, false, false);
                $folder_gui->setFormAction("save", "mep_edit.php?cmd=post&cmdClass=ilObjFolderGUI&ref_id=".
                        $_GET["ref_id"]."&obj_id=".$_GET["obj_id"]);
                $folder_gui->createObject();
                //$this->tpl->show();
        }

ilObjMediaPoolGUI::createObject (  ) 

create new object form

public

Reimplemented from ilObjectGUI.

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

References ilFrameTargetInfo::_getFrame().

        {
                parent::createObject();
                $this->tpl->setVariable("TARGET", ' target="'.
                                ilFrameTargetInfo::_getFrame("MainContent").'" ');
        }

Here is the call graph for this function:

ilObjMediaPoolGUI::edit (  ) 

edit properties of object (module form)

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

References $_GET, editObject(), and ilObjectGUI::setFormAction().

        {
                //$this->prepareOutput();
                $this->setFormAction("update", "mep_edit.php?cmd=post&ref_id=".$_GET["ref_id"].
                        "&obj_id=".$_GET["obj_id"]);
                $this->editObject();
                $this->tpl->show();
        }

Here is the call graph for this function:

ilObjMediaPoolGUI::editObject (  ) 

edit properties of object (admin form)

public

Reimplemented from ilObjectGUI.

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

References ilObjectGUI::$tpl, ilObjectGUI::$tree, and ilFrameTargetInfo::_getFrame().

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");

                if (!defined("ILIAS_MODULE"))
                {
                        $this->tpl->setCurrentBlock("btn_cell");
                        $this->tpl->setVariable("BTN_LINK","content/mep_edit.php?ref_id=".$this->object->getRefID());
                        $this->tpl->setVariable("BTN_TARGET"," target=\"".
                                ilFrameTargetInfo::_getFrame("MainContent")."\" ");
                        $this->tpl->setVariable("BTN_TXT",$this->lng->txt("edit"));
                        $this->tpl->parseCurrentBlock();
                }

                parent::editObject();
        }

Here is the call graph for this function:

Here is the caller graph for this function:

& ilObjMediaPoolGUI::executeCommand (  ) 

execute command

Reimplemented from ilObjectGUI.

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

References $_GET, $_POST, $cmd, ilObjectGUI::$tree, explorer(), getParentFolderId(), getTemplate(), ilObjectGUI::prepareOutput(), ilUtil::redirect(), sendInfo(), and ilObjectGUI::setLocator().

        {
                if ($this->ctrl->getRedirectSource() == "ilinternallinkgui")
                {
                        $this->explorer();
                        return;
                }
//echo "-".$cmd."-";

                if (!$this->creation_mode)
                {
                        $tree =& $this->object->getTree();
                }
                $next_class = $this->ctrl->getNextClass($this);
                $cmd = $this->ctrl->getCmd();
                
                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 "ilobjmediaobjectgui":

                                //$cmd.="Object";
                                if ($cmd == "create")
                                {
                                        $ret_obj = $_GET["obj_id"];
                                        $ilObjMediaObjectGUI =& new ilObjMediaObjectGUI("", 0, false, false);
                                }
                                else
                                {
                                        $ret_obj = $tree->getParentId($_GET["obj_id"]);
                                        $ilObjMediaObjectGUI =& new ilObjMediaObjectGUI("", $_GET["obj_id"], false, false);
                                }
                                if ($this->ctrl->getCmdClass() == "ilinternallinkgui")
                                {
                                        $this->ctrl->setReturn($this, "explorer");
                                }
                                else
                                {
                                        $this->ctrl->setParameter($this, "obj_id", $ret_obj);
                                        $this->ctrl->setReturn($this, "listMedia");
                                        $this->ctrl->setParameter($this, "obj_id", $_GET["obj_id"]);
                                }
                                $this->getTemplate();
                                $ilObjMediaObjectGUI->setAdminTabs();
                                $this->setLocator();

//echo ":".$tree->getParentId($_GET["obj_id"]).":";
                                //$ret =& $ilObjMediaObjectGUI->executeCommand();
                                $ret =& $this->ctrl->forwardCommand($ilObjMediaObjectGUI);
//echo "<br>ilObjMediaPoolGUI:afterexecute:<br>"; exit;
                                switch($cmd)
                                {
                                        case "save":
                                                $parent = ($_GET["obj_id"] == "")
                                                        ? $tree->getRootId()
                                                        : $_GET["obj_id"];
                                                $tree->insertNode($ret->getId(), $parent);
                                                ilUtil::redirect("mep_edit.php?cmd=listMedia&ref_id=".
                                                        $_GET["ref_id"]."&obj_id=".$_GET["obj_id"]);
                                                break;

                                        default:
                                                $this->tpl->show();
                                                break;
                                }
                                break;

                        case "ilobjfoldergui":
                                $folder_gui = new ilObjFolderGUI("", 0, false, false);
                                $this->ctrl->setReturn($this, "listMedia");
                                $cmd.="Object";
//echo "-$cmd-";
                                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["obj_id"] == "")
                                                        ? $tree->getRootId()
                                                        : $_GET["obj_id"];
                                                $folder_gui->setFolderTree($tree);
                                                $folder_gui->saveObject($parent);
                                                //$this->ctrl->redirect($this, "listMedia");
                                                break;

                                        case "editObject":
                                                $this->prepareOutput();
                                                $folder_gui =& new ilObjFolderGUI("", $_GET["obj_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("", $_GET["obj_id"], false, false);
                                                $this->ctrl->setParameter($this, "obj_id", $this->getParentFolderId());
                                                $this->ctrl->setReturn($this, "listMedia");
                                                $folder_gui->updateObject(true);                // this returns to parent
                                                break;

                                        case "cancelObject":
                                                sendInfo($this->lng->txt("action_aborted"), true);
                                                if ($_GET["foldereditmode"])
                                                {
                                                        $this->ctrl->setParameter($this, "obj_id", $this->getParentFolderId());
                                                }
                                                $this->ctrl->redirect($this, "listMedia");
                                                break;
                                }
                                break;

                        case "ileditclipboardgui":
                                $this->prepareOutput();
                                $this->ctrl->setReturn($this, "listMedia");
                                $clip_gui = new ilEditClipboardGUI();
                                $clip_gui->setMultipleSelections(true);
                                //$ret =& $clip_gui->executeCommand();
                                $ret =& $this->ctrl->forwardCommand($clip_gui);
                                $this->tpl->show();
                                break;
                                
                        case 'ilpermissiongui':
                                $this->prepareOutput();
                                include_once("./classes/class.ilPermissionGUI.php");
                                $perm_gui =& new ilPermissionGUI($this);
                                $ret =& $this->ctrl->forwardCommand($perm_gui);
                                $this->tpl->show();
                                break;

                        default:
                                $this->prepareOutput();
                                $cmd = $this->ctrl->getCmd("frameset");
                                if ($this->creation_mode)
                                {
                                        $cmd.= "Object";
                                }
                                $this->$cmd();  
                                break;
                }
        }

Here is the call graph for this function:

ilObjMediaPoolGUI::explorer (  ) 

output explorer tree

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

References $_GET, $exp, $expanded, $output, ilUtil::getImagePath(), and ilUtil::getStyleSheetLocation().

Referenced by executeCommand().

        {
                $this->tpl = new ilTemplate("tpl.main.html", true, true);

                $this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());

                $this->tpl->addBlockFile("CONTENT", "content", "tpl.explorer.html");
                $this->tpl->setVariable("IMG_SPACE", ilUtil::getImagePath("spacer.gif", false));

                require_once ("content/classes/class.ilMediaPoolExplorer.php");
                $exp = new ilMediaPoolExplorer($this->ctrl->getLinkTarget($this, "listMedia"), $this->object);
                $exp->setTargetGet("obj_id");
                //$exp->setExpandTarget("mep_edit.php?cmd=explorer&ref_id=".$this->object->getRefId());
                $exp->setExpandTarget($this->ctrl->getLinkTarget($this, "explorer"));

                $exp->addFilter("root");
                $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();

                $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->tpl->setVariable("ACTION", "mep_edit.php?cmd=explorer&ref_id=".$this->ref_id."&mepexpand=".$_GET["mepexpand"]);
                $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 (  ) 

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

Definition at line 685 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(
                        "mep_edit.php?cmd=listMedia&ref_id=".$this->ref_id);
                $fs_gui->setSideFrameSource(
                        "mep_edit.php?cmd=explorer&expand=1&ref_id=".$this->ref_id);
                $fs_gui->setFramesetTitle($this->object->getTitle());
                $fs_gui->show();
                exit;
        }

ilObjMediaPoolGUI::getParentFolderId (  ) 

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

References $_GET.

Referenced by executeCommand(), and showUpperIcon().

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

Here is the caller graph for this function:

ilObjMediaPoolGUI::getTabs ( &$  tabs_gui  ) 

adds tabs to tab gui object

Parameters:
object $tabs_gui ilTabsGUI object

Reimplemented from ilObjectGUI.

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

Referenced by setTabs().

        {
                global $ilAccess;
                
                $tabs_gui->addTarget("view_content", $this->ctrl->getLinkTarget($this, "listMedia"),
                        "listMedia", "");

                if ($ilAccess->checkAccess("write", "", $this->object->getRefId()))
                {
                        $tabs_gui->addTarget("edit_properties", $this->ctrl->getLinkTarget($this, "edit"),
                                "edit", array("", "ilobjmediapoolgui"));
                }

                if ($ilAccess->checkAccess("edit_permission", "", $this->object->getRefId()))
                {
                        $tabs_gui->addTarget("perm_settings",
                                $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm"), array("perm","info","owner"), 'ilpermissiongui');
                }

                if ($ilAccess->checkAccess("write", "", $this->object->getRefId()))
                {
                        $tabs_gui->addTarget("clipboard", $this->ctrl->getLinkTargetByClass("ilEditClipboardGUI", "view"),
                                "view", "ileditclipboardgui");
                }
        }

Here is the caller graph for this function:

ilObjMediaPoolGUI::getTemplate (  ) 

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

Referenced by executeCommand().

        {
                $this->tpl->addBlockFile("CONTENT", "content", "tpl.adm_content.html");
                $this->tpl->addBlockFile("STATUSLINE", "statusline", "tpl.statusline.html");
        }

Here is the caller graph for this function:

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

Constructor.

public

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

References $ilCtrl, ilObjectGUI::$lng, and ilObjectGUI::ilObjectGUI().

        {
                global $lng, $ilCtrl;

//echo "<br>ilobjmediapoolgui-constructor-id-$a_id";

                $this->ctrl =& $ilCtrl;
                $this->ctrl->saveParameter($this, array("ref_id", "obj_id"));
                $this->type = "mep";
                $lng->loadLanguageModule("content");
                parent::ilObjectGUI($a_data, $a_id, $a_call_by_reference, $a_prepare_output);

                $this->output_prepared = $a_prepare_output;

                //if (defined("ILIAS_MODULE"))
                //{
                //      $this->setTabTargetScript("mep_edit.php");
                //}
//echo "ilobjmediapoolgui-".get_class($this->object)."-";
        }

Here is the call graph for this function:

ilObjMediaPoolGUI::info (  ) 

info form

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

References ilObjectGUI::infoObject().

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

Here is the call graph for this function:

ilObjMediaPoolGUI::insertFromClipboard (  ) 

insert media object from clipboard

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

References $_GET, $id, ilEditClipboardGUI::_getSelectedIDs(), ilObject::_lookupTitle(), and 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("content/classes/class.ilEditClipboardGUI.php");
                $ids = ilEditClipboardGUI::_getSelectedIDs();
                $not_inserted = array();
                if (is_array($ids))
                {
                        foreach ($ids as $id)
                        {
                                if (!$this->object->insertInTree($id, $_GET["obj_id"]))
                                {
                                        $not_inserted[] = ilObject::_lookupTitle($id)." [".
                                                $id."]";
                                }
                        }
                }
                if (count($not_inserted) > 0)
                {
                        sendInfo($this->lng->txt("mep_not_insert_already_exist")."<br>".
                                implode($not_inserted,"<br>"), true);
                }
                $this->ctrl->redirect($this, "listMedia");
        }

Here is the call graph for this function:

ilObjMediaPoolGUI::listMedia (  ) 

list media objects

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

References $_GET, ilObjectGUI::$obj_id, $tbl, ilObjectGUI::$tree, ilObjMediaObjectGUI::_getMediaInfoHTML(), formSelect(), ilUtil::getImagePath(), and ilUtil::switchColor().

        {
                global $tree, $ilAccess;

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

                //add template for view button
                $this->tpl->addBlockfile("BUTTONS", "buttons", "tpl.buttons.html");

                $obj_id = ($_GET["obj_id"] == "")
                        ? $obj_id = $this->object->tree->getRootId()
                        : $_GET["obj_id"];

                // create table
                require_once("classes/class.ilTableGUI.php");
                $tbl = new ilTableGUI();

                // load files templates
                $this->tpl->addBlockfile("ADM_CONTENT", "adm_content", "tpl.table.html");

                // load template for table content data
                $this->tpl->addBlockfile("TBL_CONTENT", "tbl_content", "tpl.mep_list_row.html", true);

                $num = 0;

                $this->tpl->setVariable("FORMACTION", "mep_edit.php?ref_id=".$_GET["ref_id"].
                        "&obj_id=".$_GET["obj_id"]."&cmd=post");

                $tbl->setHeaderNames(array("", "", $this->lng->txt("title")));

                $cols = array("", "", "title");
                $header_params = array("ref_id" => $_GET["ref_id"],
                        "obj_id" => $_GET["obj_id"], "cmd" => "listMedia");
                $tbl->setHeaderVars($cols, $header_params);
                $tbl->setColumnWidth(array("1%", "1%", "98%"));

                if ($obj_id != $this->object->tree->getRootId())
                {
                        $node = $this->object->tree->getNodeData($obj_id);
                        $tbl->setTitle($node["title"]);
                }
                else
                {
                        $tbl->setTitle($this->object->getTitle());
                }
                
                // control
                $tbl->setOrderColumn($_GET["sort_by"]);
                $tbl->setOrderDirection($_GET["sort_order"]);
                $tbl->setLimit($_GET["limit"]);
                $tbl->setOffset($_GET["offset"]);
                $tbl->setMaxCount($this->maxcount);             // ???

                if ($ilAccess->checkAccess("write", "", $this->object->getRefId()))
                {
                        $this->tpl->setVariable("COLUMN_COUNTS", 3);
        
                        // remove button
                        $this->tpl->setVariable("IMG_ARROW", ilUtil::getImagePath("arrow_downright.gif"));
                        $this->tpl->setCurrentBlock("tbl_action_btn");
                        $this->tpl->setVariable("BTN_NAME", "confirmRemove");
                        $this->tpl->setVariable("BTN_VALUE", $this->lng->txt("remove"));
                        $this->tpl->parseCurrentBlock();
        
                        // copy to clipboard
                        $this->tpl->setCurrentBlock("tbl_action_btn");
                        $this->tpl->setVariable("BTN_NAME", "copyToClipboard");
                        $this->tpl->setVariable("BTN_VALUE", $this->lng->txt("cont_copy_to_clipboard"));
                        $this->tpl->parseCurrentBlock();
                        
                        // copy to clipboard
                        $this->tpl->setCurrentBlock("tbl_action_btn");
                        $this->tpl->setVariable("BTN_NAME", "pasteFromClipboard");
                        $this->tpl->setVariable("BTN_VALUE", $this->lng->txt("cont_paste_from_clipboard"));
                        $this->tpl->parseCurrentBlock();
                }

                // footer
                $tbl->setFooter("tblfooter",$this->lng->txt("previous"),$this->lng->txt("next"));
                //$tbl->disable("footer");
                
                // get current folders
                $fobjs = $this->object->getChilds($_GET["obj_id"], "fold");
                $f2objs = array();
                foreach ($fobjs as $obj)
                {
                        $f2objs[$obj["title"].":".$obj["id"]] = $obj;
                }
                ksort($f2objs);

                // get current media objects
                $mobjs = $this->object->getChilds($_GET["obj_id"], "mob");
                $m2objs = array();
                foreach ($mobjs as $obj)
                {
                        $m2objs[$obj["title"].":".$obj["id"]] = $obj;
                }
                ksort($m2objs);
                
                // merge everything together
                $objs = array_merge($f2objs, $m2objs);
                //$objs = $this->object->getChilds($_GET["obj_id"]);

                $tbl->setMaxCount(count($objs));
                $objs = array_slice($objs, $_GET["offset"], $_GET["limit"]);

                if ($ilAccess->checkAccess("write", "", $this->object->getRefId()))
                {
                        $subobj = array(
                                "mob" => $this->lng->txt("mob"),
                                "fold" => $this->lng->txt("fold"));
                        $opts = ilUtil::formSelect("", "new_type", $subobj, false, true);
                        $this->tpl->setCurrentBlock("add_object");
                        $this->tpl->setVariable("SELECT_OBJTYPE", $opts);
                        $this->tpl->setVariable("BTN_NAME", "create");
                        $this->tpl->setVariable("TXT_ADD", $this->lng->txt("add"));
                        $this->tpl->parseCurrentBlock();
                }
                $tbl->disable("sort");
                //$tbl->disable("title");
                $tbl->disable("header");
                if(count($objs) == 0)
                {
                        //$tbl->disable("footer");
                }
                $tbl->render();
                if(count($objs) > 0)
                {
                        $i=0;
                        foreach($objs as $obj)
                        {
                                $this->tpl->setCurrentBlock("link");
                                $this->tpl->setVariable("TXT_TITLE", $obj["title"]);
                                switch($obj["type"])
                                {
                                        case "fold":
                                                $this->ctrl->setParameter($this, "obj_id", $obj["obj_id"]);
                                                $this->tpl->setVariable("LINK_VIEW",
                                                        $this->ctrl->getLinkTarget($this, "listMedia"));
                                                $this->tpl->parseCurrentBlock();
                                                
                                                if ($ilAccess->checkAccess("write", "", $this->object->getRefId()))
                                                {
                                                        $this->tpl->setCurrentBlock("edit");
                                                        $this->tpl->setVariable("TXT_EDIT", $this->lng->txt("edit"));
                                                        $this->ctrl->setParameterByClass("ilobjfoldergui", "obj_id", $obj["obj_id"]);
                                                        $this->tpl->setVariable("EDIT_LINK",
                                                                $this->ctrl->getLinkTargetByClass("ilobjfoldergui", "edit"));
                                                        $this->tpl->parseCurrentBlock();
                                                }
                                                
                                                $this->tpl->setCurrentBlock("tbl_content");
                                                $this->tpl->setVariable("IMG_OBJ", ilUtil::getImagePath("icon_".$obj["type"].".gif"));
                                                break;

                                        case "mob":
                                                $this->tpl->touchBlock("nf");
                                                $this->ctrl->setParameterByClass("ilobjmediaobjectgui", "obj_id", $obj["obj_id"]);
                                                $this->ctrl->setParameter($this, "mob_id", $obj["obj_id"]);
                                                $this->tpl->setVariable("LINK_VIEW",
                                                        $this->ctrl->getLinkTarget($this, "showMedia"));
                                                        
                                                // edit link
                                                if ($ilAccess->checkAccess("write", "", $this->object->getRefId()))
                                                {
                                                        $this->tpl->setCurrentBlock("edit");
                                                        $this->tpl->setVariable("TXT_EDIT", $this->lng->txt("edit"));
                                                        $this->tpl->setVariable("EDIT_LINK",
                                                                $this->ctrl->getLinkTargetByClass("ilobjmediaobjectgui", "edit"));
                                                        $this->tpl->parseCurrentBlock();
                                                }
                                                /*
                                                $this->tpl->setCurrentBlock("show");
                                                $this->tpl->setVariable("TXT_SHOW", $this->lng->txt("view"));
                                                $this->ctrl->setParameter($this, "mob_id", $obj["obj_id"]);
                                                $this->tpl->setVariable("SHOW_LINK", $this->ctrl->getLinktarget($this, "showMedia"));
                                                $this->tpl->parseCurrentBlock();*/
                                                
                                                $this->tpl->setCurrentBlock("link");
                        //$this->tpl->setVariable("OBJ_URL", ilUtil::getHtmlPath(ilObjMediaObject::_getDirectory($obj["obj_id"]) . '/'. $obj["title"]));
                                                $this->tpl->setCurrentBlock("tbl_content");
                                                
                                                // output thumbnail (or mob icon)
                                                $mob =& new ilObjMediaObject($obj["obj_id"]);
                                                $med =& $mob->getMediaItem("Standard");
                                                $target = $med->getThumbnailTarget();
                                                if ($target != "")
                                                {
                                                        $this->tpl->setVariable("IMG_OBJ", $target);
                                                }
                                                else
                                                {
                                                        $this->tpl->setVariable("IMG_OBJ", ilUtil::getImagePath("icon_".$obj["type"].".gif"));
                                                }
                                                
                                                // output media info
                                                include_once("content/classes/Media/class.ilObjMediaObjectGUI.php");
                                                $this->tpl->setVariable("MEDIA_INFO",
                                                        ilObjMediaObjectGUI::_getMediaInfoHTML($mob));

                                                break;
                                }

                                $css_row = ilUtil::switchColor($i++, "tblrow1", "tblrow2");
                                
                                if ($ilAccess->checkAccess("write", "", $this->object->getRefId()))
                                {
                                        $this->tpl->setCurrentBlock("chbox");
                                        $this->tpl->setVariable("CHECKBOX_ID", $obj["obj_id"]);
                                        $this->tpl->parseCurrentBlock();
                                        $this->tpl->setCurrentBlock("tbl_content");
                                }
                                $this->tpl->setVariable("CSS_ROW", $css_row);
                                $this->tpl->parseCurrentBlock();
                                
                                $this->tpl->setCurrentBlock("mob_row");
                                $this->tpl->parseCurrentBlock();
                        }
                        $this->ctrl->setParameter($this, "obj_id", $_GET["obj_id"]);
                } //if is_array
                else
                {
                        $this->tpl->setCurrentBlock("no_row");
                        $this->tpl->setVariable("CSS_ROW", "tblrow1");
                        $this->tpl->setVariable("TXT_EMPTY_FOLDER",
                                $this->lng->txt("cont_empty_mep_folder"));
                        $this->tpl->parseCurrentBlock();
                }

                $this->tpl->parseCurrentBlock();
                $this->tpl->show();
        }

Here is the call graph for this function:

ilObjMediaPoolGUI::pasteFromClipboard (  ) 

paste from clipboard

Definition at line 885 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")));
//echo ":".$ilCtrl->getLinkTarget($this, "insertFromClipboard").":";
                $ilCtrl->redirectByClass("ilEditClipboardGUI", "getObject");
        }

ilObjMediaPoolGUI::permSave (  ) 

save permissions

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

References $_GET, ilObjectGUI::permSaveObject(), and ilObjectGUI::setReturnLocation().

        {
                $this->setReturnLocation("permSave",
                        "mep_edit.php?ref_id=".$_GET["ref_id"]."&obj_id=".$_GET["obj_id"]."&cmd=perm");
                $this->permSaveObject();
        }

Here is the call graph for this function:

ilObjMediaPoolGUI::remove (  ) 

confirm deletion of

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

References $_SESSION, ilObjectGUI::$obj_id, and sendInfo().

        {
                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);
                }

                sendInfo($this->lng->txt("cont_obj_removed"),true);
                session_unregister("ilMepRemove");
                $this->ctrl->redirect($this, "listMedia");
        }

Here is the call graph for this function:

ilObjMediaPoolGUI::saveObject (  ) 

save object public

Reimplemented from ilObjectGUI.

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

References $rbacadmin, ilUtil::redirect(), and sendInfo().

        {
                global $rbacadmin;

                // create and insert forum in objecttree
                $newObj = parent::saveObject();

                // setup rolefolder & default local roles
                //$roles = $newObj->initDefaultRoles();

                // ...finally assign role to creator of object
                //$rbacadmin->assignUser($roles[0], $newObj->getOwner(), "y");

                // put here object specific stuff

                // always send a message
                sendInfo($this->lng->txt("object_added"),true);

                //ilUtil::redirect($this->getReturnLocation("save","adm_object.php?".$this->link_params));
                ilUtil::redirect("content/mep_edit.php?ref_id=".$newObj->getRefId());

        }

Here is the call graph for this function:

ilObjMediaPoolGUI::setTabs (  ) 

prepare output

output tabs

Reimplemented from ilObjectGUI.

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

References getTabs().

        {
                // catch feedback message
                #include_once("classes/class.ilTabsGUI.php");
                #$tabs_gui =& new ilTabsGUI();
                $this->getTabs($this->tabs_gui);
                #$this->tpl->setVariable("TABS", $tabs_gui->getHTML());
                //$this->tpl->setVariable("HEADER", $this->object->getTitle());
        }

Here is the call graph for this function:

ilObjMediaPoolGUI::showFullscreen (  ) 

show fullscreen

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

References $_GET, $output, ilMediaItem::_getMapAreasIntLinks(), ilObjStyleSheet::getContentStylePath(), ilUtil::getImagePath(), ilUtil::getStyleSheetLocation(), ilUtil::getWebspaceDir(), 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, "content");
                include_once("classes/class.ilObjStyleSheet.php");
                $this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
                $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET",
                        ilObjStyleSheet::getContentStylePath(0));

                //$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("content/classes/Media/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("./content/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");
                $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::showUpperIcon (  ) 

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

Reimplemented from ilObjectGUI.

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

References $_GET, ilObjectGUI::$tpl, and getParentFolderId().

        {
                global $tpl;
                
                parent::showUpperIcon();
                
                if ($_GET["obj_id"] != "")
                {
                        $this->ctrl->setParameter($this, "obj_id",
                                $this->getParentFolderId());
                        $tpl->setUpperIcon($this->ctrl->getLinkTarget($this, "listMedia"));
                        $this->ctrl->setParameter($this, "obj_id", $_GET["obj_id"]);
                }
        }

Here is the call graph for this function:

ilObjMediaPoolGUI::update (  ) 

update properties

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

References ilObjectGUI::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:

ilObjMediaPoolGUI::view (  ) 

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

References ilObjectGUI::viewObject().

        {
                $this->viewObject();
        }

Here is the call graph for this function:


Field Documentation

ilObjMediaPoolGUI::$output_prepared

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


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