24 include_once
"classes/class.ilObjectGUI.php";
25 include_once
"./Modules/LearningModule/classes/class.ilObjContentObject.php";
26 include_once (
"./Modules/LearningModule/classes/class.ilLMPageObjectGUI.php");
27 include_once (
"./Modules/LearningModule/classes/class.ilStructureObjectGUI.php");
54 $lng->loadLanguageModule(
"content");
65 if ($this->ctrl->getRedirectSource() ==
"ilinternallinkgui")
71 if ($this->ctrl->getCmdClass() ==
"ilinternallinkgui")
73 $this->ctrl->setReturn($this,
"explorer");
77 $next_class = $this->ctrl->getNextClass($this);
80 $cmd = $this->ctrl->getCmd(
"", array(
"downloadExportFile"));
84 case "illearningprogressgui":
86 include_once
'./Services/Tracking/classes/class.ilLearningProgressGUI.php';
91 $this->ctrl->forwardCommand($new_gui);
97 include_once
'Services/MetaData/classes/class.ilMDEditorGUI.php';
99 $md_gui =&
new ilMDEditorGUI($this->object->getId(), 0, $this->
object->getType());
100 $md_gui->
addObserver($this->
object,
'MDUpdateListener',
'General');
102 $this->ctrl->forwardCommand($md_gui);
105 case "ilobjstylesheetgui":
107 include_once (
"./Services/Style/classes/class.ilObjStyleSheetGUI.php");
108 $this->ctrl->setReturn($this,
"properties");
109 $style_gui =&
new ilObjStyleSheetGUI(
"", $this->object->getStyleSheetId(),
false,
false);
111 if (
$cmd ==
"create" ||
$_GET[
"new_type"]==
"sty")
113 $style_gui->setCreationMode(
true);
115 $ret =& $this->ctrl->forwardCommand($style_gui);
118 if (
$cmd ==
"save" ||
$cmd ==
"copyStyle" ||
$cmd ==
"importStyle")
121 $this->
object->setStyleSheetId($style_id);
122 $this->
object->update();
123 $this->ctrl->redirectByClass(
"ilobjstylesheetgui",
"edit");
127 case "illmpageobjectgui":
128 $this->ctrl->saveParameter($this, array(
"obj_id"));
130 $this->ctrl->setReturn($this,
"chapters");
135 if (
$_GET[
"obj_id"] !=
"")
138 $pg_gui->setLMPageObject($obj);
141 $ret =& $this->ctrl->forwardCommand($pg_gui);
142 if (
$cmd ==
"save" ||
$cmd ==
"cancel")
144 $this->ctrl->redirect($this,
"pages");
148 case "ilstructureobjectgui":
149 $this->ctrl->saveParameter($this, array(
"obj_id"));
151 $this->ctrl->setReturn($this,
"chapters");
153 if (
$_GET[
"obj_id"] !=
"")
156 $st_gui->setStructureObject($obj);
159 $ret =& $this->ctrl->forwardCommand($st_gui);
160 if (
$cmd ==
"save" ||
$cmd ==
"cancel")
162 if (
$_GET[
"obj_id"] ==
"")
164 $this->ctrl->redirect($this,
"chapters");
168 $this->ctrl->setCmd(
"subchap");
174 case 'ilpermissiongui':
175 if (strtolower(
$_GET[
"baseClass"]) ==
"iladministrationgui")
184 include_once(
"./classes/class.ilPermissionGUI.php");
186 $ret =& $this->ctrl->forwardCommand($perm_gui);
190 case 'ilinfoscreengui':
193 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
195 $info->enablePrivateNotes();
199 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"]))
201 $info->enableNewsEditing();
202 $info->setBlockProperty(
"news",
"settings",
true);
206 $info->addMetaDataSections($this->object->getId(), 0,
207 $this->
object->getType());
209 $ret =& $this->ctrl->forwardCommand($info);
213 $new_type = $_POST[
"new_type"]
218 if (
$cmd ==
"create" &&
219 !in_array($new_type, array(
"dbk",
"lm")))
226 $this->ctrl->setCmdClass(
"ilLMPageObjectGUI");
232 $this->ctrl->setCmdClass(
"ilStructureObjectGUI");
241 in_array($new_type, array(
"dbk",
"lm")))
264 return array(
"ilLMPageObjectGUI",
"ilStructureObjectGUI",
"ilObjStyleSheetGUI");
274 $lng->loadLanguageModule(
"style");
278 $showViewInFrameset =
true;
280 if ($showViewInFrameset)
286 $buttonTarget =
"ilContObj".$this->object->getID();
290 $this->tpl->addBlockfile(
"BUTTONS",
"buttons",
"tpl.buttons.html");
293 $this->tpl->setCurrentBlock(
"btn_cell");
294 $this->tpl->setVariable(
"BTN_LINK",
"ilias.php?baseClass=ilLMPresentationGUI&ref_id=".$this->object->getRefID());
295 $this->tpl->setVariable(
"BTN_TARGET",
" target=\"".$buttonTarget.
"\" ");
296 $this->tpl->setVariable(
"BTN_TXT",$this->lng->txt(
"view"));
297 $this->tpl->parseCurrentBlock();
299 $this->tpl->setCurrentBlock(
"btn_cell");
300 $this->tpl->setVariable(
"BTN_LINK", $this->ctrl->getLinkTarget($this,
"fixTreeConfirm"));
302 $this->tpl->setVariable(
"BTN_TXT", $this->lng->txt(
"cont_fix_tree"));
303 $this->tpl->parseCurrentBlock();
308 if ($this->ilias->getSetting(
"pub_section"))
310 if ($this->object->getType() !=
"dbk")
312 $this->tpl->setCurrentBlock(
"btn_cell");
313 $this->tpl->setVariable(
"BTN_LINK", $this->ctrl->getLinkTarget($this,
"editPublicSection"));
315 $this->tpl->setVariable(
"BTN_TXT", $this->lng->txt(
"public_section"));
316 $this->tpl->parseCurrentBlock();
321 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.lm_properties.html",
"Modules/LearningModule");
322 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
323 $this->tpl->setVariable(
"TXT_PROPERTIES", $this->lng->txt(
"cont_lm_properties"));
326 $this->tpl->setVariable(
"TXT_ONLINE", $this->lng->txt(
"cont_online"));
327 $this->tpl->setVariable(
"CBOX_ONLINE",
"cobj_online");
328 $this->tpl->setVariable(
"VAL_ONLINE",
"y");
329 if ($this->object->getOnline())
331 $this->tpl->setVariable(
"CHK_ONLINE",
"checked");
335 $this->tpl->setVariable(
"TXT_LAYOUT", $this->lng->txt(
"cont_def_layout"));
338 $layouts,
false,
true);
339 $this->tpl->setVariable(
"SELECT_LAYOUT", $select_layout);
342 $this->tpl->setVariable(
"TXT_STYLE", $this->lng->txt(
"cont_style"));
343 $fixed_style = $this->ilias->getSetting(
"fixed_content_style_id");
345 if ($fixed_style > 0)
347 $this->tpl->setVariable(
"VAL_STYLE",
349 $this->lng->txt(
"global_fixed").
")");
353 $this->tpl->setCurrentBlock(
"style_edit");
354 $style_id = $this->
object->getStyleSheetId();
359 $st_styles[0] = $this->lng->txt(
"default");
362 $st_styles,
false,
true);
369 $this->tpl->setVariable(
"VAL_STYLE",
375 $this->tpl->setVariable(
"VAL_STYLE",
377 $this->tpl->setVariable(
"LINK_STYLE_EDIT",
378 $this->ctrl->getLinkTargetByClass(
"ilObjStyleSheetGUI",
"edit"));
379 $this->tpl->setVariable(
"TXT_STYLE_EDIT",
380 $this->lng->txt(
"edit"));
385 $this->tpl->setVariable(
"LINK_STYLE_DROP",
386 $this->ctrl->getLinkTargetByClass(
"ilObjStyleSheetGUI",
"delete"));
387 $this->tpl->setVariable(
"TXT_STYLE_DROP",
388 $this->lng->txt(
"delete"));
396 $this->tpl->setVariable(
"VAL_STYLE",
398 $this->tpl->setVariable(
"LINK_STYLE_CREATE",
399 $this->ctrl->getLinkTargetByClass(
"ilObjStyleSheetGUI",
"create"));
400 $this->tpl->setVariable(
"TXT_STYLE_CREATE",
401 $this->lng->txt(
"sty_create_ind_style"));
403 $this->tpl->parseCurrentBlock();
407 $this->tpl->setVariable(
"TXT_PAGE_HEADER", $this->lng->txt(
"cont_page_header"));
408 $pg_header = array (
"st_title" => $this->lng->txt(
"cont_st_title"),
409 "pg_title" => $this->lng->txt(
"cont_pg_title"),
410 "none" => $this->lng->txt(
"cont_none"));
412 $pg_header,
false,
true);
413 $this->tpl->setVariable(
"SELECT_PAGE_HEADER", $select_pg_head);
416 $this->tpl->setVariable(
"TXT_NUMBER", $this->lng->txt(
"cont_act_number"));
417 $this->tpl->setVariable(
"CBOX_NUMBER",
"cobj_act_number");
418 $this->tpl->setVariable(
"VAL_NUMBER",
"y");
419 if ($this->object->isActiveNumbering())
421 $this->tpl->setVariable(
"CHK_NUMBER",
"checked");
425 $this->tpl->setVariable(
"TXT_TOC_MODE", $this->lng->txt(
"cont_toc_mode"));
426 $arr_toc_mode = array (
"chapters" => $this->lng->txt(
"cont_chapters_only"),
427 "pages" => $this->lng->txt(
"cont_chapters_and_pages"));
429 $arr_toc_mode,
false,
true);
430 $this->tpl->setVariable(
"SELECT_TOC_MODE", $select_toc_mode);
433 if (!$this->ilias->getSetting(
'disable_notes'))
435 $this->tpl->setVariable(
"TXT_PUB_NOTES", $this->lng->txt(
"cont_public_notes"));
436 $this->tpl->setVariable(
"TXT_PUB_NOTES_DESC", $this->lng->txt(
"cont_public_notes_desc"));
437 $this->tpl->setVariable(
"CBOX_PUB_NOTES",
"cobj_pub_notes");
438 $this->tpl->setVariable(
"VAL_PUB_NOTES",
"y");
439 if ($this->object->publicNotes())
441 $this->tpl->setVariable(
"CHK_PUB_NOTES",
"checked");
446 $this->tpl->setVariable(
"TXT_CLEAN_FRAMES", $this->lng->txt(
"cont_synchronize_frames"));
447 $this->tpl->setVariable(
"TXT_CLEAN_FRAMES_DESC", $this->lng->txt(
"cont_synchronize_frames_desc"));
448 $this->tpl->setVariable(
"CBOX_CLEAN_FRAMES",
"cobj_clean_frames");
449 $this->tpl->setVariable(
"VAL_CLEAN_FRAMES",
"y");
450 if ($this->object->cleanFrames())
452 $this->tpl->setVariable(
"CHK_CLEAN_FRAMES",
"checked");
456 $this->tpl->setVariable(
"TXT_HIST_USER_COMMENTS", $this->lng->txt(
"enable_hist_user_comments"));
457 $this->tpl->setVariable(
"TXT_HIST_USER_COMMENTS_DESC", $this->lng->txt(
"enable_hist_user_comments_desc"));
458 $this->tpl->setVariable(
"CBOX_HIST_USER_COMMENTS",
"cobj_user_comments");
459 $this->tpl->setVariable(
"VAL_HIST_USER_COMMENTS",
"y");
460 if ($this->object->isActiveHistoryUserComments())
462 $this->tpl->setVariable(
"CHK_HIST_USER_COMMENTS",
"checked");
466 $this->tpl->setVariable(
"TXT_LM_MENU", $this->lng->txt(
"cont_lm_menu"));
467 $this->tpl->setVariable(
"TXT_ACT_MENU", $this->lng->txt(
"cont_active"));
468 $this->tpl->setVariable(
"CBOX_LM_MENU",
"cobj_act_lm_menu");
469 $this->tpl->setVariable(
"VAL_LM_MENU",
"y");
470 if ($this->object->isActiveLMMenu())
472 $this->tpl->setVariable(
"CHK_LM_MENU",
"checked");
476 $this->tpl->setVariable(
"TXT_TOC", $this->lng->txt(
"cont_toc"));
477 $this->tpl->setVariable(
"CBOX_TOC",
"cobj_act_toc");
478 $this->tpl->setVariable(
"VAL_TOC",
"y");
479 if ($this->object->isActiveTOC())
481 $this->tpl->setVariable(
"CHK_TOC",
"checked");
485 $this->tpl->setVariable(
"TXT_PRINT", $this->lng->txt(
"cont_print_view"));
486 $this->tpl->setVariable(
"CBOX_PRINT",
"cobj_act_print");
487 $this->tpl->setVariable(
"VAL_PRINT",
"y");
488 if ($this->object->isActivePrintView())
490 $this->tpl->setVariable(
"CHK_PRINT",
"checked");
494 $this->tpl->setVariable(
"TXT_PRINT_PREV_GLO", $this->lng->txt(
"cont_print_view_pre_glo"));
495 $this->tpl->setVariable(
"CBOX_PRINT_PREV_GLO",
"cobj_act_print_prev_glo");
496 $this->tpl->setVariable(
"VAL_PRINT_PREV_GLO",
"y");
497 if ($this->object->isActivePreventGlossaryAppendix())
499 $this->tpl->setVariable(
"CHK_PRINT_PREV_GLO",
"checked");
503 $this->tpl->setVariable(
"TXT_DOWNLOADS", $this->lng->txt(
"cont_downloads"));
504 $this->tpl->setVariable(
"TXT_DOWNLOADS_DESC", $this->lng->txt(
"cont_downloads_desc"));
505 $this->tpl->setVariable(
"CBOX_DOWNLOADS",
"cobj_act_downloads");
506 $this->tpl->setVariable(
"VAL_DOWNLOADS",
"y");
508 if ($this->object->isActiveDownloads())
510 $this->tpl->setVariable(
"CHK_DOWNLOADS",
"checked=\"checked\"");
513 $this->tpl->setVariable(
"TXT_DOWNLOADS_PUBLIC_DESC", $this->lng->txt(
"cont_downloads_public_desc"));
514 $this->tpl->setVariable(
"CBOX_DOWNLOADS_PUBLIC",
"cobj_act_downloads_public");
515 $this->tpl->setVariable(
"VAL_DOWNLOADS_PUBLIC",
"y");
517 if ($this->object->isActiveDownloadsPublic())
519 $this->tpl->setVariable(
"CHK_DOWNLOADS_PUBLIC",
"checked=\"checked\"");
522 if (!$this->object->isActiveDownloads())
524 $this->tpl->setVariable(
"CHK2_DOWNLOADS_PUBLIC",
"disabled=\"disabled\"");
529 $entries = $this->lmme_obj->getMenuEntries();
531 if (count($entries) > 0)
533 foreach ($entries as $entry)
535 $this->ctrl->setParameter($this,
"menu_entry", $entry[
"id"]);
537 $this->tpl->setCurrentBlock(
"menu_entries");
539 if ($entry[
"type"] ==
"intern")
541 $entry[
"link"] = ILIAS_HTTP_PATH.
"/goto.php?target=".$entry[
"link"];
545 if (!strstr($entry[
"link"],
'://') && !strstr($entry[
"link"],
'mailto:'))
547 $entry[
"link"] =
"http://".$entry[
"link"];
550 $this->tpl->setVariable(
"ENTRY_LINK", $entry[
"link"]);
551 $this->tpl->setVariable(
"ENTRY_TITLE", $entry[
"title"]);
553 $this->tpl->setVariable(
"CBOX_ENTRY",
"menu_entries[]");
554 $this->tpl->setVariable(
"VAL_ENTRY", $entry[
"id"]);
558 $this->tpl->setVariable(
"CHK_ENTRY",
"checked=\"checked\"");
562 $this->tpl->setVariable(
"LINK_EDIT", $this->ctrl->getLinkTarget($this,
"editMenuEntry"));
563 $this->tpl->setVariable(
"TARGET_EDIT",
"content");
564 $this->tpl->setVariable(
"TXT_EDIT", $this->lng->txt(
"edit"));
567 $this->tpl->setVariable(
"LINK_DROP", $this->ctrl->getLinkTarget($this,
"deleteMenuEntry"));
568 $this->tpl->setVariable(
"TARGET_DROP",
"content");
569 $this->tpl->setVariable(
"TXT_DROP", $this->lng->txt(
"drop"));
572 $this->tpl->parseCurrentBlock();
579 $this->tpl->setCurrentBlock(
"commands");
580 $this->tpl->setVariable(
"BTN_NAME",
"saveProperties");
581 $this->tpl->setVariable(
"BTN_TEXT", $this->lng->txt(
"save"));
582 $this->tpl->setVariable(
"BTN_NAME2",
"addMenuEntry");
583 $this->tpl->setVariable(
"BTN_TEXT2", $this->lng->txt(
"add_menu_entry"));
584 $this->tpl->parseCurrentBlock();
594 switch ($this->object->getType())
597 $gui_class =
"ilobjlearningmodulegui";
601 $gui_class =
"ilobjdlbookgui";
605 $ilCtrl->setParameterByClass($gui_class,
"active_node",
$_GET[
"active_node"]);
607 $this->tpl =
new ilTemplate(
"tpl.main.html",
true,
true);
614 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.explorer.html");
617 require_once (
"./Modules/LearningModule/classes/class.ilLMEditorExplorer.php");
622 $exp->setExpandTarget($this->ctrl->getLinkTarget($this,
"explorer"));
624 if (
$_GET[
"lmmovecopy"] ==
"1")
630 if (
$_GET[
"lmexpand"] ==
"")
632 $mtree =
new ilTree($this->object->getId());
634 $mtree->setTreeTablePK(
"lm_id");
635 $expanded = $mtree->readRootId();
639 $expanded =
$_GET[
"lmexpand"];
641 if (
$_GET[
"active_node"] !=
"")
643 $path = $this->lm_tree->getPathId(
$_GET[
"active_node"]);
644 $exp->setForceOpenPath($path);
646 $exp->highlightNode(
$_GET[
"active_node"]);
648 $exp->setExpand($expanded);
652 $output = $exp->getOutput();
655 if ($ilCtrl->isAsynch())
660 include_once(
"./Services/COPage/classes/class.ilPageEditorGUI.php");
679 $this->tpl->setCurrentBlock(
"content");
680 $this->tpl->setVariable(
"TXT_EXPLORER_HEADER", $this->lng->txt(
"cont_chap_and_pages"));
681 $this->tpl->setVariable(
"EXP_REFRESH", $this->lng->txt(
"refresh"));
682 $this->tpl->setVariable(
"EXPLORER",$output);
683 $this->ctrl->setParameter($this,
"lmexpand",
$_GET[
"lmexpand"]);
684 $this->tpl->setVariable(
"ACTION", $this->ctrl->getLinkTarget($this,
"explorer"));
685 $this->tpl->parseCurrentBlock();
686 $this->tpl->show(
false);
695 include_once
"./Services/COPage/classes/class.ilWysiwygUtil.php";
697 $popup->show(
$_GET[
"ptype"]);
708 $this->
object->executeDragDrop($_POST[
"il_hform_source_id"], $_POST[
"il_hform_target_id"],
709 $_POST[
"il_hform_fc"], $_POST[
"il_hform_as_subitem"]);
710 $ilCtrl->redirect($this,
"chapters");
720 if ($ilias->getSetting(
"fixed_content_style_id") <= 0 &&
722 || $this->object->getStyleSheetId() == 0))
724 $this->
object->setStyleSheetId($_POST[
"style_id"]);
726 $this->
object->setLayout($_POST[
"lm_layout"]);
727 $this->
object->setPageHeader($_POST[
"lm_pg_header"]);
728 $this->
object->setTOCMode($_POST[
"toc_mode"]);
729 $this->
object->setOnline(
ilUtil::yn2tf($_POST[
"cobj_online"]));
730 $this->
object->setActiveLMMenu(
ilUtil::yn2tf($_POST[
"cobj_act_lm_menu"]));
731 $this->
object->setActiveNumbering(
ilUtil::yn2tf($_POST[
"cobj_act_number"]));
732 $this->
object->setActiveTOC(
ilUtil::yn2tf($_POST[
"cobj_act_toc"]));
733 $this->
object->setActivePrintView(
ilUtil::yn2tf($_POST[
"cobj_act_print"]));
734 $this->
object->setActivePreventGlossaryAppendix(
ilUtil::yn2tf($_POST[
"cobj_act_print_prev_glo"]));
735 $this->
object->setActiveDownloads(
ilUtil::yn2tf($_POST[
"cobj_act_downloads"]));
736 $this->
object->setActiveDownloadsPublic(
ilUtil::yn2tf($_POST[
"cobj_act_downloads_public"]));
737 $this->
object->setCleanFrames(
ilUtil::yn2tf($_POST[
"cobj_clean_frames"]));
738 $this->
object->setPublicNotes(
ilUtil::yn2tf($_POST[
"cobj_pub_notes"]));
739 $this->
object->setHistoryUserComments(
ilUtil::yn2tf($_POST[
"cobj_user_comments"]));
740 $this->
object->updateProperties();
743 $this->lmme_obj->updateActiveStatus($_POST[
"menu_entries"]);
746 $this->ctrl->redirect($this,
"properties");
756 $new_type = $_POST[
"new_type"] ? $_POST[
"new_type"] :
$_GET[
"new_type"];
758 if (!$rbacsystem->checkAccess(
"create",
$_GET[
"ref_id"], $new_type))
760 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
766 $data[
"fields"] = array();
772 $this->tpl->setVariable(
"TYPE_IMG",
774 $this->tpl->setVariable(
"ALT_IMG",
775 $this->lng->txt(
"obj_".$new_type));
777 foreach (
$data[
"fields"] as $key => $val)
779 $this->tpl->setVariable(
"TXT_".strtoupper($key), $this->lng->txt($key));
780 $this->tpl->setVariable(strtoupper($key), $val);
782 if ($this->prepare_output)
784 $this->tpl->parseCurrentBlock();
791 $this->ctrl->setParameter($this,
"new_type", $new_type);
792 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this,
"save"));
795 $this->tpl->setVariable(
"TXT_HEADER", $this->lng->txt($new_type.
"_new"));
796 $this->tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
797 $this->tpl->setVariable(
"TXT_SUBMIT", $this->lng->txt($new_type.
"_add"));
798 $this->tpl->setVariable(
"CMD_SUBMIT",
"save");
799 $this->tpl->setVariable(
"TARGET",
' target="'.
801 $this->tpl->setVariable(
"TXT_REQUIRED_FLD", $this->lng->txt(
"required_field"));
803 $this->tpl->setVariable(
"TXT_IMPORT_LM", $this->lng->txt(
"import_".$new_type));
804 $this->tpl->setVariable(
"TXT_LM_FILE", $this->lng->txt(
"file"));
805 $this->tpl->setVariable(
"TXT_IMPORT", $this->lng->txt(
"import"));
808 $umf=get_cfg_var(
"upload_max_filesize");
810 $pms=get_cfg_var(
"post_max_size");
813 $max_filesize = ((int) $umf < (
int) $pms)
816 if ((
int) $pms == 0) $max_filesize = $umf;
818 if (!$max_filesize) $max_filesize=max($umf, $pms);
821 $this->tpl->setVariable(
"TXT_FILE_INFO", $this->lng->txt(
"file_notice").
" $max_filesize.");
831 global $rbacadmin, $rbacsystem;
836 if (!$rbacsystem->checkAccess(
"create",
$_GET[
"ref_id"],
$_GET[
"new_type"]))
838 $this->ilias->raiseError($this->lng->txt(
"no_create_permission"), $this->ilias->error_obj->MESSAGE);
843 if ($_POST[
"Fobject"][
"title"] ==
"")
845 $this->ilias->raiseError($this->lng->txt(
"please_enter_title"), $this->ilias->error_obj->MESSAGE);
850 include_once(
"./Modules/LearningModule/classes/class.ilObjContentObject.php");
852 $newObj->setType($this->type);
853 $newObj->setTitle(
ilUtil::stripSlashes($_POST[
"Fobject"][
"title"]));#
"content object ".$newObj->getId());
856 $newObj->createReference();
857 $newObj->putInTree(
$_GET[
"ref_id"]);
858 $newObj->setPermissions(
$_GET[
"ref_id"]);
859 $newObj->notify(
"new",
$_GET[
"ref_id"],
$_GET[
"parent_non_rbac_id"],
$_GET[
"ref_id"],$newObj->getRefId());
860 $newObj->setCleanFrames(
true);
868 $newObj->createLMTree();
873 "&baseClass=ilLMEditorGUI");
882 include_once
"./Modules/LearningModule/classes/class.ilBibItemGUI.php";
884 $bib_gui->setObject($this->
object);
885 $bibItemName = $_POST[
"bibItemName"] ? $_POST[
"bibItemName"] :
$_GET[
"bibItemName"];
886 $bibItemIndex = $_POST[
"bibItemIndex"] ? $_POST[
"bibItemIndex"] :
$_GET[
"bibItemIndex"];
887 if ($bibItemIndex ==
"")
889 $bibItemPath = $_POST[
"bibItemPath"] ? $_POST[
"bibItemPath"] :
$_GET[
"bibItemPath"];
890 if ($bibItemName !=
"")
892 $bib_gui->bib_obj->add($bibItemName, $bibItemPath, $bibItemIndex);
893 $data = $bib_gui->bib_obj->getElement(
"BibItem");
894 $bibItemIndex = (count(
$data) - 1);
902 $a_target =
"adm_object.php?ref_id=" . $this->
object->getRefId();
905 $bib_gui->edit(
"ADM_CONTENT",
"adm_content", $a_target, $bibItemIndex);
926 include_once
"./Modules/LearningModule/classes/class.ilBibItemGUI.php";
928 $bib_gui->setObject($this->
object);
929 $bibItemIndex = $_POST[
"bibItemIndex"] ? $_POST[
"bibItemIndex"] :
$_GET[
"bibItemIndex"];
930 $bib_gui->bib_obj->delete(
$_GET[
"bibItemName"],
$_GET[
"bibItemPath"], $bibItemIndex);
931 if (strpos($bibItemIndex,
",") > 0)
933 $bibItemIndex = substr($bibItemIndex, 0, strpos($bibItemIndex,
","));
937 $a_target =
"adm_object.php?ref_id=" . $this->
object->getRefId();
940 $bib_gui->edit(
"ADM_CONTENT",
"adm_content", $a_target, $bibItemIndex);
962 include_once
"./Modules/LearningModule/classes/class.ilBibItemGUI.php";
964 $bib_gui->setObject($this->
object);
965 $bibItemIndex = $_POST[
"bibItemIndex"] ? $_POST[
"bibItemIndex"] :
$_GET[
"bibItemIndex"];
967 if ($bibItemIndex < 0)
973 $a_target =
"adm_object.php?ref_id=" . $this->
object->getRefId();
976 $bib_gui->edit(
"ADM_CONTENT",
"adm_content", $a_target, $bibItemIndex);
997 include_once
"./Modules/LearningModule/classes/class.ilBibItemGUI.php";
999 $bib_gui->setObject($this->
object);
1000 $bibItemIndex = $_POST[
"bibItemIndex"] ? $_POST[
"bibItemIndex"] :
$_GET[
"bibItemIndex"];
1002 if ($bibItemIndex < 0)
1006 $bibItemIndex = $bib_gui->save($bibItemIndex);
1008 if ($a_target ==
"")
1010 $a_target =
"adm_object.php?ref_id=" . $this->
object->getRefId();
1013 $bib_gui->edit(
"ADM_CONTENT",
"adm_content", $a_target, $bibItemIndex);
1059 global $_FILES, $rbacsystem, $ilDB;
1061 include_once
"./Modules/LearningModule/classes/class.ilObjLearningModule.php";
1064 $source = $_FILES[
"xmldoc"][
"tmp_name"];
1065 if (($source ==
'none') || (!$source))
1067 $this->ilias->raiseError(
"No file selected!",$this->ilias->error_obj->MESSAGE);
1077 $info = pathinfo($_FILES[
"xmldoc"][
"name"]);
1078 if (strtolower($info[
"extension"]) !=
"zip")
1080 $this->ilias->raiseError(
"File must be a zip file!",$this->ilias->error_obj->MESSAGE);
1084 include_once(
"./Modules/LearningModule/classes/class.ilObjContentObject.php");
1086 $newObj->setType(
$_GET[
"new_type"]);
1087 $newObj->setTitle($_FILES[
"xmldoc"][
"name"]);
1088 $newObj->setDescription(
"");
1089 $newObj->create(
true);
1090 $newObj->createReference();
1091 $newObj->putInTree(
$_GET[
"ref_id"]);
1092 $newObj->setPermissions(
$_GET[
"ref_id"]);
1093 $newObj->notify(
"new",
$_GET[
"ref_id"],
$_GET[
"parent_non_rbac_id"],
$_GET[
"ref_id"],$newObj->getRefId());
1096 $newObj->createLMTree();
1099 $newObj->createImportDirectory();
1102 $file = pathinfo($_FILES[
"xmldoc"][
"name"]);
1103 $full_path = $newObj->getImportDirectory().
"/".$_FILES[
"xmldoc"][
"name"];
1106 $_FILES[
"xmldoc"][
"name"], $full_path);
1114 $subdir = basename(
$file[
"basename"],
".".
$file[
"extension"]);
1115 $xml_file = $newObj->getImportDirectory().
"/".$subdir.
"/".$subdir.
".xml";
1118 if (!is_dir($newObj->getImportDirectory().
"/".$subdir))
1120 $this->ilias->raiseError(sprintf($this->lng->txt(
"cont_no_subdir_in_zip"), $subdir),
1121 $this->ilias->error_obj->MESSAGE);
1125 if (!is_file($xml_file))
1127 $this->ilias->raiseError(sprintf($this->lng->txt(
"cont_zip_file_invalid"), $subdir.
"/".$subdir.
".xml"),
1128 $this->ilias->error_obj->MESSAGE);
1131 include_once (
"./Modules/LearningModule/classes/class.ilContObjParser.php");
1133 $contParser->startParsing();
1135 $newObj->MDUpdateListener(
'General');
1138 $style_file = $newObj->getImportDirectory().
"/".$subdir.
"/style.xml";
1139 if (is_file($style_file))
1141 require_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
1143 $style->createFromXMLFile($style_file);
1144 $newObj->writeStyleSheetId($style->getId());
1152 include_once(
"./Services/COPage/classes/class.ilPageObject.php");
1154 $newObj->getType(), $newObj->getRefId());
1156 "&baseClass=ilLMEditorGUI");
1168 if ($ilUser->getPref(
"lm_js_chapter_editing") !=
"disable")
1170 $ilCtrl->setParameter($this,
"backcmd",
"chapters");
1172 include_once(
"./Modules/LearningModule/classes/class.ilChapterHierarchyFormGUI.php");
1175 $form_gui->setTitle($this->object->getTitle());
1177 $form_gui->setTree($this->lm_tree);
1178 $form_gui->setMaxDepth(0);
1179 $form_gui->setCurrentTopNodeId($this->tree->getRootId());
1180 $form_gui->addMultiCommand($lng->txt(
"delete"),
"delete");
1181 $form_gui->addMultiCommand($lng->txt(
"cut"),
"cutItems");
1182 $form_gui->addMultiCommand($lng->txt(
"copy"),
"copyItems");
1184 $form_gui->addCommand($lng->txt(
"cont_save_all_titles"),
"saveAllTitles");
1185 $up_gui = ($this->
object->getType() ==
"dbk")
1187 :
"ilobjlearningmodulegui";
1188 $form_gui->setExplorerUpdater(
"tree",
"tree_div",
1189 $ilCtrl->getLinkTargetByClass($up_gui,
"explorer",
"",
true));
1191 $ctpl =
new ilTemplate(
"tpl.chap_and_pages.html",
true,
true,
"Modules/LearningModule");
1192 $ctpl->setVariable(
"HIERARCHY_FORM", $form_gui->getHTML());
1193 $ilCtrl->setParameter($this,
"obj_id",
"");
1194 $ctpl->setVariable(
"HREF_NO_JS_EDIT",
1195 $ilCtrl->getLinkTarget($this,
"deactivateJSChapterEditing"));
1196 $ctpl->setVariable(
"TXT_NO_JS_EDIT",
1197 $lng->txt(
"cont_not_js_chap_editing"));
1199 $this->tpl->setContent($ctpl->get());
1203 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.structure_edit.html",
"Modules/LearningModule");
1206 $this->ctrl->setParameter($this,
"backcmd",
"chapters");
1207 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
1208 $this->tpl->setVariable(
"HEADER_TEXT", $this->lng->txt(
"cont_chapters"));
1212 $childs = $this->lm_tree->getChilds($this->lm_tree->getRootId());
1213 foreach ($childs as $child)
1215 if($child[
"type"] !=
"st")
1220 $this->tpl->setCurrentBlock(
"table_row");
1225 $this->tpl->setVariable(
"CHECKBOX_ID", $child[
"obj_id"]);
1226 $this->tpl->setVariable(
"CSS_ROW", $css_row);
1230 $this->ctrl->setParameter($this,
"backcmd",
"");
1231 $this->ctrl->setParameterByClass(
"ilStructureObjectGUI",
"obj_id", $child[
"obj_id"]);
1232 $this->tpl->setVariable(
"LINK_TARGET",
1233 $this->ctrl->getLinkTargetByClass(
"ilStructureObjectGUI",
"view"));
1236 $this->tpl->setVariable(
"TEXT_CONTENT",
1238 $this->object->isActiveNumbering()));
1240 $this->tpl->parseCurrentBlock();
1243 $paste_active =
false;
1244 if ($ilUser->clipboardHasObjectsOfType(
"st"))
1246 $paste_active =
true;
1249 if($cnt == 0 && !$paste_active)
1251 $this->tpl->setCurrentBlock(
"notfound");
1252 $this->tpl->setVariable(
"NUM_COLS", 3);
1253 $this->tpl->setVariable(
"TXT_OBJECT_NOT_FOUND", $this->lng->txt(
"obj_not_found"));
1254 $this->tpl->parseCurrentBlock();
1259 $this->tpl->setVariable(
"NUM_COLS", 3);
1262 $acts = array(
"delete" =>
"delete",
"cutChapter" =>
"cut",
1263 "copyChapter" =>
"copyChapter");
1267 $acts[
"pasteChapter"] =
"pasteChapter";
1274 $this->tpl->setVariable(
"NUM_COLS", 3);
1275 $subobj = array(
"st");
1277 $this->tpl->setCurrentBlock(
"add_object");
1278 $this->tpl->setVariable(
"SELECT_OBJTYPE", $opts);
1279 $this->tpl->setVariable(
"BTN_NAME",
"create");
1280 $this->tpl->setVariable(
"TXT_ADD", $this->lng->txt(
"insert"));
1281 $this->tpl->parseCurrentBlock();
1283 $this->tpl->setCurrentBlock(
"form");
1284 $this->tpl->parseCurrentBlock();
1286 $this->tpl->setVariable(
"HREF_JS_EDIT",
1287 $ilCtrl->getLinkTarget($this,
"activateJSChapterEditing"));
1288 $this->tpl->setVariable(
"TXT_JS_EDIT",
1289 $lng->txt(
"cont_js_chap_editing"));
1303 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.all_pages.html",
"Modules/LearningModule");
1306 $this->tpl->setCurrentBlock(
"form");
1307 $this->ctrl->setParameter($this,
"backcmd",
"pages");
1308 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
1309 $this->tpl->setVariable(
"HEADER_TEXT", $this->lng->txt(
"cont_pages"));
1310 $this->tpl->setVariable(
"CONTEXT", $this->lng->txt(
"cont_usage"));
1315 foreach ($pages as $page)
1317 $this->tpl->setCurrentBlock(
"table_row");
1323 $this->tpl->setVariable(
"IMG_ALT",
1324 $this->lng->txt(
"cont_page_deactivated"));
1329 $this->object->getType()))
1332 $this->tpl->setVariable(
"IMG_ALT",
1333 $this->lng->txt(
"cont_page_deactivated_elements"));
1338 $this->tpl->setVariable(
"IMG_ALT",
1339 $this->lng->txt(
"pg"));
1347 $this->tpl->setVariable(
"CHECKBOX_ID", $page[
"obj_id"]);
1348 $this->tpl->setVariable(
"CSS_ROW", $css_row);
1351 $this->ctrl->setParameter($this,
"backcmd",
"");
1352 $this->ctrl->setParameterByClass(
"ilLMPageObjectGUI",
"obj_id", $page[
"obj_id"]);
1354 $this->tpl->setVariable(
"LINK_TARGET",
1355 $this->ctrl->getLinkTargetByClass(
"ilLMPageObjectGUI",
"edit"));
1358 $this->tpl->setVariable(
"TEXT_CONTENT", $page[
"title"]);
1361 if ($this->lm_tree->isInTree($page[
"obj_id"]))
1372 if ($page[
"obj_id"] == $this->object->getHeaderPage())
1374 $add_str =
" <b>(".$this->lng->txt(
"cont_header").
")</b>";
1376 if ($page[
"obj_id"] == $this->object->getFooterPage())
1378 $add_str =
" <b>(".$this->lng->txt(
"cont_footer").
")</b>";
1381 $this->tpl->setVariable(
"TEXT_CONTEXT", $path_str.$add_str);
1384 $this->tpl->parseCurrentBlock();
1388 $this->tpl->setCurrentBlock(
"notfound");
1389 $this->tpl->setVariable(
"NUM_COLS", 4);
1390 $this->tpl->setVariable(
"TXT_OBJECT_NOT_FOUND", $this->lng->txt(
"obj_not_found"));
1391 $this->tpl->parseCurrentBlock();
1395 $acts = array(
"delete" =>
"delete",
"movePage" =>
"movePage",
"copyPage" =>
"copyPage",
1396 "selectHeader" =>
"selectHeader",
"selectFooter" =>
"selectFooter",
1397 "activatePages" =>
"cont_de_activate");
1401 $acts[
"pastePage"] =
"pastePage";
1410 $this->tpl->setVariable(
"NUM_COLS", 4);
1423 $this->tpl->setVariable(
"NUM_COLS", 4);
1425 $subobj = array(
"pg");
1427 $this->tpl->setCurrentBlock(
"add_object");
1428 $this->tpl->setVariable(
"SELECT_OBJTYPE", $opts);
1429 $this->tpl->setVariable(
"BTN_NAME",
"create");
1430 $this->tpl->setVariable(
"TXT_ADD", $this->lng->txt(
"create"));
1431 $this->tpl->parseCurrentBlock();
1434 $this->tpl->setCurrentBlock(
"form");
1435 $this->tpl->parseCurrentBlock();
1448 include_once(
"./Modules/LearningModule/classes/class.ilLinksTableGUI.php");
1450 $this->object->getId(), $this->
object->getType());
1452 $tpl->setContent($table_gui->getHTML());
1461 if (is_array($_POST[
"id"]))
1463 foreach($_POST[
"id"] as $id)
1471 $this->ctrl->redirect($this,
"pages");
1481 $ilUser->writePref(
"lm_js_chapter_editing",
"disable");
1482 $ilCtrl->redirect($this,
"chapters");
1492 $ilUser->writePref(
"lm_js_chapter_editing",
"enable");
1493 $ilCtrl->redirect($this,
"chapters");
1503 $this->ilias->raiseError($this->lng->txt(
"no_page_in_clipboard"),$this->ilias->error_obj->MESSAGE);
1514 == $this->object->getID())
1517 $new_page =& $lm_page->copy();
1518 $id = $new_page->getId();
1524 $lm_obj =& $this->ilias->obj_factory->getInstanceByObjId($lm_id);
1526 $copied_nodes = array();
1527 $new_page =& $lm_page->copyToOtherContObject($this->
object, $copied_nodes);
1528 $id = $new_page->getId();
1538 != $this->object->getID())
1541 $lm_obj =& $this->ilias->obj_factory->getInstanceByObjId($lm_id);
1543 $lm_page->setLMId($this->object->getID());
1545 $page =& $lm_page->getPageObject();
1547 $page->setParentId($this->object->getID());
1554 $this->ctrl->redirect($this,
"pages");
1562 if(!isset($_POST[
"id"]))
1564 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
1573 $this->ctrl->redirect($this,
"pages");
1583 function delete($a_parent_subobj_id = 0)
1585 if(!isset($_POST[
"id"]))
1587 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
1590 if(count($_POST[
"id"]) == 1 && $_POST[
"id"][0] ==
IL_FIRST_NODE)
1592 $this->ilias->raiseError($this->lng->txt(
"cont_select_item"), $this->ilias->error_obj->MESSAGE);
1595 if ($a_parent_subobj_id == 0)
1603 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.confirm_deletion.html",
"Modules/LearningModule");
1607 if ($a_parent_subobj_id != 0)
1609 $this->ctrl->setParameterByClass(
"ilStructureObjectGUI",
"backcmd",
$_GET[
"backcmd"]);
1610 $this->ctrl->setParameterByClass(
"ilStructureObjectGUI",
"obj_id", $a_parent_subobj_id);
1611 $this->tpl->setVariable(
"FORMACTION",
1612 $this->ctrl->getFormActionByClass(
"ilStructureObjectGUI"));
1616 $this->ctrl->setParameter($this,
"backcmd",
$_GET[
"backcmd"]);
1617 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
1620 $this->tpl->setCurrentBlock(
"table_header");
1621 $this->tpl->setVariable(
"TEXT",$this->lng->txt(
"objects"));
1622 $this->tpl->parseCurrentBlock();
1629 foreach($_POST[
"id"] as $id)
1634 switch($obj->getType())
1643 $this->tpl->setCurrentBlock(
"table_row");
1645 $this->tpl->setVariable(
"TEXT_CONTENT", $obj->getTitle());
1646 $this->tpl->parseCurrentBlock();
1652 $buttons = array(
"cancelDelete" => $this->lng->txt(
"cancel"),
1653 "confirmedDelete" => $this->lng->txt(
"confirm"));
1654 foreach ($buttons as $name => $value)
1656 $this->tpl->setCurrentBlock(
"operation_btn");
1657 $this->tpl->setVariable(
"BTN_NAME",$name);
1658 $this->tpl->setVariable(
"BTN_VALUE",$value);
1659 $this->tpl->parseCurrentBlock();
1668 session_unregister(
"saved_post");
1670 $this->ctrl->redirect($this,
$_GET[
"backcmd"]);
1684 $tree->setTableNames(
'lm_tree',
'lm_data');
1685 $tree->setTreeTablePK(
"lm_id");
1690 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
1694 foreach (
$_SESSION[
"saved_post"] as $id)
1699 $node_data =
$tree->getNodeData($id);
1700 if (is_object($obj))
1702 $obj->setLMId($this->object->getId());
1704 include_once(
"classes/class.ilHistory.php");
1707 $this->
object->getType());
1711 if(
$tree->isInTree($id))
1713 $tree->deleteTree($node_data);
1719 $this->
object->checkTree();
1724 if ($a_parent_subobj_id == 0)
1726 $this->ctrl->redirect($this,
$_GET[
"backcmd"]);
1742 $tmpPath = $this->lm_tree->getPathFull($a_endnode_id, $a_startnode_id);
1745 for ($i = 1; $i < (count($tmpPath) - 1); $i++)
1752 $path .= $tmpPath[$i][
"title"];
1767 $notoperations = array();
1769 $operations = array();
1775 foreach (
$d as $row)
1777 if (!in_array($row[
"name"], $notoperations))
1779 $operations[] = $row;
1784 if (count($operations)>0)
1786 foreach ($operations as $val)
1788 $this->tpl->setCurrentBlock(
"operation_btn");
1789 $this->tpl->setVariable(
"BTN_NAME", $val[
"name"]);
1790 $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt($val[
"lng"]));
1791 $this->tpl->parseCurrentBlock();
1794 $this->tpl->setCurrentBlock(
"operation");
1796 $this->tpl->parseCurrentBlock();
1807 $this->
setFormAction(
"addRole", $this->ctrl->getLinkTarget($this,
"addRole"));
1808 $this->
setFormAction(
"permSave", $this->ctrl->getLinkTarget($this,
"permSave"));
1818 $this->
setReturnLocation(
"permSave", $this->ctrl->getLinkTarget($this,
"perm"));
1857 if (strtolower(
$_GET[
"baseClass"]) ==
"iladministrationgui")
1874 if(!isset($_POST[
"id"]))
1876 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
1879 if(count($_POST[
"id"]) > 1)
1881 $this->ilias->raiseError($this->lng->txt(
"cont_select_max_one_item"),$this->ilias->error_obj->MESSAGE);
1884 if(count($_POST[
"id"]) == 1 && $_POST[
"id"][0] ==
IL_FIRST_NODE)
1886 $this->ilias->raiseError($this->lng->txt(
"cont_select_item"), $this->ilias->error_obj->MESSAGE);
1894 if ($a_parent_subobj_id == 0)
1896 $this->ctrl->redirect($this,
"chapters");
1909 if(!isset($_POST[
"id"]))
1911 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
1914 if(count($_POST[
"id"]) > 1)
1916 $this->ilias->raiseError($this->lng->txt(
"cont_select_max_one_item"),$this->ilias->error_obj->MESSAGE);
1919 if(count($_POST[
"id"]) == 1 && $_POST[
"id"][0] ==
IL_FIRST_NODE)
1921 $this->ilias->raiseError($this->lng->txt(
"cont_select_item"), $this->ilias->error_obj->MESSAGE);
1927 ilUtil::sendInfo($this->lng->txt(
"cont_chap_copy_select_target_now"),
true);
1929 if ($a_parent_subobj_id == 0)
1931 $this->ctrl->redirect($this,
"chapters");
1945 $this->ilias->raiseError($this->lng->txt(
"no_chapter_in_clipboard"),$this->ilias->error_obj->MESSAGE);
1948 $target_tree =
new ilTree($this->object->getId());
1950 $target_tree->setTreeTablePK(
"lm_id");
1954 != $this->object->getID())
1957 $source_tree->setTableNames(
'lm_tree',
'lm_data');
1958 $source_tree->setTreeTablePK(
"lm_id");
1962 $source_tree =& $target_tree;
1967 $node = $source_tree->getNodeData($id);
1968 $subnodes = $source_tree->getSubtree($node);
1969 foreach ($subnodes as $subnode)
1971 if($subnode[
"obj_id"] == $a_parent_subobj_id)
1973 $this->ilias->raiseError($this->lng->txt(
"cont_target_within_source"),$this->ilias->error_obj->MESSAGE);
1976 if($_POST[
"id"][0] == $id)
1979 $this->ctrl->redirect($this,
"chapters");
1983 $parent = ($a_parent_subobj_id == 0)
1984 ? $target_tree->getRootId()
1985 : $a_parent_subobj_id;
1988 if(!isset($_POST[
"id"]))
1994 $target = $_POST[
"id"][0];
1998 $childs =& $target_tree->getChildsByType($parent,
"pg");
1999 if (count($childs) != 0)
2001 $target = $childs[count($childs) - 1][
"obj_id"];
2011 != $this->object->getID())
2016 if ($a_parent_subobj_id == 0)
2018 $this->ctrl->redirect($this,
"chapters");
2023 $target_tree->deleteTree($node);
2025 if (!$target_tree->isInTree($id))
2027 $target_tree->insertNode($id, $parent, $target);
2029 foreach ($subnodes as $node)
2033 if($node[
"obj_id"] != $id)
2035 $target_tree->insertNode($node[
"obj_id"], $node[
"parent"]);
2044 $copied_nodes = array();
2046 == $this->object->getID())
2049 $source_obj->setLMId($this->object->getId());
2050 $source_obj->copy($target_tree, $parent, $target, $copied_nodes);
2058 $source_obj->setLMId($lm_id);
2059 $source_obj->copy($target_tree, $parent, $target, $copied_nodes);
2068 $this->
object->checkTree();
2070 if ($a_parent_subobj_id == 0)
2072 $this->ctrl->redirect($this,
"chapters");
2081 if(!isset($_POST[
"id"]))
2083 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
2090 $this->ctrl->redirect($this,
"pages");
2098 if (
$_GET[
"new_type"] ==
"pg")
2100 $this->ctrl->redirect($this,
"pages");
2104 $this->ctrl->redirect($this,
"chapters");
2114 require_once(
"./Modules/LearningModule/classes/class.ilContObjectExport.php");
2116 $cont_exp->buildExportFile();
2117 $this->ctrl->redirect($this,
"exportList");
2126 $this->tpl->setCurrentBlock(
"btn_cell");
2127 $this->tpl->setVariable(
"BTN_LINK", $this->ctrl->getLinkTarget($this,
"export"));
2128 $this->tpl->setVariable(
"BTN_TXT", $this->lng->txt(
"cont_create_export_file_xml"));
2129 $this->tpl->parseCurrentBlock();
2132 $this->tpl->setCurrentBlock(
"btn_cell");
2133 $this->tpl->setVariable(
"BTN_LINK", $this->ctrl->getLinkTarget($this,
"exportHTML"));
2134 $this->tpl->setVariable(
"BTN_TXT", $this->lng->txt(
"cont_create_export_file_html"));
2135 $this->tpl->parseCurrentBlock();
2138 $this->tpl->setCurrentBlock(
"btn_cell");
2139 $this->tpl->setVariable(
"BTN_LINK", $this->ctrl->getLinkTarget($this,
"exportSCORM"));
2140 $this->tpl->setVariable(
"BTN_TXT", $this->lng->txt(
"cont_create_export_file_scorm"));
2141 $this->tpl->parseCurrentBlock();
2144 if (is_file($this->object->getExportDirectory().
"/export.log"))
2146 $this->tpl->setCurrentBlock(
"btn_cell");
2147 $this->tpl->setVariable(
"BTN_LINK", $this->ctrl->getLinkTarget($this,
"viewExportLog"));
2148 $this->tpl->setVariable(
"BTN_TXT", $this->lng->txt(
"cont_view_last_export_log"));
2149 $this->tpl->parseCurrentBlock();
2164 $this->tpl->addBlockfile(
"BUTTONS",
"buttons",
"tpl.buttons.html");
2168 $export_files = $this->
object->getExportFiles();
2171 require_once(
"./Services/Table/classes/class.ilTableGUI.php");
2175 $this->tpl->addBlockfile(
"ADM_CONTENT",
"adm_content",
"tpl.table.html");
2178 $this->tpl->addBlockfile(
"TBL_CONTENT",
"tbl_content",
"tpl.export_file_row.html",
"Modules/LearningModule");
2182 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
2184 $tbl->setTitle($this->lng->txt(
"cont_export_files"));
2186 $tbl->setHeaderNames(array(
"", $this->lng->txt(
"type"),
2187 $this->lng->txt(
"cont_file"),
2188 $this->lng->txt(
"cont_size"), $this->lng->txt(
"date") ));
2190 $cols = array(
"",
"type",
"file",
"size",
"date");
2191 $header_params = array(
"ref_id" =>
$_GET[
"ref_id"],
"baseClass" =>
$_GET[
"baseClass"],
2192 "cmd" =>
"exportList",
"cmdClass" => strtolower(get_class($this)));
2193 $tbl->setHeaderVars($cols, $header_params);
2194 $tbl->setColumnWidth(array(
"1%",
"9%",
"40%",
"25%",
"25%"));
2197 $tbl->setOrderColumn(
$_GET[
"sort_by"]);
2198 $tbl->setOrderDirection(
$_GET[
"sort_order"]);
2199 $tbl->setLimit(
$_GET[
"limit"]);
2200 $tbl->setOffset(
$_GET[
"offset"]);
2201 $tbl->setMaxCount($this->maxcount);
2202 $tbl->disable(
"sort");
2205 $this->tpl->setVariable(
"COLUMN_COUNTS", 5);
2209 $this->tpl->setCurrentBlock(
"tbl_action_btn");
2210 $this->tpl->setVariable(
"BTN_NAME",
"confirmDeleteExportFile");
2211 $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"delete"));
2212 $this->tpl->parseCurrentBlock();
2214 $this->tpl->setCurrentBlock(
"tbl_action_btn");
2215 $this->tpl->setVariable(
"BTN_NAME",
"downloadExportFile");
2216 $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"download"));
2217 $this->tpl->parseCurrentBlock();
2219 $this->tpl->setCurrentBlock(
"tbl_action_btn");
2220 $this->tpl->setVariable(
"BTN_NAME",
"publishExportFile");
2221 $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"cont_public_access"));
2222 $this->tpl->parseCurrentBlock();
2225 $tbl->setFooter(
"tblfooter",$this->lng->txt(
"previous"),$this->lng->txt(
"next"));
2228 $tbl->setMaxCount(count($export_files));
2229 $export_files = array_slice($export_files,
$_GET[
"offset"],
$_GET[
"limit"]);
2231 if(count($export_files) > 0)
2234 foreach($export_files as $exp_file)
2236 $this->tpl->setCurrentBlock(
"tbl_content");
2237 $this->tpl->setVariable(
"TXT_FILENAME", $exp_file[
"file"]);
2240 $this->tpl->setVariable(
"CSS_ROW", $css_row);
2242 $this->tpl->setVariable(
"TXT_SIZE", $exp_file[
"size"]);
2243 $public_str = ($exp_file[
"file"] == $this->
object->getPublicExportFile($exp_file[
"type"]))
2244 ?
" <b>(".$this->lng->txt(
"public").
")<b>"
2246 $this->tpl->setVariable(
"TXT_TYPE", $exp_file[
"type"].$public_str);
2247 $this->tpl->setVariable(
"CHECKBOX_ID", $exp_file[
"type"].
":".$exp_file[
"file"]);
2249 $file_arr = explode(
"__", $exp_file[
"file"]);
2250 $this->tpl->setVariable(
"TXT_DATE", date(
"Y-m-d H:i:s",$file_arr[0]));
2252 $this->tpl->parseCurrentBlock();
2257 $this->tpl->setCurrentBlock(
"notfound");
2258 $this->tpl->setVariable(
"TXT_OBJECT_NOT_FOUND", $this->lng->txt(
"obj_not_found"));
2259 $this->tpl->setVariable(
"NUM_COLS", 4);
2260 $this->tpl->parseCurrentBlock();
2263 $this->tpl->parseCurrentBlock();
2276 $this->tpl->addBlockfile(
"BUTTONS",
"buttons",
"tpl.buttons.html");
2281 $this->tpl->setVariable(
"ADM_CONTENT",
2282 nl2br(file_get_contents($this->object->getExportDirectory().
"/export.log")));
2284 $this->tpl->parseCurrentBlock();
2292 if(!isset($_POST[
"file"]))
2294 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
2297 if (count($_POST[
"file"]) > 1)
2299 $this->ilias->raiseError($this->lng->txt(
"cont_select_max_one_item"),$this->ilias->error_obj->MESSAGE);
2302 $file = explode(
":", $_POST[
"file"][0]);
2303 $export_dir = $this->
object->getExportDirectory(
$file[0]);
2313 if(!isset($_POST[
"file"]))
2315 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
2317 if (count($_POST[
"file"]) > 1)
2319 $this->ilias->raiseError($this->lng->txt(
"cont_select_max_one_item"),$this->ilias->error_obj->MESSAGE);
2322 $file = explode(
":", $_POST[
"file"][0]);
2323 $export_dir = $this->
object->getExportDirectory(
$file[0]);
2325 if ($this->object->getPublicExportFile(
$file[0]) ==
2328 $this->
object->setPublicExportFile(
$file[0],
"");
2332 $this->
object->setPublicExportFile(
$file[0],
$file[1]);
2334 $this->
object->update();
2335 $this->ctrl->redirect($this,
"exportList");
2343 if(!isset($_POST[
"file"]))
2345 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
2348 if (count($_POST[
"file"]) > 1)
2350 $this->ilias->raiseError($this->lng->txt(
"cont_select_max_one_item"),$this->ilias->error_obj->MESSAGE);
2354 $export_dir = $this->
object->getOfflineDirectory();
2364 if(!isset($_POST[
"file"]))
2366 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
2372 $_SESSION[
"ilExportFiles"] = $_POST[
"file"];
2374 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.confirm_deletion.html",
"Modules/LearningModule");
2378 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
2381 $this->tpl->setCurrentBlock(
"table_header");
2382 $this->tpl->setVariable(
"TEXT",$this->lng->txt(
"objects"));
2383 $this->tpl->parseCurrentBlock();
2387 foreach($_POST[
"file"] as
$file)
2389 $file = explode(
":", $file);
2390 $this->tpl->setCurrentBlock(
"table_row");
2392 $this->tpl->setVariable(
"TEXT_CONTENT", $file[1].
" (".$file[0].
")");
2393 $this->tpl->parseCurrentBlock();
2398 $buttons = array(
"cancelDeleteExportFile" => $this->lng->txt(
"cancel"),
2399 "deleteExportFile" => $this->lng->txt(
"confirm"));
2400 foreach ($buttons as $name => $value)
2402 $this->tpl->setCurrentBlock(
"operation_btn");
2403 $this->tpl->setVariable(
"BTN_NAME",$name);
2404 $this->tpl->setVariable(
"BTN_VALUE",$value);
2405 $this->tpl->parseCurrentBlock();
2415 session_unregister(
"ilExportFiles");
2416 $this->ctrl->redirect($this,
"exportList");
2427 $file = explode(
":", $file);
2428 $export_dir = $this->
object->getExportDirectory($file[0]);
2430 $exp_file = $export_dir.
"/".$file[1];
2431 $exp_dir = $export_dir.
"/".substr($file[1], 0, strlen($file[1]) - 4);
2432 if (@is_file($exp_file))
2436 if (@is_dir($exp_dir))
2441 $this->ctrl->redirect($this,
"exportList");
2452 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.confirm.html");
2454 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
2457 $this->tpl->setVariable(
"TXT_CONFIRM", $this->lng->txt(
"confirmation"));
2458 $this->tpl->setVariable(
"TXT_CONTENT", $this->lng->txt(
"cont_fix_tree_confirm"));
2459 $this->tpl->setVariable(
"CMD_CANCEL",
"cancelFixTree");
2460 $this->tpl->setVariable(
"CMD_OK",
"fixTree");
2461 $this->tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
2462 $this->tpl->setVariable(
"TXT_OK", $this->lng->txt(
"cont_fix_tree"));
2482 $this->ctrl->redirect($this,
"properties");
2490 $this->
object->fixTree();
2492 $this->ctrl->redirect($this,
"properties");
2499 $a_active =
"content", $a_use_global_tabs =
false)
2501 global
$ilCtrl,$ilUser, $ilAccess, $ilTabs;
2503 $active[$a_active] =
true;
2505 if (!$this->object->isActiveLMMenu())
2510 if ($a_use_global_tabs)
2512 $tabs_gui = $ilTabs;
2522 $showViewInFrameset =
true;
2524 if ($showViewInFrameset && !$a_offline)
2530 $buttonTarget =
"_top";
2533 if ($a_export_format ==
"scorm")
2541 if ($a_export_format !=
"scorm" && !$a_offline)
2545 $ilCtrl->setParameterByClass(
"illmpresentationgui",
"obj_id", $_GET[
"obj_id"]);
2546 $link = $this->ctrl->getLinkTargetByClass(
2547 array(
"illmpresentationgui",
"ilinfoscreengui"),
"showSummary");
2551 $link =
"./info.html";
2554 $tabs_gui->addTarget(($requires_purchase_to_access ?
'buy' :
'info_short'), $link,
2555 "",
"", $buttonTarget, $active[
"info"]);
2559 if (!$a_offline && $ilAccess->checkAccess(
"read",
"", $_GET[
"ref_id"]))
2561 $ilCtrl->setParameterByClass(
"illmpresentationgui",
"obj_id", $_GET[
"obj_id"]);
2562 $tabs_gui->addTarget(
"content",
2563 $ilCtrl->getLinkTargetByClass(
"illmpresentationgui",
"layout"),
2564 "",
"", $buttonTarget, $active[
"content"]);
2568 if (!$requires_purchase_to_access && $this->object->isActiveTOC() && $ilAccess->checkAccess(
"read",
"", $_GET[
"ref_id"]))
2572 $ilCtrl->setParameterByClass(
"illmpresentationgui",
"obj_id", $_GET[
"obj_id"]);
2573 $link = $ilCtrl->getLinkTargetByClass(
"illmpresentationgui",
"showTableOfContents");
2577 $link =
"./table_of_contents.html";
2580 $tabs_gui->addTarget(
"cont_toc", $link,
2581 "",
"", $buttonTarget, $active[
"toc"]);
2585 if (!$requires_purchase_to_access && $this->object->isActivePrintView() && $ilAccess->checkAccess(
"read",
"", $_GET[
"ref_id"]))
2589 $ilCtrl->setParameterByClass(
"illmpresentationgui",
"obj_id", $_GET[
"obj_id"]);
2590 $link = $ilCtrl->getLinkTargetByClass(
"illmpresentationgui",
"showPrintViewSelection");
2591 $tabs_gui->addTarget(
"cont_print_view", $link,
2592 "",
"", $buttonTarget, $active[
"print"]);
2597 if (!$requires_purchase_to_access && $ilUser->getId() == ANONYMOUS_USER_ID)
2599 $is_public = $this->
object->isActiveDownloadsPublic();
2601 else if(!$requires_purchase_to_access)
2606 if (!$requires_purchase_to_access && $this->object->isActiveDownloads() && !$a_offline && $is_public &&
2607 $ilAccess->checkAccess(
"read",
"", $_GET[
"ref_id"]))
2609 $ilCtrl->setParameterByClass(
"illmpresentationgui",
"obj_id", $_GET[
"obj_id"]);
2610 $link = $ilCtrl->getLinkTargetByClass(
"illmpresentationgui",
"showDownloadList");
2611 $tabs_gui->addTarget(
"download", $link,
2612 "",
"", $buttonTarget, $active[
"download"]);
2615 if(!$requires_purchase_to_access)
2619 $entries = $this->lmme_obj->getMenuEntries(
true);
2621 if (count($entries) > 0 && $ilAccess->checkAccess(
"read",
"", $_GET[
"ref_id"]))
2623 foreach ($entries as $entry)
2626 if ($entry[
"type"] ==
"intern")
2628 $entry[
"link"] = ILIAS_HTTP_PATH.
"/goto.php?target=".$entry[
"link"];
2632 if (!strstr($entry[
"link"],
'://') && !strstr($entry[
"link"],
'mailto:'))
2634 $entry[
"link"] =
"http://".$entry[
"link"];
2637 if (!strstr($entry[
"link"],
'mailto:'))
2641 $tabs_gui->addTarget($entry[
"title"],
2643 "",
"",
"_blank",
"",
true);
2648 return $tabs_gui->getHTML();
2656 require_once(
"./Modules/LearningModule/classes/class.ilContObjectExport.php");
2658 $cont_exp->buildExportFile();
2659 $this->offlineList();
2667 require_once(
"./Modules/LearningModule/classes/class.ilContObjectExport.php");
2669 $cont_exp->buildExportFile();
2671 $this->ctrl->redirect($this,
"exportList");
2679 require_once(
"./Modules/LearningModule/classes/class.ilContObjectExport.php");
2681 $cont_exp->buildExportFile();
2683 $this->ctrl->redirect($this,
"exportList");
2697 $this->ctrl->addLocation(
2701 $par_id = $tree->getParentId(
$_GET[
"ref_id"]);
2702 $this->ctrl->addLocation(
2704 "repository.php?cmd=frameset&ref_id=".$par_id,
2706 if (!$a_omit_obj_id)
2710 $lmtree =& $this->
object->getTree();
2714 $path = $lmtree->getPathFull(
$obj_id);
2718 $path = $lmtree->getPathFull($lmtree->getRootId());
2721 $path[] = array(
"type" =>
"pg",
"child" => $this->obj_id,
2728 foreach ($path as $key => $row)
2730 if ($row[
"child"] == 1)
2732 $this->ctrl->setParameter($this,
"obj_id",
"");
2733 $this->ctrl->addLocation(
2734 $this->object->getTitle(),
2735 $this->ctrl->getLinkTarget($this,
"chapters"),
"",
$_GET[
"ref_id"]);
2740 switch($row[
"type"])
2743 $this->ctrl->setParameterByClass(
"ilstructureobjectgui",
"obj_id", $row[
"child"]);
2744 $this->ctrl->addLocation(
2746 $this->ctrl->getLinkTargetByClass(
"ilstructureobjectgui",
"view"));
2750 $this->ctrl->setParameterByClass(
"illmpageobjectgui",
"obj_id", $row[
"child"]);
2751 $this->ctrl->addLocation(
2753 $this->ctrl->getLinkTargetByClass(
"illmpageobjectgui",
"edit"));
2758 if (!$a_omit_obj_id)
2760 $this->ctrl->setParameter($this,
"obj_id",
$_GET[
"obj_id"]);
2771 #include_once("classes/class.ilTabsGUI.php");
2772 #$tabs_gui =& new ilTabsGUI();
2773 $this->
getTabs($this->tabs_gui);
2774 $this->tpl->setCurrentBlock(
"header_image");
2776 $this->tpl->parseCurrentBlock();
2777 $this->tpl->setCurrentBlock(
"content");
2778 #$this->tpl->setVariable("TABS", $tabs_gui->getHTML());
2779 $this->tpl->setVariable(
"HEADER", $this->object->getTitle());
2789 global $rbacsystem,$ilUser;
2795 $tabs_gui->addTarget(
"info_short",
2796 $this->ctrl->getLinkTargetByClass(
"ilinfoscreengui",
'showSummary'),
2797 "",
"ilinfoscreengui");
2800 $tabs_gui->addTarget(
"cont_chapters",
2801 $this->ctrl->getLinkTarget($this,
"chapters"),
2802 "chapters", get_class($this));
2805 $tabs_gui->addTarget(
"cont_all_pages",
2806 $this->ctrl->getLinkTarget($this,
"pages"),
2807 "pages", get_class($this));
2810 $tabs_gui->addTarget(
"properties",
2811 $this->ctrl->getLinkTarget($this,
'properties'),
2812 "properties", get_class($this));
2815 $tabs_gui->addTarget(
"meta_data",
2816 $this->ctrl->getLinkTargetByClass(
'ilmdeditorgui',
''),
2817 "",
"ilmdeditorgui");
2820 $tabs_gui->addTarget(
"cont_links",
2821 $this->ctrl->getLinkTarget($this,
'listLinks'),
2822 "listLinks", get_class($this));
2824 if ($this->object->getType() ==
"lm")
2827 $tabs_gui->addTarget(
"export",
2828 $this->ctrl->getLinkTarget($this,
"exportList"),
2829 array(
"exportList",
"viewExportLog"), get_class($this));
2832 if(@include_once(
'HTTP/Request.php'))
2835 $tabs_gui->addTarget(
"link_check",
2836 $this->ctrl->getLinkTarget($this,
"linkChecker"),
2837 array(
"linkChecker",
"refreshLinkCheck"), get_class($this));
2843 $tabs_gui->addTarget(
"bib_data",
2844 $this->ctrl->getLinkTarget($this,
"editBibItem"),
2845 "editBibItem", get_class($this));
2848 include_once
'./Services/Tracking/classes/class.ilLearningProgressAccess.php';
2851 $tabs_gui->addTarget(
'learning_progress',
2852 $this->ctrl->getLinkTargetByClass(array(
'illearningprogressgui'),
''),
2854 array(
'illplistofobjectsgui',
'illplistofsettingsgui',
'illearningprogressgui',
'illplistofprogressgui',
'illmstatisticsgui'));
2857 $tabs_gui->addTarget(
"history", $this->ctrl->getLinkTarget($this,
"history")
2858 ,
"history", get_class($this));
2862 if ($rbacsystem->checkAccess(
'edit_permission',$this->object->getRefId()))
2864 $tabs_gui->addTarget(
"perm_settings",
2865 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"), array(
"perm",
"info",
"owner"),
'ilpermissiongui');
2873 switch ($this->object->getType())
2876 $gui_class =
"ilobjlearningmodulegui";
2880 $gui_class =
"ilobjdlbookgui";
2887 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.lm_public_selector.html");
2890 require_once (
"./Modules/LearningModule/classes/class.ilPublicSectionSelector.php");
2898 $output = $exp->getOutput();
2901 foreach ($exp->format_options as $node)
2903 if (!$node[
"container"])
2905 $pages[] = $node[
"child"];
2914 $this->tpl->setVariable(
"TXT_SET_PUBLIC_MODE", $this->lng->txt(
"set_public_mode"));
2915 $this->tpl->setVariable(
"TXT_CHOOSE_PUBLIC_MODE", $this->lng->txt(
"choose_public_mode"));
2916 $modes = array(
"complete" => $this->lng->txt(
"all_pages"),
"selected" => $this->lng->txt(
"selected_pages_only"));
2917 $select_public_mode =
ilUtil::formSelect ($this->object->getPublicAccessMode(),
"lm_public_mode",$modes,
false,
true);
2918 $this->tpl->setVariable(
"SELECT_PUBLIC_MODE", $select_public_mode);
2920 $this->tpl->setVariable(
"TXT_EXPLORER_HEADER", $this->lng->txt(
"choose_public_pages"));
2921 $this->tpl->setVariable(
"EXP_REFRESH", $this->lng->txt(
"refresh"));
2922 $this->tpl->setVariable(
"EXPLORER",$output);
2923 $this->tpl->setVariable(
"ONCLICK",$js_pages);
2924 $this->tpl->setVariable(
"TXT_CHECKALL", $this->lng->txt(
"check_all"));
2925 $this->tpl->setVariable(
"TXT_UNCHECKALL", $this->lng->txt(
"uncheck_all"));
2926 $this->tpl->setVariable(
"TXT_SAVE", $this->lng->txt(
"save"));
2927 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getLinkTarget($this,
"savePublicSection"));
2935 $this->
object->setPublicAccessMode($_POST[
"lm_public_mode"]);
2936 $this->
object->updateProperties();
2939 $this->ctrl->redirect($this,
"editPublicSection");
2951 require_once(
"classes/class.ilHistoryGUI.php");
2953 $this->
object->getType());
2955 $this->ctrl->getParameterArray($this,
"history"),
2956 $this->
object->isActiveHistoryUserComments()
2959 $this->tpl->setVariable(
"ADM_CONTENT", $hist_html);
2969 $invalid_links = $this->link_checker_obj->getInvalidLinksFromDB();
2974 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.link_check.html",
"Modules/LearningModule");
2976 if($last_access = $this->link_checker_obj->getLastCheckTimestamp())
2978 $this->tpl->setCurrentBlock(
"LAST_MODIFIED");
2979 $this->tpl->setVariable(
"AS_OF",$this->lng->txt(
'last_change').
": ");
2980 $this->tpl->setVariable(
"LAST_CHECK",date(
'Y-m-d H:i:s',$last_access));
2981 $this->tpl->parseCurrentBlock();
2985 $this->tpl->setVariable(
"F_ACTION",$this->ctrl->getFormAction($this));
2988 $this->tpl->setVariable(
"ALT_IMG",$this->lng->txt(
'learning_module'));
2989 $this->tpl->setVariable(
"TITLE",$this->object->getTitle().
' ('.$this->lng->txt(
'link_check').
')');
2990 $this->tpl->setVariable(
"PAGE_TITLE",$this->lng->txt(
'cont_pg_title'));
2991 $this->tpl->setVariable(
"URL",$this->lng->txt(
'url'));
2992 $this->tpl->setVariable(
"OPTIONS",$this->lng->txt(
'edit'));
2994 if(!count($invalid_links))
2996 $this->tpl->setCurrentBlock(
"no_invalid");
2997 $this->tpl->setVariable(
"TXT_NO_INVALID",$this->lng->txt(
'no_invalid_links'));
2998 $this->tpl->parseCurrentBlock();
3003 foreach($invalid_links as $invalid)
3005 $this->tpl->setCurrentBlock(
"invalid_row");
3007 $this->tpl->setVariable(
"ROW_PAGE_TITLE",
3009 $this->tpl->setVariable(
"ROW_URL",$invalid[
'url']);
3013 $this->ctrl->setParameterByClass(
'ilLMPageObjectGUI',
'obj_id',$invalid[
'page_id']);
3014 $this->tpl->setVariable(
"ROW_EDIT_LINK",$this->ctrl->getLinkTargetByClass(
'ilLMPageObjectGUI',
'edit'));
3017 $this->tpl->setVariable(
"ROW_ALT_IMG",$this->lng->txt(
'edit'));
3018 $this->tpl->parseCurrentBlock();
3021 if((
bool) $ilias->getSetting(
'cron_link_check'))
3023 include_once
'./classes/class.ilLinkCheckNotify.php';
3026 $this->tpl->setCurrentBlock(
"MESSAGE_BLOCK");
3027 $this->tpl->setVariable(
"INFO_MESSAGE",$this->lng->txt(
'link_check_message_a'));
3030 'link_check_message',
3032 $this->tpl->setVariable(
"INFO_MESSAGE_LONG",$this->lng->txt(
'link_check_message_b'));
3033 $this->tpl->parseCurrentBlock();
3036 $this->tpl->setCurrentBlock(
"CRON_ENABLED");
3038 $this->tpl->setVariable(
"BTN_SUBMIT_LINK_CHECK",$this->lng->txt(
'save'));
3039 $this->tpl->parseCurrentBlock();
3041 $this->tpl->setVariable(
"BTN_REFRESH",$this->lng->txt(
'refresh'));
3048 global $ilDB,$ilUser;
3050 include_once
'./classes/class.ilLinkCheckNotify.php';
3053 $link_check_notify->setUserId($ilUser->getId());
3054 $link_check_notify->setObjId($this->object->getId());
3056 if($_POST[
'link_check_message'])
3059 $link_check_notify->addNotifier();
3064 $link_check_notify->deleteNotifier();
3077 if(!$this->link_checker_obj->checkPear())
3085 $this->link_checker_obj->checkLinks();
3097 include_once
'./classes/class.ilLinkChecker.php';
3100 $this->link_checker_obj->setObjId($this->object->getId());
3107 include_once
'./Modules/LearningModule/classes/class.ilLMMenuEditor.php';
3110 $this->lmme_obj->setObjId($this->object->getId());
3122 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.lm_menu_entry_form.html",
"Modules/LearningModule");
3124 if (isset(
$_GET[
"link_ref_id"]))
3130 $target_link = $obj_type.
"_".
$_GET[
"link_ref_id"];
3131 $this->tpl->setVariable(
"TITLE",
$title);
3132 $this->tpl->setVariable(
"TARGET", $target_link);
3133 $this->tpl->setVariable(
"LINK_REF_ID",
$_GET[
"link_ref_id"]);
3137 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this,
"saveMenuEntry"));
3138 $this->tpl->setVariable(
"TXT_NEW_ENTRY", $this->lng->txt(
"lm_menu_new_entry"));
3139 $this->tpl->setVariable(
"TXT_TARGET", $this->lng->txt(
"lm_menu_entry_target"));
3140 $this->tpl->setVariable(
"TXT_TITLE", $this->lng->txt(
"lm_menu_entry_title"));
3141 $this->tpl->setVariable(
"BTN_NAME",
"saveMenuEntry");
3142 $this->tpl->setVariable(
"BTN_TEXT", $this->lng->txt(
"save"));
3143 $this->tpl->setVariable(
"BTN_NAME2",
"showEntrySelector");
3144 $this->tpl->setVariable(
"BTN_TEXT2", $this->lng->txt(
"lm_menu_select_internal_object"));
3157 if (empty($_POST[
"title"]))
3161 $ilCtrl->redirect($this,
"addMenuEntry");
3163 if (empty($_POST[
"target"]))
3167 $ilCtrl->redirect($this,
"addMenuEntry");
3171 $this->lmme_obj->setTitle($_POST[
"title"]);
3172 $this->lmme_obj->setTarget($_POST[
"target"]);
3173 $this->lmme_obj->setLinkRefId($_POST[
"link_ref_id"]);
3175 if ($_POST[
"link_ref_id"])
3177 $this->lmme_obj->setLinkType(
"intern");
3180 $this->lmme_obj->create();
3183 $this->ctrl->redirect($this,
"properties");
3191 if (empty(
$_GET[
"menu_entry"]))
3193 $this->ilias->raiseError($this->lng->txt(
"no_menu_entry_id"),$this->ilias->error_obj->MESSAGE);
3197 $this->lmme_obj->delete(
$_GET[
"menu_entry"]);
3200 $this->ctrl->redirect($this,
"properties");
3208 if (empty(
$_GET[
"menu_entry"]))
3210 $this->ilias->raiseError($this->lng->txt(
"no_menu_entry_id"),$this->ilias->error_obj->MESSAGE);
3214 $this->lmme_obj->readEntry(
$_GET[
"menu_entry"]);
3218 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.lm_menu_entry_form.html",
"Modules/LearningModule");
3220 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
3221 $this->tpl->setVariable(
"TXT_NEW_ENTRY", $this->lng->txt(
"lm_menu_edit_entry"));
3222 $this->tpl->setVariable(
"TXT_TARGET", $this->lng->txt(
"lm_menu_entry_target"));
3223 $this->tpl->setVariable(
"TXT_TITLE", $this->lng->txt(
"lm_menu_entry_title"));
3224 $this->tpl->setVariable(
"TITLE", $this->lmme_obj->getTitle());
3225 $this->tpl->setVariable(
"TARGET", $this->lmme_obj->getTarget());
3226 $this->tpl->setVariable(
"ENTRY_ID", $this->lmme_obj->getEntryId());
3227 $this->tpl->setVariable(
"BTN_NAME",
"updateMenuEntry");
3228 $this->tpl->setVariable(
"BTN_TEXT", $this->lng->txt(
"save"));
3229 $this->tpl->setVariable(
"BTN_NAME2",
"showEntrySelector");
3230 $this->tpl->setVariable(
"BTN_TEXT2", $this->lng->txt(
"lm_menu_select_internal_object"));
3239 if (empty($_POST[
"menu_entry"]))
3241 $this->ilias->raiseError($this->lng->txt(
"no_menu_entry_id"),$this->ilias->error_obj->MESSAGE);
3245 if (empty($_POST[
"title"]))
3247 $this->ilias->raiseError($this->lng->txt(
"please_enter_title"),$this->ilias->error_obj->MESSAGE);
3249 if (empty($_POST[
"target"]))
3251 $this->ilias->raiseError($this->lng->txt(
"please_enter_target"),$this->ilias->error_obj->MESSAGE);
3255 $this->lmme_obj->readEntry($_POST[
"menu_entry"]);
3256 $this->lmme_obj->setTitle($_POST[
"title"]);
3257 $this->lmme_obj->setTarget($_POST[
"target"]);
3258 $this->lmme_obj->update();
3261 $this->ctrl->redirect($this,
"properties");
3268 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.lm_menu_object_selector.html",
"Modules/LearningModule");
3272 require_once (
"./Modules/LearningModule/classes/class.ilLMMenuObjectSelector.php");
3275 $exp->
setExpand(
$_GET[
"lm_menu_expand"] ?
$_GET[
"lm_menu_expand"] : $this->tree->readRootId());
3276 $exp->setExpandTarget($this->ctrl->getLinkTarget($this,
'showEntrySelector'));
3277 $exp->setTargetGet(
"ref_id");
3278 $exp->setRefId($this->cur_ref_id);
3280 $sel_types = array(
'lm',
'dbk',
'glo',
'frm',
'exc',
'tst',
'svy');
3281 $exp->setSelectableTypes($sel_types);
3287 $output = $exp->getOutput();
3290 foreach ($exp->format_options as $node)
3292 if (!$node[
"container"])
3294 $pages[] = $node[
"child"];
3301 $this->tpl->setVariable(
"TXT_SET_PUBLIC_MODE", $this->lng->txt(
"set_public_mode"));
3302 $this->tpl->setVariable(
"TXT_CHOOSE_PUBLIC_MODE", $this->lng->txt(
"choose_public_mode"));
3303 $modes = array(
"complete" => $this->lng->txt(
"all_pages"),
"selected" => $this->lng->txt(
"selected_pages_only"));
3304 $select_public_mode =
ilUtil::formSelect ($this->object->getPublicAccessMode(),
"lm_public_mode",$modes,
false,
true);
3305 $this->tpl->setVariable(
"SELECT_PUBLIC_MODE", $select_public_mode);
3307 $this->tpl->setVariable(
"TXT_EXPLORER_HEADER", $this->lng->txt(
"choose_public_pages"));
3308 $this->tpl->setVariable(
"EXP_REFRESH", $this->lng->txt(
"refresh"));
3309 $this->tpl->setVariable(
"EXPLORER",$output);
3310 $this->tpl->setVariable(
"ONCLICK",$js_pages);
3311 $this->tpl->setVariable(
"TXT_CHECKALL", $this->lng->txt(
"check_all"));
3312 $this->tpl->setVariable(
"TXT_UNCHECKALL", $this->lng->txt(
"uncheck_all"));
3313 $this->tpl->setVariable(
"TXT_SAVE", $this->lng->txt(
"save"));
3314 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getLinkTarget($this,
"savePublicSection"));
3323 if(!isset($_POST[
"id"]))
3325 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
3327 if(count($_POST[
"id"]) > 1)
3329 $this->ilias->raiseError($this->lng->txt(
"cont_select_max_one_item"),$this->ilias->error_obj->MESSAGE);
3331 if ($_POST[
"id"][0] != $this->object->getHeaderPage())
3333 $this->
object->setHeaderPage($_POST[
"id"][0]);
3337 $this->
object->setHeaderPage(0);
3339 $this->
object->updateProperties();
3340 $this->ctrl->redirect($this,
"pages");
3348 if(!isset($_POST[
"id"]))
3350 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
3352 if(count($_POST[
"id"]) > 1)
3354 $this->ilias->raiseError($this->lng->txt(
"cont_select_max_one_item"),$this->ilias->error_obj->MESSAGE);
3356 if ($_POST[
"id"][0] != $this->object->getFooterPage())
3358 $this->
object->setFooterPage($_POST[
"id"][0]);
3362 $this->
object->setFooterPage(0);
3364 $this->
object->updateProperties();
3365 $this->ctrl->redirect($this,
"pages");
3377 $ilCtrl->redirect($this,
"chapters");
3387 include_once(
"./Modules/LearningModule/classes/class.ilChapterHierarchyFormGUI.php");
3394 $parent_id = $this->lm_tree->getParentId($node_id);
3399 $parent_id = $node_id;
3403 for ($i = 1; $i <= $num; $i++)
3406 $chap->setType(
"st");
3407 $chap->setTitle(
"");
3408 $chap->setLMId($this->object->getId());
3413 $ilCtrl->redirect($this,
"chapters");
3423 include_once(
"./Modules/LearningModule/classes/class.ilChapterHierarchyFormGUI.php");
3425 if ($ilUser->getPref(
"lm_js_chapter_editing") !=
"disable")
3433 if (!isset($_POST[
"id"]) || $_POST[
"id"][0] == -1)
3435 $node_id = $this->lm_tree->getRootId();
3436 $first_child =
true;
3440 $node_id = $_POST[
"id"][0];
3441 $first_child =
false;
3445 $ilLog->write(
"InsertChapterClip, num: $num, node_id: $node_id, ".
3450 $parent_id = $this->lm_tree->getParentId($node_id);
3455 $parent_id = $node_id;
3460 $chapters = $ilUser->getClipboardObjects(
"st",
true);
3461 $copied_nodes = array();
3462 foreach ($chapters as $chap)
3464 $ilLog->write(
"Call pasteTree, Target LM: ".$this->object->getId().
", Chapter ID: ".$chap[
"id"]
3465 .
", Parent ID: ".$parent_id.
", Target: ".$target);
3467 $target, $chap[
"insert_time"], $copied_nodes,
3475 $ilUser->clipboardDeleteObjectsOfType(
"pg");
3476 $ilUser->clipboardDeleteObjectsOfType(
"st");
3480 $this->
object->checkTree();
3481 $ilCtrl->redirect($this,
"chapters");
3493 if ($ilAccess->checkAccess(
"read",
"", $a_target))
3495 $_GET[
"baseClass"] =
"ilLMPresentationGUI";
3496 $_GET[
"ref_id"] = $a_target;
3497 include(
"ilias.php");
3499 }
else if ($ilAccess->checkAccess(
"visible",
"", $a_target))
3501 $_GET[
"baseClass"] =
"ilLMPresentationGUI";
3502 $_GET[
"ref_id"] = $a_target;
3503 $_GET[
"cmd"] =
"infoScreen";
3504 include(
"ilias.php");
3507 else if ($ilAccess->checkAccess(
"read",
"", ROOT_FOLDER_ID))
3509 $_GET[
"cmd"] =
"frameset";
3510 $_GET[
"target"] =
"";
3511 $_GET[
"ref_id"] = ROOT_FOLDER_ID;
3514 include(
"repository.php");
3519 $ilErr->raiseError($lng->txt(
"msg_no_perm_read_lm"), $ilErr->FATAL);
3530 if (!is_array($items))
3533 $ilCtrl->redirect($this, $a_return);
3537 foreach($items as $k => $item)
3544 foreach($todel as $k)
3552 $ilCtrl->redirect($this, $a_return);
3563 if (!is_array($items))
3566 $ilCtrl->redirect($this,
"chapters");
3570 foreach($items as $k => $item)
3577 foreach($todel as $k)
3584 $ilCtrl->redirect($this,
"chapters");