ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilStructureObjectGUI Class Reference

Class ilStructureObjectGUI. More...

+ Inheritance diagram for ilStructureObjectGUI:
+ Collaboration diagram for ilStructureObjectGUI:

Public Member Functions

 ilStructureObjectGUI (&$a_content_obj, &$a_tree)
 Constructor public.
 setStructureObject (&$a_st_object)
 set structure object
 getType ()
 this function is called by condition handler gui interface
executeCommand ()
 execute command
 create ()
 create new page or chapter in chapter
 edit ()
 view ()
 showHierarchy ()
 Show subhiearchy of pages and subchapters.
 cutItems ($a_return="view")
 Copy items to clipboard, then cut them from the current tree.
 copyItems ($a_return="view")
 Copy items to clipboard.
 saveAllTitles ()
 Save all titles of chapters/pages.
 subchap ()
 add_cell ($val, $link="")
 output a cell in object list
 save ()
 save new chapter
 putInTree ()
 put chapter into tree
 cutPage ()
 cut page
 copyPage ()
 copy page
 pastePage ()
 paste page
 cutChapter ()
 Cut chapter(s)
 copyChapter ()
 copy a single chapter (selection)
 pasteChapter ()
 paste chapter
 activatePages ()
 activates or deactivates pages
 initConditionHandlerInterface ()
 cancel ()
 cancel creation of new page or chapter
 setTabs ()
 output tabs
 insertChapter ($a_as_sub=false)
 Insert (multiple) chapters at node.
 insertSubchapter ()
 Insert (multiple) subchapters at node.
 insertChapterClip ($a_as_sub=false, $a_return="view")
 Insert Chapter from clipboard.
 insertSubchapterClip ()
 Insert Chapter from clipboard.
 insertPage ()
 Insert (multiple) pages at node.
 insertPageClip ()
 Insert pages from clipboard.
 proceedDragDrop ()
 Perform drag and drop action.
 setPageLayout ()
 Set layout for multipl pages.
 initSetPageLayoutForm ()
 Init set page layout form.
 savePageLayout ()
 Save page layout.
 editMasterLanguage ()
 Edit master language.
 switchToLanguage ()
 Switch to language.
- Public Member Functions inherited from ilLMObjectGUI
 ilLMObjectGUI (&$a_content_obj)
 constructor
 setActions ($a_actions="")
 build action array
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g.
 delete ()
 Confirm deletion screen (delete page or structure objects)
 cancelDelete ()
 cancel deletion of page/structure objects
 confirmedDelete ()
 page and structure object deletion
 showActions ($a_actions)
 show possible action (form buttons)
 checkTree ()
 check the content object tree

Static Public Member Functions

static _goto ($a_target, $a_target_ref_id="")
 redirect script

Data Fields

 $obj
 $tree
- Data Fields inherited from ilLMObjectGUI
 $ilias
 $tpl
 $lng
 $obj
 $ctrl
 $content_object
 $actions

Detailed Description

Class ilStructureObjectGUI.

User Interface for Structure Objects Editing

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
Id:
class.ilStructureObjectGUI.php 56825 2015-01-07 10:52:43Z akill

ilStructureObjectGUI: ilConditionHandlerGUI, ilMDEditorGUI

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

Member Function Documentation

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

redirect script

Parameters
string$a_target

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

References $_GET, $ilErr, ilLMObjectGUI\$lng, $ref_id, ilObject\_getAllReferences(), ilObjectGUI\_gotoRepositoryRoot(), ilLMObject\_lookupContObjID(), ilObject\_lookupTitle(), exit, and ilUtil\sendFailure().

{
global $rbacsystem, $ilErr, $lng, $ilAccess;
// determine learning object
$lm_id = ilLMObject::_lookupContObjID($a_target);
// get all references
$ref_ids = ilObject::_getAllReferences($lm_id);
// always try passed ref id first
if (in_array($a_target_ref_id, $ref_ids))
{
$ref_ids = array_merge(array($a_target_ref_id), $ref_ids);
}
// check read permissions
foreach ($ref_ids as $ref_id)
{
// Permission check
if ($ilAccess->checkAccess("read", "", $ref_id))
{
// don't redirect anymore, just set parameters
// (goto.php includes "ilias.php")
$_GET["baseClass"] = "ilLMPresentationGUI";
$_GET["obj_id"] = $a_target;
$_GET["ref_id"] = $ref_id;
include_once("ilias.php");
exit;;
}
}
if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID))
{
ilUtil::sendFailure(sprintf($lng->txt("msg_no_perm_read_item"),
ilObject::_lookupTitle($lm_id)), true);
include_once("./Services/Object/classes/class.ilObjectGUI.php");
}
$ilErr->raiseError($lng->txt("msg_no_perm_read_lm"), $ilErr->FATAL);
}

+ Here is the call graph for this function:

ilStructureObjectGUI::activatePages ( )

activates or deactivates pages

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

References $_POST, ilLMObjectGUI\$lng, $path, ilPageObject\_lookupActive(), ilLMObject\_lookupType(), ilPageObject\_writeActive(), and ilUtil\sendFailure().

{
global $lng;
include_once("./Modules/LearningModule/classes/class.ilLMPage.php");
if (is_array($_POST["id"]))
{
$act_items = array();
// get all "top" ids, i.e. remove ids, that have a selected parent
foreach($_POST["id"] as $id)
{
$path = $this->tree->getPathId($id);
$take = true;
foreach($path as $path_id)
{
if ($path_id != $id && in_array($path_id, $_POST["id"]))
{
$take = false;
}
}
if ($take)
{
$act_items[] = $id;
}
}
foreach($act_items as $id)
{
$childs = $this->tree->getChilds($id);
foreach($childs as $child)
{
if (ilLMObject::_lookupType($child["child"]) == "pg")
{
$act = ilLMPage::_lookupActive($child["child"],
$this->content_object->getType());
ilLMPage::_writeActive($child["child"],
$this->content_object->getType(), !$act);
}
}
if (ilLMObject::_lookupType($id) == "pg")
{
$this->content_object->getType());
$this->content_object->getType(), !$act);
}
}
}
else
{
ilUtil::sendFailure($lng->txt("no_checkbox"), true);
}
$this->ctrl->redirect($this, "view");
}

+ Here is the call graph for this function:

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

output a cell in object list

Reimplemented from ilLMObjectGUI.

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

{
if(!empty($link))
{
$this->tpl->setCurrentBlock("begin_link");
$this->tpl->setVariable("LINK_TARGET", $link);
$this->tpl->parseCurrentBlock();
$this->tpl->touchBlock("end_link");
}
$this->tpl->setCurrentBlock("text");
$this->tpl->setVariable("TEXT_CONTENT", $val);
$this->tpl->parseCurrentBlock();
$this->tpl->setCurrentBlock("table_cell");
$this->tpl->parseCurrentBlock();
}
ilStructureObjectGUI::cancel ( )

cancel creation of new page or chapter

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

References $_GET.

{
if ($_GET["obj_id"] != 0)
{
if ($_GET["new_type"] == "pg")
{
$this->ctrl->redirect($this, "view");
}
else
{
$this->ctrl->redirect($this, "subchap");
}
}
}
ilStructureObjectGUI::copyChapter ( )

copy a single chapter (selection)

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

References copyItems().

{
$this->copyItems("subchap");
}

+ Here is the call graph for this function:

ilStructureObjectGUI::copyItems (   $a_return = "view")

Copy items to clipboard.

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

References $_POST, $ilCtrl, ilLMObjectGUI\$lng, ilLMObject\clipboardCopy(), ilUtil\sendFailure(), ilUtil\sendInfo(), ilEditClipboard\setAction(), ilUtil\stripSlashesArray(), and ilLMObject\uniqueTypesCheck().

Referenced by copyChapter(), and copyPage().

{
global $ilCtrl, $lng;
if (!is_array($items))
{
ilUtil::sendFailure($lng->txt("no_checkbox"), true);
$ilCtrl->redirect($this, "showHierarchy");
}
$todel = array(); // delete IDs < 0 (needed for non-js editing)
foreach($items as $k => $item)
{
if ($item < 0)
{
$todel[] = $k;
}
}
foreach($todel as $k)
{
unset($items[$k]);
}
{
ilUtil::sendFailure($lng->txt("cont_choose_pages_or_chapters_only"), true);
$ilCtrl->redirect($this, "showHierarchy");
}
ilLMObject::clipboardCopy($this->content_object->getId(), $items);
ilUtil::sendInfo($lng->txt("cont_selected_items_have_been_copied"), true);
$ilCtrl->redirect($this, $a_return);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilStructureObjectGUI::copyPage ( )

copy page

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

References copyItems().

{
$this->copyItems();
}

+ Here is the call graph for this function:

ilStructureObjectGUI::create ( )

create new page or chapter in chapter

Reimplemented from ilLMObjectGUI.

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

References $_GET, and setTabs().

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

+ Here is the call graph for this function:

ilStructureObjectGUI::cutChapter ( )

Cut chapter(s)

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

References cutItems().

{
$this->cutItems("subchap");
}

+ Here is the call graph for this function:

ilStructureObjectGUI::cutItems (   $a_return = "view")

Copy items to clipboard, then cut them from the current tree.

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

References $_POST, $ilCtrl, ilLMObjectGUI\$lng, ilLMObject\clipboardCut(), ilUtil\sendFailure(), ilUtil\sendInfo(), ilEditClipboard\setAction(), ilUtil\stripSlashesArray(), and ilLMObject\uniqueTypesCheck().

Referenced by cutChapter(), and cutPage().

{
global $ilCtrl, $lng;
if (!is_array($items))
{
ilUtil::sendFailure($lng->txt("no_checkbox"), true);
$ilCtrl->redirect($this, "showHierarchy");
}
$todel = array(); // delete IDs < 0 (needed for non-js editing)
foreach($items as $k => $item)
{
if ($item < 0)
{
$todel[] = $k;
}
}
foreach($todel as $k)
{
unset($items[$k]);
}
{
ilUtil::sendFailure($lng->txt("cont_choose_pages_or_chapters_only"), true);
$ilCtrl->redirect($this, "showHierarchy");
}
ilLMObject::clipboardCut($this->content_object->getId(), $items);
//ilUtil::sendInfo($this->lng->txt("msg_cut_clipboard"), true);
ilUtil::sendInfo($lng->txt("cont_selected_items_have_been_cut"), true);
$ilCtrl->redirect($this, $a_return);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilStructureObjectGUI::cutPage ( )

cut page

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

References cutItems().

{
$this->cutItems();
}

+ Here is the call graph for this function:

ilStructureObjectGUI::edit ( )

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

References view().

{
$this->view();
}

+ Here is the call graph for this function:

ilStructureObjectGUI::editMasterLanguage ( )

Edit master language.

Parameters
@return

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

References $ilCtrl.

{
global $ilCtrl;
$ilCtrl->setParameter($this, "transl", "");
$ilCtrl->redirect($this, "showHierarchy");
}
& ilStructureObjectGUI::executeCommand ( )

execute command

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

References $_POST, $cmd, $ret, ilMDEditorGUI\addObserver(), initConditionHandlerInterface(), and setTabs().

{
//echo "<br>:cmd:".$this->ctrl->getCmd().":cmdClass:".$this->ctrl->getCmdClass().":";
$next_class = $this->ctrl->getNextClass($this);
$cmd = $this->ctrl->getCmd();
switch($next_class)
{
case 'ilmdeditorgui':
$this->setTabs();
include_once 'Services/MetaData/classes/class.ilMDEditorGUI.php';
$md_gui =& new ilMDEditorGUI($this->content_object->getID(),
$this->obj->getId(), $this->obj->getType());
$md_gui->addObserver($this->obj,'MDUpdateListener','General');
$this->ctrl->forwardCommand($md_gui);
break;
case "ilconditionhandlergui":
global $ilTabs;
include_once './Services/AccessControl/classes/class.ilConditionHandlerGUI.php';
$this->setTabs();
$this->ctrl->forwardCommand($this->condHI);
$ilTabs->setTabActive('preconditions');
break;
default:
if($cmd == 'listConditions')
{
$this->setTabs();
$ret =& $this->condHI->executeCommand();
}
elseif(($cmd == "create") && ($_POST["new_type"] == "pg"))
{
$this->setTabs();
$pg_gui =& new ilLMPageObjectGUI($this->content_object);
$ret =& $pg_gui->executeCommand();
}
else
{
$ret =& $this->$cmd();
}
break;
}
}

+ Here is the call graph for this function:

ilStructureObjectGUI::getType ( )

this function is called by condition handler gui interface

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

{
return "st";
}
ilStructureObjectGUI::ilStructureObjectGUI ( $a_content_obj,
$a_tree 
)

Constructor public.

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

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

{
global $ilias, $tpl, $lng;
parent::ilLMObjectGUI($a_content_obj);
$this->tree =& $a_tree;
}

+ Here is the call graph for this function:

ilStructureObjectGUI::initConditionHandlerInterface ( )

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

Referenced by executeCommand().

{
include_once("./Services/AccessControl/classes/class.ilConditionHandlerGUI.php");
$this->condHI =& new ilConditionHandlerGUI($this);
$this->condHI->setBackButtons(array());
$this->condHI->setAutomaticValidation(false);
$this->condHI->setTargetType("st");
$this->condHI->setTargetRefId($this->content_object->getRefId());
$this->condHI->setTargetId($this->obj->getId());
$this->condHI->setTargetTitle($this->obj->getTitle());
}

+ Here is the caller graph for this function:

ilStructureObjectGUI::initSetPageLayoutForm ( )

Init set page layout form.

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

References $_POST, $ilCtrl, ilLMObjectGUI\$lng, and ilObjContentObjectGUI\getLayoutOption().

Referenced by setPageLayout().

{
global $lng, $ilCtrl;
include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
$this->form = new ilPropertyFormGUI();
if (is_array($_POST["id"]))
{
foreach ($_POST["id"] as $id)
{
$hi = new ilHiddenInputGUI("id[]");
$hi->setValue($id);
$this->form->addItem($hi);
}
}
$layout = ilObjContentObjectGUI::getLayoutOption($lng->txt("cont_layout"), "layout",
$this->content_object->getLayout());
$this->form->addItem($layout);
$this->form->addCommandButton("savePageLayout", $lng->txt("save"));
$this->form->addCommandButton("showHierarchy", $lng->txt("cancel"));
$this->form->setTitle($lng->txt("cont_set_layout"));
$this->form->setFormAction($ilCtrl->getFormAction($this));
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilStructureObjectGUI::insertChapter (   $a_as_sub = false)

Insert (multiple) chapters at node.

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

References $ilCtrl, ilLMObjectGUI\$lng, ilHierarchyFormGUI\getPostFirstChild(), ilHierarchyFormGUI\getPostMulti(), ilHierarchyFormGUI\getPostNodeId(), IL_FIRST_NODE, and putInTree().

Referenced by insertSubchapter().

{
global $ilCtrl, $lng;
include_once("./Modules/LearningModule/classes/class.ilChapterHierarchyFormGUI.php");
if ($a_as_sub) // as subchapter
{
if (!ilChapterHierarchyFormGUI::getPostFirstChild()) // insert under parent
{
$parent_id = $node_id;
$target = "";
}
else // we shouldnt end up here
{
$ilCtrl->redirect($this, "showHierarchy");
return;
}
}
else // as chapter
{
if (!ilChapterHierarchyFormGUI::getPostFirstChild()) // insert after node id
{
$parent_id = $this->tree->getParentId($node_id);
$target = $node_id;
}
else // insert as first child
{
$parent_id = $node_id;
$target = IL_FIRST_NODE;
}
}
for ($i = 1; $i <= $num; $i++)
{
$chap = new ilStructureObject($this->content_object);
$chap->setType("st");
$chap->setTitle($lng->txt("cont_new_chap"));
$chap->setLMId($this->content_object->getId());
$chap->create();
ilLMObject::putInTree($chap, $parent_id, $target);
}
$ilCtrl->redirect($this, "view");
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilStructureObjectGUI::insertChapterClip (   $a_as_sub = false,
  $a_return = "view" 
)

Insert Chapter from clipboard.

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

References $ilCtrl, $ilLog, $ilUser, ilEditClipboard\clear(), ilEditClipboard\getAction(), ilHierarchyFormGUI\getPostFirstChild(), ilHierarchyFormGUI\getPostNodeId(), IL_FIRST_NODE, ilLMObject\pasteTree(), and ilLMObject\updateInternalLinks().

Referenced by insertSubchapterClip(), and pasteChapter().

{
$ilLog->write("Insert Chapter From Clipboard");
include_once("./Modules/LearningModule/classes/class.ilChapterHierarchyFormGUI.php");
if ($a_as_sub) // as subchapter
{
if (!$first_child) // insert under parent
{
$parent_id = $node_id;
$target = "";
}
else // we shouldnt end up here
{
$ilCtrl->redirect($this, "showHierarchy");
return;
}
}
else // as chapter
{
if (!$first_child) // insert after node id
{
$parent_id = $this->tree->getParentId($node_id);
$target = $node_id;
}
else // insert as first child
{
$parent_id = $node_id;
$target = IL_FIRST_NODE;
// do not move a chapter in front of a page
$childs = $this->tree->getChildsByType($parent_id, "pg");
if (count($childs) != 0)
{
$target = $childs[count($childs) - 1]["obj_id"];
}
}
}
// copy and paste
$chapters = $ilUser->getClipboardObjects("st", true);
$copied_nodes = array();
foreach ($chapters as $chap)
{
$ilLog->write("Call pasteTree, Target LM: ".$this->content_object->getId().", Chapter ID: ".$chap["id"]
.", Parent ID: ".$parent_id.", Target: ".$target);
$cid = ilLMObject::pasteTree($this->content_object, $chap["id"], $parent_id,
$target, $chap["insert_time"], $copied_nodes,
$target = $cid;
}
{
$ilUser->clipboardDeleteObjectsOfType("pg");
$ilUser->clipboardDeleteObjectsOfType("st");
}
$this->content_object->checkTree();
$ilCtrl->redirect($this, $a_return);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilStructureObjectGUI::insertPage ( )

Insert (multiple) pages at node.

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

References $ilCtrl, ilLMObjectGUI\$lng, ilHierarchyFormGUI\getPostFirstChild(), ilHierarchyFormGUI\getPostMulti(), ilHierarchyFormGUI\getPostNodeId(), IL_FIRST_NODE, and putInTree().

{
global $ilCtrl, $lng;
include_once("./Modules/LearningModule/classes/class.ilChapterHierarchyFormGUI.php");
if (!ilChapterHierarchyFormGUI::getPostFirstChild()) // insert after node id
{
$parent_id = $this->tree->getParentId($node_id);
$target = $node_id;
}
else // insert as first child
{
$parent_id = $node_id;
$target = IL_FIRST_NODE;
}
for ($i = 1; $i <= $num; $i++)
{
$page = new ilLMPageObject($this->content_object);
$page->setType("pg");
$page->setTitle($lng->txt("cont_new_page"));
$page->setLMId($this->content_object->getId());
$page->create();
ilLMObject::putInTree($page, $parent_id, $target);
}
$ilCtrl->redirect($this, "showHierarchy");
}

+ Here is the call graph for this function:

ilStructureObjectGUI::insertPageClip ( )

Insert pages from clipboard.

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

References $ilCtrl, $ilUser, ilEditClipboard\clear(), ilEditClipboard\getAction(), ilHierarchyFormGUI\getPostFirstChild(), ilHierarchyFormGUI\getPostNodeId(), IL_FIRST_NODE, ilLMObject\pasteTree(), and ilLMObject\updateInternalLinks().

Referenced by pastePage().

{
global $ilCtrl, $ilUser;
include_once("./Modules/LearningModule/classes/class.ilChapterHierarchyFormGUI.php");
if (!$first_child) // insert after node id
{
$parent_id = $this->tree->getParentId($node_id);
$target = $node_id;
}
else // insert as first child
{
$parent_id = $node_id;
$target = IL_FIRST_NODE;
}
// cut and paste
$pages = $ilUser->getClipboardObjects("pg");
$copied_nodes = array();
foreach ($pages as $pg)
{
$cid = ilLMObject::pasteTree($this->content_object, $pg["id"], $parent_id, $target,
$pg["insert_time"], $copied_nodes,
$target = $cid;
}
{
$ilUser->clipboardDeleteObjectsOfType("pg");
$ilUser->clipboardDeleteObjectsOfType("st");
}
$ilCtrl->redirect($this, "view");
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilStructureObjectGUI::insertSubchapter ( )

Insert (multiple) subchapters at node.

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

References $ilCtrl, and insertChapter().

{
global $ilCtrl;
$this->insertChapter(true);
}

+ Here is the call graph for this function:

ilStructureObjectGUI::insertSubchapterClip ( )

Insert Chapter from clipboard.

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

References insertChapterClip().

{
$this->insertChapterClip(true);
}

+ Here is the call graph for this function:

ilStructureObjectGUI::pasteChapter ( )

paste chapter

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

References $ilUser, and insertChapterClip().

{
global $ilUser;
return $this->insertChapterClip(false, "subchap");
}

+ Here is the call graph for this function:

ilStructureObjectGUI::pastePage ( )

paste page

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

References $ilUser, and insertPageClip().

{
global $ilUser;
if (!$ilUser->clipboardHasObjectsOfType("pg"))
{
$this->ilias->raiseError($this->lng->txt("no_page_in_clipboard"),$this->ilias->error_obj->MESSAGE);
}
return $this->insertPageClip();
}

+ Here is the call graph for this function:

ilStructureObjectGUI::proceedDragDrop ( )

Perform drag and drop action.

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

References $_POST, and $ilCtrl.

{
global $ilCtrl;
//echo "-".$_POST["il_hform_source_id"]."-".$_POST["il_hform_target_id"]."-".$_POST["il_hform_fc"]."-";
$this->content_object->executeDragDrop($_POST["il_hform_source_id"], $_POST["il_hform_target_id"],
$_POST["il_hform_fc"], $_POST["il_hform_as_subitem"]);
$ilCtrl->redirect($this, "showHierarchy");
}
ilStructureObjectGUI::putInTree ( )

put chapter into tree

Reimplemented from ilLMObjectGUI.

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

References $_GET, $tree, IL_FIRST_NODE, and IL_LAST_NODE.

Referenced by insertChapter(), insertPage(), and save().

{
//echo "st:putInTree";
// chapters should be behind pages in the tree
// so if target is first node, the target is substituted with
// the last child of type pg
if ($_GET["target"] == IL_FIRST_NODE)
{
$tree = new ilTree($this->content_object->getId());
$tree->setTableNames('lm_tree','lm_data');
$tree->setTreeTablePK("lm_id");
// determine parent node id
$parent_id = (!empty($_GET["obj_id"]))
? $_GET["obj_id"]
: $tree->getRootId();
// determine last child of type pg
$childs =& $tree->getChildsByType($parent_id, "pg");
if (count($childs) != 0)
{
$_GET["target"] = $childs[count($childs) - 1]["obj_id"];
}
}
if (empty($_GET["target"]))
{
$_GET["target"] = IL_LAST_NODE;
}
}

+ Here is the caller graph for this function:

ilStructureObjectGUI::save ( )

save new chapter

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

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

{
$this->obj =& new ilStructureObject($this->content_object);
$this->obj->setType("st");
$this->obj->setTitle(ilUtil::stripSlashes($_POST["Fobject"]["title"]));
$this->obj->setDescription(ilUtil::stripSlashes($_POST["Fobject"]["desc"]));
$this->obj->setLMId($this->content_object->getId());
$this->obj->create();
$this->putInTree();
// check the tree
$this->checkTree();
if (!empty($_GET["obj_id"]))
{
$this->ctrl->redirect($this, "subchap");
}
}

+ Here is the call graph for this function:

ilStructureObjectGUI::saveAllTitles ( )

Save all titles of chapters/pages.

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

References $_GET, $_POST, $ilCtrl, ilLMObject\saveTitles(), and ilUtil\stripSlashesArray().

{
global $ilCtrl;
ilLMObject::saveTitles($this->content_object, ilUtil::stripSlashesArray($_POST["title"]), $_GET["transl"]);
$ilCtrl->redirect($this, "showHierarchy");
}

+ Here is the call graph for this function:

ilStructureObjectGUI::savePageLayout ( )

Save page layout.

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

References $_POST, $ilCtrl, ilLMObjectGUI\$lng, ilUtil\sendSuccess(), ilUtil\stripSlashes(), and ilLMObject\writeLayout().

{
global $lng, $ilCtrl;
foreach ($_POST["id"] as $id)
{
$this->content_object);
}
ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
$ilCtrl->redirect($this, "showHierarchy");
}

+ Here is the call graph for this function:

ilStructureObjectGUI::setPageLayout ( )

Set layout for multipl pages.

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

References $_POST, $ilCtrl, ilLMObjectGUI\$lng, ilLMObjectGUI\$tpl, initSetPageLayoutForm(), and ilUtil\sendFailure().

{
global $tpl, $ilCtrl, $lng;
if (!is_array($_POST["id"]))
{
ilUtil::sendFailure($lng->txt("no_checkbox"), true);
$ilCtrl->redirect($this, "showHierarchy");
}
$tpl->setContent($this->form->getHTML());
}

+ Here is the call graph for this function:

ilStructureObjectGUI::setStructureObject ( $a_st_object)

set structure object

Parameters
object$a_st_objectstructure object

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

{
$this->obj =& $a_st_object;
}
ilStructureObjectGUI::setTabs ( )

output tabs

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

References $ilUser, ilLMObjectGUI\$lng, and ilUtil\getImagePath().

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

{
global $ilTabs, $ilUser, $lng;
// subelements
$ilTabs->addTarget("cont_pages_and_subchapters",
$this->ctrl->getLinkTarget($this,'showHierarchy'),
array("view", "showHierarchy"), get_class($this));
// preconditions
$ilTabs->addTarget("preconditions",
$this->ctrl->getLinkTarget($this, 'listConditions'),
"listConditions", get_class($this));
// metadata
$ilTabs->addTarget("meta_data",
$this->ctrl->getLinkTargetByClass("ilmdeditorgui",''),
"", "ilmdeditorgui");
$this->tpl->setTitleIcon(ilUtil::getImagePath("icon_st.svg"));
$this->tpl->setTitle(
$this->lng->txt($this->obj->getType()).": ".$this->obj->getTitle());
// presentation view
$ilTabs->addNonTabbedLink("pres_mode", $lng->txt("cont_presentation_view"),
ILIAS_HTTP_PATH."/goto.php?target=st_".$this->obj->getId(), "_top");
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilStructureObjectGUI::showHierarchy ( )

Show subhiearchy of pages and subchapters.

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

References $_GET, $ilCtrl, ilLMObjectGUI\$lng, ilUtil\getImagePath(), ilObjContentObjectGUI\getMultiLangHeader(), ilFormGUI\setFormAction(), and setTabs().

Referenced by view().

{
global $lng, $ilCtrl;
$this->setTabs();
$ilCtrl->setParameter($this, "backcmd", "showHierarchy");
include_once("./Modules/LearningModule/classes/class.ilChapterHierarchyFormGUI.php");
$form_gui = new ilChapterHierarchyFormGUI($this->content_object->getType(), $_GET["transl"]);
$form_gui->setFormAction($ilCtrl->getFormAction($this));
$form_gui->setTitle($this->obj->getTitle());
$form_gui->setIcon(ilUtil::getImagePath("icon_st.svg"));
$form_gui->setTree($this->tree);
$form_gui->setCurrentTopNodeId($this->obj->getId());
$form_gui->addMultiCommand($lng->txt("delete"), "delete");
$form_gui->addMultiCommand($lng->txt("cut"), "cutItems");
$form_gui->addMultiCommand($lng->txt("copy"), "copyItems");
$form_gui->addMultiCommand($lng->txt("cont_de_activate"), "activatePages");
if ($this->content_object->getLayoutPerPage())
{
$form_gui->addMultiCommand($lng->txt("cont_set_layout"), "setPageLayout");
}
$form_gui->setDragIcon(ilUtil::getImagePath("icon_pg.svg"));
$form_gui->addCommand($lng->txt("cont_save_all_titles"), "saveAllTitles");
$form_gui->addHelpItem($lng->txt("cont_chapters_after_pages"));
$up_gui = ($this->content_object->getType() == "dbk")
? "ilobjdlbookgui"
: "ilobjlearningmodulegui";
$ilCtrl->setParameterByClass($up_gui, "active_node", $this->obj->getId());
$ilCtrl->setParameterByClass($up_gui, "active_node", "");
$ctpl = new ilTemplate("tpl.chap_and_pages.html", true, true, "Modules/LearningModule");
$ctpl->setVariable("HIERARCHY_FORM", $form_gui->getHTML());
$ilCtrl->setParameter($this, "obj_id", $_GET["obj_id"]);
include_once("./Modules/LearningModule/classes/class.ilObjContentObjectGUI.php");
$ml_head = ilObjContentObjectGUI::getMultiLangHeader($this->content_object->getId(), $this);
$this->tpl->setContent($ml_head.$ctpl->get());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilStructureObjectGUI::subchap ( )

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

References $_GET, $ilCtrl, $ilUser, ilLMObjectGUI\$lng, $tree, ilStructureObject\_getPresentationTitle(), ilUtil\formSelect(), ilUtil\getImagePath(), IL_FIRST_NODE, setTabs(), ilLMObjectGUI\showActions(), and ilUtil\switchColor().

{
$this->setTabs();
$this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.structure_edit.html", "Modules/LearningModule");
$num = 0;
$this->tpl->setCurrentBlock("form");
$this->ctrl->setParameter($this, "backcmd", "subchap");
$this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
$this->tpl->setVariable("HEADER_TEXT", $this->lng->txt("cont_subchapters"));
$this->tpl->setVariable("CHECKBOX_TOP", IL_FIRST_NODE);
$cnt = 0;
$childs = $this->tree->getChilds($this->obj->getId());
foreach ($childs as $child)
{
if($child["type"] != "st")
{
continue;
}
$this->tpl->setCurrentBlock("table_row");
// color changing
$css_row = ilUtil::switchColor($cnt++,"tblrow1","tblrow2");
// checkbox
$this->tpl->setVariable("CHECKBOX_ID", $child["obj_id"]);
$this->tpl->setVariable("CSS_ROW", $css_row);
$this->tpl->setVariable("IMG_OBJ", ilUtil::getImagePath("icon_st.svg"));
// type
$this->ctrl->setParameterByClass("ilStructureObjectGUI", "obj_id", $child["obj_id"]);
$link = $this->ctrl->getLinkTargetByClass("ilStructureObjectGUI", "view");
$this->tpl->setVariable("LINK_TARGET", $link);
// title
$this->tpl->setVariable("TEXT_CONTENT",
$this->content_object->isActiveNumbering()));
$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", "cutChapter" => "cut",
"copyChapter" => "copyChapter");
if ($ilUser->clipboardHasObjectsOfType("st"))
{
$acts["pasteChapter"] = "pasteChapter";
}
$this->showActions($acts);
//}
// SHOW POSSIBLE SUB OBJECTS
$this->tpl->setVariable("NUM_COLS", 3);
//$this->showPossibleSubObjects("st");
$subobj = array("st");
$opts = ilUtil::formSelect(12,"new_type",$subobj);
//$this->tpl->setVariable("IMG_ARROW", ilUtil::getImagePath("arrow_downright.svg"));
$this->tpl->setCurrentBlock("add_object");
$this->tpl->setVariable("SELECT_OBJTYPE", $opts);
//$this->tpl->setVariable("FORMACTION_OBJ_ADD", "adm_object.php?cmd=create&ref_id=".$_GET["ref_id"]);
$this->tpl->setVariable("BTN_NAME", "create");
$this->tpl->setVariable("TXT_ADD", $this->lng->txt("insert"));
$this->tpl->parseCurrentBlock();
//$this->tpl->setVariable("NUM_COLS", 2);
//$this->showPossibleSubObjects("st");
$this->tpl->setCurrentBlock("form");
$this->tpl->parseCurrentBlock();
$ilCtrl->setParameter($this, "obj_id", $_GET["obj_id"]);
}

+ Here is the call graph for this function:

ilStructureObjectGUI::switchToLanguage ( )

Switch to language.

Parameters
@return

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

References $_GET, and $ilCtrl.

{
global $ilCtrl;
$ilCtrl->setParameter($this, "transl", $_GET["totransl"]);
$ilCtrl->redirect($this, "showHierarchy");
}
ilStructureObjectGUI::view ( )

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

References $ilCtrl, $ilUser, ilLMObjectGUI\$lng, $tree, and showHierarchy().

Referenced by edit().

{
$this->showHierarchy();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Field Documentation

ilStructureObjectGUI::$obj

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

ilStructureObjectGUI::$tree

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

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


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