6 require_once(
"./Modules/LearningModule/classes/class.ilLMObjectGUI.php");
7 require_once(
"./Modules/LearningModule/classes/class.ilLMObject.php");
32 parent::__construct($a_content_obj);
33 $this->tree = $a_tree;
43 $this->obj = $a_st_object;
61 $next_class = $this->ctrl->getNextClass($this);
62 $cmd = $this->ctrl->getCmd();
66 case 'ilobjectmetadatagui':
70 include_once
'Services/Object/classes/class.ilObjectMetaDataGUI.php';
71 $md_gui =
new ilObjectMetaDataGUI($this->content_object, $this->obj->getType(), $this->obj->getId());
72 $md_gui->
addMDObserver($this->obj,
'MDUpdateListener',
'General');
73 $md_gui->addMDObserver($this->obj,
'MDUpdateListener',
'Educational');
74 $this->ctrl->forwardCommand($md_gui);
77 case "ilconditionhandlergui":
79 include_once
'./Services/AccessControl/classes/class.ilConditionHandlerGUI.php';
83 $this->ctrl->forwardCommand($this->condHI);
84 $ilTabs->setTabActive(
'preconditions');
88 if(
$cmd ==
'listConditions')
92 $this->condHI->executeCommand();
94 elseif((
$cmd ==
"create") && (
$_POST[
"new_type"] ==
"pg"))
98 $pg_gui->executeCommand();
114 if (
$_GET[
"obj_id"] !=
"")
146 $ilCtrl->setParameter($this,
"backcmd",
"showHierarchy");
148 include_once(
"./Modules/LearningModule/classes/class.ilChapterHierarchyFormGUI.php");
151 $form_gui->setTitle($this->obj->getTitle());
153 $form_gui->setTree($this->tree);
154 $form_gui->setCurrentTopNodeId($this->obj->getId());
155 $form_gui->addMultiCommand($lng->txt(
"delete"),
"delete");
156 $form_gui->addMultiCommand($lng->txt(
"cut"),
"cutItems");
157 $form_gui->addMultiCommand($lng->txt(
"copy"),
"copyItems");
158 $form_gui->addMultiCommand($lng->txt(
"cont_de_activate"),
"activatePages");
159 if ($this->content_object->getLayoutPerPage())
161 $form_gui->addMultiCommand($lng->txt(
"cont_set_layout"),
"setPageLayout");
164 $form_gui->addCommand($lng->txt(
"cont_save_all_titles"),
"saveAllTitles");
165 $form_gui->addHelpItem($lng->txt(
"cont_chapters_after_pages"));
166 $up_gui =
"ilobjlearningmodulegui";
167 $ilCtrl->setParameterByClass($up_gui,
"active_node", $this->obj->getId());
168 $ilCtrl->setParameterByClass($up_gui,
"active_node",
"");
170 $ctpl =
new ilTemplate(
"tpl.chap_and_pages.html",
true,
true,
"Modules/LearningModule");
171 $ctpl->setVariable(
"HIERARCHY_FORM", $form_gui->getHTML());
172 $ilCtrl->setParameter($this,
"obj_id",
$_GET[
"obj_id"]);
174 include_once(
"./Modules/LearningModule/classes/class.ilObjContentObjectGUI.php");
177 $this->tpl->setContent($ml_head.$ctpl->get());
188 if (!is_array($items))
191 $ilCtrl->redirect($this,
"showHierarchy");
195 foreach($items as $k => $item)
202 foreach($todel as $k)
210 $ilCtrl->redirect($this,
"showHierarchy");
218 $ilCtrl->redirect($this, $a_return);
229 if (!is_array($items))
232 $ilCtrl->redirect($this,
"showHierarchy");
236 foreach($items as $k => $item)
243 foreach($todel as $k)
251 $ilCtrl->redirect($this,
"showHierarchy");
258 $ilCtrl->redirect($this, $a_return);
270 $ilCtrl->redirect($this,
"showHierarchy");
282 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.structure_edit.html",
"Modules/LearningModule");
285 $this->tpl->setCurrentBlock(
"form");
286 $this->ctrl->setParameter($this,
"backcmd",
"subchap");
287 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
288 $this->tpl->setVariable(
"HEADER_TEXT", $this->lng->txt(
"cont_subchapters"));
292 $childs = $this->tree->getChilds($this->obj->getId());
293 foreach ($childs as $child)
295 if($child[
"type"] !=
"st")
299 $this->tpl->setCurrentBlock(
"table_row");
304 $this->tpl->setVariable(
"CHECKBOX_ID", $child[
"obj_id"]);
305 $this->tpl->setVariable(
"CSS_ROW", $css_row);
309 $this->ctrl->setParameterByClass(
"ilStructureObjectGUI",
"obj_id", $child[
"obj_id"]);
310 $link = $this->ctrl->getLinkTargetByClass(
"ilStructureObjectGUI",
"view");
311 $this->tpl->setVariable(
"LINK_TARGET", $link);
314 $this->tpl->setVariable(
"TEXT_CONTENT",
316 $this->content_object->isActiveNumbering()));
318 $this->tpl->parseCurrentBlock();
322 $this->tpl->setCurrentBlock(
"notfound");
323 $this->tpl->setVariable(
"NUM_COLS", 3);
324 $this->tpl->setVariable(
"TXT_OBJECT_NOT_FOUND", $this->lng->txt(
"obj_not_found"));
325 $this->tpl->parseCurrentBlock();
330 $this->tpl->setVariable(
"NUM_COLS", 3);
331 $acts =
array(
"delete" =>
"delete",
"cutChapter" =>
"cut",
332 "copyChapter" =>
"copyChapter");
333 if ($ilUser->clipboardHasObjectsOfType(
"st"))
335 $acts[
"pasteChapter"] =
"pasteChapter";
341 $this->tpl->setVariable(
"NUM_COLS", 3);
343 $subobj =
array(
"st");
346 $this->tpl->setCurrentBlock(
"add_object");
347 $this->tpl->setVariable(
"SELECT_OBJTYPE", $opts);
349 $this->tpl->setVariable(
"BTN_NAME",
"create");
350 $this->tpl->setVariable(
"TXT_ADD", $this->lng->txt(
"insert"));
351 $this->tpl->parseCurrentBlock();
356 $this->tpl->setCurrentBlock(
"form");
357 $this->tpl->parseCurrentBlock();
359 $ilCtrl->setParameter($this,
"obj_id",
$_GET[
"obj_id"]);
370 $this->tpl->setCurrentBlock(
"begin_link");
371 $this->tpl->setVariable(
"LINK_TARGET", $link);
372 $this->tpl->parseCurrentBlock();
373 $this->tpl->touchBlock(
"end_link");
376 $this->tpl->setCurrentBlock(
"text");
377 $this->tpl->setVariable(
"TEXT_CONTENT", $val);
378 $this->tpl->parseCurrentBlock();
379 $this->tpl->setCurrentBlock(
"table_cell");
380 $this->tpl->parseCurrentBlock();
392 $this->obj->setType(
"st");
395 $this->obj->setLMId($this->content_object->getId());
396 $this->obj->create();
403 if (!empty(
$_GET[
"obj_id"]))
405 $this->ctrl->redirect($this,
"subchap");
421 $tree =
new ilTree($this->content_object->getId());
423 $tree->setTreeTablePK(
"lm_id");
426 $parent_id = (!empty(
$_GET[
"obj_id"]))
428 : $tree->getRootId();
430 $childs = $tree->getChildsByType($parent_id,
"pg");
431 if (count($childs) != 0)
433 $_GET[
"target"] = $childs[count($childs) - 1][
"obj_id"];
436 if (empty(
$_GET[
"target"]))
467 if (!$ilUser->clipboardHasObjectsOfType(
"pg"))
469 $this->
ilias->raiseError($this->lng->txt(
"no_page_in_clipboard"),$this->
ilias->error_obj->MESSAGE);
509 include_once(
"./Modules/LearningModule/classes/class.ilLMPage.php");
510 if (is_array(
$_POST[
"id"]))
512 $act_items =
array();
514 foreach(
$_POST[
"id"] as $id)
516 $path = $this->tree->getPathId($id);
518 foreach(
$path as $path_id)
520 if ($path_id != $id && in_array($path_id,
$_POST[
"id"]))
532 foreach($act_items as $id)
534 $childs = $this->tree->getChilds($id);
535 foreach($childs as $child)
540 $this->content_object->getType());
542 $this->content_object->getType(), !$act);
548 $this->content_object->getType());
550 $this->content_object->getType(), !$act);
559 $this->ctrl->redirect($this,
"view");
568 include_once(
"./Services/AccessControl/classes/class.ilConditionHandlerGUI.php");
571 $this->condHI->setBackButtons(
array());
572 $this->condHI->setAutomaticValidation(
false);
573 $this->condHI->setTargetType(
"st");
574 $this->condHI->setTargetRefId($this->content_object->getRefId());
575 $this->condHI->setTargetId($this->obj->getId());
576 $this->condHI->setTargetTitle($this->obj->getTitle());
585 if (
$_GET[
"obj_id"] != 0)
587 if (
$_GET[
"new_type"] ==
"pg")
589 $this->ctrl->redirect($this,
"view");
593 $this->ctrl->redirect($this,
"subchap");
607 $ilTabs->addTarget(
"cont_pages_and_subchapters",
608 $this->ctrl->getLinkTarget($this,
'showHierarchy'),
609 array(
"view",
"showHierarchy"), get_class($this));
612 $ilTabs->addTarget(
"preconditions",
613 $this->ctrl->getLinkTarget($this,
'listConditions'),
614 "listConditions", get_class($this));
617 include_once
"Services/Object/classes/class.ilObjectMetaDataGUI.php";
618 $mdgui =
new ilObjectMetaDataGUI($this->content_object, $this->obj->getType(), $this->obj->getId());
619 $mdtab = $mdgui->
getTab();
622 $ilTabs->addTarget(
"meta_data",
624 "",
"ilmdeditorgui");
628 $this->tpl->setTitle(
629 $this->lng->txt($this->obj->getType()).
": ".$this->obj->getTitle());
632 $ilTabs->addNonTabbedLink(
"pres_mode", $lng->txt(
"cont_presentation_view"),
633 ILIAS_HTTP_PATH.
"/goto.php?target=st_".$this->obj->getId(),
"_top");
641 public static function _goto($a_target, $a_target_ref_id =
"")
652 if (in_array($a_target_ref_id, $ref_ids))
654 $ref_ids = array_merge(
array($a_target_ref_id), $ref_ids);
661 if ($ilAccess->checkAccess(
"read",
"", $ref_id))
665 $_GET[
"baseClass"] =
"ilLMPresentationGUI";
666 $_GET[
"obj_id"] = $a_target;
668 include_once(
"ilias.php");
673 if ($ilAccess->checkAccess(
"read",
"", ROOT_FOLDER_ID))
677 include_once(
"./Services/Object/classes/class.ilObjectGUI.php");
681 $ilErr->raiseError($lng->txt(
"msg_no_perm_read_lm"), $ilErr->FATAL);
691 include_once(
"./Modules/LearningModule/classes/class.ilChapterHierarchyFormGUI.php");
700 $parent_id = $node_id;
705 $ilCtrl->redirect($this,
"showHierarchy");
713 $parent_id = $this->tree->getParentId($node_id);
718 $parent_id = $node_id;
722 for ($i = 1; $i <= $num; $i++)
725 $chap->setType(
"st");
726 $chap->setTitle($lng->txt(
"cont_new_chap"));
727 $chap->setLMId($this->content_object->getId());
732 $ilCtrl->redirect($this,
"view");
752 $ilLog->write(
"Insert Chapter From Clipboard");
754 include_once(
"./Modules/LearningModule/classes/class.ilChapterHierarchyFormGUI.php");
763 $parent_id = $node_id;
768 $ilCtrl->redirect($this,
"showHierarchy");
776 $parent_id = $this->tree->getParentId($node_id);
781 $parent_id = $node_id;
785 $childs = $this->tree->getChildsByType($parent_id,
"pg");
786 if (count($childs) != 0)
788 $target = $childs[count($childs) - 1][
"obj_id"];
794 $chapters = $ilUser->getClipboardObjects(
"st",
true);
795 $copied_nodes =
array();
797 foreach ($chapters as $chap)
799 $ilLog->write(
"Call pasteTree, Target LM: ".$this->content_object->getId().
", Chapter ID: ".$chap[
"id"]
800 .
", Parent ID: ".$parent_id.
", Target: ".
$target);
802 $target, $chap[
"insert_time"], $copied_nodes,
810 $ilUser->clipboardDeleteObjectsOfType(
"pg");
811 $ilUser->clipboardDeleteObjectsOfType(
"st");
815 $this->content_object->checkTree();
816 $ilCtrl->redirect($this, $a_return);
834 include_once(
"./Modules/LearningModule/classes/class.ilChapterHierarchyFormGUI.php");
841 $parent_id = $this->tree->getParentId($node_id);
846 $parent_id = $node_id;
850 for ($i = 1; $i <= $num; $i++)
853 $page->setType(
"pg");
854 $page->setTitle($lng->txt(
"cont_new_page"));
855 $page->setLMId($this->content_object->getId());
860 $ilCtrl->redirect($this,
"showHierarchy");
870 include_once(
"./Modules/LearningModule/classes/class.ilChapterHierarchyFormGUI.php");
877 $parent_id = $this->tree->getParentId($node_id);
882 $parent_id = $node_id;
887 $pages = $ilUser->getClipboardObjects(
"pg");
888 $copied_nodes =
array();
889 foreach ($pages as $pg)
892 $pg[
"insert_time"], $copied_nodes,
900 $ilUser->clipboardDeleteObjectsOfType(
"pg");
901 $ilUser->clipboardDeleteObjectsOfType(
"st");
905 $ilCtrl->redirect($this,
"view");
917 $this->content_object->executeDragDrop(
$_POST[
"il_hform_source_id"],
$_POST[
"il_hform_target_id"],
919 $ilCtrl->redirect($this,
"showHierarchy");
933 if (!is_array(
$_POST[
"id"]))
936 $ilCtrl->redirect($this,
"showHierarchy");
941 $tpl->setContent($this->form->getHTML());
951 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
954 if (is_array(
$_POST[
"id"]))
956 foreach (
$_POST[
"id"] as $id)
960 $this->form->addItem($hi);
964 $this->content_object->getLayout());
968 $this->form->addCommandButton(
"savePageLayout", $lng->txt(
"save"));
969 $this->form->addCommandButton(
"showHierarchy", $lng->txt(
"cancel"));
971 $this->form->setTitle($lng->txt(
"cont_set_layout"));
972 $this->form->setFormAction($ilCtrl->getFormAction($this));
983 foreach (
$_POST[
"id"] as $id)
988 $this->content_object);
991 $ilCtrl->redirect($this,
"showHierarchy");
1004 $ilCtrl->setParameter($this,
"transl",
"");
1005 $ilCtrl->redirect($this,
"showHierarchy");
1018 $ilCtrl->setParameter($this,
"transl",
$_GET[
"totransl"]);
1019 $ilCtrl->redirect($this,
"showHierarchy");
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
proceedDragDrop()
Perform drag and drop action.
saveAllTitles()
Save all titles of chapters/pages.
initConditionHandlerInterface()
cutChapter()
Cut chapter(s)
class ilConditionHandlerGUI
editMasterLanguage()
Edit master language.
static updateInternalLinks($a_copied_nodes, $a_parent_type="lm")
Update internal links, after multiple pages have been copied.
static _lookupType($a_obj_id, $a_lm_id=0)
Lookup type.
initSetPageLayoutForm()
Init set page layout form.
static getMultiLangHeader($a_lm_id, $a_gui_class)
Get multi lang header.
static _getPresentationTitle($a_st_id, $a_mode=IL_CHAPTER_TITLE, $a_include_numbers=false, $a_time_scheduled_activation=false, $a_force_content=false, $a_lm_id=0, $a_lang="-")
get presentation title
static uniqueTypesCheck($a_items)
Check for unique types (all pages or all chapters)
checkTree()
check the content object tree
static saveTitles($a_lm, $a_titles, $a_lang="-")
Save titles for lm objects.
static _gotoRepositoryRoot($a_raise_error=false)
Goto repository root.
Class ilStructureObjectGUI.
insertPage()
Insert (multiple) pages at node.
static pasteTree($a_target_lm, $a_item_id, $a_parent_id, $a_target, $a_insert_time, &$a_copied_nodes, $a_as_copy=false, $a_source_lm=null)
Paste item (tree) from clipboard to current lm.
static getLayoutOption($a_txt, $a_var, $a_def_option="")
Save help mapping.
static _lookupTitle($a_id)
lookup object title
insertSubchapter()
Insert (multiple) subchapters at node.
static writeLayout($a_obj_id, $a_layout, $a_lm=null)
Write layout setting.
insertChapterClip($a_as_sub=false, $a_return="view")
Insert Chapter from clipboard.
static _lookupContObjID($a_id)
get learning module / digibook id for lm object
static _goto($a_target, $a_target_ref_id="")
redirect script
cancel()
cancel creation of new page or chapter
static _getAllReferences($a_id)
get all reference ids of object
setPageLayout()
Set layout for multipl pages.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
getType()
this function is called by condition handler gui interface
insertSubchapterClip()
Insert Chapter from clipboard.
static clipboardCopy($a_cont_obj_id, $a_ids)
Copy a set of chapters/pages into the clipboard.
static _lookupActive($a_id, $a_parent_type, $a_check_scheduled_activation=false, $a_lang="-")
lookup activation status
static _writeActive($a_id, $a_parent_type, $a_active, $a_reset_scheduled_activation=true, $a_lang="-")
write activation status
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static formSelect($selected, $varname, $options, $multiple=false, $direct_text=false, $size="0", $style_class="", $attribs="", $disabled=false)
Builds a select form field with options and shows the selected option first.
pasteChapter()
paste chapter
special template class to simplify handling of ITX/PEAR
static putInTree($a_obj, $a_parent_id="", $a_target_node_id="")
put this object into content object tree
static clipboardCut($a_cont_obj_id, $a_ids)
Copy a set of chapters/pages into the clipboard.
cutItems($a_return="view")
Copy items to clipboard, then cut them from the current tree.
redirection script todo: (a better solution should control the processing via a xml file) ...
setTableNames($a_table_tree, $a_table_obj_data, $a_table_obj_reference="")
set table names The primary key of the table containing your object_data must be 'obj_id' You may use...
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
setStructureObject(&$a_st_object)
set structure object
copyItems($a_return="view")
Copy items to clipboard.
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
insertPageClip()
Insert pages from clipboard.
Create styles array
The data for the language used.
switchToLanguage()
Switch to language.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
showActions($a_actions)
show possible action (form buttons)
copyChapter()
copy a single chapter (selection)
static stripSlashesArray($a_arr, $a_strip_html=true, $a_allow="")
Strip slashes from array.
savePageLayout()
Save page layout.
add_cell($val, $link="")
output a cell in object list
create()
create new page or chapter in chapter
static switchColor($a_num, $a_css1, $a_css2)
switches style sheets for each even $a_num (used for changing colors of different result rows) ...
__construct(&$a_content_obj, &$a_tree)
Constructor public.
activatePages()
activates or deactivates pages
executeCommand()
execute command
insertChapter($a_as_sub=false)
Insert (multiple) chapters at node.
static setAction($a_action)
putInTree()
put chapter into tree
showHierarchy()
Show subhiearchy of pages and subchapters.