Public Member Functions | Data Fields

ilObjMediaPoolGUI Class Reference

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=true)
 Constructor.
 executeCommand ()
 execute command
 saveObject ()
 save object public
 editObject ()
 edit properties of object (admin form)
 edit ()
 edit properties of object (module form)
 cancel ()
 cancel editing
 update ()
 update properties
 perm ()
 permission form
 permSave ()
 save permissions
 addRole ()
 add role
 owner ()
 show owner of media pool
 listMedia ()
 list media objects
 getTemplate ()
 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
 setLocator ($a_tree="", $a_id="", $scriptname="adm_object.php")
 set locator
 createFolderForm ()
 create folder form
 prepareOutput ()
 prepare output
 setTabs ()
 output tabs
 getTabs (&$tabs_gui)
 adds tabs to tab gui object

Data Fields

 $output_prepared

Detailed Description

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


Member Function Documentation

ilObjMediaPoolGUI::addRole (  ) 

add role

Definition at line 314 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::cancel (  ) 

cancel editing

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

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

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

Here is the call graph for this function:

ilObjMediaPoolGUI::cancelRemove (  ) 

cancel deletion of media objects/folders

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

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

ilObjMediaPoolGUI::confirmRemove (  ) 

confirm remove of mobs

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

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

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

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

        {
                global $ilUser;

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

References $_GET, and prepareOutput().

        {
                $this->prepareOutput();

                $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();
        }

Here is the call graph for this function:

ilObjMediaPoolGUI::edit (  ) 

edit properties of object (module form)

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

References $_GET, editObject(), prepareOutput(), 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 231 of file class.ilObjMediaPoolGUI.php.

References $rbacsystem, ilObjectGUI::$tpl, and ilObjectGUI::$tree.

Referenced by edit().

        {
                global $rbacsystem, $tree, $tpl;

                if (!$rbacsystem->checkAccess("visible,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=\"bottom\" ");
                        $this->tpl->setVariable("BTN_TXT",$this->lng->txt("edit"));
                        $this->tpl->parseCurrentBlock();
                }

                parent::editObject();
        }

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, $cmd, ilObjectGUI::$tree, explorer(), getTemplate(), prepareOutput(), ilUtil::redirect(), sendInfo(), and setLocator().

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

                $tree =& $this->object->getTree();
                $next_class = $this->ctrl->getNextClass($this);
                $cmd = $this->ctrl->getCmd();

                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);
                                $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["obj_id"] == "")
                                                        ? $tree->getRootId()
                                                        : $_GET["obj_id"];
                                                $folder_gui->setFolderTree($tree);
                                                $folder_gui->saveObject($parent);
                                                break;

                                        case "editObject":
                                                $this->prepareOutput();
                                                $folder_gui =& new ilObjFolderGUI("", $_GET["obj_id"], false, false);
                                                $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);
                                                $folder_gui->setReturnLocation("update", $this->ctrl->getLinkTarget($this, "listMedia"));
                                                $folder_gui->updateObject();
                                                break;

                                        case "cancelObject":
                                                sendInfo($this->lng->txt("action_aborted"), true);
                                                $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;

                        default:
                                $cmd = $this->ctrl->getCmd("frameset");
                                $this->$cmd();
                                break;
                }
        }

Here is the call graph for this function:

ilObjMediaPoolGUI::explorer (  ) 

output explorer tree

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

References $_GET, $exp, $expanded, $output, 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");

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

        {
                $this->tpl = new ilTemplate("tpl.mep_edit_frameset.html", false, false, "content");
                $this->tpl->setVariable("REF_ID",$this->ref_id);
                $this->tpl->show();
        }

ilObjMediaPoolGUI::getTabs ( &$  tabs_gui  ) 

adds tabs to tab gui object

Parameters:
object $tabs_gui ilTabsGUI object

Reimplemented from ilObjectGUI.

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

Referenced by setTabs().

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

                $tabs_gui->addTarget("edit_properties", $this->ctrl->getLinkTarget($this, "edit"),
                        get_class($this), "edit");

                $tabs_gui->addTarget("permission_settings", $this->ctrl->getLinkTarget($this, "perm"),
                        get_class($this), "perm");

                $tabs_gui->addTarget("show_owner", $this->ctrl->getLinkTarget($this, "owner"),
                        get_class($this), "owner");

                $tabs_gui->addTarget("clipboard", $this->ctrl->getLinkTargetByClass("ilEditClipboardGUI", "view"),
                        "ileditclipboardgui", "view");

        }

Here is the caller graph for this function:

ilObjMediaPoolGUI::getTemplate (  ) 

Definition at line 528 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 = true 
)

Constructor.

public

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

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

        {
                global $lng, $ilCtrl;

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

Here is the call graph for this function:

ilObjMediaPoolGUI::insertFromClipboard (  ) 

insert media object from clipboard

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

References $_GET, $id, ilEditClipboardGUI::_getSelectedIDs(), ilObject::_lookupTitle(), and sendInfo().

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

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

        {
                global $tree;

                if (!$this->output_prepared)
                {
                        $this->prepareOutput();
                }

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

                // create folder form button
                $this->tpl->setCurrentBlock("btn_cell");
                $this->tpl->setVariable("BTN_LINK",
                        $this->ctrl->getLinkTargetByClass("ilobjfoldergui", "create"));
                $this->tpl->setVariable("BTN_TXT",$this->lng->txt("cont_create_folder"));
                $this->tpl->parseCurrentBlock();

                // create mob form button
                $this->tpl->setCurrentBlock("btn_cell");
                $this->tpl->setVariable("BTN_LINK",
                        $this->ctrl->getLinkTargetByClass("ilobjmediaobjectgui", "create"));
                $this->tpl->setVariable("BTN_TXT",$this->lng->txt("cont_create_mob"));
                $this->tpl->parseCurrentBlock();

                $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->setTitle($this->lng->txt("cont_content"));

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

                // control
                $tbl->setOrderColumn($_GET["sort_by"]);
                $tbl->setOrderDirection($_GET["sort_order"]);
                $tbl->setLimit($_GET["limit"]);
                $tbl->setOffset($_GET["offset"]);
                $tbl->setMaxCount($this->maxcount);             // ???

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

                $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();
                                                $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->ctrl->setParameterByClass("ilobjmediaobjectgui", "obj_id", $obj["obj_id"]);
                                                $this->tpl->setVariable("LINK_VIEW",
                                                        $this->ctrl->getLinkTargetByClass("ilobjmediaobjectgui", "edit"));
                                                $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");
                                $this->tpl->setVariable("CHECKBOX_ID", $obj["obj_id"]);
                                $this->tpl->setVariable("CSS_ROW", $css_row);

                                $this->tpl->parseCurrentBlock();
                        }
                        $this->ctrl->setParameter($this, "obj_id", $_GET["obj_id"]);
                } //if is_array
                else
                {
                        $this->tpl->setCurrentBlock("notfound");
                        $this->tpl->setVariable("TXT_OBJECT_NOT_FOUND", $this->lng->txt("obj_not_found"));
                        $this->tpl->setVariable("NUM_COLS", 3);
                        $this->tpl->parseCurrentBlock();
                }

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

Here is the call graph for this function:

ilObjMediaPoolGUI::owner (  ) 

show owner of media pool

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

References ilObjectGUI::ownerObject(), and prepareOutput().

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

Here is the call graph for this function:

ilObjMediaPoolGUI::pasteFromClipboard (  ) 

paste from clipboard

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

References $ilCtrl.

        {
                global $ilCtrl;

                $ilCtrl->setParameterByClass("ileditclipboardgui", "returnCommand",
                        rawurlencode($ilCtrl->getLinkTarget($this,
                        "insertFromClipboard")));
//echo ":".$ilCtrl->getLinkTarget($this, "insertFromClipboard").":";
                $ilCtrl->redirectByClass("ilEditClipboardGUI", "getObject");
        }

ilObjMediaPoolGUI::perm (  ) 

permission form

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

References $_GET, ilObjectGUI::permObject(), prepareOutput(), and ilObjectGUI::setFormAction().

        {
                $this->prepareOutput();
                $this->setFormAction("permSave", "mep_edit.php?cmd=permSave&ref_id=".$_GET["ref_id"].
                        "&obj_id=".$_GET["obj_id"]);
                $this->setFormAction("addRole", "mep_edit.php?ref_id=".$_GET["ref_id"].
                        "&obj_id=".$_GET["obj_id"]."&cmd=addRole");
                $this->permObject();
                $this->tpl->show();
        }

Here is the call graph for this function:

ilObjMediaPoolGUI::permSave (  ) 

save permissions

Definition at line 304 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::prepareOutput (  ) 

prepare output

Reimplemented from ilObjectGUI.

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

References sendInfo(), setLocator(), and setTabs().

Referenced by confirmRemove(), createFolderForm(), edit(), executeCommand(), listMedia(), owner(), and perm().

        {
                if (!defined("ILIAS_MODULE"))
                {
                        parent::prepareOutput();
                        return;
                }

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

                $title = $this->object->getTitle();

                // catch feedback message
                sendInfo();

                if (!empty($title))
                {
                        $this->tpl->setVariable("HEADER", $title);
                }

                $this->setTabs();
                $this->setLocator();
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilObjMediaPoolGUI::remove (  ) 

confirm deletion of

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

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

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

References $rbacadmin, ilObjectGUI::getReturnLocation(), 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));
        }

Here is the call graph for this function:

ilObjMediaPoolGUI::setLocator ( a_tree = "",
a_id = "",
scriptname = "adm_object.php" 
)

set locator

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

References $_GET, $ilias_locator, ilObjectGUI::$obj_id, $path, $row, and ilObjectGUI::$tree.

Referenced by executeCommand(), and prepareOutput().

        {
                global $ilias_locator;

                if (!defined("ILIAS_MODULE"))
                {
                        parent::setLocator();
                        return;
                }
                else
                {
                        $tree =& $this->object->getTree();
                        $obj_id = ($_GET["obj_id"] == "")
                                ? $tree->getRootId()
                                : $_GET["obj_id"];
                        parent::setLocator($tree, $obj_id, "mep_edit.php?cmd=listMedia&ref_id=".$_GET["ref_id"],
                                "obj_id", false, $this->object->getTitle());
                }
                return;

                if (!is_object($a_tree))
                {
                        $a_tree =& $this->tree;
                }

                if (!($a_id))
                {
                        $a_id = $_GET["ref_id"];
                }

                $this->tpl->addBlockFile("LOCATOR", "locator", "tpl.locator.html");

                $path = $a_tree->getPathFull($a_id);

        //check if object isn't in tree, this is the case if parent_parent is set
                // TODO: parent_parent no longer exist. need another marker
                if ($a_parent_parent)
                {
                        //$subObj = getObject($a_ref_id);
                        $subObj =& $this->ilias->obj_factory->getInstanceByRefId($a_ref_id);

                        $path[] = array(
                                "id"     => $a_ref_id,
                                "title"  => $this->lng->txt($subObj->getTitle())
                                );
                }

                // this is a stupid workaround for a bug in PEAR:IT
                $modifier = 1;

                if (isset($_GET["obj_id"]))
                {
                        $modifier = 0;
                }

                // ### AA 03.11.10 added new locator GUI class ###
                $i = 1;

                foreach ($path as $key => $row)
                {
                        if ($key < count($path)-$modifier)
                        {
                                $this->tpl->touchBlock("locator_separator");
                        }

                        $this->tpl->setCurrentBlock("locator_item");
                        $this->tpl->setVariable("ITEM", $row["title"]);

                        $this->tpl->setVariable("LINK_ITEM", $scriptname."?ref_id=".$row["child"]);
                        $this->tpl->parseCurrentBlock();

                        // ### AA 03.11.10 added new locator GUI class ###
                        // navigate locator
                        $ilias_locator->navigate($i++,$row["title"],$scriptname."?ref_id=".$row["child"],"bottom");
                }

                if (isset($_GET["obj_id"]))
                {
                        $obj_data =& $this->ilias->obj_factory->getInstanceByObjId($_GET["obj_id"]);

                        $this->tpl->setCurrentBlock("locator_item");
                        $this->tpl->setVariable("ITEM", $obj_data->getTitle());

                        $this->tpl->setVariable("LINK_ITEM", $scriptname."?ref_id=".$_GET["ref_id"]."&obj_id=".$_GET["obj_id"]);
                        $this->tpl->parseCurrentBlock();

                        // ### AA 03.11.10 added new locator GUI class ###
                        // navigate locator
                        $ilias_locator->navigate($i++,$obj_data->getTitle(),$scriptname."?ref_id=".$_GET["ref_id"]."&obj_id=".$_GET["obj_id"],"bottom");
                }

                $this->tpl->setCurrentBlock("locator");

                if (DEBUG)
                {
                        $debug = "DEBUG: <font color=\"red\">".$this->type."::".$this->id."::".$_GET["cmd"]."</font><br/>";
                }

                $prop_name = $this->objDefinition->getPropertyName($_GET["cmd"],$this->type);

                if ($_GET["cmd"] == "confirmDeleteAdm")
                {
                        $prop_name = "delete_object";
                }

                $this->tpl->setVariable("TXT_LOCATOR",$debug.$this->lng->txt("locator"));
                $this->tpl->parseCurrentBlock();
        }

Here is the caller graph for this function:

ilObjMediaPoolGUI::setTabs (  ) 

output tabs

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

References getTabs().

Referenced by prepareOutput().

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

Here is the call graph for this function:

Here is the caller graph for this function:

ilObjMediaPoolGUI::showFullscreen (  ) 

show fullscreen

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

References $_GET, $args, $output, $params, $xh, $xml, $xsl, ilMediaItem::_getMapAreasIntLinks(), ilObjStyleSheet::getContentStylePath(), ilUtil::getImagePath(), ilUtil::getStyleSheetLocation(), ilUtil::getWebspaceDir(), xslt_create(), xslt_error(), xslt_free(), and xslt_process().

Referenced by showFullscreen().

        {
                $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::update (  ) 

update properties

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

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

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

Here is the call graph for this function:


Field Documentation

ilObjMediaPoolGUI::$output_prepared

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


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