Public Member Functions | Data Fields

ilObjContentObjectGUI Class Reference

Inheritance diagram for ilObjContentObjectGUI:
Collaboration diagram for ilObjContentObjectGUI:

Public Member Functions

 ilObjContentObjectGUI ($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
 Constructor.
executeCommand ()
 execute command
 _forwards ()
 properties ()
 edit properties form
 explorer ()
 output explorer tree
 proceedDragDrop ()
 proceed drag and drop operations on pages/chapters
 saveProperties ()
 save properties
 createObject ()
 form for new content object creation
 saveObject ()
 save new content object to db
 chooseMetaSectionObject ($a_target="")
 chooseMetaSection ()
 addMetaObject ($a_target="")
 addMeta ()
 addBibItemObject ($a_target="")
 add bib item (admin call)
 addBibItem ()
 add bib item (module call)
 deleteMetaObject ($a_target="")
 deleteMeta ()
 deleteBibItemObject ($a_target="")
 delete bib item (admin call)
 deleteBibItem ()
 delete bib item (module call)
 editMetaObject ($a_target="")
 editMeta ()
 editBibItemObject ($a_target="")
 edit bib items (admin call)
 editBibItem ()
 edit bib items (module call)
 saveMetaObject ($a_target="adm_object.php")
 saveMeta ()
 saveBibItemObject ($a_target="")
 save bib item (admin call)
 saveBibItem ()
 save bib item (module call)
 viewObject ()
 view object
 exportObject ()
 export object
 importObject ()
 display dialogue for importing XML-LeaningObjects
 importFileObject ()
 display status information or report errors messages in case of error
 chapters ()
 show chapters
 pages ()
 pastePage ()
 paste page
 copyPage ()
 copy page
 delete ($a_parent_subobj_id=0)
 confirm deletion screen for page object and structure object deletion
 cancelDelete ()
 cancel delete
 confirmedDelete ($a_parent_subobj_id=0)
 delete page object or structure objects
 getContextPath ($a_endnode_id, $a_startnode_id=1)
 get context path in content object tree
 showActions ()
 show possible action (form buttons)
 perm ()
 edit permissions
 permSave ()
 save permissions
 addRole ()
 add local role
 owner ()
 show owner of content object
 view ()
 view content object
 moveChapter ($a_parent_subobj_id=0)
 move a single chapter (selection)
 pasteChapter ($a_parent_subobj_id=0)
 paste chapter
 movePage ()
 move page
 cancel ()
 cancel action
 export ()
 export content object
 exportMenu ()
 exportList ()
 viewExportLog ()
 downloadExportFile ()
 download export file
 publishExportFile ()
 download export file
 downloadPDFFile ()
 download export file
 confirmDeleteExportFile ()
 confirmation screen for export file deletion
 cancelDeleteExportFile ()
 cancel deletion of export files
 deleteExportFile ()
 delete export files
 fixTreeConfirm ()
 confirm screen for tree fixing
 cancelFixTree ()
 cancel tree fixing
 fixTree ()
 fix tree
 setilLMMenu ($a_offline=false)
 get lm menu html
 createPDF ()
 export content object
 exportHTML ()
 create html package
 addLocations ()
 display locator
 setTabs ()
 output tabs
 getTabs (&$tabs_gui)
 adds tabs to tab gui object
 editPublicSection ()
 savePublicSection ()
 linkChecker ()
 saveLinkCheck ()
 refreshLinkCheck ()
 __initLinkChecker ()
 __initLMMenuEditor ()
 addMenuEntry ()
 display add menu entry form
 saveMenuEntry ()
 save new menu entry
 deleteMenuEntry ()
 drop a menu entry
 editMenuEntry ()
 edit menu entry form
 updateMenuEntry ()
 update a menu entry
 showEntrySelector ()

Data Fields

 $ctrl

Detailed Description

Definition at line 43 of file class.ilObjContentObjectGUI.php.


Member Function Documentation

ilObjContentObjectGUI::__initLinkChecker (  ) 

Definition at line 2733 of file class.ilObjContentObjectGUI.php.

References $ilDB.

Referenced by linkChecker(), and refreshLinkCheck().

        {
                global $ilDB;

                include_once './classes/class.ilLinkChecker.php';

                $this->link_checker_obj =& new ilLinkChecker($ilDB,false);
                $this->link_checker_obj->setObjId($this->object->getId());

                return true;
        }

Here is the caller graph for this function:

ilObjContentObjectGUI::__initLMMenuEditor (  ) 

Definition at line 2745 of file class.ilObjContentObjectGUI.php.

Referenced by deleteMenuEntry(), editMenuEntry(), properties(), saveMenuEntry(), saveProperties(), setilLMMenu(), and updateMenuEntry().

        {
                include_once './content/classes/class.ilLMMenuEditor.php';

                $this->lmme_obj =& new ilLMMenuEditor();
                $this->lmme_obj->setObjId($this->object->getId());

                return true;
        }

Here is the caller graph for this function:

ilObjContentObjectGUI::_forwards (  ) 

Definition at line 173 of file class.ilObjContentObjectGUI.php.

        {
                return array("ilLMPageObjectGUI", "ilStructureObjectGUI","ilObjStyleSheetGUI");
        }

ilObjContentObjectGUI::addBibItem (  ) 

add bib item (module call)

Definition at line 934 of file class.ilObjContentObjectGUI.php.

References addBibItemObject(), and setTabs().

        {
                $this->setTabs();
                $this->addBibItemObject($this->ctrl->getLinkTarget($this));
        }

Here is the call graph for this function:

ilObjContentObjectGUI::addBibItemObject ( a_target = ""  ) 

add bib item (admin call)

Definition at line 903 of file class.ilObjContentObjectGUI.php.

References $_GET, $_POST, ilObjectGUI::$data, and sendInfo().

Referenced by addBibItem().

        {
                include_once "content/classes/class.ilBibItemGUI.php";
                $bib_gui =& new ilBibItemGUI();
                $bib_gui->setObject($this->object);
                $bibItemName = $_POST["bibItemName"] ? $_POST["bibItemName"] : $_GET["bibItemName"];
                $bibItemIndex = $_POST["bibItemIndex"] ? $_POST["bibItemIndex"] : $_GET["bibItemIndex"];
                if ($bibItemIndex == "")
                        $bibItemIndex = 0;
                $bibItemPath = $_POST["bibItemPath"] ? $_POST["bibItemPath"] : $_GET["bibItemPath"];
                if ($bibItemName != "")
                {
                        $bib_gui->bib_obj->add($bibItemName, $bibItemPath, $bibItemIndex);
                        $data = $bib_gui->bib_obj->getElement("BibItem");
                        $bibItemIndex = (count($data) - 1);
                }
                else
                {
                        sendInfo($this->lng->txt("bibitem_choose_element"), true);
                }
                if ($a_target == "")
                {
                        $a_target = "adm_object.php?ref_id=" . $this->object->getRefId();
                }

                $bib_gui->edit("ADM_CONTENT", "adm_content", $a_target, $bibItemIndex);
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilObjContentObjectGUI::addLocations (  ) 

display locator

Definition at line 2452 of file class.ilObjContentObjectGUI.php.

References $_GET, ilObjectGUI::$lng, ilObjectGUI::$obj_id, $path, $row, ilObjectGUI::$tree, and ilLMPageObject::_getPresentationTitle().

Referenced by executeCommand().

        {
                global $lng;

                $obj_id = $_GET["obj_id"];
                $tree =& $this->object->getTree();

                if (($obj_id != 0) && $tree->isInTree($obj_id))
                {
                        $path = $tree->getPathFull($obj_id);
                }
                else
                {
                        $path = $tree->getPathFull($tree->getRootId());
                        if ($obj_id != 0)
                        {
                                $path[] = array("type" => "pg", "child" => $this->obj_id,
                                        "title" => ilLMPageObject::_getPresentationTitle($this->obj_id));
                        }
                }

                $modifier = 1;

                foreach ($path as $key => $row)
                {
                        if ($row["child"] == 1)
                        {
                                $this->ctrl->setParameter($this, "obj_id", "");
                                $this->ctrl->addLocation(
                                        $this->object->getTitle(),
                                        $this->ctrl->getLinkTarget($this, "properties"));
                        }
                        else
                        {
                                $title = $row["title"];
                                switch($row["type"])
                                {
                                        case "st":
                                                $this->ctrl->setParameterByClass("ilstructureobjectgui", "obj_id", $row["child"]);
                                                $this->ctrl->addLocation(
                                                        $title,
                                                        $this->ctrl->getLinkTargetByClass("ilstructureobjectgui", "view"));
                                                break;

                                        case "pg":
                                                $this->ctrl->setParameterByClass("illmpageobjectgui", "obj_id", $row["child"]);
                                                $this->ctrl->addLocation(
                                                        $title,
                                                        $this->ctrl->getLinkTargetByClass("illmpageobjectgui", "view"));
                                                break;
                                }
                        }
                }
                $this->ctrl->setParameter($this, "obj_id", $_GET["obj_id"]);
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilObjContentObjectGUI::addMenuEntry (  ) 

display add menu entry form

Definition at line 2758 of file class.ilObjContentObjectGUI.php.

References $_GET, ilObjectGUI::$obj_id, ilObject::_lookupObjectId(), ilObject::_lookupTitle(), ilObject::_lookupType(), and setTabs().

        {
                $this->setTabs();

                $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.lm_menu_entry_form.html",true);
                
                if (isset($_GET["link_ref_id"]))
                {
                        $obj_type = ilObject::_lookupType($_GET["link_ref_id"],true);
                        $obj_id = ilObject::_lookupObjectId($_GET["link_ref_id"]);
                        $title = ilObject::_lookupTitle($obj_id);
                        
                        $target_link = $obj_type."_".$_GET["link_ref_id"];
                        $this->tpl->setVariable("TITLE", $title);
                        $this->tpl->setVariable("TARGET", $target_link);
                        $this->tpl->setVariable("LINK_REF_ID", $_GET["link_ref_id"]);
                }

                $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
                $this->tpl->setVariable("TXT_NEW_ENTRY", $this->lng->txt("lm_menu_new_entry"));
                $this->tpl->setVariable("TXT_TARGET", $this->lng->txt("lm_menu_entry_target"));
                $this->tpl->setVariable("TXT_TITLE", $this->lng->txt("lm_menu_entry_title"));
                $this->tpl->setVariable("BTN_NAME", "saveMenuEntry");
                $this->tpl->setVariable("BTN_TEXT", $this->lng->txt("save"));
                $this->tpl->setVariable("BTN_NAME2", "showEntrySelector");
                $this->tpl->setVariable("BTN_TEXT2", $this->lng->txt("lm_menu_select_internal_object"));
                $this->tpl->parseCurrentBlock();
        }

Here is the call graph for this function:

ilObjContentObjectGUI::addMeta (  ) 

Definition at line 894 of file class.ilObjContentObjectGUI.php.

References addMetaObject(), and setTabs().

        {
                $this->setTabs();
                $this->addMetaObject($this->ctrl->getLinkTarget($this));
        }

Here is the call graph for this function:

ilObjContentObjectGUI::addMetaObject ( a_target = ""  ) 

Definition at line 867 of file class.ilObjContentObjectGUI.php.

References $_GET, $_POST, and sendInfo().

Referenced by addMeta().

        {
                if ($a_target == "")
                {
                        $a_target = "adm_object.php?ref_id=".$this->object->getRefId();
                }

                include_once "classes/class.ilMetaDataGUI.php";
                $meta_gui =& new ilMetaDataGUI();
                $meta_gui->setObject($this->object);
                $meta_name = $_POST["meta_name"] ? $_POST["meta_name"] : $_GET["meta_name"];
                $meta_index = $_POST["meta_index"] ? $_POST["meta_index"] : $_GET["meta_index"];
                if ($meta_index == "")
                        $meta_index = 0;
                $meta_path = $_POST["meta_path"] ? $_POST["meta_path"] : $_GET["meta_path"];
                $meta_section = $_POST["meta_section"] ? $_POST["meta_section"] : $_GET["meta_section"];
                if ($meta_name != "")
                {
                        $meta_gui->meta_obj->add($meta_name, $meta_path, $meta_index);
                }
                else
                {
                        sendInfo($this->lng->txt("meta_choose_element"), true);
                }
                $meta_gui->edit("ADM_CONTENT", "adm_content", $a_target, $meta_section);
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilObjContentObjectGUI::addRole (  ) 

add local role

Definition at line 1781 of file class.ilObjContentObjectGUI.php.

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

        {
                $this->setReturnLocation("addRole", $this->ctrl->getLinkTarget($this, "perm"));
                $this->addRoleObject();
        }

Here is the call graph for this function:

ilObjContentObjectGUI::cancel (  ) 

cancel action

Definition at line 1953 of file class.ilObjContentObjectGUI.php.

References $_GET.

        {
                if ($_GET["new_type"] == "pg")
                {
                        $this->ctrl->redirect($this, "pages");
                }
                else
                {
                        $this->ctrl->redirect($this, "chapters");
                }
        }

ilObjContentObjectGUI::cancelDelete (  ) 

cancel delete

Definition at line 1630 of file class.ilObjContentObjectGUI.php.

References $_GET.

        {
                session_unregister("saved_post");

                $this->ctrl->redirect($this, $_GET["backcmd"]);

        }

ilObjContentObjectGUI::cancelDeleteExportFile (  ) 

cancel deletion of export files

Definition at line 2261 of file class.ilObjContentObjectGUI.php.

        {
                session_unregister("ilExportFiles");
                $this->ctrl->redirect($this, "exportList");
        }

ilObjContentObjectGUI::cancelFixTree (  ) 

cancel tree fixing

Definition at line 2316 of file class.ilObjContentObjectGUI.php.

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

ilObjContentObjectGUI::chapters (  ) 

show chapters

Definition at line 1271 of file class.ilObjContentObjectGUI.php.

References $num, ilObjectGUI::$tree, formSelect(), ilEditClipboard::getContentObjectId(), ilEditClipboard::getContentObjectType(), ilUtil::getImagePath(), ilObjectGUI::setActions(), setTabs(), showActions(), and ilUtil::switchColor().

        {
                global $tree;

                $this->setTabs();

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

                $this->ctrl->setParameter($this, "backcmd", "chapters");
                $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
                $this->tpl->setVariable("HEADER_TEXT", $this->lng->txt("cont_chapters"));
                $this->tpl->setVariable("CHECKBOX_TOP", IL_FIRST_NODE);


                $cnt = 0;
                $childs = $this->lm_tree->getChilds($this->lm_tree->getRootId());
                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_cat.gif"));

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

                        // 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);
                        $acts = array("delete" => "delete", "move" => "moveChapter");
                        if (ilEditClipboard::getContentObjectType() == "st")
                        {
                                if ($this->lm_tree->isInTree(ilEditClipboard::getContentObjectId()))
                                {
                                        $acts["pasteChapter"] =  "pasteChapter";
                                }
                        }
                        $this->setActions($acts);
                        $this->showActions();
                }

                // SHOW POSSIBLE SUB OBJECTS
                $this->tpl->setVariable("NUM_COLS", 3);
                $subobj = array("st");
                $opts = ilUtil::formSelect(12,"new_type",$subobj);
                $this->tpl->setCurrentBlock("add_object");
                $this->tpl->setVariable("SELECT_OBJTYPE", $opts);
                $this->tpl->setVariable("BTN_NAME", "create");
                $this->tpl->setVariable("TXT_ADD", $this->lng->txt("insert"));
                $this->tpl->parseCurrentBlock();

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

        }

Here is the call graph for this function:

ilObjContentObjectGUI::chooseMetaSection (  ) 

Definition at line 860 of file class.ilObjContentObjectGUI.php.

References chooseMetaSectionObject(), and setTabs().

        {
                $this->setTabs();
//echo "<br>target:".$this->ctrl->getLinkTarget($this).":";
                $this->chooseMetaSectionObject($this->ctrl->getLinkTarget($this));
        }

Here is the call graph for this function:

ilObjContentObjectGUI::chooseMetaSectionObject ( a_target = ""  ) 

Definition at line 845 of file class.ilObjContentObjectGUI.php.

Referenced by chooseMetaSection().

        {
                if ($a_target == "")
                {
                        $a_target = "adm_object.php?ref_id=".$this->object->getRefId();
                }

                include_once "classes/class.ilMetaDataGUI.php";
                $meta_gui =& new ilMetaDataGUI();
                $meta_gui->setObject($this->object);
                $meta_gui->edit("ADM_CONTENT", "adm_content",
                        $a_target, $_REQUEST["meta_section"]);
        }

Here is the caller graph for this function:

ilObjContentObjectGUI::confirmDeleteExportFile (  ) 

confirmation screen for export file deletion

Definition at line 2210 of file class.ilObjContentObjectGUI.php.

References $_POST, $_SESSION, $counter, $file, ilUtil::getImagePath(), sendInfo(), setTabs(), and ilUtil::switchColor().

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

                $this->setTabs();

                // SAVE POST VALUES
                $_SESSION["ilExportFiles"] = $_POST["file"];

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

                sendInfo($this->lng->txt("info_delete_sure"));

                $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));

                // BEGIN TABLE HEADER
                $this->tpl->setCurrentBlock("table_header");
                $this->tpl->setVariable("TEXT",$this->lng->txt("objects"));
                $this->tpl->parseCurrentBlock();

                // BEGIN TABLE DATA
                $counter = 0;
                foreach($_POST["file"] as $file)
                {
                                $file = explode(":", $file);
                                $this->tpl->setCurrentBlock("table_row");
                                $this->tpl->setVariable("CSS_ROW",ilUtil::switchColor(++$counter,"tblrow1","tblrow2"));
                                $this->tpl->setVariable("TEXT_CONTENT", $file[1]." (".$file[0].")");
                                $this->tpl->parseCurrentBlock();
                }

                // cancel/confirm button
                $this->tpl->setVariable("IMG_ARROW",ilUtil::getImagePath("arrow_downright.gif"));
                $buttons = array( "cancelDeleteExportFile"  => $this->lng->txt("cancel"),
                        "deleteExportFile"  => $this->lng->txt("confirm"));
                foreach ($buttons as $name => $value)
                {
                        $this->tpl->setCurrentBlock("operation_btn");
                        $this->tpl->setVariable("BTN_NAME",$name);
                        $this->tpl->setVariable("BTN_VALUE",$value);
                        $this->tpl->parseCurrentBlock();
                }
        }

Here is the call graph for this function:

ilObjContentObjectGUI::confirmedDelete ( a_parent_subobj_id = 0  ) 

delete page object or structure objects

Parameters:
int $a_parent_subobj_id id of parent object (structure object) of the objects, that should be deleted (or no parent object id for top level)

Definition at line 1645 of file class.ilObjContentObjectGUI.php.

References $_GET, $_SESSION, $id, $obj, ilObjectGUI::$tree, ilLMObjectFactory::getInstance(), and sendInfo().

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

                // check number of objects
                if (!isset($_SESSION["saved_post"]))
                {
                        $this->ilias->raiseError($this->lng->txt("no_checkbox"),$this->ilias->error_obj->MESSAGE);
                }

                // delete all selected objects
                foreach ($_SESSION["saved_post"] as $id)
                {
                        if ($id != IL_FIRST_NODE)
                        {
                                $obj =& ilLMObjectFactory::getInstance($this->object, $id, false);
                                $node_data = $tree->getNodeData($id);
                                if (is_object($obj))
                                {
                                        $obj->setLMId($this->object->getId());
                                        $obj->delete();
                                }
                                if($tree->isInTree($id))
                                {
                                        $tree->deleteTree($node_data);
                                }
                        }
                }

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

                // feedback
                sendInfo($this->lng->txt("info_deleted"),true);

                if ($a_parent_subobj_id == 0)
                {
                        $this->ctrl->redirect($this, $_GET["backcmd"]);
                }
        }

Here is the call graph for this function:

ilObjContentObjectGUI::copyPage (  ) 

copy page

Definition at line 1522 of file class.ilObjContentObjectGUI.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);
                }

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

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

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

Here is the call graph for this function:

ilObjContentObjectGUI::createObject (  ) 

form for new content object creation

Reimplemented from ilObjectGUI.

Definition at line 735 of file class.ilObjContentObjectGUI.php.

References $_GET, $_POST, $_SESSION, ilObjectGUI::$data, $rbacsystem, ilObjectGUI::getFormAction(), ilObjectGUI::getTargetFrame(), ilObjectGUI::getTemplateFile(), ilUtil::prepareFormOutput(), and ilUtil::stripSlashes().

Referenced by importObject().

        {
                global $rbacsystem;

                $new_type = $_POST["new_type"] ? $_POST["new_type"] : $_GET["new_type"];

                if (!$rbacsystem->checkAccess("create", $_GET["ref_id"], $new_type))
                {
                        $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
                }
                else
                {
                        // fill in saved values in case of error
                        $data = array();
                        $data["fields"] = array();
                        $data["fields"]["title"] = ilUtil::prepareFormOutput($_SESSION["error_post_vars"]["Fobject"]["title"],true);
                        $data["fields"]["desc"] = ilUtil::stripSlashes($_SESSION["error_post_vars"]["Fobject"]["desc"]);

                        $this->getTemplateFile("create", $new_type);

                        foreach ($data["fields"] as $key => $val)
                        {
                                $this->tpl->setVariable("TXT_".strtoupper($key), $this->lng->txt($key));
                                $this->tpl->setVariable(strtoupper($key), $val);

                                if ($this->prepare_output)
                                {
                                        $this->tpl->parseCurrentBlock();
                                }
                        }

                        $this->tpl->setVariable("FORMACTION", $this->getFormAction("save","adm_object.php?cmd=gateway&ref_id=".
                                $_GET["ref_id"]."&new_type=".$new_type));
                        $this->tpl->setVariable("TXT_HEADER", $this->lng->txt($new_type."_new"));
                        $this->tpl->setVariable("TXT_CANCEL", $this->lng->txt("cancel"));
                        $this->tpl->setVariable("TXT_SUBMIT", $this->lng->txt($new_type."_add"));
                        $this->tpl->setVariable("CMD_SUBMIT", "save");
                        $this->tpl->setVariable("TARGET", $this->getTargetFrame("save"));
                        $this->tpl->setVariable("TXT_REQUIRED_FLD", $this->lng->txt("required_field"));

                        $this->tpl->setVariable("TXT_IMPORT_LM", $this->lng->txt("import_".$new_type));
                        $this->tpl->setVariable("TXT_LM_FILE", $this->lng->txt("file"));
                        $this->tpl->setVariable("TXT_IMPORT", $this->lng->txt("import"));
                        
                        // get the value for the maximal uploadable filesize from the php.ini (if available)
                        $umf=get_cfg_var("upload_max_filesize");
                        // get the value for the maximal post data from the php.ini (if available)
                        $pms=get_cfg_var("post_max_size");
        
                        // use the smaller one as limit
                        $max_filesize=min($umf, $pms);
                        if (!$max_filesize) $max_filesize=max($umf, $pms);
                        
                        // gives out the limit as a littel notice :)
                        $this->tpl->setVariable("TXT_FILE_INFO", $this->lng->txt("file_notice")." $max_filesize.");

                }               
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilObjContentObjectGUI::createPDF (  ) 

export content object

Definition at line 2429 of file class.ilObjContentObjectGUI.php.

        {
                require_once("content/classes/class.ilContObjectExport.php");
                $cont_exp = new ilContObjectExport($this->object, "pdf");
                $cont_exp->buildExportFile();
                $this->offlineList();
        }

ilObjContentObjectGUI::delete ( a_parent_subobj_id = 0  ) 

confirm deletion screen for page object and structure object deletion

Parameters:
int $a_parent_subobj_id id of parent object (structure object) of the objects, that should be deleted (or no parent object id for top level)

Definition at line 1548 of file class.ilObjContentObjectGUI.php.

References $_GET, $_POST, $_SESSION, $counter, $id, $obj, ilUtil::getImagePath(), sendInfo(), setTabs(), and ilUtil::switchColor().

        {
                if(!isset($_POST["id"]))
                {
                        $this->ilias->raiseError($this->lng->txt("no_checkbox"),$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);
                }

                if ($a_parent_subobj_id == 0)
                {
                        $this->setTabs();
                }

                // SAVE POST VALUES
                $_SESSION["saved_post"] = $_POST["id"];

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

                sendInfo($this->lng->txt("info_delete_sure"));

                if ($a_parent_subobj_id != 0)
                {
                        $this->ctrl->setParameterByClass("ilStructureObjectGUI", "backcmd", $_GET["backcmd"]);
                        $this->ctrl->setParameterByClass("ilStructureObjectGUI", "obj_id", $a_parent_subobj_id);
                        $this->tpl->setVariable("FORMACTION",
                                $this->ctrl->getFormActionByClass("ilStructureObjectGUI"));
                }
                else
                {
                        $this->ctrl->setParameter($this, "backcmd", $_GET["backcmd"]);
                        $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
                }
                // BEGIN TABLE HEADER
                $this->tpl->setCurrentBlock("table_header");
                $this->tpl->setVariable("TEXT",$this->lng->txt("objects"));
                $this->tpl->parseCurrentBlock();

                // END TABLE HEADER

                // BEGIN TABLE DATA
                $counter = 0;
                foreach($_POST["id"] as $id)
                {
                        if ($id != IL_FIRST_NODE)
                        {
                                $obj =& new ilLMObject($this->object, $id);
                                switch($obj->getType())         // ok that's not so nice, could be done better
                                {
                                        case "pg":
                                                $this->tpl->setVariable("IMG_OBJ", ilUtil::getImagePath("icon_le.gif"));
                                                break;
                                        case "st":
                                                $this->tpl->setVariable("IMG_OBJ", ilUtil::getImagePath("icon_cat.gif"));
                                                break;
                                }
                                $this->tpl->setCurrentBlock("table_row");
                                $this->tpl->setVariable("CSS_ROW",ilUtil::switchColor(++$counter,"tblrow1","tblrow2"));
                                $this->tpl->setVariable("TEXT_CONTENT", $obj->getTitle());
                                $this->tpl->parseCurrentBlock();
                        }
                }

                // cancel/confirm button
                $this->tpl->setVariable("IMG_ARROW",ilUtil::getImagePath("arrow_downright.gif"));
                $buttons = array( "cancelDelete"  => $this->lng->txt("cancel"),
                                                                  "confirmedDelete"  => $this->lng->txt("confirm"));
                foreach ($buttons as $name => $value)
                {
                        $this->tpl->setCurrentBlock("operation_btn");
                        $this->tpl->setVariable("BTN_NAME",$name);
                        $this->tpl->setVariable("BTN_VALUE",$value);
                        $this->tpl->parseCurrentBlock();
                }
        }

Here is the call graph for this function:

ilObjContentObjectGUI::deleteBibItem (  ) 

delete bib item (module call)

Definition at line 986 of file class.ilObjContentObjectGUI.php.

References deleteBibItemObject(), and setTabs().

        {
                $this->setTabs();
                $this->deleteBibItemObject($this->ctrl->getLinkTarget($this));
        }

Here is the call graph for this function:

ilObjContentObjectGUI::deleteBibItemObject ( a_target = ""  ) 

delete bib item (admin call)

Definition at line 964 of file class.ilObjContentObjectGUI.php.

References $_GET, and $_POST.

Referenced by deleteBibItem().

        {
                include_once "content/classes/class.ilBibItemGUI.php";
                $bib_gui =& new ilBibItemGUI();
                $bib_gui->setObject($this->object);
                $bibItemIndex = $_POST["bibItemIndex"] ? $_POST["bibItemIndex"] : $_GET["bibItemIndex"];
                $bib_gui->bib_obj->delete($_GET["bibItemName"], $_GET["bibItemPath"], $bibItemIndex);
                if (strpos($bibItemIndex, ",") > 0)
                {
                        $bibItemIndex = substr($bibItemIndex, 0, strpos($bibItemIndex, ","));
                }
                if ($a_target == "")
                {
                        $a_target = "adm_object.php?ref_id=" . $this->object->getRefId();
                }

                $bib_gui->edit("ADM_CONTENT", "adm_content", $a_target, $bibItemIndex);
        }

Here is the caller graph for this function:

ilObjContentObjectGUI::deleteExportFile (  ) 

delete export files

Definition at line 2271 of file class.ilObjContentObjectGUI.php.

References $_SESSION, $file, and ilUtil::delDir().

        {
                foreach($_SESSION["ilExportFiles"] as $file)
                {
                        $file = explode(":", $file);
                        $export_dir = $this->object->getExportDirectory($file[0]);
                        
                        $exp_file = $export_dir."/".$file[1];
                        $exp_dir = $export_dir."/".substr($file[1], 0, strlen($file[1]) - 4);
                        if (@is_file($exp_file))
                        {
                                unlink($exp_file);
                        }
                        if (@is_dir($exp_dir))
                        {
                                ilUtil::delDir($exp_dir);
                        }
                }
                $this->ctrl->redirect($this, "exportList");
        }

Here is the call graph for this function:

ilObjContentObjectGUI::deleteMenuEntry (  ) 

drop a menu entry

Definition at line 2821 of file class.ilObjContentObjectGUI.php.

References $_GET, __initLMMenuEditor(), and sendInfo().

        {
                if (empty($_GET["menu_entry"]))
                {
                        $this->ilias->raiseError($this->lng->txt("no_menu_entry_id"),$this->ilias->error_obj->MESSAGE);
                }
                
                $this->__initLMMenuEditor();
                $this->lmme_obj->delete($_GET["menu_entry"]);

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

Here is the call graph for this function:

ilObjContentObjectGUI::deleteMeta (  ) 

Definition at line 955 of file class.ilObjContentObjectGUI.php.

References deleteMetaObject(), and setTabs().

        {
                $this->setTabs();
                $this->deleteMetaObject($this->ctrl->getLinkTarget($this));
        }

Here is the call graph for this function:

ilObjContentObjectGUI::deleteMetaObject ( a_target = ""  ) 

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

References $_GET, and $_POST.

Referenced by deleteMeta().

        {
                if ($a_target == "")
                {
                        $a_target = "adm_object.php?ref_id=".$this->object->getRefId();
                }

                include_once "classes/class.ilMetaDataGUI.php";
                $meta_gui =& new ilMetaDataGUI();
                $meta_gui->setObject($this->object);
                $meta_index = $_POST["meta_index"] ? $_POST["meta_index"] : $_GET["meta_index"];
                $meta_gui->meta_obj->delete($_GET["meta_name"], $_GET["meta_path"], $meta_index);
                $meta_gui->edit("ADM_CONTENT", "adm_content", $a_target, $_GET["meta_section"]);
        }

Here is the caller graph for this function:

ilObjContentObjectGUI::downloadExportFile (  ) 

download export file

Definition at line 2138 of file class.ilObjContentObjectGUI.php.

References $_POST, $file, and ilUtil::deliverFile().

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

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

                $file = explode(":", $_POST["file"][0]);
                $export_dir = $this->object->getExportDirectory($file[0]);
                ilUtil::deliverFile($export_dir."/".$file[1],
                        $file[1]);
        }

Here is the call graph for this function:

ilObjContentObjectGUI::downloadPDFFile (  ) 

download export file

Definition at line 2189 of file class.ilObjContentObjectGUI.php.

References $_POST, and ilUtil::deliverFile().

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

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


                $export_dir = $this->object->getOfflineDirectory();
                ilUtil::deliverFile($export_dir."/".$_POST["file"][0],
                        $_POST["file"][0]);
        }

Here is the call graph for this function:

ilObjContentObjectGUI::editBibItem (  ) 

edit bib items (module call)

Definition at line 1038 of file class.ilObjContentObjectGUI.php.

References editBibItemObject(), and setTabs().

        {
                $this->setTabs();
                $this->editBibItemObject($this->ctrl->getLinkTarget($this));
        }

Here is the call graph for this function:

ilObjContentObjectGUI::editBibItemObject ( a_target = ""  ) 

edit bib items (admin call)

Definition at line 1016 of file class.ilObjContentObjectGUI.php.

References $_GET, and $_POST.

Referenced by editBibItem().

        {
                include_once "content/classes/class.ilBibItemGUI.php";
                $bib_gui =& new ilBibItemGUI();
                $bib_gui->setObject($this->object);
                $bibItemIndex = $_POST["bibItemIndex"] ? $_POST["bibItemIndex"] : $_GET["bibItemIndex"];
                $bibItemIndex *= 1;
                if ($bibItemIndex < 0)
                {
                        $bibItemIndex = 0;
                }
                if ($a_target == "")
                {
                        $a_target = "adm_object.php?ref_id=" . $this->object->getRefId();
                }

                $bib_gui->edit("ADM_CONTENT", "adm_content", $a_target, $bibItemIndex);
        }

Here is the caller graph for this function:

ilObjContentObjectGUI::editMenuEntry (  ) 

edit menu entry form

Definition at line 2838 of file class.ilObjContentObjectGUI.php.

References $_GET, __initLMMenuEditor(), and setTabs().

        {
                if (empty($_GET["menu_entry"]))
                {
                        $this->ilias->raiseError($this->lng->txt("no_menu_entry_id"),$this->ilias->error_obj->MESSAGE);
                }
                
                $this->__initLMMenuEditor();
                $this->lmme_obj->readEntry($_GET["menu_entry"]);

                $this->setTabs();

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

                $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
                $this->tpl->setVariable("TXT_NEW_ENTRY", $this->lng->txt("lm_menu_edit_entry"));
                $this->tpl->setVariable("TXT_TARGET", $this->lng->txt("lm_menu_entry_target"));
                $this->tpl->setVariable("TXT_TITLE", $this->lng->txt("lm_menu_entry_title"));
                $this->tpl->setVariable("TITLE", $this->lmme_obj->getTitle());
                $this->tpl->setVariable("TARGET", $this->lmme_obj->getTarget());
                $this->tpl->setVariable("ENTRY_ID", $this->lmme_obj->getEntryId());
                $this->tpl->setVariable("BTN_NAME", "updateMenuEntry");
                $this->tpl->setVariable("BTN_TEXT", $this->lng->txt("save"));
                $this->tpl->setVariable("BTN_NAME2", "showEntrySelector");
                $this->tpl->setVariable("BTN_TEXT2", $this->lng->txt("lm_menu_select_internal_object"));
                $this->tpl->parseCurrentBlock();
        }

Here is the call graph for this function:

ilObjContentObjectGUI::editMeta (  ) 

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

References editMetaObject(), and setTabs().

        {
                $this->setTabs();
                $this->editMetaObject($this->ctrl->getLinkTarget($this));
        }

Here is the call graph for this function:

ilObjContentObjectGUI::editMetaObject ( a_target = ""  ) 

Definition at line 992 of file class.ilObjContentObjectGUI.php.

References $_GET.

Referenced by editMeta().

        {

                if ($a_target == "")
                {
                        $a_target = "adm_object.php?ref_id=".$this->object->getRefId();
                }

                include_once "classes/class.ilMetaDataGUI.php";
                $meta_gui =& new ilMetaDataGUI();
                $meta_gui->setObject($this->object);
//echo "target:$a_target:";
                $meta_gui->edit("ADM_CONTENT", "adm_content", $a_target, $_GET["meta_section"]);
        }

Here is the caller graph for this function:

ilObjContentObjectGUI::editPublicSection (  ) 

Definition at line 2533 of file class.ilObjContentObjectGUI.php.

References $exp, $output, ilUtil::array_php2js(), formSelect(), and setTabs().

        {
                $this->setTabs();

                switch ($this->object->getType())
                {
                        case "lm":
                                $gui_class = "ilobjlearningmodulegui";
                                break;

                        case "dlb":
                                $gui_class = "ilobjdlbookgui";
                                break;
                }

                // get learning module object
                $this->lm_obj =& new ilObjLearningModule($this->ref_id, true);

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

                require_once ("content/classes/class.ilPublicSectionSelector.php");
                $exp = new ilPublicSectionSelector("lm_edit.php?cmd=view&ref_id=".$this->object->getRefId(),
                        $this->object, $gui_class);

                $exp->setTargetGet("obj_id");

                // build html-output
                $exp->setOutput(0);
                $output = $exp->getOutput();
                
                // get page ids
                foreach ($exp->format_options as $node)
                {
                        if (!$node["container"])
                        {
                                $pages[] = $node["child"];
                        }
                }
                
                $js_pages = ilUtil::array_php2js($pages);

                //$this->tpl->setCurrentBlock("content");
                //var_dump($this->object->getPublicAccessMode());
                // access mode selector
                $this->tpl->setVariable("TXT_SET_PUBLIC_MODE", $this->lng->txt("set_public_mode"));
                $this->tpl->setVariable("TXT_CHOOSE_PUBLIC_MODE", $this->lng->txt("choose_public_mode"));
                $modes = array("complete" => $this->lng->txt("all_pages"), "selected" => $this->lng->txt("selected_pages_only"));
                $select_public_mode = ilUtil::formSelect ($this->object->getPublicAccessMode(),"lm_public_mode",$modes, false, true);
                $this->tpl->setVariable("SELECT_PUBLIC_MODE", $select_public_mode);

                $this->tpl->setVariable("TXT_EXPLORER_HEADER", $this->lng->txt("choose_public_pages"));
                $this->tpl->setVariable("EXPLORER",$output);
                $this->tpl->setVariable("ONCLICK",$js_pages);
                $this->tpl->setVariable("TXT_CHECKALL", $this->lng->txt("check_all"));
                $this->tpl->setVariable("TXT_UNCHECKALL", $this->lng->txt("uncheck_all"));
                $this->tpl->setVariable("TXT_SAVE", $this->lng->txt("save"));
                $this->tpl->setVariable("FORMACTION", $this->ctrl->getLinkTarget($this, "savePublicSection"));
                $this->tpl->parseCurrentBlock();
        }

Here is the call graph for this function:

& ilObjContentObjectGUI::executeCommand (  ) 

execute command

Reimplemented from ilObjectGUI.

Definition at line 66 of file class.ilObjContentObjectGUI.php.

References $_GET, $_POST, $cmd, $obj, addLocations(), explorer(), ilLMObjectFactory::getInstance(), and setTabs().

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

                if ($this->ctrl->getCmdClass() == "ilinternallinkgui")
                {
                        $this->ctrl->setReturn($this, "explorer");
                }

                // get next class that processes or forwards current command
                $next_class = $this->ctrl->getNextClass($this);

                // get current command
                $cmd = $this->ctrl->getCmd();

                $this->addLocations();
                switch($next_class)
                {
                        case "ilobjstylesheetgui":
                                $this->ctrl->setReturn($this, "properties");
                                $style_gui =& new ilObjStyleSheetGUI("", $this->object->getStyleSheetId(), false);
                                $ret =& $this->ctrl->forwardCommand($style_gui);
                                //$ret =& $style_gui->executeCommand();

                                if ($cmd == "save")
                                {
                                        $style_id = $ret;
                                        $this->object->setStyleSheetId($style_id);
                                        $this->object->update();
                                        $this->ctrl->redirect($this, "properties");
                                }
                                break;

                        case "illmpageobjectgui":
                                $this->ctrl->setReturn($this, "properties");
//echo "!";
                                //$this->lm_obj =& $this->ilias->obj_factory->getInstanceByRefId($this->ref_id);

                                $pg_gui =& new ilLMPageObjectGUI($this->object);
                                if ($_GET["obj_id"] != "")
                                {
                                        $obj =& ilLMObjectFactory::getInstance($this->object, $_GET["obj_id"]);
                                        $pg_gui->setLMPageObject($obj);
                                }
                                //$ret =& $pg_gui->executeCommand();
                                $ret =& $this->ctrl->forwardCommand($pg_gui);
                                if ($cmd == "save" || $cmd == "cancel")
                                {
                                        $this->ctrl->redirect($this, "pages");
                                }
                                break;

                        case "ilstructureobjectgui":
                                $this->ctrl->setReturn($this, "properties");
                                $st_gui =& new ilStructureObjectGUI($this->object, $this->object->lm_tree);
                                if ($_GET["obj_id"] != "")
                                {
                                        $obj =& ilLMObjectFactory::getInstance($this->object, $_GET["obj_id"]);
                                        $st_gui->setStructureObject($obj);
                                }
                                //$ret =& $st_gui->executeCommand();
                                $ret =& $this->ctrl->forwardCommand($st_gui);
                                if ($cmd == "save" || $cmd == "cancel")
                                {
                                        if ($_GET["obj_id"] == "")
                                        {
                                                $this->ctrl->redirect($this, "chapters");
                                        }
                                        else
                                        {
                                                $this->ctrl->setCmd("subchap");
                                                $this->executeCommand();
                                        }
                                }
                                break;

                        default:
                                if ($cmd == "create")
                                {
                                        switch ($_POST["new_type"])
                                        {
                                                case "pg":
                                                        $this->setTabs();
                                                        $this->ctrl->setCmdClass("ilLMPageObjectGUI");
                                                        $ret =& $this->executeCommand();
                                                        break;

                                                case "st":
                                                        $this->setTabs();
                                                        $this->ctrl->setCmdClass("ilStructureObjectGUI");
                                                        $ret =& $this->executeCommand();
                                                        break;
                                        }
                                }
                                else
                                {
                                        $ret =& $this->$cmd();
                                }
                                break;
                }
                return $ret;
        }

Here is the call graph for this function:

ilObjContentObjectGUI::explorer (  ) 

output explorer tree

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

References $_GET, $exp, $expanded, ilObjectGUI::$ilias, $ilUser, $output, ilPageEditorGUI::_doJSEditing(), ilUtil::getStyleSheetLocation(), and proceedDragDrop().

Referenced by executeCommand().

        {
                global $ilUser, $ilias;
                
                switch ($this->object->getType())
                {
                        case "lm":
                                $gui_class = "ilobjlearningmodulegui";
                                break;

                        case "dlb":
                                $gui_class = "ilobjdlbookgui";
                                break;
                }

                

                $this->tpl = new ilTemplate("tpl.main.html", true, true);
                // get learning module object
                //$this->lm_obj =& new ilObjLearningModule($this->ref_id, true);

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

                //$this->tpl = new ilTemplate("tpl.explorer.html", false, false);
                $this->tpl->addBlockFile("CONTENT", "content", "tpl.explorer.html");

                require_once ("content/classes/class.ilLMEditorExplorer.php");
                $exp = new ilLMEditorExplorer("lm_edit.php?cmd=view&ref_id=".$this->object->getRefId(),
                        $this->object, $gui_class);

                $exp->setTargetGet("obj_id");
                $exp->setExpandTarget($this->ctrl->getLinkTarget($this, "explorer"));

                if ($_GET["lmmovecopy"] == "1")
                {
                        $this->proceedDragDrop();
                }
        
                
                if ($_GET["lmexpand"] == "")
                {
                        $mtree = new ilTree($this->object->getId());
                        $mtree->setTableNames('lm_tree','lm_data');
                        $mtree->setTreeTablePK("lm_id");
                        $expanded = $mtree->readRootId();
                }
                else
                {
                        $expanded = $_GET["lmexpand"];
                }

                $exp->setExpand($expanded);

                // build html-output
                $exp->setOutput(0);
                $output = $exp->getOutput();

                include_once("content/classes/Pages/class.ilPageEditorGUI.php");
                if (ilPageEditorGUI::_doJSEditing()) 
                {
                        //$this->tpl->touchBlock("includejavascript");
                        
                        $IDS = "";
                        for ($i=0;$i<count($exp->iconList);$i++) 
                        {
                                if ($i>0) $IDS .= ",";
                                $IDS .= "'".$exp->iconList[$i]."'";
                        }
                        $this->tpl->setVariable("ICONIDS",$IDS);
                        //$this->ctrl->setParameter($this, "lmovecopy", 1);
                        $this->tpl->setVariable("TESTPFAD",$this->ctrl->getLinkTarget($this, "explorer")."&lmmovecopy=1");
                        $this->tpl->setVariable("POPUPLINK",$this->ctrl->getLinkTarget($this, "popup")."&ptype=movecopytreenode");
                }
                
                
                $this->tpl->setCurrentBlock("content");
                $this->tpl->setVariable("TXT_EXPLORER_HEADER", $this->lng->txt("cont_chap_and_pages"));
                $this->tpl->setVariable("EXPLORER",$output);
                $this->ctrl->setParameter($this, "lmexpand", $_GET["lmexpand"]);
                //$this->tpl->setVariable("ACTION", "lm_edit.php?cmd=explorer&ref_id=".$this->ref_id."&lmexpand=".$_GET["lmexpand"]);
                $this->tpl->setVariable("ACTION", $this->ctrl->getLinkTarget($this, "explorer"));
                $this->tpl->parseCurrentBlock();
                //$this->tpl->show(false);

        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilObjContentObjectGUI::export (  ) 

export content object

Reimplemented in ilObjDlBookGUI.

Definition at line 1969 of file class.ilObjContentObjectGUI.php.

References exportList().

        {
                require_once("content/classes/class.ilContObjectExport.php");
                $cont_exp = new ilContObjectExport($this->object);
                $cont_exp->buildExportFile();
                $this->exportList();
        }

Here is the call graph for this function:

ilObjContentObjectGUI::exportHTML (  ) 

create html package

Definition at line 2440 of file class.ilObjContentObjectGUI.php.

References exportList().

        {
                require_once("content/classes/class.ilContObjectExport.php");
                $cont_exp = new ilContObjectExport($this->object, "html");
                $cont_exp->buildExportFile();
//echo $this->tpl->get();
                $this->exportList();
        }

Here is the call graph for this function:

ilObjContentObjectGUI::exportList (  ) 

Definition at line 2005 of file class.ilObjContentObjectGUI.php.

References $_GET, $num, $tbl, ilObjectGUI::$tree, exportMenu(), ilUtil::getImagePath(), setTabs(), and ilUtil::switchColor().

Referenced by export(), and exportHTML().

        {
                global $tree;

                $this->setTabs();

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

                $this->exportMenu();
                
                $export_files = $this->object->getExportFiles();

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

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

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

                $num = 0;

                $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));

                $tbl->setTitle($this->lng->txt("cont_export_files"));

                $tbl->setHeaderNames(array("", $this->lng->txt("type"),
                        $this->lng->txt("cont_file"),
                        $this->lng->txt("cont_size"), $this->lng->txt("date") ));

                $cols = array("", "type", "file", "size", "date");
                $header_params = array("ref_id" => $_GET["ref_id"],
                        "cmd" => "exportList", "cmdClass" => strtolower(get_class($this)));
                $tbl->setHeaderVars($cols, $header_params);
                $tbl->setColumnWidth(array("1%", "9%", "40%", "20%", "20%"));

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


                $this->tpl->setVariable("COLUMN_COUNTS", 5);

                // delete button
                $this->tpl->setVariable("IMG_ARROW", ilUtil::getImagePath("arrow_downright.gif"));
                $this->tpl->setCurrentBlock("tbl_action_btn");
                $this->tpl->setVariable("BTN_NAME", "confirmDeleteExportFile");
                $this->tpl->setVariable("BTN_VALUE", $this->lng->txt("delete"));
                $this->tpl->parseCurrentBlock();

                $this->tpl->setCurrentBlock("tbl_action_btn");
                $this->tpl->setVariable("BTN_NAME", "downloadExportFile");
                $this->tpl->setVariable("BTN_VALUE", $this->lng->txt("download"));
                $this->tpl->parseCurrentBlock();

                $this->tpl->setCurrentBlock("tbl_action_btn");
                $this->tpl->setVariable("BTN_NAME", "publishExportFile");
                $this->tpl->setVariable("BTN_VALUE", $this->lng->txt("cont_public_access"));
                $this->tpl->parseCurrentBlock();

                // footer
                $tbl->setFooter("tblfooter",$this->lng->txt("previous"),$this->lng->txt("next"));
                //$tbl->disable("footer");

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

                $tbl->render();
                if(count($export_files) > 0)
                {
                        $i=0;
                        foreach($export_files as $exp_file)
                        {
                                $this->tpl->setCurrentBlock("tbl_content");
                                $this->tpl->setVariable("TXT_FILENAME", $exp_file["file"]);

                                $css_row = ilUtil::switchColor($i++, "tblrow1", "tblrow2");
                                $this->tpl->setVariable("CSS_ROW", $css_row);

                                $this->tpl->setVariable("TXT_SIZE", $exp_file["size"]);
                                $public_str = ($exp_file["file"] == $this->object->getPublicExportFile($exp_file["type"]))
                                        ? " <b>(".$this->lng->txt("public").")<b>"
                                        : "";
                                $this->tpl->setVariable("TXT_TYPE", $exp_file["type"].$public_str);
                                $this->tpl->setVariable("CHECKBOX_ID", $exp_file["type"].":".$exp_file["file"]);

                                $file_arr = explode("__", $exp_file["file"]);
                                $this->tpl->setVariable("TXT_DATE", date("Y-m-d H:i:s",$file_arr[0]));

                                $this->tpl->parseCurrentBlock();
                        }
                } //if is_array
                else
                {
                        $this->tpl->setCurrentBlock("notfound");
                        $this->tpl->setVariable("TXT_OBJECT_NOT_FOUND", $this->lng->txt("obj_not_found"));
                        $this->tpl->setVariable("NUM_COLS", 4);
                        $this->tpl->parseCurrentBlock();
                }

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

Here is the call graph for this function:

Here is the caller graph for this function:

ilObjContentObjectGUI::exportMenu (  ) 

Definition at line 1977 of file class.ilObjContentObjectGUI.php.

Referenced by exportList(), and viewExportLog().

        {
                                // create export file button
                $this->tpl->setCurrentBlock("btn_cell");
                $this->tpl->setVariable("BTN_LINK", $this->ctrl->getLinkTarget($this, "export"));
                $this->tpl->setVariable("BTN_TXT", $this->lng->txt("cont_create_export_file_xml"));
                $this->tpl->parseCurrentBlock();
                
                // create export file button
                $this->tpl->setCurrentBlock("btn_cell");
                $this->tpl->setVariable("BTN_LINK", $this->ctrl->getLinkTarget($this, "exportHTML"));
                $this->tpl->setVariable("BTN_TXT", $this->lng->txt("cont_create_export_file_html"));
                $this->tpl->parseCurrentBlock();

                // view last export log button
                if (is_file($this->object->getExportDirectory()."/export.log"))
                {
                        $this->tpl->setCurrentBlock("btn_cell");
                        $this->tpl->setVariable("BTN_LINK", $this->ctrl->getLinkTarget($this, "viewExportLog"));
                        $this->tpl->setVariable("BTN_TXT", $this->lng->txt("cont_view_last_export_log"));
                        $this->tpl->parseCurrentBlock();
                }

        }

Here is the caller graph for this function:

ilObjContentObjectGUI::exportObject (  ) 

export object

public

Definition at line 1154 of file class.ilObjContentObjectGUI.php.

        {
                return;
        }

ilObjContentObjectGUI::fixTree (  ) 

fix tree

Definition at line 2324 of file class.ilObjContentObjectGUI.php.

References sendInfo().

        {
                $this->object->fixTree();
                sendInfo($this->lng->txt("cont_tree_fixed"), true);
                $this->ctrl->redirect($this, "properties");
        }

Here is the call graph for this function:

ilObjContentObjectGUI::fixTreeConfirm (  ) 

confirm screen for tree fixing

Definition at line 2296 of file class.ilObjContentObjectGUI.php.

References setTabs().

        {
                $this->setTabs();

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

                $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));

                //
                $this->tpl->setVariable("TXT_CONFIRM", $this->lng->txt("confirmation"));
                $this->tpl->setVariable("TXT_CONTENT", $this->lng->txt("cont_fix_tree_confirm"));
                $this->tpl->setVariable("CMD_CANCEL", "cancelFixTree");
                $this->tpl->setVariable("CMD_OK", "fixTree");
                $this->tpl->setVariable("TXT_CANCEL", $this->lng->txt("cancel"));
                $this->tpl->setVariable("TXT_OK", $this->lng->txt("cont_fix_tree"));
        }

Here is the call graph for this function:

ilObjContentObjectGUI::getContextPath ( a_endnode_id,
a_startnode_id = 1 
)

get context path in content object tree

Parameters:
int $a_endnode_id id of endnode
int $a_startnode_id id of startnode

Reimplemented in ilObjDlBookGUI.

Definition at line 1696 of file class.ilObjContentObjectGUI.php.

References $path.

Referenced by pages().

        {
                $path = "";

                $tmpPath = $this->lm_tree->getPathFull($a_endnode_id, $a_startnode_id);

                // count -1, to exclude the learning module itself
                for ($i = 1; $i < (count($tmpPath) - 1); $i++)
                {
                        if ($path != "")
                        {
                                $path .= " > ";
                        }

                        $path .= $tmpPath[$i]["title"];
                }

                return $path;
        }

Here is the caller graph for this function:

ilObjContentObjectGUI::getTabs ( &$  tabs_gui  ) 

adds tabs to tab gui object

Parameters:
object $tabs_gui ilTabsGUI object

Reimplemented from ilObjectGUI.

Definition at line 2527 of file class.ilObjContentObjectGUI.php.

Referenced by setTabs().

        {
                // back to upper context
                $tabs_gui->getTargetsByObjectType($this, $this->object->getType());
        }

Here is the caller graph for this function:

ilObjContentObjectGUI::ilObjContentObjectGUI ( a_data,
a_id = 0,
a_call_by_reference = true,
a_prepare_output = true 
)

Constructor.

public

Definition at line 52 of file class.ilObjContentObjectGUI.php.

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

Referenced by ilObjDlBookGUI::ilObjDlBookGUI(), and ilObjLearningModuleGUI::ilObjLearningModuleGUI().

        {
                global $lng, $ilCtrl;

                $this->ctrl =& $ilCtrl;
                $lng->loadLanguageModule("content");
                parent::ilObjectGUI($a_data,$a_id,$a_call_by_reference,$a_prepare_output);
                $this->actions = $this->objDefinition->getActions("lm");

        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilObjContentObjectGUI::importFileObject (  ) 

display status information or report errors messages in case of error

public

Definition at line 1177 of file class.ilObjContentObjectGUI.php.

References $_GET, $file, $ilDB, $rbacsystem, ilObject::_writeDescription(), ilObject::_writeTitle(), ilObjectGUI::getReturnLocation(), ilUtil::moveUploadedFile(), ilUtil::redirect(), sendInfo(), and ilUtil::unzip().

        {
                global $HTTP_POST_FILES, $rbacsystem, $ilDB;

                include_once "content/classes/class.ilObjLearningModule.php";

                // check if file was uploaded
                $source = $HTTP_POST_FILES["xmldoc"]["tmp_name"];
                if (($source == 'none') || (!$source))
                {
                        $this->ilias->raiseError("No file selected!",$this->ilias->error_obj->MESSAGE);
                }
                // check create permission
                /*
                if (!$rbacsystem->checkAccess("create", $_GET["ref_id"], $_GET["new_type"]))
                {
                        $this->ilias->raiseError($this->lng->txt("no_create_permission"), $this->ilias->error_obj->WARNING);
                }*/

                // check correct file type
                if ($HTTP_POST_FILES["xmldoc"]["type"] != "application/zip" && $HTTP_POST_FILES["xmldoc"]["type"] != "application/x-zip-compressed")
                {
                        $this->ilias->raiseError("Wrong file type!",$this->ilias->error_obj->MESSAGE);
                }

                // create and insert object in objecttree
                include_once("content/classes/class.ilObjContentObject.php");
                $newObj = new ilObjContentObject();
                $newObj->setType($_GET["new_type"]);
                $newObj->setTitle($_FILES["xmldoc"]["name"]);
                $newObj->setDescription("");
                $newObj->create(true);
                $newObj->createReference();
                $newObj->putInTree($_GET["ref_id"]);
                $newObj->setPermissions($_GET["ref_id"]);
                $newObj->notify("new",$_GET["ref_id"],$_GET["parent_non_rbac_id"],$_GET["ref_id"],$newObj->getRefId());

                // create learning module tree
                $newObj->createLMTree();

                // create import directory
                $newObj->createImportDirectory();

                // copy uploaded file to import directory
                $file = pathinfo($_FILES["xmldoc"]["name"]);
                $full_path = $newObj->getImportDirectory()."/".$_FILES["xmldoc"]["name"];
                
                ilUtil::moveUploadedFile($_FILES["xmldoc"]["tmp_name"],
                        $_FILES["xmldoc"]["name"], $full_path);

                //move_uploaded_file($_FILES["xmldoc"]["tmp_name"], $full_path);

                // unzip file
                ilUtil::unzip($full_path);

                // determine filename of xml file
                $subdir = basename($file["basename"],".".$file["extension"]);
                $xml_file = $newObj->getImportDirectory()."/".$subdir."/".$subdir.".xml";
//echo "xmlfile:".$xml_file;

                include_once ("content/classes/class.ilContObjParser.php");
                $contParser = new ilContObjParser($newObj, $xml_file, $subdir);
                $contParser->startParsing();
                
                // import style
                $style_file = $newObj->getImportDirectory()."/".$subdir."/style.xml";
                if (is_file($style_file))
                {
                        require_once("classes/class.ilObjStyleSheet.php");
                        $style = new ilObjStyleSheet();
                        $style->createFromXMLFile($style_file);
                        $newObj->writeStyleSheetId($style->getId());
                }

                /* update title and description in object data */
                if (is_object($newObj->meta_data))
                {
                        $newObj->meta_data->read();
                        $newObj->setTitle($newObj->meta_data->getTitle());
                        $newObj->setDescription($newObj->meta_data->getDescription());
                        ilObject::_writeTitle($newObj->getID(), $newObj->getTitle());
                        ilObject::_writeDescription($newObj->getID(), $newObj->getDescription());
                        //$q = "UPDATE object_data SET title = '" . $newObj->getTitle() . "', description = '" . $newObj->getDescription() . "' WHERE obj_id = '" . $newObj->getID() . "'";
                        //$this->ilias->db->query($q);
                }

                sendInfo($this->lng->txt($this->type."_added"),true);
                ilUtil::redirect($this->getReturnLocation("save","adm_object.php?".$this->link_params));

        }

Here is the call graph for this function:

ilObjContentObjectGUI::importObject (  ) 

display dialogue for importing XML-LeaningObjects

public

Reimplemented from ilObjectGUI.

Definition at line 1164 of file class.ilObjContentObjectGUI.php.

References createObject().

        {
                $this->createObject();
                return;
        }

Here is the call graph for this function:

ilObjContentObjectGUI::linkChecker (  ) 

Definition at line 2603 of file class.ilObjContentObjectGUI.php.

References $counter, ilObjectGUI::$ilias, $ilUser, __initLinkChecker(), ilLinkCheckNotify::_getNotifyStatus(), ilLMPageObject::_getPresentationTitle(), ilUtil::formCheckbox(), ilUtil::getImagePath(), setTabs(), and ilUtil::switchColor().

Referenced by refreshLinkCheck(), and saveLinkCheck().

        {
                global $ilias,$ilUser;

                $this->__initLinkChecker();

                $invalid_links = $this->link_checker_obj->getInvalidLinksFromDB();


                $this->setTabs();

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

                if($last_access = $this->link_checker_obj->getLastCheckTimestamp())
                {
                        $this->tpl->setCurrentBlock("LAST_MODIFIED");
                        $this->tpl->setVariable("AS_OF",$this->lng->txt('last_change').": ");
                        $this->tpl->setVariable("LAST_CHECK",date('Y-m-d H:i:s',$last_access));
                        $this->tpl->parseCurrentBlock();
                }


                $this->tpl->setVariable("F_ACTION",$this->ctrl->getFormAction($this));

                $this->tpl->setVariable("TYPE_IMG",ilUtil::getImagePath('icon_lm.gif'));
                $this->tpl->setVariable("ALT_IMG",$this->lng->txt('learning_module'));
                $this->tpl->setVariable("TITLE",$this->object->getTitle().' ('.$this->lng->txt('link_check').')');
                $this->tpl->setVariable("PAGE_TITLE",$this->lng->txt('cont_pg_title'));
                $this->tpl->setVariable("URL",$this->lng->txt('url'));
                $this->tpl->setVariable("OPTIONS",$this->lng->txt('edit'));

                if(!count($invalid_links))
                {
                        $this->tpl->setCurrentBlock("no_invalid");
                        $this->tpl->setVariable("TXT_NO_INVALID",$this->lng->txt('no_invalid_links'));
                        $this->tpl->parseCurrentBlock();
                }
                else
                {
                        $counter = 0;
                        foreach($invalid_links as $invalid)
                        {
                                $this->tpl->setCurrentBlock("invalid_row");
                                $this->tpl->setVariable("ROW_COLOR",ilUtil::switchColor(++$counter,'tblrow1','tblrow2'));
                                $this->tpl->setVariable("ROW_PAGE_TITLE",
                                                                                ilLMPageObject::_getPresentationTitle($invalid['page_id'],$this->object->getPageHeader()));
                                $this->tpl->setVariable("ROW_URL",$invalid['url']);


                                // EDIT IMAGE
                                $this->ctrl->setParameterByClass('ilLMPageObjectGUI','obj_id',$invalid['page_id']);
                                $this->tpl->setVariable("ROW_EDIT_LINK",$this->ctrl->getLinkTargetByClass('ilLMPageObjectGUI','view'));

                                $this->tpl->setVariable("ROW_IMG",ilUtil::getImagePath('edit.gif'));
                                $this->tpl->setVariable("ROW_ALT_IMG",$this->lng->txt('edit'));
                                $this->tpl->parseCurrentBlock();
                        }
                }
                if((bool) $ilias->getSetting('cron_link_check'))
                {
                        include_once './classes/class.ilLinkCheckNotify.php';

                        // Show message block
                        $this->tpl->setCurrentBlock("MESSAGE_BLOCK");
                        $this->tpl->setVariable("INFO_MESSAGE",$this->lng->txt('link_check_message_a'));
                        $this->tpl->setVariable("CHECK_MESSAGE",ilUtil::formCheckbox(
                                                                                ilLinkCheckNotify::_getNotifyStatus($ilUser->getId(),$this->object->getId()),
                                                                                'link_check_message',
                                                                                1));
                        $this->tpl->setVariable("INFO_MESSAGE_LONG",$this->lng->txt('link_check_message_b'));
                        $this->tpl->parseCurrentBlock();

                        // Show save button
                        $this->tpl->setCurrentBlock("CRON_ENABLED");
                        $this->tpl->setVariable("DOWNRIGHT_IMG",ilUtil::getImagePath('arrow_downright.gif'));
                        $this->tpl->setVariable("BTN_SUBMIT_LINK_CHECK",$this->lng->txt('save'));
                        $this->tpl->parseCurrentBlock();
                }
                $this->tpl->setVariable("BTN_REFRESH",$this->lng->txt('refresh'));

                return true;

        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilObjContentObjectGUI::moveChapter ( a_parent_subobj_id = 0  ) 

move a single chapter (selection)

Definition at line 1810 of file class.ilObjContentObjectGUI.php.

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

        {
                if(!isset($_POST["id"]))
                {
                        $this->ilias->raiseError($this->lng->txt("no_checkbox"),$this->ilias->error_obj->MESSAGE);
                }
//echo "Hallo::"; exit;
                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("st", $_POST["id"][0]);

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

                if ($a_parent_subobj_id == 0)
                {
                        $this->ctrl->redirect($this, "chapters");
                }
        }

Here is the call graph for this function:

ilObjContentObjectGUI::movePage (  ) 

move page

Definition at line 1932 of file class.ilObjContentObjectGUI.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);
                }

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

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

Here is the call graph for this function:

ilObjContentObjectGUI::owner (  ) 

show owner of content object

Definition at line 1791 of file class.ilObjContentObjectGUI.php.

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

        {
                $this->setTabs();
                $this->ownerObject();
        }

Here is the call graph for this function:

ilObjContentObjectGUI::pages (  ) 

Definition at line 1357 of file class.ilObjContentObjectGUI.php.

References $num, ilObjectGUI::$tree, formSelect(), ilEditClipboard::getAction(), ilEditClipboard::getContentObjectType(), getContextPath(), ilUtil::getImagePath(), ilLMPageObject::getPageList(), ilObjectGUI::setActions(), setTabs(), showActions(), and ilUtil::switchColor().

        {
                global $tree;

                $this->setTabs();

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

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

                $cnt = 0;
                $pages = ilLMPageObject::getPageList($this->object->getId());
                foreach ($pages as $page)
                {
                        $this->tpl->setCurrentBlock("table_row");
                        // color changing
                        $css_row = ilUtil::switchColor($cnt++,"tblrow1","tblrow2");

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

                        // link
                        $this->ctrl->setParameter($this, "backcmd", "");
                        $this->ctrl->setParameterByClass("ilLMPageObjectGUI", "obj_id", $page["obj_id"]);
//echo "<br>:".$this->ctrl->getLinkTargetByClass("ilLMPageObjectGUI", "view").":";
                        $this->tpl->setVariable("LINK_TARGET",
                                $this->ctrl->getLinkTargetByClass("ilLMPageObjectGUI", "view"));

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

                        // context
                        if ($this->lm_tree->isInTree($page["obj_id"]))
                        {
                                $path_str = $this->getContextPath($page["obj_id"]);
                        }
                        else
                        {
                                $path_str = "---";
                        }
                        $this->tpl->setVariable("TEXT_CONTEXT", $path_str);

                        $this->tpl->parseCurrentBlock();
                }
                if($cnt == 0)
                {
                        $this->tpl->setCurrentBlock("notfound");
                        $this->tpl->setVariable("NUM_COLS", 4);
                        $this->tpl->setVariable("TXT_OBJECT_NOT_FOUND", $this->lng->txt("obj_not_found"));
                        $this->tpl->parseCurrentBlock();
                }
                else
                {
                        $acts = array("delete" => "delete", "movePage" => "movePage", "copyPage" => "copyPage");
                        if(ilEditClipboard::getContentObjectType() == "pg" &&
                                ilEditClipboard::getAction() == "copy")
                        {
                                $acts["pastePage"] = "pastePage";
                        }

                        /*
                        if (ilEditClipboard::getContentObjectType() == "st")
                        {
                                $acts["pasteChapter"] =  "pasteChapter";
                        }*/
                        $this->setActions($acts);
                        $this->tpl->setVariable("NUM_COLS", 4);
                        $this->showActions();

                        // SHOW VALID ACTIONS
                        /*
                        $this->tpl->setCurrentBlock("operation_btn");
                        $this->tpl->setVariable("BTN_NAME", "delete");
                        $this->tpl->setVariable("BTN_VALUE", $this->lng->txt("delete"));
                        $this->tpl->parseCurrentBlock();*/

                }

                // SHOW POSSIBLE SUB OBJECTS
                $this->tpl->setVariable("NUM_COLS", 4);
                //$this->showPossibleSubObjects("st");
                $subobj = array("pg");
                $opts = ilUtil::formSelect(12,"new_type",$subobj);
                $this->tpl->setCurrentBlock("add_object");
                $this->tpl->setVariable("SELECT_OBJTYPE", $opts);
                $this->tpl->setVariable("BTN_NAME", "create");
                $this->tpl->setVariable("TXT_ADD", $this->lng->txt("create"));
                $this->tpl->parseCurrentBlock();


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

        }

Here is the call graph for this function:

ilObjContentObjectGUI::pasteChapter ( a_parent_subobj_id = 0  ) 

paste chapter

Definition at line 1842 of file class.ilObjContentObjectGUI.php.

References $_POST, $id, ilObjectGUI::$tree, ilEditClipboard::clear(), ilEditClipboard::getContentObjectId(), and ilEditClipboard::getContentObjectType().

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

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

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

                $node = $tree->getNodeData($id);

                $subnodes = $tree->getSubtree($node);

                // check, if target is within subtree
                foreach ($subnodes as $subnode)
                {
                        if($subnode["obj_id"] == $a_parent_subobj_id)
                        {
                                $this->ilias->raiseError($this->lng->txt("cont_target_within_source"),$this->ilias->error_obj->MESSAGE);
                        }
                }
                if($_POST["id"][0] == $id)
                {
                        ilEditClipboard::clear();
                        $this->ctrl->redirect($this, "chapters");
                }


                //echo ":".$id.":";
                // delete old tree entries
                $tree->deleteTree($node);
                if(!isset($_POST["id"]))
                {
                        $target = IL_LAST_NODE;
                }
                else
                {
                        $target = $_POST["id"][0];
                }

                // determin parent
                $parent = ($a_parent_subobj_id == 0)
                        ? $tree->getRootId()
                        : $a_parent_subobj_id;

                // do not move a chapter in front of a page
                if($target == IL_FIRST_NODE)
                {
                        $childs =& $tree->getChildsByType($parent, "pg");
                        if (count($childs) != 0)
                        {
                                $target = $childs[count($childs) - 1]["obj_id"];
                        }
                }


                if (!$tree->isInTree($id))
                {
                        $tree->insertNode($id, $parent, $target);

                        foreach ($subnodes as $node)
                        {
                                //$obj_data =& $this->ilias->obj_factory->getInstanceByRefId($node["child"]);
                                //$obj_data->putInTree($node["parent"]);
                                if($node["obj_id"] != $id)
                                {
                                        $tree->insertNode($node["obj_id"], $node["parent"]);
                                }
                        }
                }

                ilEditClipboard::clear();

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

                if ($a_parent_subobj_id == 0)
                {
                        $this->ctrl->redirect($this, "chapters");
                }
        }

Here is the call graph for this function:

ilObjContentObjectGUI::pastePage (  ) 

paste page

Definition at line 1463 of file class.ilObjContentObjectGUI.php.

References $id, $lm_id, ilLMObject::_lookupContObjID(), 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);
                }

                // 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->object->getID())
                        {
                                $lm_page = new ilLMPageObject($this->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->object);
                                $id = $new_page->getId();
                        }
                }
                
                // cut is not be possible in "all pages" form yet
                if (ilEditClipboard::getAction() == "cut")
                {
                        // check wether page belongs not to lm
                        if (ilLMObject::_lookupContObjID(ilEditClipboard::getContentObjectId())
                                != $this->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->object->getID());
                                $lm_page->update();
                                $page =& $lm_page->getPageObject();
                                $page->buildDom();
                                $page->setParentId($this->object->getID());
                                $page->update();
                        }
                }


                ilEditClipboard::clear();
                $this->ctrl->redirect($this, "pages");
        }

Here is the call graph for this function:

ilObjContentObjectGUI::perm (  ) 

edit permissions

Definition at line 1758 of file class.ilObjContentObjectGUI.php.

References ilObjectGUI::permObject(), ilObjectGUI::setFormAction(), and setTabs().

        {
                $this->setTabs();

                $this->setFormAction("addRole", $this->ctrl->getLinkTarget($this, "addRole"));
                $this->setFormAction("permSave", $this->ctrl->getLinkTarget($this, "permSave"));
                $this->permObject();
        }

Here is the call graph for this function:

ilObjContentObjectGUI::permSave (  ) 

save permissions

Definition at line 1771 of file class.ilObjContentObjectGUI.php.

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

        {
                $this->setReturnLocation("permSave", $this->ctrl->getLinkTarget($this, "perm"));
                $this->permSaveObject();
        }

Here is the call graph for this function:

ilObjContentObjectGUI::proceedDragDrop (  ) 

proceed drag and drop operations on pages/chapters

Definition at line 489 of file class.ilObjContentObjectGUI.php.

References $_GET, $target_id, ilHistory::_createEntry(), ilLMObject::_lookupTitle(), and ilLMObjectFactory::getInstance().

Referenced by explorer().

        {
                $lmtree = new ilTree($this->object->getId());
                $lmtree->setTableNames('lm_tree','lm_data');
                $lmtree->setTreeTablePK("lm_id");

                
                // node-id of dragged object
                $source_id = $_GET["dragdropSource"];
                
                // node-id of object under dragged obj at drop
                $target_id = $_GET["dragdropTarget"];
                
                // "move" | "copy"
                $movecopy = $_GET["dragdropCopymove"];
                
                // "after" | "before" : copy or move the source-object before or after the selected target-object.
                $position = $_GET["dragdropPosition"];
                
                //echo "sourceId: $sourceId<br>";
                //echo "targetId: $targetId<br>";
                //echo "move or copy: $movecopy<br>";
                //echo "position: $position<br>";
                
                $source_obj = ilLMObjectFactory::getInstance($this->object, $source_id, true);
                $source_obj->setLMId($this->object->getId());
                $target_obj = ilLMObjectFactory::getInstance($this->object, $target_id, true);
                $target_obj->setLMId($this->object->getId());
                $target_parent = $lmtree->getParentId($target_id);
                

                // handle pages
                if ($source_obj->getType() == "pg")
                {
                        if ($lmtree->isInTree($source_obj->getId()))
                        {
                                $node_data = $lmtree->getNodeData($source_obj->getId());
                                
                                // cut on move
                                if ($movecopy == "move")
                                {
                                        $parent_id = $lmtree->getParentId($source_obj->getId());
                                        $lmtree->deleteTree($node_data);
                                        
                                        // write history entry
                                        require_once("classes/class.ilHistory.php");
                                        ilHistory::_createEntry($source_obj->getId(), "cut",
                                                array(ilLMObject::_lookupTitle($parent_id), $parent_id),
                                                $this->object->getType().":pg");
                                        ilHistory::_createEntry($parent_id, "cut_page",
                                                array(ilLMObject::_lookupTitle($source_obj->getId()), $source_obj->getId()),
                                                $this->object->getType().":st");
                                }
                                else
                                {
                                        // copy page
                                        $new_page =& $source_obj->copy();
                                        $source_id = $new_page->getId();
                                        $source_obj =& $new_page;
                                }
                                
                                // paste page
                                if(!$lmtree->isInTree($source_obj->getId()))
                                {
                                        // move page after/before other page
                                        if ($target_obj->getType() == "pg")
                                        {
                                                $target_pos = $target_id;
                                                if ($position == "before")
                                                {
                                                        $target_pos = IL_FIRST_NODE;
                                                        if ($pred = $lmtree->fetchPredecessorNode($target_id))
                                                        {
                                                                if ($lmtree->getParentId($pred["child"]) == $target_parent)
                                                                {
                                                                        $target_pos = $pred["child"];
                                                                }
                                                        }
                                                }
                                                $parent = $target_parent;
                                        }
                                        else // move page into chapter
                                        {
                                                $target_pos = IL_FIRST_NODE;
                                                $parent = $target_id;
                                        }
                                        
                                        // insert page into tree
                                        $lmtree->insertNode($source_obj->getId(),
                                                $parent, $target_pos);
                                        
                                        // write hisroty entry
                                        if ($movecopy == "move")
                                        {
                                                // write history comments
                                                include_once("classes/class.ilHistory.php");
                                                ilHistory::_createEntry($source_obj->getId(), "paste",
                                                        array(ilLMObject::_lookupTitle($parent), $parent),
                                                        $this->object->getType().":pg");
                                                ilHistory::_createEntry($parent, "paste_page",
                                                        array(ilLMObject::_lookupTitle($source_obj->getId()), $source_obj->getId()),
                                                        $this->object->getType().":st");
                                        }

                                }
                        }
                }
                
                // handle chapters
                if ($source_obj->getType() == "st")
                {
                        // check wether target is a chapter
                        if ($target_obj->getType() != "st")
                        {
                                return;
                        }
                        $source_node = $lmtree->getNodeData($source_id);
                        $subnodes = $lmtree->getSubtree($source_node);                                  

                        // check, if target is within subtree
                        foreach ($subnodes as $subnode)
                        {
                                if($subnode["obj_id"] == $target_id)
                                {
                                        return;
                                }
                        }

                        $target_pos = $target_id;
                        
                        // insert before
                        if ($position == "before")
                        {
                                $target_pos = IL_FIRST_NODE;
                                
                                // look for predecessor chapter on same level
                                $childs = $lmtree->getChildsByType($target_parent, "st");
                                $found = false;
                                foreach ($childs as $child)
                                {
                                        if ($child["obj_id"] == $target_id)
                                        {
                                                $found = true;
                                        }
                                        if (!$found)
                                        {
                                                $target_pos = $child["obj_id"];
                                        }
                                }
                                
                                // if target_pos is still first node we must skip all pages
                                if ($target_pos == IL_FIRST_NODE)
                                {
                                        $pg_childs =& $lmtree->getChildsByType($target_parent, "pg");
                                        if (count($pg_childs) != 0)
                                        {
                                                $target_pos = $pg_childs[count($pg_childs) - 1]["obj_id"];
                                        }
                                }
                        }
                        
                        // insert into
                        if ($position == "into")
                        {
                                $target_parent = $target_id;
                                $target_pos = IL_FIRST_NODE;
                                                                                
                                // if target_pos is still first node we must skip all pages
                                if ($target_pos == IL_FIRST_NODE)
                                {
                                        $pg_childs =& $lmtree->getChildsByType($target_parent, "pg");
                                        if (count($pg_childs) != 0)
                                        {
                                                $target_pos = $pg_childs[count($pg_childs) - 1]["obj_id"];
                                        }
                                }
                        }

                        
                        // delete source tree
                        if ($movecopy == "move")
                        {
                                $lmtree->deleteTree($source_node);
                        }
                        else
                        {
                                // copy chapter (incl. subcontents)
                                $new_chapter =& $source_obj->copy($lmtree, $target_parent, $target_pos);
                        }
                        
                        if (!$lmtree->isInTree($source_id))
                        {
                                $lmtree->insertNode($source_id, $target_parent, $target_pos);
                                
                                // insert moved tree
                                if ($movecopy == "move")
                                {
                                        foreach ($subnodes as $node)
                                        {
                                                if($node["obj_id"] != $source_id)
                                                {
                                                        $lmtree->insertNode($node["obj_id"], $node["parent"]);
                                                }
                                        }
                                }
                        }
        
                        // check the tree
                        $this->object->checkTree();

                }

                
                $this->object->checkTree();
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilObjContentObjectGUI::properties (  ) 

edit properties form

Reimplemented in ilObjDlBookGUI.

Definition at line 181 of file class.ilObjContentObjectGUI.php.

References $entries, __initLMMenuEditor(), formSelect(), ilObjContentObject::getAvailableLayouts(), ilUtil::getImagePath(), setTabs(), and ilUtil::yn2tf().

Referenced by ilObjLearningModuleGUI::view().

        {
                $this->setTabs();

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

                // view button
                $this->tpl->setCurrentBlock("btn_cell");
                $this->tpl->setVariable("BTN_LINK","lm_presentation.php?ref_id=".$this->object->getRefID());
                $this->tpl->setVariable("BTN_TARGET"," target=\"ilContObj".$this->object->getID()."\" ");
                $this->tpl->setVariable("BTN_TXT",$this->lng->txt("view"));
                $this->tpl->parseCurrentBlock();

                // test purpose: create stylesheet
                if ($this->object->getStyleSheetId() == 0)
                {
                        $this->tpl->setCurrentBlock("btn_cell");
                        $this->tpl->setVariable("BTN_LINK",
                                $this->ctrl->getLinkTargetByClass("ilObjStyleSheetGUI", "create"));
                        $this->tpl->setVariable("BTN_TXT",$this->lng->txt("create_stylesheet"));
                        $this->tpl->parseCurrentBlock();
                }
                else // test purpose: edit stylesheet
                {
                        $this->tpl->setCurrentBlock("btn_cell");
                        $this->tpl->setVariable("BTN_LINK",
                                $this->ctrl->getLinkTargetByClass("ilObjStyleSheetGUI", "edit"));
                        $this->tpl->setVariable("BTN_TXT",$this->lng->txt("edit_stylesheet"));
                        $this->tpl->parseCurrentBlock();
                }

                $this->tpl->setCurrentBlock("btn_cell");
                $this->tpl->setVariable("BTN_LINK", $this->ctrl->getLinkTarget($this, "fixTreeConfirm"));
                //$this->tpl->setVariable("BTN_TARGET"," target=\"_top\" ");
                $this->tpl->setVariable("BTN_TXT", $this->lng->txt("cont_fix_tree"));
                $this->tpl->parseCurrentBlock();

                //$this->tpl->touchBlock("btn_row");

                // edit public section
                if ($this->ilias->getSetting("pub_section"))
                {
                        $this->tpl->setCurrentBlock("btn_cell");
                        $this->tpl->setVariable("BTN_LINK", $this->ctrl->getLinkTarget($this, "editPublicSection"));
                        //$this->tpl->setVariable("BTN_TARGET"," target=\"_top\" ");
                        $this->tpl->setVariable("BTN_TXT", $this->lng->txt("public_section"));
                        $this->tpl->parseCurrentBlock();
                }
                
                // lm properties
                $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.lm_properties.html", true);
                $this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
                $this->tpl->setVariable("TXT_PROPERTIES", $this->lng->txt("cont_lm_properties"));

                // online
                $this->tpl->setVariable("TXT_ONLINE", $this->lng->txt("cont_online"));
                $this->tpl->setVariable("CBOX_ONLINE", "cobj_online");
                $this->tpl->setVariable("VAL_ONLINE", "y");
                if ($this->object->getOnline())
                {
                        $this->tpl->setVariable("CHK_ONLINE", "checked");
                }

                // layout
                $this->tpl->setVariable("TXT_LAYOUT", $this->lng->txt("cont_def_layout"));
                $layouts = ilObjLearningModule::getAvailableLayouts();
                $select_layout = ilUtil::formSelect ($this->object->getLayout(), "lm_layout",
                        $layouts, false, true);
                $this->tpl->setVariable("SELECT_LAYOUT", $select_layout);

                // page header
                $this->tpl->setVariable("TXT_PAGE_HEADER", $this->lng->txt("cont_page_header"));
                $pg_header = array ("st_title" => $this->lng->txt("cont_st_title"),
                        "pg_title" => $this->lng->txt("cont_pg_title"),
                        "none" => $this->lng->txt("cont_none"));
                $select_pg_head = ilUtil::formSelect ($this->object->getPageHeader(), "lm_pg_header",
                        $pg_header, false, true);
                $this->tpl->setVariable("SELECT_PAGE_HEADER", $select_pg_head);

                // chapter numbers
                $this->tpl->setVariable("TXT_NUMBER", $this->lng->txt("cont_act_number"));
                $this->tpl->setVariable("CBOX_NUMBER", "cobj_act_number");
                $this->tpl->setVariable("VAL_NUMBER", "y");
                if ($this->object->isActiveNumbering())
                {
                        $this->tpl->setVariable("CHK_NUMBER", "checked");
                }

                // toc mode
                $this->tpl->setVariable("TXT_TOC_MODE", $this->lng->txt("cont_toc_mode"));
                $arr_toc_mode = array ("chapters" => $this->lng->txt("cont_chapters_only"),
                        "pages" => $this->lng->txt("cont_chapters_and_pages"));
                $select_toc_mode = ilUtil::formSelect ($this->object->getTOCMode(), "toc_mode",
                        $arr_toc_mode, false, true);
                $this->tpl->setVariable("SELECT_TOC_MODE", $select_toc_mode);

                // clean frames
                $this->tpl->setVariable("TXT_CLEAN_FRAMES", $this->lng->txt("cont_clean_frames"));
                $this->tpl->setVariable("TXT_CLEAN_FRAMES_DESC", $this->lng->txt("cont_clean_frames_desc"));
                $this->tpl->setVariable("CBOX_CLEAN_FRAMES", "cobj_clean_frames");
                $this->tpl->setVariable("VAL_CLEAN_FRAMES", "y");
                if ($this->object->cleanFrames())
                {
                        $this->tpl->setVariable("CHK_CLEAN_FRAMES", "checked");
                }
                
                // history user comments
                $this->tpl->setVariable("TXT_HIST_USER_COMMENTS", $this->lng->txt("enable_hist_user_comments"));
                $this->tpl->setVariable("TXT_HIST_USER_COMMENTS_DESC", $this->lng->txt("enable_hist_user_comments_desc"));
                $this->tpl->setVariable("CBOX_HIST_USER_COMMENTS", "cobj_user_comments");
                $this->tpl->setVariable("VAL_HIST_USER_COMMENTS", "y");
                if ($this->object->isActiveHistoryUserComments())
                {
                        $this->tpl->setVariable("CHK_HIST_USER_COMMENTS", "checked");
                }

                // lm menu
                $this->tpl->setVariable("TXT_LM_MENU", $this->lng->txt("cont_lm_menu"));
                $this->tpl->setVariable("TXT_ACT_MENU", $this->lng->txt("cont_active"));
                $this->tpl->setVariable("CBOX_LM_MENU", "cobj_act_lm_menu");
                $this->tpl->setVariable("VAL_LM_MENU", "y");
                if ($this->object->isActiveLMMenu())
                {
                        $this->tpl->setVariable("CHK_LM_MENU", "checked");
                }

                // toc
                $this->tpl->setVariable("TXT_TOC", $this->lng->txt("cont_toc"));
                $this->tpl->setVariable("CBOX_TOC", "cobj_act_toc");
                $this->tpl->setVariable("VAL_TOC", "y");
                if ($this->object->isActiveTOC())
                {
                        $this->tpl->setVariable("CHK_TOC", "checked");
                }

                // print view
                $this->tpl->setVariable("TXT_PRINT", $this->lng->txt("cont_print_view"));
                $this->tpl->setVariable("CBOX_PRINT", "cobj_act_print");
                $this->tpl->setVariable("VAL_PRINT", "y");
                if ($this->object->isActivePrintView())
                {
                        $this->tpl->setVariable("CHK_PRINT", "checked");
                }
                
                // downloads
                $this->tpl->setVariable("TXT_DOWNLOADS", $this->lng->txt("cont_downloads"));
                $this->tpl->setVariable("TXT_DOWNLOADS_DESC", $this->lng->txt("cont_downloads_desc"));
                $this->tpl->setVariable("CBOX_DOWNLOADS", "cobj_act_downloads");
                $this->tpl->setVariable("VAL_DOWNLOADS", "y");
                if ($this->object->isActiveDownloads())
                {
                        $this->tpl->setVariable("CHK_DOWNLOADS", "checked");
                }
                
                // get user defined menu entries
                $this->__initLMMenuEditor();
                $entries = $this->lmme_obj->getMenuEntries();
                
                if (count($entries) > 0)
                {
                        foreach ($entries as $entry)
                        {
                                $this->ctrl->setParameter($this, "menu_entry", $entry["id"]);

                                $this->tpl->setCurrentBlock("menu_entries");
                                
                                if ($entry["type"] == "intern")
                                {
                                        $entry["link"] = ILIAS_HTTP_PATH."/goto.php?target=".$entry["link"];
                                }

                                // add http:// prefix if not exist
                                if (!strstr($entry["link"],'http://'))
                                {
                                        $entry["link"] = "http://".$entry["link"];
                                }
                                
                                $this->tpl->setVariable("ENTRY_LINK", $entry["link"]);
                                $this->tpl->setVariable("ENTRY_TITLE", $entry["title"]);

                                $this->tpl->setVariable("CBOX_ENTRY", "menu_entries[]");
                                $this->tpl->setVariable("VAL_ENTRY", $entry["id"]);

                                if (ilUtil::yn2tf($entry["active"]))
                                {
                                        $this->tpl->setVariable("CHK_ENTRY", "checked=\"checked\"");
                                }


                                $this->tpl->setVariable("LINK_EDIT", $this->ctrl->getLinkTarget($this,"editMenuEntry"));
                                $this->tpl->setVariable("TARGET_EDIT", "content");
                                $this->tpl->setVariable("TXT_EDIT", $this->lng->txt("edit"));
                                $this->tpl->setVariable("IMG_EDIT", ilUtil::getImagePath("icon_pencil.gif"));

                                $this->tpl->setVariable("LINK_DROP", $this->ctrl->getLinkTarget($this,"deleteMenuEntry"));
                                $this->tpl->setVariable("TARGET_DROP", "content");
                                $this->tpl->setVariable("TXT_DROP", $this->lng->txt("drop"));
                                $this->tpl->setVariable("IMG_DROP", ilUtil::getImagePath("delete.gif"));

                                $this->tpl->parseCurrentBlock();
                        }
                }
                
                // add entry link


                $this->tpl->setCurrentBlock("commands");
                $this->tpl->setVariable("BTN_NAME", "saveProperties");
                $this->tpl->setVariable("BTN_TEXT", $this->lng->txt("save"));
                $this->tpl->setVariable("BTN_NAME2", "addMenuEntry");
                $this->tpl->setVariable("BTN_TEXT2", $this->lng->txt("add_menu_entry"));
                $this->tpl->parseCurrentBlock();
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilObjContentObjectGUI::publishExportFile (  ) 

download export file

Definition at line 2159 of file class.ilObjContentObjectGUI.php.

References $_POST, and $file.

        {
                if(!isset($_POST["file"]))
                {
                        $this->ilias->raiseError($this->lng->txt("no_checkbox"),$this->ilias->error_obj->MESSAGE);
                }
                if (count($_POST["file"]) > 1)
                {
                        $this->ilias->raiseError($this->lng->txt("cont_select_max_one_item"),$this->ilias->error_obj->MESSAGE);
                }
                
                $file = explode(":", $_POST["file"][0]);
                $export_dir = $this->object->getExportDirectory($file[0]);
                
                if ($this->object->getPublicExportFile($file[0]) ==
                        $file[1])
                {
                        $this->object->setPublicExportFile($file[0], "");
                }
                else
                {
                        $this->object->setPublicExportFile($file[0], $file[1]);
                }
                $this->object->update();
                $this->ctrl->redirect($this, "exportList");
        }

ilObjContentObjectGUI::refreshLinkCheck (  ) 

Definition at line 2713 of file class.ilObjContentObjectGUI.php.

References __initLinkChecker(), linkChecker(), and sendInfo().

        {
                $this->__initLinkChecker();

                if(!$this->link_checker_obj->checkPear())
                {
                        sendInfo($this->lng->txt('missing_pear_library'));
                        $this->linkChecker();

                        return false;
                }

                $this->link_checker_obj->checkLinks();
                sendInfo($this->lng->txt('link_checker_refreshed'));

                $this->linkChecker();

                return true;
        }

Here is the call graph for this function:

ilObjContentObjectGUI::saveBibItem (  ) 

save bib item (module call)

Definition at line 1086 of file class.ilObjContentObjectGUI.php.

References saveBibItemObject(), and setTabs().

        {
                $this->setTabs();
                $this->saveBibItemObject($this->ctrl->getLinkTarget($this));
        }

Here is the call graph for this function:

ilObjContentObjectGUI::saveBibItemObject ( a_target = ""  ) 

save bib item (admin call)

Definition at line 1062 of file class.ilObjContentObjectGUI.php.

References $_GET, and $_POST.

Referenced by saveBibItem().

        {
                include_once "content/classes/class.ilBibItemGUI.php";
                $bib_gui =& new ilBibItemGUI();
                $bib_gui->setObject($this->object);
                $bibItemIndex = $_POST["bibItemIndex"] ? $_POST["bibItemIndex"] : $_GET["bibItemIndex"];
                $bibItemIndex *= 1;
                if ($bibItemIndex < 0)
                {
                        $bibItemIndex = 0;
                }
                $bibItemIndex = $bib_gui->save($bibItemIndex);

                if ($a_target == "")
                {
                        $a_target = "adm_object.php?ref_id=" . $this->object->getRefId();
                }

                $bib_gui->edit("ADM_CONTENT", "adm_content", $a_target, $bibItemIndex);
        }

Here is the caller graph for this function:

ilObjContentObjectGUI::saveLinkCheck (  ) 

Definition at line 2686 of file class.ilObjContentObjectGUI.php.

References $_POST, $ilDB, $ilUser, linkChecker(), and sendInfo().

        {
                global $ilDB,$ilUser;

                include_once './classes/class.ilLinkCheckNotify.php';

                $link_check_notify =& new ilLinkCheckNotify($ilDB);
                $link_check_notify->setUserId($ilUser->getId());
                $link_check_notify->setObjId($this->object->getId());

                if($_POST['link_check_message'])
                {
                        sendInfo($this->lng->txt('link_check_message_enabled'));
                        $link_check_notify->addNotifier();
                }
                else
                {
                        sendInfo($this->lng->txt('link_check_message_disabled'));
                        $link_check_notify->deleteNotifier();
                }
                $this->linkChecker();

                return true;
        }

Here is the call graph for this function:

ilObjContentObjectGUI::saveMenuEntry (  ) 

save new menu entry

Definition at line 2790 of file class.ilObjContentObjectGUI.php.

References $_POST, __initLMMenuEditor(), and sendInfo().

        {
                // check title and target
                if (empty($_POST["title"]))
                {
                        $this->ilias->raiseError($this->lng->txt("please_enter_title"),$this->ilias->error_obj->MESSAGE);
                }
                if (empty($_POST["target"]))
                {
                        $this->ilias->raiseError($this->lng->txt("please_enter_target"),$this->ilias->error_obj->MESSAGE);
                }
                
                $this->__initLMMenuEditor();
                $this->lmme_obj->setTitle($_POST["title"]);
                $this->lmme_obj->setTarget($_POST["target"]);
                $this->lmme_obj->setLinkRefId($_POST["link_ref_id"]);
                
                if ($_POST["link_ref_id"])
                {
                        $this->lmme_obj->setLinkType("intern");
                }
                
                $this->lmme_obj->create();

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

Here is the call graph for this function:

ilObjContentObjectGUI::saveMeta (  ) 

Definition at line 1054 of file class.ilObjContentObjectGUI.php.

References saveMetaObject().

        {
                $this->saveMetaObject("lm_edit.php");
        }

Here is the call graph for this function:

ilObjContentObjectGUI::saveMetaObject ( a_target = "adm_object.php"  ) 

Definition at line 1044 of file class.ilObjContentObjectGUI.php.

References $_POST, and ilUtil::redirect().

Referenced by saveMeta().

        {
                include_once "classes/class.ilMetaDataGUI.php";
                $meta_gui =& new ilMetaDataGUI();
                $meta_gui->setObject($this->object);
//echo "title_value:".htmlentities($_POST["meta"]["Title"]["Value"]); exit;
                $meta_gui->save($_POST["meta_section"]);
                ilUtil::redirect($a_target . "?cmd=editMeta&ref_id=" . $this->object->getRefId() . "&meta_section=" . $_POST["meta_section"]);
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilObjContentObjectGUI::saveObject (  ) 

save new content object to db

Reimplemented from ilObjectGUI.

Definition at line 797 of file class.ilObjContentObjectGUI.php.

References $_GET, $_POST, $rbacadmin, $rbacsystem, ilObjectGUI::getReturnLocation(), ilUtil::redirect(), and sendInfo().

        {
                global $rbacadmin, $rbacsystem;

                // always call parent method first to create an object_data entry & a reference
                //$newObj = parent::saveObject();
                // TODO: fix MetaDataGUI implementation to make it compatible to use parent call
                if (!$rbacsystem->checkAccess("create", $_GET["ref_id"], $_GET["new_type"]))
                {
                        $this->ilias->raiseError($this->lng->txt("no_create_permission"), $this->ilias->error_obj->MESSAGE);
                }
                else
                {
                        // check title
                        if ($_POST["Fobject"]["title"] == "")
                        {
                                $this->ilias->raiseError($this->lng->txt("please_enter_title"), $this->ilias->error_obj->MESSAGE);
                                return;
                        }
                        
                        // create and insert object in objecttree
                        include_once("content/classes/class.ilObjContentObject.php");
                        $newObj = new ilObjContentObject();
                        $newObj->setType($this->type);
                        $newObj->setTitle($_POST["Fobject"]["title"]);#"content object ".$newObj->getId());             // set by meta_gui->save
                        $newObj->setDescription($_POST["Fobject"]["desc"]);     // set by meta_gui->save
                        $newObj->create();
                        $newObj->createReference();
                        $newObj->putInTree($_GET["ref_id"]);
                        $newObj->setPermissions($_GET["ref_id"]);
                        $newObj->notify("new",$_GET["ref_id"],$_GET["parent_non_rbac_id"],$_GET["ref_id"],$newObj->getRefId());

                        // setup rolefolder & default local roles (moderator)
                        //$roles = $newObj->initDefaultRoles();
                        // assign author role to creator of forum object
                        //$rbacadmin->assignUser($roles[0], $newObj->getOwner(), "n");
                        //ilObjUser::updateActiveRoles($newObj->getOwner());
                        // create content object tree
                        $newObj->createLMTree();
                        unset($newObj);

                        // always send a message
                        sendInfo($this->lng->txt($this->type."_added"), true);
                        ilUtil::redirect($this->getReturnLocation("save","adm_object.php?".$this->link_params));
                }
        }

Here is the call graph for this function:

ilObjContentObjectGUI::saveProperties (  ) 

save properties

Definition at line 710 of file class.ilObjContentObjectGUI.php.

References $_POST, __initLMMenuEditor(), sendInfo(), and ilUtil::yn2tf().

        {
                $this->object->setLayout($_POST["lm_layout"]);
                $this->object->setPageHeader($_POST["lm_pg_header"]);
                $this->object->setTOCMode($_POST["toc_mode"]);
                $this->object->setOnline(ilUtil::yn2tf($_POST["cobj_online"]));
                $this->object->setActiveLMMenu(ilUtil::yn2tf($_POST["cobj_act_lm_menu"]));
                $this->object->setActiveNumbering(ilUtil::yn2tf($_POST["cobj_act_number"]));
                $this->object->setActiveTOC(ilUtil::yn2tf($_POST["cobj_act_toc"]));
                $this->object->setActivePrintView(ilUtil::yn2tf($_POST["cobj_act_print"]));
                $this->object->setActiveDownloads(ilUtil::yn2tf($_POST["cobj_act_downloads"]));
                $this->object->setCleanFrames(ilUtil::yn2tf($_POST["cobj_clean_frames"]));
                $this->object->setHistoryUserComments(ilUtil::yn2tf($_POST["cobj_user_comments"]));
                $this->object->updateProperties();
                
                $this->__initLMMenuEditor();
                $this->lmme_obj->updateActiveStatus($_POST["menu_entries"]);

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

Here is the call graph for this function:

ilObjContentObjectGUI::savePublicSection (  ) 

Definition at line 2593 of file class.ilObjContentObjectGUI.php.

References $_POST, ilLMObject::_writePublicAccessStatus(), and sendInfo().

        {
                //var_dump($_POST["lm_public_mode"]);exit;
                $this->object->setPublicAccessMode($_POST["lm_public_mode"]);
                $this->object->updateProperties();
                ilLMObject::_writePublicAccessStatus($_POST["pages"],$this->object->getId());
                sendInfo($this->lng->txt("msg_obj_modified"), true);
                $this->ctrl->redirect($this, "editPublicSection");
        }

Here is the call graph for this function:

ilObjContentObjectGUI::setilLMMenu ( a_offline = false  ) 

get lm menu html

Definition at line 2334 of file class.ilObjContentObjectGUI.php.

References $_GET, $entries, and __initLMMenuEditor().

        {
                if (!$this->object->isActiveLMMenu())
                {
                        return "";
                }

                include_once("./classes/class.ilTemplate.php");

                $tpl_menu =& new ilTemplate("tpl.lm_menu.html", true, true, true);
                $tpl_menu->setCurrentBlock("lm_menu_btn");

                // Determine whether the view of a learning resource should
                // be shown in the frameset of ilias, or in a separate window.
                $showViewInFrameset = $this->ilias->ini->readVariable("layout","view_target") == "frame";

                if ($showViewInFrameset) 
                {
                        $buttonTarget = "bottom";
                }
                else
                {
                        $buttonTarget = "_top";
                }

                if ($this->object->isActiveTOC())
                {
                        if (!$a_offline)
                        {
                                $tpl_menu->setVariable("BTN_LINK", "./lm_presentation.php?cmd=showTableOfContents&ref_id=".$_GET["ref_id"]."&obj_id=".$_GET["obj_id"]);
                        }
                        else
                        {
                                $tpl_menu->setVariable("BTN_LINK", "./table_of_contents.html");
                        }
                        $tpl_menu->setVariable("BTN_TXT", $this->lng->txt("cont_contents"));
                        $tpl_menu->setVariable("BTN_TARGET", $buttonTarget);
                        $tpl_menu->parseCurrentBlock();
                }

                // print view
                if ($this->object->isActivePrintView())
                {
                        if (!$a_offline)                // has to be implemented for offline mode
                        {
                                $tpl_menu->setVariable("BTN_LINK", "./lm_presentation.php?cmd=showPrintViewSelection&ref_id=".$_GET["ref_id"]."&obj_id=".$_GET["obj_id"]);
                                $tpl_menu->setVariable("BTN_TXT", $this->lng->txt("cont_print_view"));
                                                        $tpl_menu->setVariable("BTN_TARGET", $buttonTarget);
                                $tpl_menu->parseCurrentBlock();
                        }
                }

                // download
                if ($this->object->isActiveDownloads() && !$a_offline)
                {
                        $tpl_menu->setVariable("BTN_LINK", "./lm_presentation.php?cmd=showDownloadList&ref_id=".$_GET["ref_id"]."&obj_id=".$_GET["obj_id"]);
                        $tpl_menu->setVariable("BTN_TXT", $this->lng->txt("download"));
                                                $tpl_menu->setVariable("BTN_TARGET", $buttonTarget);
                        $tpl_menu->parseCurrentBlock();
                }
                
                // get user defined menu entries
                $this->__initLMMenuEditor();
                $entries = $this->lmme_obj->getMenuEntries(true);
                
                if (count($entries) > 0)
                {
                        foreach ($entries as $entry)
                        {
                                // build goto-link for internal resources
                                if ($entry["type"] == "intern")
                                {
                                        $entry["link"] = ILIAS_HTTP_PATH."/goto.php?target=".$entry["link"];
                                }

                                // add http:// prefix if not exist
                                if (!strstr($entry["link"],'http://'))
                                {
                                        $entry["link"] = "http://".$entry["link"];
                                }
                                
                                $tpl_menu->setVariable("BTN_LINK", $entry["link"]);
                                $tpl_menu->setVariable("BTN_TXT", $entry["title"]);
                                //$tpl_menu->setVariable("BTN_TARGET", $buttonTarget);
                                $tpl_menu->setVariable("BTN_TARGET", "_blank");
                                $tpl_menu->parseCurrentBlock();
                        }
                }

                return $tpl_menu->get();
        }

Here is the call graph for this function:

ilObjContentObjectGUI::setTabs (  ) 

output tabs

Definition at line 2512 of file class.ilObjContentObjectGUI.php.

References getTabs().

Referenced by addBibItem(), addMenuEntry(), addMeta(), chapters(), chooseMetaSection(), confirmDeleteExportFile(), delete(), deleteBibItem(), deleteMeta(), editBibItem(), editMenuEntry(), editMeta(), editPublicSection(), executeCommand(), exportList(), fixTreeConfirm(), linkChecker(), owner(), pages(), perm(), properties(), saveBibItem(), showEntrySelector(), and viewExportLog().

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

Here is the call graph for this function:

Here is the caller graph for this function:

ilObjContentObjectGUI::showActions (  ) 

show possible action (form buttons)

public

Definition at line 1723 of file class.ilObjContentObjectGUI.php.

References $d, $row, and ilUtil::getImagePath().

Referenced by chapters(), and pages().

        {
                $notoperations = array();

                $operations = array();

                $d = $this->actions;

                foreach ($d as $row)
                {
                        if (!in_array($row["name"], $notoperations))
                        {
                                $operations[] = $row;
                        }
                }

                if (count($operations)>0)
                {
                        foreach ($operations as $val)
                        {
                                $this->tpl->setCurrentBlock("operation_btn");
                                $this->tpl->setVariable("BTN_NAME", $val["lng"]);
                                $this->tpl->setVariable("BTN_VALUE", $this->lng->txt($val["lng"]));
                                $this->tpl->parseCurrentBlock();
                        }

                        $this->tpl->setCurrentBlock("operation");
                        $this->tpl->setVariable("IMG_ARROW",ilUtil::getImagePath("arrow_downright.gif"));
                        $this->tpl->parseCurrentBlock();
                }
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilObjContentObjectGUI::showEntrySelector (  ) 

Definition at line 2896 of file class.ilObjContentObjectGUI.php.

References $_GET, $exp, $output, formSelect(), sendInfo(), and setTabs().

        {
                $this->setTabs();
                
                $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.lm_menu_object_selector.html",true);

                sendInfo($this->lng->txt("lm_menu_select_object_to_add"));
                
                require_once ("content/classes/class.ilLMMenuObjectSelector.php");
                $exp = new ilLMMenuObjectSelector($this->ctrl->getLinkTarget($this,'test'),$this);

                $exp->setExpand($_GET["lm_menu_expand"] ? $_GET["lm_menu_expand"] : $this->tree->readRootId());
                $exp->setExpandTarget($this->ctrl->getLinkTarget($this,'showEntrySelector'));
                $exp->setTargetGet("ref_id");
                $exp->setRefId($this->cur_ref_id);
                
                $sel_types = array('lm','glo','frm','exc','tst','svy');
                $exp->setSelectableTypes($sel_types);

                //$exp->setTargetGet("obj_id");

                // build html-output
                $exp->setOutput(0);
                $output = $exp->getOutput();
                
                // get page ids
                foreach ($exp->format_options as $node)
                {
                        if (!$node["container"])
                        {
                                $pages[] = $node["child"];
                        }
                }
                
                //$this->tpl->setCurrentBlock("content");
                //var_dump($this->object->getPublicAccessMode());
                // access mode selector
                $this->tpl->setVariable("TXT_SET_PUBLIC_MODE", $this->lng->txt("set_public_mode"));
                $this->tpl->setVariable("TXT_CHOOSE_PUBLIC_MODE", $this->lng->txt("choose_public_mode"));
                $modes = array("complete" => $this->lng->txt("all_pages"), "selected" => $this->lng->txt("selected_pages_only"));
                $select_public_mode = ilUtil::formSelect ($this->object->getPublicAccessMode(),"lm_public_mode",$modes, false, true);
                $this->tpl->setVariable("SELECT_PUBLIC_MODE", $select_public_mode);

                $this->tpl->setVariable("TXT_EXPLORER_HEADER", $this->lng->txt("choose_public_pages"));
                $this->tpl->setVariable("EXPLORER",$output);
                $this->tpl->setVariable("ONCLICK",$js_pages);
                $this->tpl->setVariable("TXT_CHECKALL", $this->lng->txt("check_all"));
                $this->tpl->setVariable("TXT_UNCHECKALL", $this->lng->txt("uncheck_all"));
                $this->tpl->setVariable("TXT_SAVE", $this->lng->txt("save"));
                $this->tpl->setVariable("FORMACTION", $this->ctrl->getLinkTarget($this, "savePublicSection"));
                $this->tpl->parseCurrentBlock();
        }

Here is the call graph for this function:

ilObjContentObjectGUI::updateMenuEntry (  ) 

update a menu entry

Definition at line 2869 of file class.ilObjContentObjectGUI.php.

References $_POST, __initLMMenuEditor(), and sendInfo().

        {
                if (empty($_POST["menu_entry"]))
                {
                        $this->ilias->raiseError($this->lng->txt("no_menu_entry_id"),$this->ilias->error_obj->MESSAGE);
                }
                
                // check title and target
                if (empty($_POST["title"]))
                {
                        $this->ilias->raiseError($this->lng->txt("please_enter_title"),$this->ilias->error_obj->MESSAGE);
                }
                if (empty($_POST["target"]))
                {
                        $this->ilias->raiseError($this->lng->txt("please_enter_target"),$this->ilias->error_obj->MESSAGE);
                }
                
                $this->__initLMMenuEditor();
                $this->lmme_obj->readEntry($_POST["menu_entry"]);
                $this->lmme_obj->setTitle($_POST["title"]);
                $this->lmme_obj->setTarget($_POST["target"]);
                $this->lmme_obj->update();

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

Here is the call graph for this function:

ilObjContentObjectGUI::view (  ) 

view content object

Reimplemented in ilObjLearningModuleGUI.

Definition at line 1801 of file class.ilObjContentObjectGUI.php.

References viewObject().

        {
                $this->viewObject();
        }

Here is the call graph for this function:

ilObjContentObjectGUI::viewExportLog (  ) 

Definition at line 2117 of file class.ilObjContentObjectGUI.php.

References ilObjectGUI::$tree, exportMenu(), and setTabs().

        {
                global $tree;

                $this->setTabs();

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

                // load files templates
                $this->tpl->setVariable("ADM_CONTENT",
                        nl2br(file_get_contents($this->object->getExportDirectory()."/export.log")));

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

Here is the call graph for this function:

ilObjContentObjectGUI::viewObject (  ) 

view object

public

Reimplemented from ilObjectGUI.

Definition at line 1097 of file class.ilObjContentObjectGUI.php.

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

Referenced by view().

        {
                global $rbacsystem, $tree, $tpl;


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

                // Determine whether the view of a learning resource should
                // be shown in the frameset of ilias, or in a separate window.
                $showViewInFrameset = $this->ilias->ini->readVariable("layout","view_target") == "frame";

                // edit button
                $this->tpl->addBlockfile("BUTTONS", "buttons", "tpl.buttons.html");

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

                // view button
                $this->tpl->setCurrentBlock("btn_cell");
                if (!defined("ILIAS_MODULE"))
                {
                        $this->tpl->setVariable("BTN_LINK","content/lm_presentation.php?ref_id=".$this->object->getRefID());
                }
                else
                {
                        $this->tpl->setVariable("BTN_LINK","lm_presentation.php?ref_id=".$this->object->getRefID());
                }
                if ($showViewInFrameset) 
                {
                        $this->tpl->setVariable("BTN_TARGET"," target=\"bottom\" ");
                }
                else
                {
                        $this->tpl->setVariable("BTN_TARGET"," target=\"_top\" ");
                }
                $this->tpl->setVariable("BTN_TXT",$this->lng->txt("view"));
                $this->tpl->parseCurrentBlock();


                parent::viewObject();

        }

Here is the caller graph for this function:


Field Documentation

ilObjContentObjectGUI::$ctrl

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


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