Public Member Functions

ilContainerGUI Class Reference

Inheritance diagram for ilContainerGUI:
Collaboration diagram for ilContainerGUI:

Public Member Functions

 ilContainerGUI ($a_data, $a_id, $a_call_by_reference=true, $a_prepare_output=true)
 Constructor public.
executeCommand ()
 execute command note: this method is overwritten in all container objects
 prepareOutput ()
 prepare output
 showTreeFlatIcon ()
 setTitleAndDescription ()
 called by prepare output
 showPossibleSubObjects ()
 show possible sub objects selection list
 renderObject ()
 display tree view
 showAdministrationPanel (&$tpl)
 show administration panel
 getSubItems ()
 get all subitems of the container
 renderItemList ($a_type="all")
 clearAdminCommandsDetermination ()
 cleaer administration commands determination
 determineAdminCommands ($a_ref_id, $a_admin_com_included_in_list=false)
 determin admin commands
newBlockTemplate ()
 returns a new list block template
 addHeaderRow (&$a_tpl, $a_type, $a_show_image=true)
 adds a header row to a block template
 addStandardRow (&$a_tpl, $a_html, $a_item_ref_id="", $a_item_obj_id="", $a_image_type="")
 adds a standard row to a block template
 resetRowType ()
 addSeparatorRow (&$a_tpl)
 getTabs (&$tabs_gui)
 common tabs for all container objects (should be called at the end of child getTabs() method
 enableAdministrationPanelObject ()
 enable administration panel
 disableAdministrationPanelObject ()
 enable administration panel
 addToDeskObject ()
 subscribe item
 removeFromDeskObject ()
 unsubscribe item
 cutObject ()
 cut object(s) out from a container and write the information to clipboard
 linkObject ()
 create an new reference of an object in tree it's like a hard link of unix
 clearObject ()
 clear clipboard and go back to last object
 pasteObject ()
 paste object from clipboard to current place Depending on the chosen command the object(s) are linked, copied or moved
 clipboardObject ()
 show clipboard
 showCustomIconsEditing ($a_input_colspan=1)
 show edit section of custom icons for container
 isActiveAdministrationPanel ()

Detailed Description

Definition at line 40 of file class.ilContainerGUI.php.


Member Function Documentation

ilContainerGUI::addHeaderRow ( &$  a_tpl,
a_type,
a_show_image = true 
)

adds a header row to a block template

Parameters:
object $a_tpl block template
string $a_type object type private

Definition at line 577 of file class.ilContainerGUI.php.

References ilUtil::getImagePath().

Referenced by ilObjiLincCourseGUI::renderItemList(), and renderItemList().

        {
                if ($a_type != "lres")
                {
                        $icon = ilUtil::getImagePath("icon_".$a_type.".gif");
                        $title = $this->lng->txt("objs_".$a_type);
                }
                else
                {
                        $icon = ilUtil::getImagePath("icon_lm.gif");
                        $title = $this->lng->txt("learning_resources");
                }
                
                if ($a_show_image)
                {
                        $a_tpl->setCurrentBlock("container_header_row_image");
                        $a_tpl->setVariable("HEADER_IMG", $icon);
                        $a_tpl->setVariable("HEADER_ALT", $title);
                }
                else
                {
                        $a_tpl->setCurrentBlock("container_header_row");
                }
                
                $a_tpl->setVariable("BLOCK_HEADER_CONTENT", $title);
                $a_tpl->parseCurrentBlock();
                $a_tpl->touchBlock("container_row");
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilContainerGUI::addSeparatorRow ( &$  a_tpl  ) 

Definition at line 676 of file class.ilContainerGUI.php.

Referenced by ilObjiLincCourseGUI::renderItemList(), and renderItemList().

        {
                $a_tpl->touchBlock("separator_row");
                $a_tpl->touchBlock("container_row");
        }

Here is the caller graph for this function:

ilContainerGUI::addStandardRow ( &$  a_tpl,
a_html,
a_item_ref_id = "",
a_item_obj_id = "",
a_image_type = "" 
)

adds a standard row to a block template

Parameters:
object $a_tpl block template
string $a_html html code private

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

References $path, ilContainer::_lookupIconPath(), ilUtil::getImagePath(), and isActiveAdministrationPanel().

Referenced by ilObjiLincCourseGUI::renderItemList(), and renderItemList().

        {
                $this->cur_row_type = ($this->cur_row_type == "row_type_1")
                        ? "row_type_2"
                        : "row_type_1";

                $a_tpl->touchBlock($this->cur_row_type);
                
                $nbsp = true;
                if ($a_image_type != "")
                {
                        if ($a_image_type != "lres")
                        {
                                $icon = ilUtil::getImagePath("icon_".$a_image_type.".gif");
                                $alt = $this->lng->txt("obj_".$a_image_type);
                        }
                        else
                        {
                                $icon = ilUtil::getImagePath("icon_lm.gif");
                                $alt = $this->lng->txt("learning_resource");
                        }
                        
                        // custom icon
                        if ($this->ilias->getSetting("custom_icons") &&
                                in_array($a_image_type, array("cat","grp","crs")))
                        {
                                require_once("classes/class.ilContainer.php");
                                if (($path = ilContainer::_lookupIconPath($a_item_obj_id, "small")) != "")
                                {
                                        $icon = $path;
                                }
                        }

                        $a_tpl->setCurrentBlock("block_row_image");
                        $a_tpl->setVariable("ROW_IMG", $icon);
                        $a_tpl->setVariable("ROW_ALT", $alt);
                        $a_tpl->parseCurrentBlock();
                        $nbsp = false;
                }

                if ($this->isActiveAdministrationPanel())
                {
                        $a_tpl->setCurrentBlock("block_row_check");
                        $a_tpl->setVariable("ITEM_ID", $a_item_ref_id);
                        $a_tpl->parseCurrentBlock();
                        $nbsp = false;
                }
                if ($nbsp)
                {
                        $a_tpl->setVariable("ROW_NBSP", " ");
                }
                $a_tpl->setCurrentBlock("container_standard_row");
                $a_tpl->setVariable("BLOCK_ROW_CONTENT", $a_html);
                $a_tpl->parseCurrentBlock();
                $a_tpl->touchBlock("container_row");
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilContainerGUI::addToDeskObject (  ) 

subscribe item

Definition at line 732 of file class.ilContainerGUI.php.

References $_GET, $_POST, $type, ilObject::_lookupType(), and renderObject().

        {
                if ($_GET["item_ref_id"] and $_GET["type"])
                {
                        $this->ilias->account->addDesktopItem($_GET["item_ref_id"], $_GET["type"]);
                }
                else
                {
                        if ($_POST["items"])
                        {
                                foreach ($_POST["items"] as $item)
                                {
                                        $type = ilObject::_lookupType($item, true);
                                        $this->ilias->account->addDesktopItem($item, $type);
                                        unset($tmp_obj);
                                }
                        }
                }
                $this->renderObject();
        }

Here is the call graph for this function:

ilContainerGUI::clearAdminCommandsDetermination (  ) 

cleaer administration commands determination

Definition at line 531 of file class.ilContainerGUI.php.

Referenced by renderItemList().

        {
                $this->adminCommands = false;
        }

Here is the caller graph for this function:

ilContainerGUI::clearObject (  ) 

clear clipboard and go back to last object

public

Definition at line 926 of file class.ilContainerGUI.php.

References $_POST, and $_SESSION.

Referenced by pasteObject().

        {
                unset($_SESSION["clipboard"]);
                unset($_SESSION["il_rep_clipboard"]);
                //var_dump($this->getReturnLocation("clear",$this->ctrl->getLinkTarget($this)),get_class($this));

                // only redirect if clipboard was cleared
                if (isset($_POST["cmd"]["clear"]))
                {
                        sendinfo($this->lng->txt("msg_clear_clipboard"),true);

                        $this->ctrl->returnToParent($this);
                        //ilUtil::redirect($this->getReturnLocation("clear",$this->ctrl->getLinkTarget($this)),get_class($this));
                }
        }

Here is the caller graph for this function:

ilContainerGUI::clipboardObject (  ) 

show clipboard

Definition at line 1288 of file class.ilContainerGUI.php.

References $_SESSION, $counter, $ilErr, $ilLog, ilObjectGUI::$ref_id, ilObjectGUI::__showClipboardTable(), and ilObjectFactory::getInstanceByRefId().

        {
                global $ilErr,$ilLog;

                // function should not be called if clipboard is empty
                if (empty($_SESSION['clipboard']) or !is_array($_SESSION['clipboard']))
                {
                        $message = sprintf('%s::clipboardObject(): Illegal access. Clipboard variable is empty!', get_class($this));
                        $ilLog->write($message,$ilLog->FATAL);
                        $ilErr->raiseError($this->lng->txt("permission_denied"),$ilErr->WARNING);
                }

                $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.rep_clipboard.html");

                // FORMAT DATA
                $counter = 0;
                $f_result = array();

                foreach($_SESSION["clipboard"]["ref_ids"] as $ref_id)
                {
                        if(!$tmp_obj = ilObjectFactory::getInstanceByRefId($ref_id,false))
                        {
                                continue;
                        }

                        //$f_result[$counter][] = ilUtil::formCheckbox(0,"user[]",$user);
                        $f_result[$counter][] = $this->lng->txt("obj_".$tmp_obj->getType());
                        $f_result[$counter][] = $tmp_obj->getTitle();
                        //$f_result[$counter][] = $tmp_obj->getDescription();
                        $f_result[$counter][] = ($_SESSION["clipboard"]["cmd"] == "cut") ? $this->lng->txt("move") :$this->lng->txt($_SESSION["clipboard"]["cmd"]);

                        unset($tmp_obj);
                        ++$counter;
                }

                $this->__showClipboardTable($f_result, "clipboardObject");

                return true;
        }

Here is the call graph for this function:

ilContainerGUI::cutObject (  ) 

cut object(s) out from a container and write the information to clipboard

public

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

References $_GET, $_POST, $_SESSION, $rbacsystem, ilObjectGUI::$ref_id, and ilObjectGUI::getTitlesByRefId().

        {
                global $rbacsystem;
                
                if ($_GET["item_ref_id"] != "")
                {
                        $_POST["id"] = array($_GET["item_ref_id"]);
                }

                //$this->ilias->raiseError("move operation does not work at the moment and is disabled",$this->ilias->error_obj->MESSAGE);

//echo "CUT";
//echo $_SESSION["referer"];
                if (!isset($_POST["id"]))
                {
                        $this->ilias->raiseError($this->lng->txt("no_checkbox"),$this->ilias->error_obj->MESSAGE);
                }

                // FOR ALL OBJECTS THAT SHOULD BE COPIED
                foreach ($_POST["id"] as $ref_id)
                {
                        // GET COMPLETE NODE_DATA OF ALL SUBTREE NODES
                        $node_data = $this->tree->getNodeData($ref_id);
                        $subtree_nodes = $this->tree->getSubTree($node_data);

                        $all_node_data[] = $node_data;
                        $all_subtree_nodes[] = $subtree_nodes;

                        // CHECK DELETE PERMISSION OF ALL OBJECTS IN ACTUAL SUBTREE
                        foreach ($subtree_nodes as $node)
                        {
                                if (!$rbacsystem->checkAccess('delete',$node["ref_id"]))
                                {
                                        $no_cut[] = $node["ref_id"];
                                }
                        }
                }
                // IF THERE IS ANY OBJECT WITH NO PERMISSION TO 'delete'
                if (count($no_cut))
                {
                        $this->ilias->raiseError($this->lng->txt("msg_no_perm_cut")." ".implode(',',$this->getTitlesByRefId($no_cut)),
                                                                         $this->ilias->error_obj->MESSAGE);
                }
                //echo "GET";var_dump($_GET);echo "POST";var_dump($_POST);
                $_SESSION["clipboard"]["parent"] = $_GET["ref_id"];
                $_SESSION["clipboard"]["cmd"] = ($_GET["cmd"] != "" && $_GET["cmd"] != "post")
                        ? $_GET["cmd"]
                        : key($_POST["cmd"]);
//echo "-".$clipboard["cmd"]."-";
                $_SESSION["clipboard"]["ref_ids"] = $_POST["id"];
//echo "-".$_SESSION["clipboard"]["cmd"]."-";

                sendinfo($this->lng->txt("msg_cut_clipboard"),true);

                $this->ctrl->returnToParent($this);

        } // END CUT

Here is the call graph for this function:

ilContainerGUI::determineAdminCommands ( a_ref_id,
a_admin_com_included_in_list = false 
)

determin admin commands

Definition at line 539 of file class.ilContainerGUI.php.

References isActiveAdministrationPanel().

Referenced by renderItemList().

        {
                if (!$this->adminCommands)
                {
                        if (!$this->isActiveAdministrationPanel())
                        {
                                if ($this->rbacsystem->checkAccess("delete", $a_ref_id))
                                {
                                        $this->adminCommands = true;
                                }
                        }
                        else
                        {
                                $this->adminCommands = $a_admin_com_included_in_list;
                        }
                }
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilContainerGUI::disableAdministrationPanelObject (  ) 

enable administration panel

Definition at line 723 of file class.ilContainerGUI.php.

References $_SESSION.

        {
                $_SESSION["il_cont_admin_panel"] = false;
                $this->ctrl->redirect($this, "render");
        }

ilContainerGUI::enableAdministrationPanelObject (  ) 

enable administration panel

Definition at line 714 of file class.ilContainerGUI.php.

References $_SESSION.

        {
                $_SESSION["il_cont_admin_panel"] = true;
                $this->ctrl->redirect($this, "render");
        }

& ilContainerGUI::executeCommand (  ) 

execute command note: this method is overwritten in all container objects

Reimplemented from ilObjectGUI.

Reimplemented in ilObjCategoryGUI, ilObjFolderGUI, ilObjGroupGUI, ilObjRecoveryFolderGUI, ilObjRootFolderGUI, ilObjCourseGUI, and ilObjiLincCourseGUI.

Definition at line 63 of file class.ilContainerGUI.php.

References $cmd, and prepareOutput().

        {
                $next_class = $this->ctrl->getNextClass();
                $cmd = $this->ctrl->getCmd("render");

                switch($next_class)
                {
                        default:
                                $this->prepareOutput();
                                $cmd .= "Object";
                                $this->$cmd();

                                break;
                }
                return true;
        }

Here is the call graph for this function:

ilContainerGUI::getSubItems (  ) 

get all subitems of the container

Reimplemented in ilObjiLincCourseGUI.

Definition at line 361 of file class.ilContainerGUI.php.

References $ilBench, $key, ilObjectGUI::$objDefinition, ilObjectGUI::$object, and $type.

Referenced by renderObject().

        {
                global $objDefinition, $ilBench;

                $objects = $this->tree->getChilds($this->object->getRefId(), "title");

                $found = false;

                foreach ($objects as $key => $object)
                {

                        // hide object types in devmode
                        if ($objDefinition->getDevMode($object["type"]))
                        {
                                continue;
                        }

                        // group together types (e.g. ILIAS learning modules
                        // and SCORM learning modules to learning materials)
                        switch ($object["type"])
                        {
                                // learning material
                                case "sahs":
                                case "lm":
                                case "dbk":
                                case "htlm":
                                        $type = "lres";
                                        break;

                                default:
                                        $type = $object["type"];
                                        break;
                        }

                        $this->items[$type][$key] = $object;
                }
        }

Here is the caller graph for this function:

ilContainerGUI::getTabs ( &$  tabs_gui  ) 

common tabs for all container objects (should be called at the end of child getTabs() method

Reimplemented from ilObjectGUI.

Reimplemented in ilObjCategoryGUI, ilObjFolderGUI, ilObjGroupGUI, ilObjRootFolderGUI, ilObjCourseGUI, and ilObjiLincCourseGUI.

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

References $_SESSION, and $rbacsystem.

        {
                global $rbacsystem;

                // edit permissions
                if ($rbacsystem->checkAccess('edit_permission',$this->ref_id))
                {
                        $tabs_gui->addTarget("perm_settings",
                                $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm"), array("perm","info","owner"), 'ilpermissiongui');
                }

                // show clipboard
                if ($this->ctrl->getTargetScript() == "repository.php" and !empty($_SESSION["clipboard"]))
                {
                        $tabs_gui->addTarget("clipboard",
                                 $this->ctrl->getLinkTarget($this, "clipboard"), "clipboard", get_class($this));
                }

        }

ilContainerGUI::ilContainerGUI ( a_data,
a_id,
a_call_by_reference = true,
a_prepare_output = true 
)

Constructor public.

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

References $rbacsystem, and ilObjectGUI::ilObjectGUI().

Referenced by ilObjCategoryGUI::ilObjCategoryGUI(), ilObjCourseGUI::ilObjCourseGUI(), ilObjFolderGUI::ilObjFolderGUI(), ilObjGroupGUI::ilObjGroupGUI(), ilObjiLincCourseGUI::ilObjiLincCourseGUI(), and ilObjRootFolderGUI::ilObjRootFolderGUI().

        {
                global $rbacsystem;

                $this->rbacsystem =& $rbacsystem;

                //$this->ilObjectGUI($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
                
                // prepare output things should generally be made in executeCommand
                // method (maybe dependent on current class/command
                $this->ilObjectGUI($a_data, $a_id, $a_call_by_reference, false);
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilContainerGUI::isActiveAdministrationPanel (  ) 

Reimplemented in ilObjiLincCourseGUI.

Definition at line 1369 of file class.ilContainerGUI.php.

References $_SESSION.

Referenced by addStandardRow(), determineAdminCommands(), renderItemList(), and showAdministrationPanel().

        {
                return $_SESSION["il_cont_admin_panel"];
        }

Here is the caller graph for this function:

ilContainerGUI::linkObject (  ) 

create an new reference of an object in tree it's like a hard link of unix

public

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

References $_GET, $_POST, $_SESSION, ilObjectGUI::$object, $rbacadmin, $rbacsystem, ilObjectGUI::$ref_id, and $type.

        {
                global $clipboard, $rbacsystem, $rbacadmin;
                
                if ($_GET["item_ref_id"] != "")
                {
                        $_POST["id"] = array($_GET["item_ref_id"]);
                }

                if (!isset($_POST["id"]))
                {
                        $this->ilias->raiseError($this->lng->txt("no_checkbox"),$this->ilias->error_obj->MESSAGE);
                }

                // CHECK ACCESS
                foreach ($_POST["id"] as $ref_id)
                {
                        if (!$rbacsystem->checkAccess('delete',$ref_id))
                        {
                                $no_cut[] = $ref_id;
                        }

                        $object =& $this->ilias->obj_factory->getInstanceByRefId($ref_id);

                        if (!$this->objDefinition->allowLink($object->getType()))
                        {
                                $no_link[] = $object->getType();
                        }
                }

                // NO ACCESS
                if (count($no_cut))
                {
                        $this->ilias->raiseError($this->lng->txt("msg_no_perm_link")." ".
                                                                         implode(',',$no_cut),$this->ilias->error_obj->MESSAGE);
                }

                if (count($no_link))
                {
                        $no_link = array_unique($no_link);

                        foreach ($no_link as $type)
                        {
                                $txt_objs[] = $this->lng->txt("objs_".$type);
                        }

                        $this->ilias->raiseError(implode(', ',$txt_objs)." ".$this->lng->txt("msg_obj_no_link"),$this->ilias->error_obj->MESSAGE);

                        //$this->ilias->raiseError($this->lng->txt("msg_not_possible_link")." ".
                        //                                               implode(',',$no_link),$this->ilias->error_obj->MESSAGE);
                }

                // WRITE TO CLIPBOARD
                $clipboard["parent"] = $_GET["ref_id"];
                $clipboard["cmd"] = ($_GET["cmd"] != "" && $_GET["cmd"] != "post")
                        ? $_GET["cmd"]
                        : key($_POST["cmd"]);

                foreach ($_POST["id"] as $ref_id)
                {
                        $clipboard["ref_ids"][] = $ref_id;
                }

                $_SESSION["clipboard"] = $clipboard;

                sendinfo($this->lng->txt("msg_link_clipboard"),true);

                $this->ctrl->returnToParent($this);

        } // END LINK

& ilContainerGUI::newBlockTemplate (  ) 

returns a new list block template

private

Returns:
object block template

Definition at line 563 of file class.ilContainerGUI.php.

References ilObjectGUI::$tpl.

Referenced by ilObjiLincCourseGUI::renderItemList(), and renderItemList().

        {
                $tpl = new ilTemplate ("tpl.container_list_block.html", true, true);
                $this->cur_row_type = "row_type_1";
                return $tpl;
        }

Here is the caller graph for this function:

ilContainerGUI::pasteObject (  ) 

paste object from clipboard to current place Depending on the chosen command the object(s) are linked, copied or moved

public

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

References $_GET, $_SESSION, $key, $log, $rbacadmin, $rbacreview, $rbacsystem, ilObjectGUI::$ref_id, clearObject(), ilObjectGUI::removeDeletedNodes(), and sendInfo().

        {
                global $rbacsystem, $rbacadmin, $rbacreview, $log;

//var_dump($_SESSION["clipboard"]);exit;
                if (!in_array($_SESSION["clipboard"]["cmd"],array("cut","link","copy")))
                {
                        $message = get_class($this)."::pasteObject(): cmd was neither 'cut','link' or 'copy'; may be a hack attempt!";
                        $this->ilias->raiseError($message,$this->ilias->error_obj->WARNING);
                }

                // this loop does all checks
                foreach ($_SESSION["clipboard"]["ref_ids"] as $ref_id)
                {
                        $obj_data =& $this->ilias->obj_factory->getInstanceByRefId($ref_id);

                        // CHECK ACCESS
                        if (!$rbacsystem->checkAccess('create',$this->object->getRefId(), $obj_data->getType()))
                        {
                                $no_paste[] = $ref_id;
                        }

                        // CHECK IF REFERENCE ALREADY EXISTS
                        if ($this->object->getRefId() == $this->tree->getParentId($obj_data->getRefId()))
                        {
                                $exists[] = $ref_id;
                                break;
                        }

                        // CHECK IF PASTE OBJECT SHALL BE CHILD OF ITSELF
                        if ($this->tree->isGrandChild($ref_id,$this->object->getRefId()))
                        {
                                $is_child[] = $ref_id;
                        }

                        // CHECK IF OBJECT IS ALLOWED TO CONTAIN PASTED OBJECT AS SUBOBJECT
                        $obj_type = $obj_data->getType();

                        if (!in_array($obj_type, array_keys($this->objDefinition->getSubObjects($this->object->getType()))))
                        {
                                $not_allowed_subobject[] = $obj_data->getType();
                        }
                }

                // process checking results
                if (count($exists))
                {
                        $this->ilias->raiseError($this->lng->txt("msg_obj_exists"),$this->ilias->error_obj->MESSAGE);
                }

                if (count($is_child))
                {
                        $this->ilias->raiseError($this->lng->txt("msg_not_in_itself")." ".implode(',',$is_child),
                                                                         $this->ilias->error_obj->MESSAGE);
                }

                if (count($not_allowed_subobject))
                {
                        $this->ilias->raiseError($this->lng->txt("msg_may_not_contain")." ".implode(',',$not_allowed_subobject),
                                                                         $this->ilias->error_obj->MESSAGE);
                }

                if (count($no_paste))
                {
                        $this->ilias->raiseError($this->lng->txt("msg_no_perm_paste")." ".
                                                                         implode(',',$no_paste),$this->ilias->error_obj->MESSAGE);
                }

                // log pasteObject call
                $log->write("ilObjectGUI::pasteObject(), cmd: ".$_SESSION["clipboard"]["cmd"]);

                // everything ok: now paste the objects to new location

                // to prevent multiple actions via back/reload button
                $ref_ids = $_SESSION["clipboard"]["ref_ids"];
                unset($_SESSION["clipboard"]["ref_ids"]);

                // process COPY command
                if ($_SESSION["clipboard"]["cmd"] == "copy")
                {
                        // CALL PRIVATE CLONE METHOD
                        $this->cloneObject($ref_ids);
                }

                // process CUT command
                if ($_SESSION["clipboard"]["cmd"] == "cut")
                {
                        // get subtrees
                        foreach($ref_ids as $ref_id)
                        {
                                // get node data
                                $top_node = $this->tree->getNodeData($ref_id);

                                // get subnodes of top nodes
                                $subnodes[$ref_id] = $this->tree->getSubtree($top_node);
                        }

                        // STEP 1: Move all subtrees to trash
                        $log->write("ilObjectGUI::pasteObject(), (1/3) move subtrees to trash");

                        foreach($ref_ids as $ref_id)
                        {
                                $tnodes = $this->tree->getSubtree($this->tree->getNodeData($ref_id));

                                foreach ($tnodes as $tnode)
                                {
                                        $rbacadmin->revokePermission($tnode["child"],0,false);
                                        
                                        // we don't remove the item from the personal desktop,
                                        // just due to moving it
                                        //$affected_users = ilUtil::removeItemFromDesktops($tnode["child"]);
                                }

                                $this->tree->saveSubTree($ref_id);
                                $this->tree->deleteTree($this->tree->getNodeData($ref_id));
                        }

                        // STEP 2: Move all subtrees to new location
                        $log->write("ilObjectGUI::pasteObject(), (2/3) move subtrees to new location");

                        // TODO: this whole put in place again stuff needs revision. Permission settings get lost.
                        foreach ($subnodes as $key => $subnode)
                        {
$log->write("ilObjectGUI::pasteObject(), 0");
                                // first paste top_node ...
                                $rbacadmin->revokePermission($key,0,false);
$log->write("ilObjectGUI::pasteObject(), 1");
                                $obj_data =& $this->ilias->obj_factory->getInstanceByRefId($key);
$log->write("ilObjectGUI::pasteObject(), 2");
                                $obj_data->putInTree($this->object->getRefId());
$log->write("ilObjectGUI::pasteObject(), 3");
                                $obj_data->setPermissions($key);
$log->write("ilObjectGUI::pasteObject(), 4");
                                // log entry
                                $log->write("ilObjectGUI::pasteObject(), inserted top node. ref_id: $key,".
                                        " rgt: ".$subnode[0]["rgt"].", lft: ".$subnode[0]["lft"].", parent: ".$subnode[0]["parent"].",".
                                        " obj_id: ".$obj_data->getId().", type: ".$obj_data->getType().
                                        ", title: ".$obj_data->getTitle());

                                // ... remove top_node from list ...
                                array_shift($subnode);

                                // ... insert subtree of top_node if any subnodes exist
                                if (count($subnode) > 0)
                                {
                                        foreach ($subnode as $node)
                                        {
                                                $rbacadmin->revokePermission($node["child"],0,false);
                                                $obj_data =& $this->ilias->obj_factory->getInstanceByRefId($node["child"]);
                                                $obj_data->putInTree($node["parent"]);
                                                $obj_data->setPermissions($node["parent"]);

                                                // log entry
                                                $log->write("ilObjectGUI::pasteObject(), inserted subnode. ref_id: ".$node["child"].",".
                                                        " rgt: ".$node["rgt"].", lft: ".$node["lft"].", parent: ".$node["parent"].",".
                                                        " obj_id: ".$obj_data->getId().", type: ".$obj_data->getType().
                                                        ", title: ".$obj_data->getTitle());
                                        }
                                }
                        }

                        // STEP 3: Remove trashed objects from system
                        $log->write("ilObjectGUI::pasteObject(), (3/3) remove trashed subtrees from system");

                        foreach ($ref_ids as $ref_id)
                        {
                                // GET COMPLETE NODE_DATA OF ALL SUBTREE NODES
                                $saved_tree = new ilTree(-(int)$ref_id);
                                $node_data = $saved_tree->getNodeData($ref_id);
                                $subtree_nodes = $saved_tree->getSubTree($node_data);

                                // remember already checked deleted node_ids
                                $checked[] = -(int) $ref_id;

                                // dive in recursive manner in each already deleted subtrees and remove these objects too
                                $this->removeDeletedNodes($ref_id, $checked, false);

                                // delete save tree
                                $this->tree->deleteTree($node_data);

                                // write log entry
                                $log->write("ilObjectGUI::pasteObject(), deleted tree, tree_id: ".$node_data["tree"].
                                        ", child: ".$node_data["child"]);
                        }


                        $log->write("ilObjectGUI::pasteObject(), cut finished");

                        // inform other objects in hierarchy about paste operation
                        //$this->object->notify("paste",$this->object->getRefId(),$_SESSION["clipboard"]["parent_non_rbac_id"],$this->object->getRefId(),$subnodes);

                        // inform other objects in hierarchy about cut operation
                        // the parent object where cut occured
                        $tmp_object = $this->ilias->obj_factory->getInstanceByRefId($_SESSION["clipboard"]["parent"]);
                        //$tmp_object->notify("cut", $tmp_object->getRefId(),$_SESSION["clipboard"]["parent_non_rbac_id"],$tmp_object->getRefId(),$ref_ids);
                        unset($tmp_object);
                } // END CUT

                // process LINK command
                if ($_SESSION["clipboard"]["cmd"] == "link")
                {
                        foreach ($ref_ids as $ref_id)
                        {
                                // get node data
                                $top_node = $this->tree->getNodeData($ref_id);

                                // get subnodes of top nodes
                                $subnodes[$ref_id] = $this->tree->getSubtree($top_node);
                        }

                        // now move all subtrees to new location
                        foreach ($subnodes as $key => $subnode)
                        {
                                // first paste top_node....
                                $obj_data =& $this->ilias->obj_factory->getInstanceByRefId($key);
                                $new_ref_id = $obj_data->createReference();
                                $obj_data->putInTree($_GET["ref_id"]);
                                $obj_data->setPermissions($_GET["ref_id"]);

                                // ... remove top_node from list ...
                                array_shift($subnode);

                                // ... store mapping of old ref_id => new_ref_id in hash array ...
                                $mapping[$new_ref_id] = $key;

                                // save old ref_id & create rolefolder if applicable
                                $old_ref_id = $obj_data->getRefId();
                                $obj_data->setRefId($new_ref_id);
                                $obj_data->initDefaultRoles();
                                $rolf_data = $rbacreview->getRoleFolderOfObject($obj_data->getRefId());

                                if (isset($rolf_data["child"]))
                                {
                                        // a role folder was created, so map it to old role folder
                                        $rolf_data_old = $rbacreview->getRoleFolderOfObject($old_ref_id);

                                        // ... use mapping array to find out the correct new parent node where to put in the node...
                                        //$new_parent = array_search($node["parent"],$mapping);
                                        // ... append node to mapping for further possible subnodes ...
                                        $mapping[$rolf_data["child"]] = (int) $rolf_data_old["child"];

                                        // log creation of role folder
                                        $log->write("ilObjectGUI::pasteObject(), created role folder (ref_id): ".$rolf_data["child"].
                                                ", for object ref_id:".$obj_data->getRefId().", obj_id: ".$obj_data->getId().
                                                ", type: ".$obj_data->getType().", title: ".$obj_data->getTitle());

                                }

                                // ... insert subtree of top_node if any subnodes exist ...
                                if (count($subnode) > 0)
                                {
                                        foreach ($subnode as $node)
                                        {
                                                if ($node["type"] != 'rolf')
                                                {
                                                        $obj_data =& $this->ilias->obj_factory->getInstanceByRefId($node["child"]);
                                                        $new_ref_id = $obj_data->createReference();

                                                        // ... use mapping array to find out the correct new parent node where to put in the node...
                                                        $new_parent = array_search($node["parent"],$mapping);
                                                        // ... append node to mapping for further possible subnodes ...
                                                        $mapping[$new_ref_id] = (int) $node["child"];

                                                        $obj_data->putInTree($new_parent);
                                                        $obj_data->setPermissions($new_parent);

                                                        // save old ref_id & create rolefolder if applicable
                                                        $old_ref_id = $obj_data->getRefId();
                                                        $obj_data->setRefId($new_ref_id);
                                                        $obj_data->initDefaultRoles();
                                                        $rolf_data = $rbacreview->getRoleFolderOfObject($obj_data->getRefId());

                                                        if (isset($rolf_data["child"]))
                                                        {
                                                                // a role folder was created, so map it to old role folder
                                                                $rolf_data_old = $rbacreview->getRoleFolderOfObject($old_ref_id);

                                                                // ... use mapping array to find out the correct new parent node where to put in the node...
                                                                //$new_parent = array_search($node["parent"],$mapping);
                                                                // ... append node to mapping for further possible subnodes ...
                                                                $mapping[$rolf_data["child"]] = (int) $rolf_data_old["child"];

                                                                // log creation of role folder
                                                                $log->write("ilObjectGUI::pasteObject(), created role folder (ref_id): ".$rolf_data["child"].
                                                                        ", for object ref_id:".$obj_data->getRefId().", obj_id: ".$obj_data->getId().
                                                                        ", type: ".$obj_data->getType().", title: ".$obj_data->getTitle());

                                                        }
                                                }

                                                // re-map $subnodes
                                                foreach ($subnodes as $old_ref => $subnode)
                                                {
                                                        $new_ref = array_search($old_ref,$mapping);

                                                        foreach ($subnode as $node)
                                                        {
                                                                $node["child"] = array_search($node["child"],$mapping);
                                                                $node["parent"] = array_search($node["parent"],$mapping);
                                                                $new_subnodes[$ref_id][] = $node;
                                                        }
                                                }

                                        }
                                }
                        }

                        $log->write("ilObjectGUI::pasteObject(), link finished");

                        // inform other objects in hierarchy about link operation
                        //$this->object->notify("link",$this->object->getRefId(),$_SESSION["clipboard"]["parent_non_rbac_id"],$this->object->getRefId(),$subnodes);
                } // END LINK

                // save cmd for correct message output after clearing the clipboard
                $last_cmd = $_SESSION["clipboard"]["cmd"];


                // clear clipboard
                $this->clearObject();

                if ($last_cmd == "cut")
                {
                        sendInfo($this->lng->txt("msg_cut_copied"),true);
                }
                else
                {
                        sendInfo($this->lng->txt("msg_linked"),true);
                }

                $this->ctrl->returnToParent($this);

        } // END PASTE

Here is the call graph for this function:

ilContainerGUI::prepareOutput (  ) 

prepare output

Reimplemented from ilObjectGUI.

Definition at line 83 of file class.ilContainerGUI.php.

References ilObjectGUI::getCreationMode(), and showTreeFlatIcon().

Referenced by ilObjiLincCourseGUI::executeCommand(), ilObjCourseGUI::executeCommand(), ilObjRootFolderGUI::executeCommand(), ilObjRecoveryFolderGUI::executeCommand(), ilObjGroupGUI::executeCommand(), ilObjFolderGUI::executeCommand(), ilObjCategoryGUI::executeCommand(), and executeCommand().

        {
                if (parent::prepareOutput())    // return false in admin mode
                {
                        if ($this->getCreationMode() != true)
                        {
                                // This method is called directly from ilContainerGUI::renderObject
                                #$this->showPossibleSubObjects();
                                $this->showTreeFlatIcon();
                        }
                }
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilContainerGUI::removeFromDeskObject (  ) 

unsubscribe item

Definition at line 756 of file class.ilContainerGUI.php.

References $_GET, $_POST, $type, ilObject::_lookupType(), and renderObject().

        {
                if ($_GET["item_ref_id"] and $_GET["type"])
                {
                        $this->ilias->account->dropDesktopItem($_GET["item_ref_id"], $_GET["type"]);
                }
                else
                {
                        if ($_POST["items"])
                        {
                                foreach ($_POST["items"] as $item)
                                {
                                        $type = ilObject::_lookupType($item, true);
                                        $this->ilias->account->dropDesktopItem($item, $type);
                                        unset($tmp_obj);
                                }
                        }
                }
                $this->renderObject();
        }

Here is the call graph for this function:

ilContainerGUI::renderItemList ( a_type = "all"  ) 

Reimplemented in ilObjiLincCourseGUI.

Definition at line 399 of file class.ilContainerGUI.php.

References $ilBench, $key, ilObjectGUI::$objDefinition, ilObjectGUI::$tpl, $type, ilObjectListGUIFactory::_getListGUIByType(), addHeaderRow(), addSeparatorRow(), addStandardRow(), clearAdminCommandsDetermination(), determineAdminCommands(), isActiveAdministrationPanel(), newBlockTemplate(), and resetRowType().

Referenced by renderObject().

        {
                global $objDefinition, $ilBench;
                
                include_once("classes/class.ilObjectListGUIFactory.php");

                $html = "";
                $this->clearAdminCommandsDetermination();
                
                switch ($a_type)
                {
                        // render all items list
                        case "all":

                                // to do: implement all types
                                /*
                                $type_ordering = array(
                                        "cat", "fold", "crs", "grp",
                                        "lres", "glo", "chat", "frm",
                                        "exc", "file", "mep", "qpl", "tst", "spl", "svy",
                                        "icrs", "icla", "webr"
                                );*/

                                // resource type ordering
                                // (note that resource type is not equal object type,
                                // the resource type "lres" contains the object types
                                // "lm", "dbk", "sahs" and "htlm")
                                $type_ordering = array(
                                        "cat", "fold", "crs", "icrs", "icla", "grp", "chat", "frm", "lres",
                                        "glo", "webr", "file", "exc",
                                        "tst", "svy", "mep", "qpl", "spl");

                                $cur_obj_type = "";
                                $tpl =& $this->newBlockTemplate();
                                $first = true;
                                foreach ($type_ordering as $type)
                                {
                                        $item_html = array();

                                        if (is_array($this->items[$type]))
                                        {
                                                foreach($this->items[$type] as $key => $item)
                                                {
                                                        // get list gui class for each object type
                                                        if ($cur_obj_type != $item["type"])
                                                        {
                                                                /*
                                                                $class = $objDefinition->getClassName($item["type"]);
                                                                $location = $objDefinition->getLocation($item["type"]);
                                                                $full_class = "ilObj".$class."ListGUI";
                                                                include_once($location."/class.".$full_class.".php");
                                                                $item_list_gui = new $full_class();*/
                                                                $item_list_gui =& ilObjectListGUIFactory::_getListGUIByType($item["type"]);
                                                                $item_list_gui->setContainerObject($this);
                                                        }
                                                        // render item row
                                                        $ilBench->start("ilContainerGUI", "0210_getListHTML");
                                                        
                                                        // show administration command buttons (or not)
                                                        if (!$this->isActiveAdministrationPanel())
                                                        {
                                                                $item_list_gui->enableDelete(false);
                                                                $item_list_gui->enableLink(false);
                                                                $item_list_gui->enableCut(false);
                                                        }
                                                        
                                                        $html = $item_list_gui->getListItemHTML($item["ref_id"],
                                                                $item["obj_id"], $item["title"], $item["description"]);
                                                                
                                                        // check wheter any admin command is allowed for
                                                        // the items
                                                        $this->determineAdminCommands($item["ref_id"],
                                                                $item_list_gui->adminCommandsIncluded());
                                                        $ilBench->stop("ilContainerGUI", "0210_getListHTML");
                                                        if ($html != "")
                                                        {
                                                                $item_html[] = array("html" => $html, "item_ref_id" => $item["ref_id"]
                                                                        , "item_obj_id" => $item["obj_id"]);
                                                        }
                                                }

                                                // output block for resource type
                                                if (count($item_html) > 0)
                                                {
                                                        // separator row
                                                        if (!$first)
                                                        {
                                                                $this->addSeparatorRow($tpl);
                                                        }
                                                        $first = false;

                                                        // add a header for each resource type
                                                        if ($this->ilias->getSetting("icon_position_in_lists") == "item_rows")
                                                        {
                                                                $this->addHeaderRow($tpl, $type, false);
                                                        }
                                                        else
                                                        {
                                                                $this->addHeaderRow($tpl, $type);
                                                        }
                                                        $this->resetRowType();

                                                        // content row
                                                        foreach($item_html as $item)
                                                        {
                                                                if ($this->ilias->getSetting("icon_position_in_lists") == "item_rows")
                                                                {
                                                                        $this->addStandardRow($tpl, $item["html"], $item["item_ref_id"], $item["item_obj_id"], $type);
                                                                }
                                                                else
                                                                {
                                                                        $this->addStandardRow($tpl, $item["html"], $item["item_ref_id"], $item["item_obj_id"]);
                                                                }
                                                        }
                                                }
                                        }
                                }
                                $html = $tpl->get();
                                
                                break;

                        default:
                                // to do:
                                break;
                }

                return $html;
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilContainerGUI::renderObject (  ) 

display tree view

render container object (this should include multiple lists in the future that together build the blocks of a container page)

Definition at line 257 of file class.ilContainerGUI.php.

References $ilBench, ilObjectGUI::$tpl, ilObjectGUI::$tree, getSubItems(), renderItemList(), showAdministrationPanel(), and showPossibleSubObjects().

Referenced by addToDeskObject(), removeFromDeskObject(), ilObjiLincCourseGUI::viewObject(), ilObjGroupGUI::viewObject(), and ilObjFolderGUI::viewObject().

        {
                global $ilBench, $tree;
                
                // 'add object'
                $this->showPossibleSubObjects();

                // course content interface methods could probably
                // move to this class
                if($this->type != 'icrs' and $tree->checkForParentType($this->ref_id,'crs'))
                {
                        $this->initCourseContentInterface();
                        $this->cci_obj->cci_setContainer($this);
                        $this->cci_obj->cci_view();
                        
                        return;
                }


                $ilBench->start("ilContainerGUI", "0000__renderObject");

                $tpl = new ilTemplate ("tpl.container_page.html", true, true);
                
                // get all sub items
                $ilBench->start("ilContainerGUI", "0100_getSubItems");
                $this->getSubItems();
                $ilBench->stop("ilContainerGUI", "0100_getSubItems");

                $ilBench->start("ilContainerGUI", "0200_renderItemList");
                $html = $this->renderItemList();
                $tpl->setVariable("CONTAINER_PAGE_CONTENT", $html);
                $ilBench->stop("ilContainerGUI", "0200_renderItemList");
                
                $this->showAdministrationPanel($tpl);
                
                $this->html = $tpl->get();
                
                $ilBench->stop("ilContainerGUI", "0000__renderObject");
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilContainerGUI::resetRowType (  ) 

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

Referenced by ilObjiLincCourseGUI::renderItemList(), and renderItemList().

        {
                $this->cur_row_type = "";
        }

Here is the caller graph for this function:

ilContainerGUI::setTitleAndDescription (  ) 

called by prepare output

Reimplemented from ilObjectGUI.

Reimplemented in ilObjRootFolderGUI.

Definition at line 116 of file class.ilContainerGUI.php.

References ilObjectGUI::$ilias, $path, ilContainer::_lookupIconPath(), and ilUtil::getImagePath().

        {
                global $ilias;
//echo "1-".get_class($this)."-";
                $this->tpl->setTitle($this->object->getTitle());
                $this->tpl->setDescription($this->object->getLongDescription());

                // set tile icon
                $icon = ilUtil::getImagePath("icon_".$this->object->getType()."_b.gif");
                if ($ilias->getSetting("custom_icons") &&
                        in_array($this->object->getType(), array("cat","grp","crs")))
                {
                        require_once("classes/class.ilContainer.php");
                        if (($path = ilContainer::_lookupIconPath($this->object->getId(), "big")) != "")
                        {
                                $icon = $path;
                        }
                }
                $this->tpl->setTitleIcon($icon, $this->lng->txt("obj_".$this->object->getType()));
        }

Here is the call graph for this function:

ilContainerGUI::showAdministrationPanel ( &$  tpl  ) 

show administration panel

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

References $_SESSION, ilObjectGUI::$tpl, ilUtil::getImagePath(), and isActiveAdministrationPanel().

Referenced by renderObject().

        {
                if ($this->isActiveAdministrationPanel())
                {
                        $tpl->setCurrentBlock("admin_button_off");
                        $tpl->setVariable("ADMIN_MODE_LINK",
                                $this->ctrl->getLinkTarget($this, "disableAdministrationPanel"));
                        $tpl->setVariable("TXT_ADMIN_MODE",
                                $this->lng->txt("admin_panel_disable"));
                        $tpl->parseCurrentBlock();
                        
                        // administration panel
                        $tpl->setCurrentBlock("admin_panel_cmd");
                        $tpl->setVariable("TXT_PANEL_CMD", $this->lng->txt("delete_selected_items"));
                        $tpl->setVariable("PANEL_CMD", "delete");
                        $tpl->parseCurrentBlock();
                        if (!$_SESSION["clipboard"])
                        {
                                $tpl->setCurrentBlock("admin_panel_cmd");
                                $tpl->setVariable("TXT_PANEL_CMD", $this->lng->txt("move_selected_items"));
                                $tpl->setVariable("PANEL_CMD", "cut");
                                $tpl->parseCurrentBlock();
                                $tpl->setCurrentBlock("admin_panel_cmd");
                                $tpl->setVariable("TXT_PANEL_CMD", $this->lng->txt("link_selected_items"));
                                $tpl->setVariable("PANEL_CMD", "link");
                                $tpl->parseCurrentBlock();
                        }
                        else
                        {
                                $tpl->setCurrentBlock("admin_panel_cmd");
                                $tpl->setVariable("TXT_PANEL_CMD", $this->lng->txt("paste_clipboard_items"));
                                $tpl->setVariable("PANEL_CMD", "paste");
                                $tpl->parseCurrentBlock();
                                $tpl->setCurrentBlock("admin_panel_cmd");
                                $tpl->setVariable("TXT_PANEL_CMD", $this->lng->txt("clear_clipboard"));
                                $tpl->setVariable("PANEL_CMD", "clear");
                                $tpl->parseCurrentBlock();
                        }
                        $tpl->setCurrentBlock("admin_panel");
                        $tpl->setVariable("IMG_ARROW", ilUtil::getImagePath("arrow_downright.gif"));
                        $tpl->setVariable("ALT_ARROW", $this->lng->txt("actions"));
                        $tpl->setVariable("TXT_ADMIN_PANEL", $this->lng->txt("admin_panel"));
                        $tpl->parseCurrentBlock();
                        $this->ctrl->setParameter($this, "type", "");
                        $this->ctrl->setParameter($this, "item_ref_id", "");
                        $tpl->setVariable("FORM_ACTION", $this->ctrl->getFormAction($this));
                }
                else if ($this->adminCommands)
                {
                        $tpl->setCurrentBlock("admin_button");
                        $tpl->setVariable("ADMIN_MODE_LINK",
                                $this->ctrl->getLinkTarget($this, "enableAdministrationPanel"));
                        $tpl->setVariable("TXT_ADMIN_MODE",
                                $this->lng->txt("admin_panel_enable"));
                        $tpl->parseCurrentBlock();
                }
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilContainerGUI::showCustomIconsEditing ( a_input_colspan = 1  ) 

show edit section of custom icons for container

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

Referenced by ilObjCourseGUI::editCourseIconsObject(), ilObjGroupGUI::editObject(), and ilObjCategoryGUI::editObject().

        {
                if ($this->ilias->getSetting("custom_icons"))
                {
                        $this->tpl->addBlockFile("CONTAINER_ICONS", "container_icon_settings",
                                "tpl.container_icon_settings.html");

                        if (($big_icon = $this->object->getBigIconPath()) != "")
                        {
                                $this->tpl->setCurrentBlock("big_icon");
                                $this->tpl->setVariable("SRC_BIG_ICON", $big_icon);
                                $this->tpl->parseCurrentBlock();
                        }
                        if (($small_icon = $this->object->getSmallIconPath()) != "")
                        {
                                $this->tpl->setCurrentBlock("small_icon");
                                $this->tpl->setVariable("SRC_SMALL_ICON", $small_icon);
                                $this->tpl->parseCurrentBlock();
                        }
                        $this->tpl->setCurrentBlock("container_icon_settings");
                        $this->tpl->setVariable("SPAN_TITLE", $a_input_colspan + 1);
                        $this->tpl->setVariable("SPAN_INPUT", $a_input_colspan);
                        $this->tpl->setVariable("ICON_SETTINGS", $this->lng->txt("icon_settings"));
                        $this->tpl->setVariable("BIG_ICON", $this->lng->txt("big_icon"));
                        $this->tpl->setVariable("SMALL_ICON", $this->lng->txt("small_icon"));
                        $this->tpl->setVariable("BIG_SIZE", "(".
                                $this->ilias->getSetting("custom_icon_big_width")."x".
                                $this->ilias->getSetting("custom_icon_big_height").")");
                        $this->tpl->setVariable("SMALL_SIZE", "(".
                                $this->ilias->getSetting("custom_icon_small_width")."x".
                                $this->ilias->getSetting("custom_icon_small_height").")");
                        $this->tpl->setVariable("TXT_REMOVE", $this->lng->txt("remove"));
                        $this->tpl->parseCurrentBlock();
                }
        }

Here is the caller graph for this function:

ilContainerGUI::showPossibleSubObjects (  ) 

show possible sub objects selection list

Reimplemented from ilObjectGUI.

Reimplemented in ilObjRecoveryFolderGUI.

Definition at line 141 of file class.ilContainerGUI.php.

References $cmd, $count, $d, $row, $type, and formSelect().

Referenced by renderObject().

        {
                $found = false;
                $cmd = ($this->cmd != "")
                        ? $this->cmd
                        : $this->ctrl->getCmd();

                #if ($cmd != "" && $cmd != "showList" && $cmd != "render"
                #       && $cmd != "view")
                #{
                #       return;
                #}
                
                $type = $this->object->getType();

                $d = $this->objDefinition->getCreatableSubObjects($type);

                if (count($d) > 0)
                {
                        foreach ($d as $row)
                        {
                            $count = 0;
                                if ($row["max"] > 0)
                                {
                                        //how many elements are present?
                                        //var_dump($this->data);
                                        // this is broken
                                        /*
                                        for ($i=0; $i<count($this->data["ctrl"]); $i++)
                                        {
                                                if ($this->data["ctrl"][$i]["type"] == $row["name"])
                                                {
                                                    $count++;
                                                }
                                        }*/
                                }

                                if ($row["max"] == "" || $count < $row["max"])
                                {
                                        if (in_array($row["name"], array("sahs", "alm", "hlm", "lm", "grp", "frm", "mep","crs",
                                                                                                         "cat", "glo", "dbk","exc", "qpl", "tst", "svy", "spl", "chat", 
                                                                                                         "htlm","fold","linkr","file","icrs","icla","crsg",'webr')))
                                        {
                                                if ($this->rbacsystem->checkAccess("create", $this->object->getRefId(), $row["name"]))
                                                {
                                                        $subobj[] = $row["name"];
                                                }
                                        }
                                }
                        }
                }

                if (is_array($subobj))
                {
                        $this->tpl->parseCurrentBlock("add_commands");
                        $this->tpl->setVariable("H_FORMACTION",  "repository.php?ref_id=".$this->object->getRefId().
                                "&cmd=post");
                        // possible subobjects
                        $opts = ilUtil::formSelect("", "new_type", $subobj);
                        $this->tpl->setVariable("SELECT_OBJTYPE_REPOS", $opts);
                        $this->tpl->setVariable("BTN_NAME_REPOS", "create");
                        $this->tpl->setVariable("TXT_ADD_REPOS", $this->lng->txt("add"));
                        $this->tpl->parseCurrentBlock();
                }
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilContainerGUI::showTreeFlatIcon (  ) 

Definition at line 96 of file class.ilContainerGUI.php.

References $_GET, $_SESSION, and ilObjectGUI::$tpl.

Referenced by prepareOutput().

        {
                global $tpl;
                
                // dont show icon, if role (permission gui->rolegui) is edited
                if ($_GET["obj_id"] != "")
                {
                        return;
                }
                
                $mode = ($_SESSION["il_rep_mode"] == "flat")
                        ? "tree"
                        : "flat";
                $link = "repository.php?cmd=frameset&set_mode=".$mode."&ref_id=".$this->object->getRefId();
                $tpl->setTreeFlatIcon($link, $mode);
        }

Here is the caller graph for this function:


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