Public Member Functions | Data Fields

ilStructureObjectGUI Class Reference
[Modules/IliasLearningModule]

Class ilStructureObjectGUI. More...

Inheritance diagram for ilStructureObjectGUI:
Collaboration diagram for ilStructureObjectGUI:

Public Member Functions

 ilStructureObjectGUI (&$a_content_obj, &$a_tree)
 Constructor public.
 setStructureObject (&$a_st_object)
 set structure object
 getType ()
 this function is called by condition handler gui interface
executeCommand ()
 execute command
 create ()
 create new page or chapter in chapter
 view ()
 subchap ()
 add_cell ($val, $link="")
 output a cell in object list
 save ()
 save new chapter
 putInTree ()
 put chapter into tree
 cutPage ()
 cut page
 copyPage ()
 copy page
 pastePage ()
 paste page
 moveChapter ()
 move a single chapter (selection)
 copyChapter ()
 copy a single chapter (selection)
 pasteChapter ()
 paste chapter
 activatePages ()
 activates or deactivates pages
 initConditionHandlerInterface ()
 cancel ()
 cancel creation of new page or chapter
 setTabs ()
 output tabs
 getTabs (&$tabs_gui)
 adds tabs to tab gui object
 _goto ($a_target, $a_target_ref_id="")
 redirect script

Data Fields

 $obj
 $tree

Detailed Description

Class ilStructureObjectGUI.

User Interface for Structure Objects Editing

Author:
Alex Killing <alex.killing@gmx.de>
Version:
Id:
class.ilStructureObjectGUI.php 12179 2006-10-10 11:13:57Z akill

ilStructureObjectGUI: ilConditionHandlerInterface, ilMDEditorGUI

Definition at line 39 of file class.ilStructureObjectGUI.php.


Member Function Documentation

ilStructureObjectGUI::_goto ( a_target,
a_target_ref_id = "" 
)

redirect script

Parameters:
string $a_target

Definition at line 773 of file class.ilStructureObjectGUI.php.

References $_GET, $ilErr, $lm_id, ilLMObjectGUI::$lng, $rbacsystem, $ref_id, ilObject::_getAllReferences(), ilLMObject::_lookupContObjID(), ilObject::_lookupTitle(), exit, and sendInfo().

        {
                global $rbacsystem, $ilErr, $lng, $ilAccess;

                // determine learning object
                $lm_id = ilLMObject::_lookupContObjID($a_target);

                // get all references
                $ref_ids = ilObject::_getAllReferences($lm_id);
                
                // always try passed ref id first
                if (in_array($a_target_ref_id, $ref_ids))
                {
                        $ref_ids = array_merge(array($a_target_ref_id), $ref_ids);
                }

                // check read permissions
                foreach ($ref_ids as $ref_id)
                {
                        // Permission check
                        if ($ilAccess->checkAccess("read", "", $ref_id))
                        {
                                // don't redirect anymore, just set parameters
                                // (goto.php includes  "ilias.php")
                                $_GET["baseClass"] = "ilLMPresentationGUI";
                                $_GET["obj_id"] = $a_target;
                                $_GET["ref_id"] = $ref_id;
                                include_once("ilias.php");
                                exit;;
                        }
                }
                
                if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID))
                {
                        $_GET["cmd"] = "frameset";
                        $_GET["target"] = "";
                        $_GET["ref_id"] = ROOT_FOLDER_ID;
                        sendInfo(sprintf($lng->txt("msg_no_perm_read_item"),
                                ilObject::_lookupTitle($lm_id)), true);
                        include("repository.php");
                        exit;
                }

                $ilErr->raiseError($lng->txt("msg_no_perm_read_lm"), $ilErr->FATAL);
        }

Here is the call graph for this function:

ilStructureObjectGUI::activatePages (  ) 

activates or deactivates pages

Definition at line 666 of file class.ilStructureObjectGUI.php.

References $_POST, $id, ilLMObject::_lookupActive(), and ilLMObject::_writeActive().

        {
                if (is_array($_POST["id"]))
                {
                        foreach($_POST["id"] as $id)
                        {
                                $act = ilLMObject::_lookupActive($id);
                                ilLMObject::_writeActive($id, !$act);
//echo "-".$a_id."-".!$act."-";
                        }
                }

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

Here is the call graph for this function:

ilStructureObjectGUI::add_cell ( val,
link = "" 
)

output a cell in object list

Reimplemented from ilLMObjectGUI.

Definition at line 359 of file class.ilStructureObjectGUI.php.

        {
                if(!empty($link))
                {
                        $this->tpl->setCurrentBlock("begin_link");
                        $this->tpl->setVariable("LINK_TARGET", $link);
                        $this->tpl->parseCurrentBlock();
                        $this->tpl->touchBlock("end_link");
                }

                $this->tpl->setCurrentBlock("text");
                $this->tpl->setVariable("TEXT_CONTENT", $val);
                $this->tpl->parseCurrentBlock();
                $this->tpl->setCurrentBlock("table_cell");
                $this->tpl->parseCurrentBlock();
        }

ilStructureObjectGUI::cancel (  ) 

cancel creation of new page or chapter

Definition at line 701 of file class.ilStructureObjectGUI.php.

References $_GET, and sendInfo().

        {
                sendInfo($this->lng->txt("msg_cancel"), true);
                if ($_GET["obj_id"] != 0)
                {
                        if ($_GET["new_type"] == "pg")
                        {
                                $this->ctrl->redirect($this, "view");
                        }
                        else
                        {
                                $this->ctrl->redirect($this, "subchap");
                        }
                }
        }

Here is the call graph for this function:

ilStructureObjectGUI::copyChapter (  ) 

copy a single chapter (selection)

Definition at line 635 of file class.ilStructureObjectGUI.php.

        {
                $cont_obj_gui =& new ilObjContentObjectGUI("",$this->content_object->getRefId(),
                        true, false);
                $cont_obj_gui->copyChapter($this->obj->getId());

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

ilStructureObjectGUI::copyPage (  ) 

copy page

Definition at line 508 of file class.ilStructureObjectGUI.php.

References $_POST, sendInfo(), and ilEditClipboard::storeContentObject().

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

                if(count($_POST["id"]) == 1 && $_POST["id"][0] == IL_FIRST_NODE)
                {
                        $this->ilias->raiseError($this->lng->txt("cont_select_item"), $this->ilias->error_obj->MESSAGE);
                }

                // SAVE POST VALUES
                ilEditClipboard::storeContentObject("pg",$_POST["id"][0],"copy");

                sendInfo($this->lng->txt("msg_copy_clipboard"), true);

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

Here is the call graph for this function:

ilStructureObjectGUI::create (  ) 

create new page or chapter in chapter

Reimplemented from ilLMObjectGUI.

Definition at line 134 of file class.ilStructureObjectGUI.php.

References $_GET, and setTabs().

        {
                if ($_GET["obj_id"] != "")
                {
                        $this->setTabs();
                }
                parent::create();
        }

Here is the call graph for this function:

ilStructureObjectGUI::cutPage (  ) 

cut page

Definition at line 440 of file class.ilStructureObjectGUI.php.

References $_POST, $id, $obj, $tree, ilHistory::_createEntry(), ilLMObject::_lookupTitle(), ilLMObjectGUI::checkTree(), ilLMObjectFactory::getInstance(), sendInfo(), and ilEditClipboard::storeContentObject().

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

                }
                if(count($_POST["id"]) > 1)
                {
                        $this->ilias->raiseError($this->lng->txt("cont_select_max_one_item"),$this->ilias->error_obj->MESSAGE);
                }

                if(count($_POST["id"]) == 1 && $_POST["id"][0] == IL_FIRST_NODE)
                {
                        $this->ilias->raiseError($this->lng->txt("cont_select_item"), $this->ilias->error_obj->MESSAGE);
                }

                // SAVE POST VALUES
                ilEditClipboard::storeContentObject("pg",$_POST["id"][0]);

                $tree = new ilTree($this->content_object->getId());
                $tree->setTableNames('lm_tree','lm_data');
                $tree->setTreeTablePK("lm_id");

                // cut selected object
                $cutted = 0;
                foreach ($_POST["id"] as $id)
                {
                        if ($id == -1)
                        {
                                continue;
                        }
                        
                        $obj =& ilLMObjectFactory::getInstance($this->content_object, $id);
                        $obj->setLMId($this->content_object->getId());
                        $node_data = $tree->getNodeData($id);
                        //$obj->delete();
                        if($tree->isInTree($id))
                        {
                                $parent_id = $tree->getParentId($id);
                                $tree->deleteTree($node_data);
                                
                                // write history entry
                                require_once("classes/class.ilHistory.php");
                                ilHistory::_createEntry($id, "cut",
                                        array(ilLMObject::_lookupTitle($parent_id), $parent_id),
                                        $this->content_object->getType().":pg");
                                ilHistory::_createEntry($parent_id, "cut_page",
                                        array(ilLMObject::_lookupTitle($id), $id),
                                        $this->content_object->getType().":st");
                        }
                        $cutted++;
                }

                // tree check
                $this->checkTree();

                if($cutted > 0)
                {
                        sendInfo($this->lng->txt("msg_cut_clipboard"), true);
                }

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

Here is the call graph for this function:

& ilStructureObjectGUI::executeCommand (  ) 

execute command

Definition at line 79 of file class.ilStructureObjectGUI.php.

References $_POST, $cmd, initConditionHandlerInterface(), and setTabs().

        {
//echo "<br>:cmd:".$this->ctrl->getCmd().":cmdClass:".$this->ctrl->getCmdClass().":";
                $next_class = $this->ctrl->getNextClass($this);
                $cmd = $this->ctrl->getCmd();

                switch($next_class)
                {
                        case 'ilmdeditorgui':

                                $this->setTabs();
                                include_once 'Services/MetaData/classes/class.ilMDEditorGUI.php';

                                $md_gui =& new ilMDEditorGUI($this->content_object->getID(),
                                        $this->obj->getId(), $this->obj->getType());
                                $md_gui->addObserver($this->obj,'MDUpdateListener','General');

                                $this->ctrl->forwardCommand($md_gui);
                                break;

                        case "ilconditionhandlerinterface":
                                global $ilTabs;
                                include_once './classes/class.ilConditionHandlerInterface.php';

                                $this->setTabs();
                                $this->initConditionHandlerInterface();
                                $this->ctrl->forwardCommand($this->condHI);
                                $ilTabs->setTabActive('preconditions');
                                break;

                        default:
                                if($cmd == 'listConditions')
                                {
                                        $this->setTabs();
                                        $this->initConditionHandlerInterface();
                                        $ret =& $this->condHI->executeCommand();
                                }
                                elseif(($cmd == "create") && ($_POST["new_type"] == "pg"))
                                {
                                        $this->setTabs();
                                        $pg_gui =& new ilLMPageObjectGUI($this->content_object);
                                        $ret =& $pg_gui->executeCommand();
                                }
                                else
                                {
                                        $ret =& $this->$cmd();
                                }
                                break;
                }
        }

Here is the call graph for this function:

ilStructureObjectGUI::getTabs ( &$  tabs_gui  ) 

adds tabs to tab gui object

Parameters:
object $tabs_gui ilTabsGUI object

Definition at line 750 of file class.ilStructureObjectGUI.php.

        {
                // back to upper context
                $tabs_gui->addTarget("edit", $this->ctrl->getLinkTarget($this, "view")
                        , "view", get_class($this));

                $tabs_gui->addTarget("cont_preview", $this->ctrl->getLinkTarget($this, "preview")
                        , "preview", get_class($this));

                $tabs_gui->addTarget("meta_data",
                         $this->ctrl->getLinkTargetByClass('ilmdeditorgui',''),
                         "", get_class($this));

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

        }

ilStructureObjectGUI::getType (  ) 

this function is called by condition handler gui interface

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

        {
                return "st";
        }

ilStructureObjectGUI::ilStructureObjectGUI ( &$  a_content_obj,
&$  a_tree 
)

Constructor public.

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

References ilLMObjectGUI::$ilias, ilLMObjectGUI::$lng, ilLMObjectGUI::$tpl, and ilLMObjectGUI::ilLMObjectGUI().

        {
                global $ilias, $tpl, $lng;

                parent::ilLMObjectGUI($a_content_obj);
                $this->tree =& $a_tree;
        }

Here is the call graph for this function:

ilStructureObjectGUI::initConditionHandlerInterface (  ) 

Definition at line 685 of file class.ilStructureObjectGUI.php.

Referenced by executeCommand().

        {
                include_once("classes/class.ilConditionHandlerInterface.php");

                $this->condHI =& new ilConditionHandlerInterface($this);
                $this->condHI->setBackButtons(array());
                $this->condHI->setAutomaticValidation(false);
                $this->condHI->setTargetType("st");
                $this->condHI->setTargetId($this->obj->getId());
                $this->condHI->setTargetTitle($this->obj->getTitle());
        }

Here is the caller graph for this function:

ilStructureObjectGUI::moveChapter (  ) 

move a single chapter (selection)

Definition at line 623 of file class.ilStructureObjectGUI.php.

        {
                $cont_obj_gui =& new ilObjContentObjectGUI("",$this->content_object->getRefId(),
                        true, false);
                $cont_obj_gui->moveChapter($this->obj->getId());

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

ilStructureObjectGUI::pasteChapter (  ) 

paste chapter

Definition at line 647 of file class.ilStructureObjectGUI.php.

References $_POST, $id, ilEditClipboard::clear(), ilEditClipboard::getContentObjectId(), and subchap().

        {
                $id = ilEditClipboard::getContentObjectId();
                if($id == $_POST["id"][0])
                {
                        ilEditClipboard::clear();
                        $this->subchap();
                        return;
                }
                $cont_obj_gui =& new ilObjContentObjectGUI("",$this->content_object->getRefId(),
                        true, false);
                $cont_obj_gui->pasteChapter($this->obj->getId());

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

Here is the call graph for this function:

ilStructureObjectGUI::pastePage (  ) 

paste page

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

References $_POST, $id, $lm_id, $tree, ilHistory::_createEntry(), ilLMObject::_lookupContObjID(), ilLMObject::_lookupTitle(), ilLMObjectGUI::checkTree(), ilEditClipboard::clear(), ilEditClipboard::getAction(), ilEditClipboard::getContentObjectId(), and ilEditClipboard::getContentObjectType().

        {
                if(ilEditClipboard::getContentObjectType() != "pg")
                {
                        $this->ilias->raiseError($this->lng->txt("no_page_in_clipboard"),$this->ilias->error_obj->MESSAGE);
                }

                $tree = new ilTree($this->content_object->getId());
                $tree->setTableNames('lm_tree','lm_data');
                $tree->setTreeTablePK("lm_id");

                // paste selected object
                $id = ilEditClipboard::getContentObjectId();

                // copy page, if action is copy
                if (ilEditClipboard::getAction() == "copy")
                {
                        // check wether page belongs to lm
                        if (ilLMObject::_lookupContObjID(ilEditClipboard::getContentObjectId())
                                == $this->content_object->getID())
                        {
                                $lm_page = new ilLMPageObject($this->content_object, $id);
                                $new_page =& $lm_page->copy();
                                $id = $new_page->getId();
                        }
                        else
                        {
                                // get page from other content object into current content object
                                $lm_id = ilLMObject::_lookupContObjID(ilEditClipboard::getContentObjectId());
                                $lm_obj =& $this->ilias->obj_factory->getInstanceByObjId($lm_id);
                                $lm_page = new ilLMPageObject($lm_obj, $id);
                                $new_page =& $lm_page->copyToOtherContObject($this->content_object);
                                $id = $new_page->getId();
                        }
                }
                
                if (ilEditClipboard::getAction() == "cut")
                {
                        // check wether page belongs not to lm
                        if (ilLMObject::_lookupContObjID(ilEditClipboard::getContentObjectId())
                                != $this->content_object->getID())
                        {
                                $lm_id = ilLMObject::_lookupContObjID(ilEditClipboard::getContentObjectId());
                                $lm_obj =& $this->ilias->obj_factory->getInstanceByObjId($lm_id);
                                $lm_page = new ilLMPageObject($lm_obj, $id);
                                $lm_page->setLMId($this->content_object->getID());
                                $lm_page->update();
                                $page =& $lm_page->getPageObject();
                                $page->buildDom();
                                $page->setParentId($this->content_object->getID());
                                $page->update();
                        }
                }

                if(!$tree->isInTree($id))
                {
                        if(!isset($_POST["id"]))
                        {
                                $target = IL_FIRST_NODE;
                        }
                        else
                        {
                                $target = $_POST["id"][0];
                        }
                        $tree->insertNode($id, $this->obj->getId(), $target);
                        ilEditClipboard::clear();
                }

                // write history comments
                include_once("classes/class.ilHistory.php");
                $parent_id = $tree->getParentId($id);
                ilHistory::_createEntry($id, "paste",
                        array(ilLMObject::_lookupTitle($this->obj->getId()), $this->obj->getId()),
                        $this->content_object->getType().":pg");
                ilHistory::_createEntry($parent_id, "paste_page",
                        array(ilLMObject::_lookupTitle($id), $id),
                        $this->content_object->getType().":st");

                // check the tree
                $this->checkTree();

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

Here is the call graph for this function:

ilStructureObjectGUI::putInTree (  ) 

put chapter into tree

Reimplemented from ilLMObjectGUI.

Definition at line 406 of file class.ilStructureObjectGUI.php.

References $_GET, and $tree.

Referenced by save().

        {
//echo "st:putInTree";
                // chapters should be behind pages in the tree
                // so if target is first node, the target is substituted with
                // the last child of type pg
                if ($_GET["target"] == IL_FIRST_NODE)
                {
                        $tree = new ilTree($this->content_object->getId());
                        $tree->setTableNames('lm_tree','lm_data');
                        $tree->setTreeTablePK("lm_id");

                        // determine parent node id
                        $parent_id = (!empty($_GET["obj_id"]))
                                ? $_GET["obj_id"]
                                : $tree->getRootId();
                        // determine last child of type pg
                        $childs =& $tree->getChildsByType($parent_id, "pg");
                        if (count($childs) != 0)
                        {
                                $_GET["target"] = $childs[count($childs) - 1]["obj_id"];
                        }
                }
                if (empty($_GET["target"]))
                {
                        $_GET["target"] = IL_LAST_NODE;
                }

                parent::putInTree();
        }

Here is the caller graph for this function:

ilStructureObjectGUI::save (  ) 

save new chapter

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

References $_GET, $_POST, ilLMObjectGUI::checkTree(), putInTree(), and ilUtil::stripSlashes().

        {

                $this->obj =& new ilStructureObject($this->content_object);

                $this->obj->setType("st");
                $this->obj->setTitle(ilUtil::stripSlashes($_POST["Fobject"]["title"]));
                $this->obj->setDescription(ilUtil::stripSlashes($_POST["Fobject"]["desc"]));
                $this->obj->setLMId($this->content_object->getId());
                $this->obj->create();

                $this->putInTree();

                // check the tree
                $this->checkTree();

                if (!empty($_GET["obj_id"]))
                {
                        $this->ctrl->redirect($this, "subchap");
                }

        }

Here is the call graph for this function:

ilStructureObjectGUI::setStructureObject ( &$  a_st_object  ) 

set structure object

Parameters:
object $a_st_object structure object

Definition at line 61 of file class.ilStructureObjectGUI.php.

        {
                $this->obj =& $a_st_object;
                $this->actions = $this->objDefinition->getActions("st");
        }

ilStructureObjectGUI::setTabs (  ) 

output tabs

Definition at line 721 of file class.ilStructureObjectGUI.php.

References ilUtil::getImagePath().

Referenced by create(), executeCommand(), subchap(), and view().

        {
                global $ilTabs;

                // catch feedback message
                #include_once("classes/class.ilTabsGUI.php");
                #$tabs_gui =& new ilTabsGUI();
                //$this->getTabs($tabs_gui);
                $ilTabs->getTargetsByObjectType($this, "st");

                $ilTabs->addTarget("meta_data",
                         $this->ctrl->getLinkTargetByClass("ilmdeditorgui",''),
                         "", "ilmdeditorgui");
                         
                $this->tpl->setCurrentBlock("header_image");
                $this->tpl->setVariable("IMG_HEADER", ilUtil::getImagePath("icon_st_b.gif"));
                $this->tpl->parseCurrentBlock();
                $this->tpl->setCurrentBlock("content");

                #$this->tpl->setVariable("TABS", $tabs_gui->getHTML());
                $this->tpl->setVariable("HEADER",
                        $this->lng->txt($this->obj->getType()).": ".$this->obj->getTitle());
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilStructureObjectGUI::subchap (  ) 

Definition at line 262 of file class.ilStructureObjectGUI.php.

References $tree, ilStructureObject::_getPresentationTitle(), formSelect(), ilEditClipboard::getAction(), ilEditClipboard::getContentObjectId(), ilEditClipboard::getContentObjectType(), ilUtil::getImagePath(), ilLMObjectGUI::setActions(), setTabs(), ilLMObjectGUI::showActions(), and ilUtil::switchColor().

Referenced by pasteChapter().

        {
                global $tree;

                $this->setTabs();

                $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.structure_edit.html", true);
                $num = 0;

                $this->tpl->setCurrentBlock("form");
                $this->ctrl->setParameter($this, "backcmd", "subchap");
                $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
                $this->tpl->setVariable("HEADER_TEXT", $this->lng->txt("cont_subchapters"));
                $this->tpl->setVariable("CHECKBOX_TOP", IL_FIRST_NODE);

                $cnt = 0;
                $childs = $this->tree->getChilds($this->obj->getId());
                foreach ($childs as $child)
                {
                        if($child["type"] != "st")
                        {
                                continue;
                        }
                        $this->tpl->setCurrentBlock("table_row");
                        // color changing
                        $css_row = ilUtil::switchColor($cnt++,"tblrow1","tblrow2");

                        // checkbox
                        $this->tpl->setVariable("CHECKBOX_ID", $child["obj_id"]);
                        $this->tpl->setVariable("CSS_ROW", $css_row);
                        $this->tpl->setVariable("IMG_OBJ", ilUtil::getImagePath("icon_st.gif"));

                        // type
                        $this->ctrl->setParameterByClass("ilStructureObjectGUI", "obj_id", $child["obj_id"]);
                        $link = $this->ctrl->getLinkTargetByClass("ilStructureObjectGUI", "view");
                        $this->tpl->setVariable("LINK_TARGET", $link);

                        // title
                        $this->tpl->setVariable("TEXT_CONTENT",
                                ilStructureObject::_getPresentationTitle($child["obj_id"],
                                        $this->content_object->isActiveNumbering()));

                        $this->tpl->parseCurrentBlock();
                }
                if($cnt == 0)
                {
                        $this->tpl->setCurrentBlock("notfound");
                        $this->tpl->setVariable("NUM_COLS", 2);
                        $this->tpl->setVariable("TXT_OBJECT_NOT_FOUND", $this->lng->txt("obj_not_found"));
                        $this->tpl->parseCurrentBlock();
                }
                //else
                //{
                        // SHOW VALID ACTIONS
                        $this->tpl->setVariable("NUM_COLS", 3);
                        $acts = array("delete" => "delete", "moveChapter" => "moveChapter",
                                "copyChapter" => "copyChapter");
                        if(ilEditClipboard::getContentObjectType() == "st")
                        {
                                if ($this->tree->isInTree(ilEditClipboard::getContentObjectId())
                                        || ilEditClipboard::getAction() == "copy")
                                {
                                        $acts["pasteChapter"] =  "pasteChapter";
                                }
                        }
                        /*if(!empty($_SESSION["ilEditClipboard"]))
                        {
                                $acts["paste"] = "paste";
                        }*/
                        $this->setActions($acts);
                        $this->showActions();
                //}

                // SHOW POSSIBLE SUB OBJECTS
                $this->tpl->setVariable("NUM_COLS", 3);
                //$this->showPossibleSubObjects("st");
                $subobj = array("st");
                $opts = ilUtil::formSelect(12,"new_type",$subobj);
                //$this->tpl->setVariable("IMG_ARROW", ilUtil::getImagePath("arrow_downright.gif"));
                $this->tpl->setCurrentBlock("add_object");
                $this->tpl->setVariable("SELECT_OBJTYPE", $opts);
                //$this->tpl->setVariable("FORMACTION_OBJ_ADD", "adm_object.php?cmd=create&ref_id=".$_GET["ref_id"]);
                $this->tpl->setVariable("BTN_NAME", "create");
                $this->tpl->setVariable("TXT_ADD", $this->lng->txt("insert"));
                $this->tpl->parseCurrentBlock();

                //$this->tpl->setVariable("NUM_COLS", 2);
                //$this->showPossibleSubObjects("st");

                $this->tpl->setCurrentBlock("form");
                $this->tpl->parseCurrentBlock();

        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilStructureObjectGUI::view (  ) 

Definition at line 147 of file class.ilStructureObjectGUI.php.

References $tree, ilLMObject::_lookupActive(), ilPageObject::_lookupContainsDeactivatedElements(), ilLMObject::_lookupContObjID(), formSelect(), ilEditClipboard::getAction(), ilEditClipboard::getContentObjectId(), ilEditClipboard::getContentObjectType(), ilUtil::getImagePath(), ilLMObjectGUI::setActions(), setTabs(), ilLMObjectGUI::showActions(), and ilUtil::switchColor().

        {
                global $tree;

                $this->setTabs();

                $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.structure_edit.html", true);
                $num = 0;

                $this->tpl->setCurrentBlock("form");
                $this->ctrl->setParameter($this, "backcmd", "view");
                $this->tpl->setVariable("FORMACTION",
                        $this->ctrl->getFormAction($this));
                $this->tpl->setVariable("HEADER_TEXT", $this->lng->txt("cont_pages"));
                $this->tpl->setVariable("CHECKBOX_TOP", IL_FIRST_NODE);

                $cnt = 0;
                $childs = $this->tree->getChilds($this->obj->getId());
                foreach ($childs as $child)
                {
                        if($child["type"] != "pg")
                        {
                                continue;
                        }
                        
                        // check activation
                        if (!ilLMPageObject::_lookupActive($child["obj_id"]))
                        {
                                $this->tpl->setCurrentBlock("deactivated");
                                $this->tpl->setVariable("TXT_DEACTIVATED",
                                        $this->lng->txt("cont_page_deactivated"));
                                $this->tpl->parseCurrentBlock();
                        }
                        else
                        {
                                if (ilPageObject::_lookupContainsDeactivatedElements($child["obj_id"],
                                        $this->content_object->getType()))
                                {
                                        $this->tpl->setCurrentBlock("deactivated");
                                        $this->tpl->setVariable("TXT_DEACTIVATED",
                                                $this->lng->txt("cont_page_deactivated_elements"));
                                        $this->tpl->parseCurrentBlock();
                                }
                        }
                        
                        $this->tpl->setCurrentBlock("table_row");
                        // color changing
                        $css_row = ilUtil::switchColor($cnt++,"tblrow1","tblrow2");

                        // checkbox
                        $this->tpl->setVariable("CHECKBOX_ID", $child["obj_id"]);
                        $this->tpl->setVariable("CSS_ROW", $css_row);
                        $this->tpl->setVariable("IMG_OBJ", ilUtil::getImagePath("icon_pg.gif"));

                        // link
                        $this->ctrl->setParameterByClass("ilLMPageObjectGUI", "obj_id", $child["obj_id"]);
                        $link = $this->ctrl->getLinkTargetByClass("ilLMPageObjectGUI", "view", "", true);
                        $this->tpl->setVariable("LINK_TARGET", $link);

                        // title
                        $this->tpl->setVariable("TEXT_CONTENT", $child["title"]);

                        $this->tpl->parseCurrentBlock();
                }
                if($cnt == 0)
                {
                        $this->tpl->setCurrentBlock("notfound");
                        $this->tpl->setVariable("NUM_COLS", 3);
                        $this->tpl->setVariable("TXT_OBJECT_NOT_FOUND", $this->lng->txt("obj_not_found"));
                        $this->tpl->parseCurrentBlock();
                }
                //else
                //{
                        // SHOW VALID ACTIONS
                        $this->tpl->setVariable("NUM_COLS", 3);
                        //$this->setActions(array("confirmTermDeletion" => "delete", "addDefinition" => "cont_add_definition"));
                        $acts = array("delete" => "delete", "cutPage" => "cutPage",
                                "copyPage" => "copyPage", "activatePages" => "cont_de_activate");
//echo ":".$this->checkClipboardContentType().":<br>";
                        if(ilEditClipboard::getContentObjectType() == "pg")
                        {
                                if (ilLMObject::_lookupContObjID(ilEditClipboard::getContentObjectId())
                                        == $this->content_object->getId()
                                        || ilEditClipboard::getAction() == "copy")
                                {
                                        $acts["pastePage"] = "pastePage";
                                }
                        }
                        $this->setActions($acts);
                        $this->showActions();
                //}

                // SHOW POSSIBLE SUB OBJECTS
                $this->tpl->setVariable("NUM_COLS", 3);
                //$this->showPossibleSubObjects("st");
                $subobj = array("pg");
                $opts = ilUtil::formSelect(12,"new_type",$subobj);
                //$this->tpl->setVariable("IMG_ARROW", ilUtil::getImagePath("arrow_downright.gif"));
                $this->tpl->setCurrentBlock("add_object");
                $this->tpl->setVariable("SELECT_OBJTYPE", $opts);
                //$this->tpl->setVariable("FORMACTION_OBJ_ADD", "adm_object.php?cmd=create&ref_id=".$_GET["ref_id"]);
                $this->tpl->setVariable("BTN_NAME", "create");
                $this->tpl->setVariable("TXT_ADD", $this->lng->txt("insert"));
                $this->tpl->parseCurrentBlock();


                $this->tpl->setCurrentBlock("form");
                $this->tpl->parseCurrentBlock();

        }

Here is the call graph for this function:


Field Documentation

ilStructureObjectGUI::$obj

Reimplemented from ilLMObjectGUI.

Definition at line 41 of file class.ilStructureObjectGUI.php.

Referenced by cutPage().

ilStructureObjectGUI::$tree

Definition at line 42 of file class.ilStructureObjectGUI.php.

Referenced by cutPage(), pastePage(), putInTree(), subchap(), and view().


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