4 include_once
"classes/class.ilObjectGUI.php";
5 include_once
"./Modules/LearningModule/classes/class.ilObjContentObject.php";
6 include_once (
"./Modules/LearningModule/classes/class.ilLMPageObjectGUI.php");
7 include_once (
"./Modules/LearningModule/classes/class.ilStructureObjectGUI.php");
8 require_once
'Services/LinkChecker/interfaces/interface.ilLinkCheckerGUIRowHandling.php';
35 $lng->loadLanguageModule(
"content");
44 global $ilAccess,
$lng;
46 if ($this->ctrl->getRedirectSource() ==
"ilinternallinkgui")
52 if ($this->ctrl->getCmdClass() ==
"ilinternallinkgui")
54 $this->ctrl->setReturn($this,
"explorer");
58 $next_class = $this->ctrl->getNextClass($this);
61 $cmd = $this->ctrl->getCmd(
"", array(
"downloadExportFile"));
65 case "illearningprogressgui":
67 include_once
'./Services/Tracking/classes/class.ilLearningProgressGUI.php';
72 $this->ctrl->forwardCommand($new_gui);
78 include_once
'Services/MetaData/classes/class.ilMDEditorGUI.php';
80 $md_gui =&
new ilMDEditorGUI($this->object->getId(), 0, $this->
object->getType());
81 $md_gui->
addObserver($this->
object,
'MDUpdateListener',
'General');
83 $this->ctrl->forwardCommand($md_gui);
86 case "ilobjstylesheetgui":
88 include_once (
"./Services/Style/classes/class.ilObjStyleSheetGUI.php");
89 $this->ctrl->setReturn($this,
"editStyleProperties");
90 $style_gui =&
new ilObjStyleSheetGUI(
"", $this->object->getStyleSheetId(),
false,
false);
92 if (
$cmd ==
"create" ||
$_GET[
"new_type"]==
"sty")
94 $style_gui->setCreationMode(
true);
96 $ret =& $this->ctrl->forwardCommand($style_gui);
99 if (
$cmd ==
"save" ||
$cmd ==
"copyStyle" ||
$cmd ==
"importStyle")
102 $this->
object->setStyleSheetId($style_id);
103 $this->
object->update();
104 $this->ctrl->redirectByClass(
"ilobjstylesheetgui",
"edit");
108 case "illmpageobjectgui":
109 $this->ctrl->saveParameter($this, array(
"obj_id"));
111 $this->ctrl->setReturn($this,
"chapters");
116 if (
$_GET[
"obj_id"] !=
"")
119 $pg_gui->setLMPageObject($obj);
122 $ret =& $this->ctrl->forwardCommand($pg_gui);
123 if (
$cmd ==
"save" ||
$cmd ==
"cancel")
129 case "ilstructureobjectgui":
130 $this->ctrl->saveParameter($this, array(
"obj_id"));
132 $this->ctrl->setReturn($this,
"chapters");
134 if (
$_GET[
"obj_id"] !=
"")
137 $st_gui->setStructureObject($obj);
140 $ret =& $this->ctrl->forwardCommand($st_gui);
141 if (
$cmd ==
"save" ||
$cmd ==
"cancel")
143 if (
$_GET[
"obj_id"] ==
"")
145 $this->ctrl->redirect($this,
"chapters");
149 $this->ctrl->setCmd(
"subchap");
155 case 'ilpermissiongui':
156 if (strtolower(
$_GET[
"baseClass"]) ==
"iladministrationgui")
165 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
167 $ret =& $this->ctrl->forwardCommand($perm_gui);
171 case 'ilinfoscreengui':
174 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
176 $info->enablePrivateNotes();
177 $info->enableLearningProgress();
180 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"]))
182 $info->enableNewsEditing();
183 $info->setBlockProperty(
"news",
"settings",
true);
187 $info->addMetaDataSections($this->object->getId(), 0,
188 $this->
object->getType());
190 $ret =& $this->ctrl->forwardCommand($info);
196 include_once(
"./Services/Export/classes/class.ilExportGUI.php");
198 $exp_gui->addFormat(
"xml",
"", $this,
"export");
199 $exp_gui->addFormat(
"html",
"", $this,
"exportHTML");
200 $exp_gui->addFormat(
"scorm",
"", $this,
"exportSCORM");
201 $exp_gui->addCustomColumn($lng->txt(
"cont_public_access"),
202 $this,
"getPublicAccessColValue");
203 $exp_gui->addCustomMultiCommand($lng->txt(
"cont_public_access"),
204 $this,
"publishExportFile");
205 $ret = $this->ctrl->forwardCommand($exp_gui);
210 $new_type =
$_POST[
"new_type"]
215 if (
$cmd ==
"create" &&
216 !in_array($new_type, array(
"dbk",
"lm")))
223 $this->ctrl->setCmdClass(
"ilLMPageObjectGUI");
229 $this->ctrl->setCmdClass(
"ilStructureObjectGUI");
238 in_array($new_type, array(
"dbk",
"lm")))
261 return array(
"ilLMPageObjectGUI",
"ilStructureObjectGUI",
"ilObjStyleSheetGUI");
271 $lng->loadLanguageModule(
"style");
276 $showViewInFrameset =
true;
278 if ($showViewInFrameset)
284 $buttonTarget =
"ilContObj".$this->object->getID();
288 $this->tpl->addBlockfile(
"BUTTONS",
"buttons",
"tpl.buttons.html");
291 $this->tpl->setCurrentBlock(
"btn_cell");
292 $this->tpl->setVariable(
"BTN_LINK",
"ilias.php?baseClass=ilLMPresentationGUI&ref_id=".$this->object->getRefID());
293 $this->tpl->setVariable(
"BTN_TARGET",
" target=\"".$buttonTarget.
"\" ");
294 $this->tpl->setVariable(
"BTN_TXT",$this->lng->txt(
"view"));
295 $this->tpl->parseCurrentBlock();
297 $this->tpl->setCurrentBlock(
"btn_cell");
298 $this->tpl->setVariable(
"BTN_LINK", $this->ctrl->getLinkTarget($this,
"fixTreeConfirm"));
300 $this->tpl->setVariable(
"BTN_TXT", $this->lng->txt(
"cont_fix_tree"));
301 $this->tpl->parseCurrentBlock();
308 $this->tpl->setContent($this->form->getHTML());
318 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
327 $this->form->addItem($ti);
334 $this->form->addItem($ta);
338 $this->form->addItem($online);
350 $option[
$l] =
"<table><tr><td>".$im_tag.
"</td><td><b>".$lng->txt(
"cont_layout_".$l).
"</b>: ".$lng->txt(
"cont_layout_".$l.
"_desc").
"</td></tr></table>";
353 $this->form->addItem($layout);
356 $page_header =
new ilSelectInputGUI($lng->txt(
"cont_page_header"),
"lm_pg_header");
357 $option = array (
"st_title" => $this->lng->txt(
"cont_st_title"),
358 "pg_title" => $this->lng->txt(
"cont_pg_title"),
359 "none" => $this->lng->txt(
"cont_none"));
361 $this->form->addItem($page_header);
365 $this->form->addItem($chap_num);
369 $option = array (
"chapters" => $this->lng->txt(
"cont_chapters_only"),
370 "pages" => $this->lng->txt(
"cont_chapters_and_pages"));
372 $this->form->addItem($toc_mode);
375 if (!$this->ilias->getSetting(
'disable_notes'))
377 $pub_nodes =
new ilCheckboxInputGUI($lng->txt(
"cont_public_notes"),
"cobj_pub_notes");
378 $pub_nodes->
setInfo($this->lng->txt(
"cont_public_notes_desc"));
379 $this->form->addItem($pub_nodes);
384 $lpp->
setInfo($this->lng->txt(
"cont_layout_per_page_info"));
385 $this->form->addItem($lpp);
388 $synch =
new ilCheckboxInputGUI($lng->txt(
"cont_synchronize_frames"),
"cobj_clean_frames");
389 $synch->
setInfo($this->lng->txt(
"cont_synchronize_frames_desc"));
390 $this->form->addItem($synch);
393 $com =
new ilCheckboxInputGUI($lng->txt(
"enable_hist_user_comments"),
"cobj_user_comments");
394 $com->
setInfo($this->lng->txt(
"enable_hist_user_comments_desc"));
395 $this->form->addItem($com);
397 $this->form->setTitle($lng->txt(
"cont_general_properties"));
398 $this->form->addCommandButton(
"saveProperties", $lng->txt(
"save"));
399 $this->form->setFormAction($ilCtrl->getFormAction($this));
408 $values[
"title"] = $this->
object->getTitle();
409 $values[
"description"] = $this->
object->getDescription();
410 if ($this->object->getOnline())
412 $values[
"cobj_online"] =
true;
414 $values[
"lm_layout"] = $this->
object->getLayout();
415 $values[
"lm_pg_header"] = $this->
object->getPageHeader();
416 if ($this->object->isActiveNumbering())
418 $values[
"cobj_act_number"] =
true;
420 $values[
"toc_mode"] = $this->
object->getTOCMode();
421 if ($this->object->publicNotes())
423 $values[
"cobj_pub_notes"] =
true;
425 if ($this->object->cleanFrames())
427 $values[
"cobj_clean_frames"] =
true;
429 if ($this->object->isActiveHistoryUserComments())
431 $values[
"cobj_user_comments"] =
true;
433 $values[
"layout_per_page"] = $this->
object->getLayoutPerPage();
435 $this->form->setValuesByArray($values);
446 if ($this->form->checkInput())
448 $this->
object->setTitle(
$_POST[
'title']);
449 $this->
object->setDescription(
$_POST[
'description']);
450 $this->
object->setLayout(
$_POST[
"lm_layout"]);
451 $this->
object->setPageHeader(
$_POST[
"lm_pg_header"]);
452 $this->
object->setTOCMode(
$_POST[
"toc_mode"]);
453 $this->
object->setOnline(
$_POST[
"cobj_online"]);
454 $this->
object->setActiveNumbering(
$_POST[
"cobj_act_number"]);
455 $this->
object->setCleanFrames(
$_POST[
"cobj_clean_frames"]);
456 $this->
object->setPublicNotes(
$_POST[
"cobj_pub_notes"]);
457 $this->
object->setHistoryUserComments(
$_POST[
"cobj_user_comments"]);
458 $this->
object->setLayoutPerPage(
$_POST[
"layout_per_page"]);
459 $this->
object->updateProperties();
460 $this->
object->update();
462 $this->ctrl->redirect($this,
"properties");
466 $this->form->setValuesByPost();
467 $tpl->setContent($this->form->getHTML());
479 $tpl->setContent($this->form->getHTML());
489 $lng->loadLanguageModule(
"style");
491 $ilTabs->setTabActive(
"settings");
494 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
497 $fixed_style = $ilSetting->get(
"fixed_content_style_id");
498 $style_id = $this->
object->getStyleSheetId();
500 if ($fixed_style > 0)
504 $this->lng->txt(
"global_fixed").
")");
505 $this->form->addItem($st);
512 $st_styles[0] = $this->lng->txt(
"default");
522 $this->form->addItem($st);
527 $this->form->addCommandButton(
"editStyle",
528 $lng->txt(
"cont_edit_style"));
529 $this->form->addCommandButton(
"deleteStyle",
530 $lng->txt(
"cont_delete_style"));
538 $st_styles,
false,
true);
539 $style_sel =
new ilSelectInputGUI($lng->txt(
"cont_current_style"),
"style_id");
541 $style_sel->setValue($style_id);
542 $this->form->addItem($style_sel);
544 $this->form->addCommandButton(
"saveStyleSettings",
546 $this->form->addCommandButton(
"createStyle",
547 $lng->txt(
"sty_create_ind_style"));
550 $this->form->setTitle($lng->txt(
"cont_style"));
551 $this->form->setFormAction($ilCtrl->getFormAction($this));
561 $ilCtrl->redirectByClass(
"ilobjstylesheetgui",
"create");
571 $ilCtrl->redirectByClass(
"ilobjstylesheetgui",
"edit");
581 $ilCtrl->redirectByClass(
"ilobjstylesheetgui",
"delete");
591 if ($ilSetting->get(
"fixed_content_style_id") <= 0 &&
593 || $this->object->getStyleSheetId() == 0))
596 $this->
object->update();
599 $this->ctrl->redirect($this,
"editStyleProperties");
609 $lng->loadLanguageModule(
"style");
611 $ilTabs->setTabActive(
"settings");
615 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.lm_properties.html",
"Modules/LearningModule");
616 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
618 $this->tpl->setVariable(
"TXT_LM_MENU", $this->lng->txt(
"cont_lm_menu"));
619 $this->tpl->setVariable(
"TXT_ACT_MENU", $this->lng->txt(
"cont_active"));
620 $this->tpl->setVariable(
"CBOX_LM_MENU",
"cobj_act_lm_menu");
621 $this->tpl->setVariable(
"VAL_LM_MENU",
"y");
622 if ($this->object->isActiveLMMenu())
624 $this->tpl->setVariable(
"CHK_LM_MENU",
"checked");
628 $this->tpl->setVariable(
"TXT_TOC", $this->lng->txt(
"cont_toc"));
629 $this->tpl->setVariable(
"CBOX_TOC",
"cobj_act_toc");
630 $this->tpl->setVariable(
"VAL_TOC",
"y");
631 if ($this->object->isActiveTOC())
633 $this->tpl->setVariable(
"CHK_TOC",
"checked");
637 $this->tpl->setVariable(
"TXT_PRINT", $this->lng->txt(
"cont_print_view"));
638 $this->tpl->setVariable(
"CBOX_PRINT",
"cobj_act_print");
639 $this->tpl->setVariable(
"VAL_PRINT",
"y");
640 if ($this->object->isActivePrintView())
642 $this->tpl->setVariable(
"CHK_PRINT",
"checked");
646 $this->tpl->setVariable(
"TXT_PRINT_PREV_GLO", $this->lng->txt(
"cont_print_view_pre_glo"));
647 $this->tpl->setVariable(
"CBOX_PRINT_PREV_GLO",
"cobj_act_print_prev_glo");
648 $this->tpl->setVariable(
"VAL_PRINT_PREV_GLO",
"y");
649 if ($this->object->isActivePreventGlossaryAppendix())
651 $this->tpl->setVariable(
"CHK_PRINT_PREV_GLO",
"checked");
655 $no_download_file_available =
656 " ".$lng->txt(
"cont_no_download_file_available").
657 " <a href='".$ilCtrl->getLinkTargetByClass(
"ilexportgui",
"").
"'>".$lng->txt(
"change").
"</a>";
658 $types = array(
"xml",
"html",
"scorm");
659 foreach($types as
$type)
661 if ($this->object->getPublicExportFile($type) !=
"")
663 if (is_file($this->object->getExportDirectory($type).
"/".
664 $this->
object->getPublicExportFile($type)))
666 $no_download_file_available =
"";
670 $this->tpl->setVariable(
"TXT_DOWNLOADS", $this->lng->txt(
"cont_downloads"));
671 $this->tpl->setVariable(
"TXT_DOWNLOADS_DESC", $this->lng->txt(
"cont_downloads_desc").$no_download_file_available);
672 $this->tpl->setVariable(
"CBOX_DOWNLOADS",
"cobj_act_downloads");
673 $this->tpl->setVariable(
"VAL_DOWNLOADS",
"y");
675 if ($this->object->isActiveDownloads())
677 $this->tpl->setVariable(
"CHK_DOWNLOADS",
"checked=\"checked\"");
680 $this->tpl->setVariable(
"TXT_DOWNLOADS_PUBLIC_DESC", $this->lng->txt(
"cont_downloads_public_desc"));
681 $this->tpl->setVariable(
"CBOX_DOWNLOADS_PUBLIC",
"cobj_act_downloads_public");
682 $this->tpl->setVariable(
"VAL_DOWNLOADS_PUBLIC",
"y");
684 if ($this->object->isActiveDownloadsPublic())
686 $this->tpl->setVariable(
"CHK_DOWNLOADS_PUBLIC",
"checked=\"checked\"");
689 if (!$this->object->isActiveDownloads())
691 $this->tpl->setVariable(
"CHK2_DOWNLOADS_PUBLIC",
"disabled=\"disabled\"");
696 $entries = $this->lmme_obj->getMenuEntries();
698 if (count($entries) > 0)
700 foreach ($entries as $entry)
702 $this->ctrl->setParameter($this,
"menu_entry", $entry[
"id"]);
704 $this->tpl->setCurrentBlock(
"menu_entries");
706 if ($entry[
"type"] ==
"intern")
708 $entry[
"link"] = ILIAS_HTTP_PATH.
"/goto.php?target=".$entry[
"link"];
712 if (!strstr($entry[
"link"],
'://') && !strstr($entry[
"link"],
'mailto:'))
714 $entry[
"link"] =
"http://".$entry[
"link"];
717 $this->tpl->setVariable(
"ENTRY_LINK", $entry[
"link"]);
718 $this->tpl->setVariable(
"ENTRY_TITLE", $entry[
"title"]);
720 $this->tpl->setVariable(
"CBOX_ENTRY",
"menu_entries[]");
721 $this->tpl->setVariable(
"VAL_ENTRY", $entry[
"id"]);
725 $this->tpl->setVariable(
"CHK_ENTRY",
"checked=\"checked\"");
729 $this->tpl->setVariable(
"LINK_EDIT", $this->ctrl->getLinkTarget($this,
"editMenuEntry"));
730 $this->tpl->setVariable(
"TARGET_EDIT",
"content");
731 $this->tpl->setVariable(
"TXT_EDIT", $this->lng->txt(
"edit"));
734 $this->tpl->setVariable(
"LINK_DROP", $this->ctrl->getLinkTarget($this,
"deleteMenuEntry"));
735 $this->tpl->setVariable(
"TARGET_DROP",
"content");
736 $this->tpl->setVariable(
"TXT_DROP", $this->lng->txt(
"drop"));
739 $this->tpl->parseCurrentBlock();
746 $this->tpl->setCurrentBlock(
"commands");
747 $this->tpl->setVariable(
"BTN_NAME",
"saveMenuProperties");
748 $this->tpl->setVariable(
"BTN_TEXT", $this->lng->txt(
"save"));
749 $this->tpl->setVariable(
"BTN_NAME2",
"addMenuEntry");
750 $this->tpl->setVariable(
"BTN_TEXT2", $this->lng->txt(
"add_menu_entry"));
751 $this->tpl->parseCurrentBlock();
764 $this->
object->setActivePreventGlossaryAppendix(
ilUtil::yn2tf(
$_POST[
"cobj_act_print_prev_glo"]));
766 $this->
object->setActiveDownloadsPublic(
ilUtil::yn2tf(
$_POST[
"cobj_act_downloads_public"]));
767 $this->
object->updateProperties();
771 $this->lmme_obj->updateActiveStatus(
$_POST[
"menu_entries"]);
774 $this->ctrl->redirect($this,
"editMenuProperties");
784 switch ($this->object->getType())
787 $gui_class =
"ilobjlearningmodulegui";
791 $gui_class =
"ilobjdlbookgui";
795 $ilCtrl->setParameterByClass($gui_class,
"active_node",
$_GET[
"active_node"]);
797 $this->tpl =
new ilTemplate(
"tpl.main.html",
true,
true);
804 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.explorer.html");
807 require_once (
"./Modules/LearningModule/classes/class.ilLMEditorExplorer.php");
812 $exp->setExpandTarget($this->ctrl->getLinkTarget($this,
"explorer"));
814 if (
$_GET[
"lmmovecopy"] ==
"1")
820 if (
$_GET[
"lmexpand"] ==
"")
822 $mtree =
new ilTree($this->object->getId());
824 $mtree->setTreeTablePK(
"lm_id");
825 $expanded = $mtree->readRootId();
829 $expanded =
$_GET[
"lmexpand"];
831 if (
$_GET[
"active_node"] !=
"")
833 $path = $this->lm_tree->getPathId(
$_GET[
"active_node"]);
834 $exp->setForceOpenPath(
$path);
836 $exp->highlightNode(
$_GET[
"active_node"]);
838 $exp->setExpand($expanded);
842 $output = $exp->getOutput();
845 if ($ilCtrl->isAsynch())
850 include_once(
"./Services/COPage/classes/class.ilPageEditorGUI.php");
869 $this->tpl->setCurrentBlock(
"content");
870 $this->tpl->setVariable(
"TXT_EXPLORER_HEADER", $this->lng->txt(
"cont_chap_and_pages"));
871 $this->tpl->setVariable(
"EXP_REFRESH", $this->lng->txt(
"refresh"));
872 $this->tpl->setVariable(
"EXPLORER",$output);
873 $this->ctrl->setParameter($this,
"lmexpand",
$_GET[
"lmexpand"]);
874 $this->tpl->setVariable(
"ACTION", $this->ctrl->getLinkTarget($this,
"explorer"));
875 $this->tpl->parseCurrentBlock();
876 $this->tpl->show(
false);
885 include_once
"./Services/COPage/classes/class.ilWysiwygUtil.php";
887 $popup->show(
$_GET[
"ptype"]);
898 $this->
object->executeDragDrop(
$_POST[
"il_hform_source_id"],
$_POST[
"il_hform_target_id"],
900 $ilCtrl->redirect($this,
"chapters");
908 global $rbacsystem,
$tpl;
912 if (!$rbacsystem->checkAccess(
"create",
$_GET[
"ref_id"], $new_type))
914 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
919 $f1 = $this->form->getHTML();
921 $f2 = $this->form->getHTML();
922 $this->tpl->setContent($f1.
"<br />".$f2);
929 $data[
"fields"] = array();
935 $this->tpl->setVariable(
"TYPE_IMG",
937 $this->tpl->setVariable(
"ALT_IMG",
938 $this->lng->txt(
"obj_".$new_type));
940 foreach (
$data[
"fields"] as $key => $val)
942 $this->tpl->setVariable(
"TXT_".strtoupper($key), $this->lng->txt($key));
943 $this->tpl->setVariable(strtoupper($key), $val);
945 if ($this->prepare_output)
947 $this->tpl->parseCurrentBlock();
955 $this->ctrl->setParameter($this,
"new_type", $new_type);
956 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this,
"save"));
959 $this->tpl->setVariable(
"TXT_HEADER", $this->lng->txt($new_type.
"_new"));
960 $this->tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
961 $this->tpl->setVariable(
"TXT_SUBMIT", $this->lng->txt($new_type.
"_add"));
962 $this->tpl->setVariable(
"CMD_SUBMIT",
"save");
963 $this->tpl->setVariable(
"TARGET",
' target="'.
965 $this->tpl->setVariable(
"TXT_REQUIRED_FLD", $this->lng->txt(
"required_field"));
967 $this->tpl->setVariable(
"TXT_IMPORT_LM", $this->lng->txt(
"import_".$new_type));
968 $this->tpl->setVariable(
"TXT_LM_FILE", $this->lng->txt(
"file"));
969 $this->tpl->setVariable(
"TXT_IMPORT", $this->lng->txt(
"import"));
972 $umf=get_cfg_var(
"upload_max_filesize");
974 $pms=get_cfg_var(
"post_max_size");
977 $max_filesize = ((int) $umf < (
int) $pms)
980 if ((
int) $pms == 0) $max_filesize = $umf;
982 if (!$max_filesize) $max_filesize=max($umf, $pms);
985 $this->tpl->setVariable(
"TXT_FILE_INFO", $this->lng->txt(
"file_notice").
" $max_filesize.");
999 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
1003 $this->ctrl->setParameter($this,
"new_type", $new_type);
1006 $this->form->setTableWidth(
"600px");
1011 $ti->setRequired(
true);
1013 $this->form->addItem($ti);
1019 $this->form->addItem($ta);
1021 $this->form->addCommandButton(
"save", $this->lng->txt($new_type.
"_add"));
1022 $this->form->addCommandButton(
"cancel", $lng->txt(
"cancel"));
1023 $this->form->
setTitle($this->lng->txt($new_type.
"_new"));
1024 $this->form->setFormAction($this->ctrl->getFormAction($this,
"save"));
1034 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
1038 $this->ctrl->setParameter($this,
"new_type", $new_type);
1041 $this->form->setTableWidth(
"600px");
1046 $fi->setRequired(
true);
1048 $this->form->addItem($fi);
1052 $cb->
setInfo($this->lng->txt(
""));
1053 $this->form->addItem($cb);
1055 $this->form->addCommandButton(
"importFile", $lng->txt(
"import"));
1056 $this->form->addCommandButton(
"cancel", $lng->txt(
"cancel"));
1058 $this->form->setTitle($this->lng->txt(
"import_".$new_type));
1059 $this->form->setFormAction($ilCtrl->getFormAction($this));
1068 global $rbacadmin, $rbacsystem,
$tpl;
1073 if (!$rbacsystem->checkAccess(
"create",
$_GET[
"ref_id"],
$_GET[
"new_type"]))
1075 $this->ilias->raiseError($this->lng->txt(
"no_create_permission"), $this->ilias->error_obj->MESSAGE);
1080 if ($this->form->checkInput())
1083 include_once(
"./Modules/LearningModule/classes/class.ilObjContentObject.php");
1085 $newObj->setType($this->type);
1086 $newObj->setTitle(
$_POST[
"title"]);#
"content object ".$newObj->getId());
1087 $newObj->setDescription(
$_POST[
"desc"]);
1089 $newObj->createReference();
1090 $newObj->putInTree(
$_GET[
"ref_id"]);
1091 $newObj->setPermissions(
$_GET[
"ref_id"]);
1092 $newObj->notify(
"new",
$_GET[
"ref_id"],
$_GET[
"parent_non_rbac_id"],
$_GET[
"ref_id"],$newObj->getRefId());
1093 $newObj->setCleanFrames(
true);
1097 $newObj->createLMTree();
1102 "&baseClass=ilLMEditorGUI");
1107 $this->form->setValuesByPost();
1108 $tpl->setContent($this->form->getHtml());
1117 include_once
"./Modules/LearningModule/classes/class.ilBibItemGUI.php";
1119 $bib_gui->setObject($this->
object);
1120 $bibItemName =
$_POST[
"bibItemName"] ?
$_POST[
"bibItemName"] :
$_GET[
"bibItemName"];
1121 $bibItemIndex =
$_POST[
"bibItemIndex"] ?
$_POST[
"bibItemIndex"] :
$_GET[
"bibItemIndex"];
1122 if ($bibItemIndex ==
"")
1124 $bibItemPath =
$_POST[
"bibItemPath"] ?
$_POST[
"bibItemPath"] :
$_GET[
"bibItemPath"];
1125 if ($bibItemName !=
"")
1127 $bib_gui->bib_obj->add($bibItemName, $bibItemPath, $bibItemIndex);
1128 $data = $bib_gui->bib_obj->getElement(
"BibItem");
1129 $bibItemIndex = (count(
$data) - 1);
1135 if ($a_target ==
"")
1137 $a_target =
"adm_object.php?ref_id=" . $this->
object->getRefId();
1140 $bib_gui->edit(
"ADM_CONTENT",
"adm_content", $a_target, $bibItemIndex);
1161 include_once
"./Modules/LearningModule/classes/class.ilBibItemGUI.php";
1163 $bib_gui->setObject($this->
object);
1164 $bibItemIndex =
$_POST[
"bibItemIndex"] ?
$_POST[
"bibItemIndex"] :
$_GET[
"bibItemIndex"];
1165 $bib_gui->bib_obj->delete(
$_GET[
"bibItemName"],
$_GET[
"bibItemPath"], $bibItemIndex);
1166 if (strpos($bibItemIndex,
",") > 0)
1168 $bibItemIndex = substr($bibItemIndex, 0, strpos($bibItemIndex,
","));
1170 if ($a_target ==
"")
1172 $a_target =
"adm_object.php?ref_id=" . $this->
object->getRefId();
1175 $bib_gui->edit(
"ADM_CONTENT",
"adm_content", $a_target, $bibItemIndex);
1197 include_once
"./Modules/LearningModule/classes/class.ilBibItemGUI.php";
1199 $bib_gui->setObject($this->
object);
1200 $bibItemIndex =
$_POST[
"bibItemIndex"] ?
$_POST[
"bibItemIndex"] :
$_GET[
"bibItemIndex"];
1202 if ($bibItemIndex < 0)
1206 if ($a_target ==
"")
1208 $a_target =
"adm_object.php?ref_id=" . $this->
object->getRefId();
1211 $bib_gui->edit(
"ADM_CONTENT",
"adm_content", $a_target, $bibItemIndex);
1232 include_once
"./Modules/LearningModule/classes/class.ilBibItemGUI.php";
1234 $bib_gui->setObject($this->
object);
1235 $bibItemIndex =
$_POST[
"bibItemIndex"] ?
$_POST[
"bibItemIndex"] :
$_GET[
"bibItemIndex"];
1237 if ($bibItemIndex < 0)
1241 $bibItemIndex = $bib_gui->save($bibItemIndex);
1243 if ($a_target ==
"")
1245 $a_target =
"adm_object.php?ref_id=" . $this->
object->getRefId();
1248 $bib_gui->edit(
"ADM_CONTENT",
"adm_content", $a_target, $bibItemIndex);
1294 global $_FILES, $rbacsystem,
$ilDB,
$tpl;
1296 include_once
"./Modules/LearningModule/classes/class.ilObjLearningModule.php";
1298 if (!$rbacsystem->checkAccess(
"create",
$_GET[
"ref_id"],
$_GET[
"new_type"]))
1300 $this->ilias->raiseError($this->lng->txt(
"no_create_permission"), $this->ilias->error_obj->MESSAGE);
1305 if ($this->form->checkInput())
1308 include_once(
"./Modules/LearningModule/classes/class.ilObjContentObject.php");
1310 $newObj->setType(
$_GET[
"new_type"]);
1311 $newObj->setTitle($_FILES[
"xmldoc"][
"name"]);
1312 $newObj->setDescription(
"");
1313 $newObj->create(
true);
1314 $newObj->createReference();
1315 $newObj->putInTree(
$_GET[
"ref_id"]);
1316 $newObj->setPermissions(
$_GET[
"ref_id"]);
1317 $newObj->notify(
"new",
$_GET[
"ref_id"],
$_GET[
"parent_non_rbac_id"],
$_GET[
"ref_id"],$newObj->getRefId());
1320 $newObj->createLMTree();
1323 $mess = $newObj->importFromZipFile($_FILES[
"xmldoc"][
"tmp_name"], $_FILES[
"xmldoc"][
"name"],
1330 "&baseClass=ilLMEditorGUI");
1334 $link =
'<a href="'.
"ilias.php?ref_id=".$newObj->getRefId().
1335 "&baseClass=ilLMEditorGUI".
'" target="_top">'.$this->lng->txt(
"btn_next").
'</a>';
1336 $tpl->setContent(
"<br />".$link.
"<br /><br />".$mess.$link);
1341 $this->form->setValuesByPost();
1342 $tpl->setContent($this->form->getHtml());
1355 if ($ilUser->getPref(
"lm_js_chapter_editing") !=
"disable")
1357 $ilCtrl->setParameter($this,
"backcmd",
"chapters");
1359 include_once(
"./Modules/LearningModule/classes/class.ilChapterHierarchyFormGUI.php");
1362 $form_gui->setTitle($this->object->getTitle());
1364 $form_gui->setTree($this->lm_tree);
1365 $form_gui->setMaxDepth(0);
1366 $form_gui->setCurrentTopNodeId($this->tree->getRootId());
1367 $form_gui->addMultiCommand($lng->txt(
"delete"),
"delete");
1368 $form_gui->addMultiCommand($lng->txt(
"cut"),
"cutItems");
1369 $form_gui->addMultiCommand($lng->txt(
"copy"),
"copyItems");
1371 $form_gui->addCommand($lng->txt(
"cont_save_all_titles"),
"saveAllTitles");
1372 $up_gui = ($this->
object->getType() ==
"dbk")
1374 :
"ilobjlearningmodulegui";
1375 $form_gui->setExplorerUpdater(
"tree",
"tree_div",
1376 $ilCtrl->getLinkTargetByClass($up_gui,
"explorer",
"",
true));
1378 $ctpl =
new ilTemplate(
"tpl.chap_and_pages.html",
true,
true,
"Modules/LearningModule");
1379 $ctpl->setVariable(
"HIERARCHY_FORM", $form_gui->getHTML());
1380 $ilCtrl->setParameter($this,
"obj_id",
"");
1381 $ctpl->setVariable(
"HREF_NO_JS_EDIT",
1382 $ilCtrl->getLinkTarget($this,
"deactivateJSChapterEditing"));
1383 $ctpl->setVariable(
"TXT_NO_JS_EDIT",
1384 $lng->txt(
"cont_not_js_chap_editing"));
1386 $this->tpl->setContent($ctpl->get());
1390 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.structure_edit.html",
"Modules/LearningModule");
1393 $this->ctrl->setParameter($this,
"backcmd",
"chapters");
1394 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
1395 $this->tpl->setVariable(
"HEADER_TEXT", $this->lng->txt(
"cont_chapters"));
1399 $childs = $this->lm_tree->getChilds($this->lm_tree->getRootId());
1400 foreach ($childs as $child)
1402 if($child[
"type"] !=
"st")
1407 $this->tpl->setCurrentBlock(
"table_row");
1412 $this->tpl->setVariable(
"CHECKBOX_ID", $child[
"obj_id"]);
1413 $this->tpl->setVariable(
"CSS_ROW", $css_row);
1417 $this->ctrl->setParameter($this,
"backcmd",
"");
1418 $this->ctrl->setParameterByClass(
"ilStructureObjectGUI",
"obj_id", $child[
"obj_id"]);
1419 $this->tpl->setVariable(
"LINK_TARGET",
1420 $this->ctrl->getLinkTargetByClass(
"ilStructureObjectGUI",
"view"));
1423 $this->tpl->setVariable(
"TEXT_CONTENT",
1425 $this->object->isActiveNumbering()));
1427 $this->tpl->parseCurrentBlock();
1430 $paste_active =
false;
1431 if ($ilUser->clipboardHasObjectsOfType(
"st"))
1433 $paste_active =
true;
1436 if($cnt == 0 && !$paste_active)
1438 $this->tpl->setCurrentBlock(
"notfound");
1439 $this->tpl->setVariable(
"NUM_COLS", 3);
1440 $this->tpl->setVariable(
"TXT_OBJECT_NOT_FOUND", $this->lng->txt(
"obj_not_found"));
1441 $this->tpl->parseCurrentBlock();
1446 $this->tpl->setVariable(
"NUM_COLS", 3);
1449 $acts = array(
"delete" =>
"delete",
"cutChapter" =>
"cut",
1450 "copyChapter" =>
"copyChapter");
1454 $acts[
"pasteChapter"] =
"pasteChapter";
1460 $this->tpl->setVariable(
"NUM_COLS", 3);
1461 $subobj = array(
"st");
1463 $this->tpl->setCurrentBlock(
"add_object");
1464 $this->tpl->setVariable(
"SELECT_OBJTYPE", $opts);
1465 $this->tpl->setVariable(
"BTN_NAME",
"create");
1466 $this->tpl->setVariable(
"TXT_ADD", $this->lng->txt(
"insert"));
1467 $this->tpl->parseCurrentBlock();
1469 $this->tpl->setCurrentBlock(
"form");
1470 $this->tpl->parseCurrentBlock();
1472 $this->tpl->setVariable(
"HREF_JS_EDIT",
1473 $ilCtrl->getLinkTarget($this,
"activateJSChapterEditing"));
1474 $this->tpl->setVariable(
"TXT_JS_EDIT",
1475 $lng->txt(
"cont_js_chap_editing"));
1489 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.all_pages.html",
"Modules/LearningModule");
1492 $this->tpl->setCurrentBlock(
"form");
1493 $this->ctrl->setParameter($this,
"backcmd",
"pages");
1494 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
1495 $this->tpl->setVariable(
"HEADER_TEXT", $this->lng->txt(
"cont_pages"));
1496 $this->tpl->setVariable(
"CONTEXT", $this->lng->txt(
"cont_usage"));
1501 foreach ($pages as $page)
1503 $this->tpl->setCurrentBlock(
"table_row");
1506 include_once(
"./Services/COPage/classes/class.ilPageObject.php");
1509 $lm_set->get(
"time_scheduled_page_activation"));
1512 $img_sc = ($lm_set->get(
"time_scheduled_page_activation") &&
1520 $this->tpl->setVariable(
"IMG_ALT",
1521 $this->lng->txt(
"cont_page_deactivated"));
1526 $this->object->getType()))
1529 $this->tpl->setVariable(
"IMG_ALT",
1530 $this->lng->txt(
"cont_page_deactivated_elements"));
1535 $this->tpl->setVariable(
"IMG_ALT",
1536 $this->lng->txt(
"pg"));
1544 $this->tpl->setVariable(
"CHECKBOX_ID", $page[
"obj_id"]);
1545 $this->tpl->setVariable(
"CSS_ROW", $css_row);
1548 $this->ctrl->setParameter($this,
"backcmd",
"");
1549 $this->ctrl->setParameterByClass(
"ilLMPageObjectGUI",
"obj_id", $page[
"obj_id"]);
1551 $this->tpl->setVariable(
"LINK_TARGET",
1552 $this->ctrl->getLinkTargetByClass(
"ilLMPageObjectGUI",
"edit"));
1555 $this->tpl->setVariable(
"TEXT_CONTENT", $page[
"title"]);
1558 if ($this->lm_tree->isInTree($page[
"obj_id"]))
1569 if ($page[
"obj_id"] == $this->object->getHeaderPage())
1571 $add_str =
" <b>(".$this->lng->txt(
"cont_header").
")</b>";
1573 if ($page[
"obj_id"] == $this->object->getFooterPage())
1575 $add_str =
" <b>(".$this->lng->txt(
"cont_footer").
")</b>";
1578 $this->tpl->setVariable(
"TEXT_CONTEXT", $path_str.$add_str);
1581 $this->tpl->parseCurrentBlock();
1585 $this->tpl->setCurrentBlock(
"notfound");
1586 $this->tpl->setVariable(
"NUM_COLS", 4);
1587 $this->tpl->setVariable(
"TXT_OBJECT_NOT_FOUND", $this->lng->txt(
"obj_not_found"));
1588 $this->tpl->parseCurrentBlock();
1592 $acts = array(
"delete" =>
"delete",
"movePage" =>
"movePage",
"copyPage" =>
"copyPage",
1593 "selectHeader" =>
"selectHeader",
"selectFooter" =>
"selectFooter",
1594 "activatePages" =>
"cont_de_activate");
1598 $acts[
"pastePage"] =
"pastePage";
1606 $this->tpl->setVariable(
"NUM_COLS", 4);
1619 $this->tpl->setVariable(
"NUM_COLS", 4);
1621 $subobj = array(
"pg");
1623 $this->tpl->setCurrentBlock(
"add_object");
1624 $this->tpl->setVariable(
"SELECT_OBJTYPE", $opts);
1625 $this->tpl->setVariable(
"BTN_NAME",
"create");
1626 $this->tpl->setVariable(
"TXT_ADD", $this->lng->txt(
"create"));
1627 $this->tpl->parseCurrentBlock();
1630 $this->tpl->setCurrentBlock(
"form");
1631 $this->tpl->parseCurrentBlock();
1645 include_once(
"./Modules/LearningModule/classes/class.ilLinksTableGUI.php");
1647 $this->object->getId(), $this->
object->getType());
1649 $tpl->setContent($table_gui->getHTML());
1658 if (is_array(
$_POST[
"id"]))
1660 foreach(
$_POST[
"id"] as $id)
1662 include_once(
"./Services/COPage/classes/class.ilPageObject.php");
1668 $this->ctrl->redirect($this,
"pages");
1678 $ilUser->writePref(
"lm_js_chapter_editing",
"disable");
1679 $ilCtrl->redirect($this,
"chapters");
1689 $ilUser->writePref(
"lm_js_chapter_editing",
"enable");
1690 $ilCtrl->redirect($this,
"chapters");
1700 $this->ilias->raiseError($this->lng->txt(
"no_page_in_clipboard"),$this->ilias->error_obj->MESSAGE);
1711 == $this->object->getID())
1714 $new_page =& $lm_page->copy();
1715 $id = $new_page->getId();
1721 $lm_obj =& $this->ilias->obj_factory->getInstanceByObjId($lm_id);
1723 $copied_nodes = array();
1724 $new_page =& $lm_page->copyToOtherContObject($this->
object, $copied_nodes);
1725 $id = $new_page->getId();
1735 != $this->object->getID())
1738 $lm_obj =& $this->ilias->obj_factory->getInstanceByObjId($lm_id);
1740 $lm_page->setLMId($this->object->getID());
1742 $page =& $lm_page->getPageObject();
1744 $page->setParentId($this->object->getID());
1751 $this->ctrl->redirect($this,
"pages");
1761 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
1770 $this->ctrl->redirect($this,
"pages");
1780 function delete($a_parent_subobj_id = 0)
1784 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
1789 $this->ilias->raiseError($this->lng->txt(
"cont_select_item"), $this->ilias->error_obj->MESSAGE);
1792 if ($a_parent_subobj_id == 0)
1800 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.confirm_deletion.html",
"Modules/LearningModule");
1804 if ($a_parent_subobj_id != 0)
1806 $this->ctrl->setParameterByClass(
"ilStructureObjectGUI",
"backcmd",
$_GET[
"backcmd"]);
1807 $this->ctrl->setParameterByClass(
"ilStructureObjectGUI",
"obj_id", $a_parent_subobj_id);
1808 $this->tpl->setVariable(
"FORMACTION",
1809 $this->ctrl->getFormActionByClass(
"ilStructureObjectGUI"));
1813 $this->ctrl->setParameter($this,
"backcmd",
$_GET[
"backcmd"]);
1814 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
1817 $this->tpl->setCurrentBlock(
"table_header");
1818 $this->tpl->setVariable(
"TEXT",$this->lng->txt(
"objects"));
1819 $this->tpl->parseCurrentBlock();
1826 foreach(
$_POST[
"id"] as $id)
1831 switch($obj->getType())
1840 $this->tpl->setCurrentBlock(
"table_row");
1842 $this->tpl->setVariable(
"TEXT_CONTENT", $obj->getTitle());
1843 $this->tpl->parseCurrentBlock();
1849 $buttons = array(
"cancelDelete" => $this->lng->txt(
"cancel"),
1850 "confirmedDelete" => $this->lng->txt(
"confirm"));
1851 foreach ($buttons as
$name => $value)
1853 $this->tpl->setCurrentBlock(
"operation_btn");
1854 $this->tpl->setVariable(
"BTN_NAME",
$name);
1855 $this->tpl->setVariable(
"BTN_VALUE",$value);
1856 $this->tpl->parseCurrentBlock();
1865 session_unregister(
"saved_post");
1867 $this->ctrl->redirect($this,
$_GET[
"backcmd"]);
1881 $tree->setTableNames(
'lm_tree',
'lm_data');
1882 $tree->setTreeTablePK(
"lm_id");
1887 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
1891 foreach (
$_SESSION[
"saved_post"] as $id)
1896 $node_data =
$tree->getNodeData($id);
1897 if (is_object($obj))
1899 $obj->setLMId($this->object->getId());
1901 include_once(
"classes/class.ilHistory.php");
1904 $this->
object->getType());
1908 if(
$tree->isInTree($id))
1910 $tree->deleteTree($node_data);
1916 $this->
object->checkTree();
1921 if ($a_parent_subobj_id == 0)
1923 $this->ctrl->redirect($this,
$_GET[
"backcmd"]);
1939 $tmpPath = $this->lm_tree->getPathFull($a_endnode_id, $a_startnode_id);
1942 for ($i = 1; $i < (count($tmpPath) - 1); $i++)
1949 $path .= $tmpPath[$i][
"title"];
1969 $notoperations = array();
1971 $operations = array();
1977 if (!in_array($row[
"name"], $notoperations))
1979 $operations[] =
$row;
1984 if (count($operations)>0)
1986 foreach ($operations as $val)
1988 $this->tpl->setCurrentBlock(
"operation_btn");
1989 $this->tpl->setVariable(
"BTN_NAME", $val[
"name"]);
1990 $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt($val[
"lng"]));
1991 $this->tpl->parseCurrentBlock();
1994 $this->tpl->setCurrentBlock(
"operation");
1996 $this->tpl->parseCurrentBlock();
2007 $this->
setFormAction(
"addRole", $this->ctrl->getLinkTarget($this,
"addRole"));
2008 $this->
setFormAction(
"permSave", $this->ctrl->getLinkTarget($this,
"permSave"));
2009 $this->permObject();
2018 $this->
setReturnLocation(
"permSave", $this->ctrl->getLinkTarget($this,
"perm"));
2019 $this->permSaveObject();
2028 $this->infoObject();
2038 $this->addRoleObject();
2048 $this->ownerObject();
2057 if (strtolower(
$_GET[
"baseClass"]) ==
"iladministrationgui")
2076 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
2079 if(count(
$_POST[
"id"]) > 1)
2081 $this->ilias->raiseError($this->lng->txt(
"cont_select_max_one_item"),$this->ilias->error_obj->MESSAGE);
2086 $this->ilias->raiseError($this->lng->txt(
"cont_select_item"), $this->ilias->error_obj->MESSAGE);
2094 if ($a_parent_subobj_id == 0)
2096 $this->ctrl->redirect($this,
"chapters");
2111 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
2114 if(count(
$_POST[
"id"]) > 1)
2116 $this->ilias->raiseError($this->lng->txt(
"cont_select_max_one_item"),$this->ilias->error_obj->MESSAGE);
2121 $this->ilias->raiseError($this->lng->txt(
"cont_select_item"), $this->ilias->error_obj->MESSAGE);
2127 ilUtil::sendInfo($this->lng->txt(
"cont_chap_copy_select_target_now"),
true);
2129 if ($a_parent_subobj_id == 0)
2131 $this->ctrl->redirect($this,
"chapters");
2145 $this->ilias->raiseError($this->lng->txt(
"no_chapter_in_clipboard"),$this->ilias->error_obj->MESSAGE);
2148 $target_tree =
new ilTree($this->object->getId());
2150 $target_tree->setTreeTablePK(
"lm_id");
2154 != $this->object->getID())
2157 $source_tree->setTableNames(
'lm_tree',
'lm_data');
2158 $source_tree->setTreeTablePK(
"lm_id");
2162 $source_tree =& $target_tree;
2167 $node = $source_tree->getNodeData($id);
2168 $subnodes = $source_tree->getSubtree($node);
2169 foreach ($subnodes as $subnode)
2171 if($subnode[
"obj_id"] == $a_parent_subobj_id)
2173 $this->ilias->raiseError($this->lng->txt(
"cont_target_within_source"),$this->ilias->error_obj->MESSAGE);
2176 if(
$_POST[
"id"][0] == $id)
2179 $this->ctrl->redirect($this,
"chapters");
2183 $parent = ($a_parent_subobj_id == 0)
2184 ? $target_tree->getRootId()
2185 : $a_parent_subobj_id;
2194 $target =
$_POST[
"id"][0];
2198 $childs =& $target_tree->getChildsByType($parent,
"pg");
2199 if (count($childs) != 0)
2201 $target = $childs[count($childs) - 1][
"obj_id"];
2211 != $this->object->getID())
2216 if ($a_parent_subobj_id == 0)
2218 $this->ctrl->redirect($this,
"chapters");
2223 $target_tree->deleteTree($node);
2225 if (!$target_tree->isInTree($id))
2227 $target_tree->insertNode($id, $parent, $target);
2229 foreach ($subnodes as $node)
2233 if($node[
"obj_id"] != $id)
2235 $target_tree->insertNode($node[
"obj_id"], $node[
"parent"]);
2244 $copied_nodes = array();
2246 == $this->object->getID())
2249 $source_obj->setLMId($this->object->getId());
2250 $source_obj->copy($target_tree, $parent, $target, $copied_nodes);
2258 $source_obj->setLMId($lm_id);
2259 $source_obj->copy($target_tree, $parent, $target, $copied_nodes);
2268 $this->
object->checkTree();
2270 if ($a_parent_subobj_id == 0)
2272 $this->ctrl->redirect($this,
"chapters");
2283 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
2290 $this->ctrl->redirect($this,
"pages");
2298 if (
$_GET[
"new_type"] ==
"pg")
2300 $this->ctrl->redirect($this,
"pages");
2304 $this->ctrl->redirect($this,
"chapters");
2314 require_once(
"./Modules/LearningModule/classes/class.ilContObjectExport.php");
2316 $cont_exp->buildExportFile();
2327 $changelink =
"<a href='".$ilCtrl->getLinkTarget($this,
"editMenuProperties").
"'>".$lng->txt(
"change").
"</a>";
2328 if (!$this->object->isActiveLMMenu())
2330 $add =
"<br />".$lng->txt(
"cont_download_no_menu").
" ".$changelink;
2332 else if (!$this->object->isActiveDownloads())
2334 $add =
"<br />".$lng->txt(
"cont_download_no_download").
" ".$changelink;
2338 if ($this->object->getPublicExportFile($a_type) == $a_file)
2340 return $lng->txt(
"yes").$add;
2355 if(!isset($a_files))
2361 foreach ($a_files as
$f)
2363 $file = explode(
":", $f);
2364 $export_dir = $this->
object->getExportDirectory(
$file[0]);
2366 if ($this->object->getPublicExportFile(
$file[0]) ==
2369 $this->
object->setPublicExportFile(
$file[0],
"");
2373 $this->
object->setPublicExportFile(
$file[0],
$file[1]);
2376 $this->
object->update();
2378 $ilCtrl->redirectByClass(
"ilexportgui");
2386 if(!isset(
$_POST[
"file"]))
2388 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
2391 if (count(
$_POST[
"file"]) > 1)
2393 $this->ilias->raiseError($this->lng->txt(
"cont_select_max_one_item"),$this->ilias->error_obj->MESSAGE);
2397 $export_dir = $this->
object->getOfflineDirectory();
2411 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.confirm.html");
2413 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
2416 $this->tpl->setVariable(
"TXT_CONFIRM", $this->lng->txt(
"confirmation"));
2417 $this->tpl->setVariable(
"TXT_CONTENT", $this->lng->txt(
"cont_fix_tree_confirm"));
2418 $this->tpl->setVariable(
"CMD_CANCEL",
"cancelFixTree");
2419 $this->tpl->setVariable(
"CMD_OK",
"fixTree");
2420 $this->tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
2421 $this->tpl->setVariable(
"TXT_OK", $this->lng->txt(
"cont_fix_tree"));
2440 $this->ctrl->redirect($this,
"properties");
2448 $this->
object->fixTree();
2450 $this->ctrl->redirect($this,
"properties");
2457 $a_active =
"content", $a_use_global_tabs =
false, $a_as_subtabs =
false,
2460 global
$ilCtrl,$ilUser, $ilAccess, $ilTabs, $rbacsystem, $ilPluginAdmin;
2465 $addcmd =
"addSubTabTarget";
2466 $getcmd =
"getSubTabHTML";
2470 $addcmd =
"addTarget";
2471 $getcmd =
"getHTML";
2474 $active[$a_active] =
true;
2476 if (!$this->object->isActiveLMMenu())
2481 if ($a_use_global_tabs)
2483 $tabs_gui = $ilTabs;
2493 $showViewInFrameset =
true;
2495 if ($showViewInFrameset && !$a_offline)
2501 $buttonTarget =
"_top";
2504 if ($a_export_format ==
"scorm")
2512 if (!$a_offline && $ilAccess->checkAccess(
"read",
"", $_GET[
"ref_id"]))
2514 $ilCtrl->setParameterByClass(
"illmpresentationgui",
"obj_id", $_GET[
"obj_id"]);
2515 $tabs_gui->$addcmd(
"content",
2516 $ilCtrl->getLinkTargetByClass(
"illmpresentationgui",
"layout"),
2517 "",
"", $buttonTarget, $active[
"content"]);
2521 if (!$requires_purchase_to_access && $this->object->isActiveTOC() && $ilAccess->checkAccess(
"read",
"", $_GET[
"ref_id"]))
2525 $ilCtrl->setParameterByClass(
"illmpresentationgui",
"obj_id", $_GET[
"obj_id"]);
2526 $link = $ilCtrl->getLinkTargetByClass(
"illmpresentationgui",
"showTableOfContents");
2530 $link =
"./table_of_contents.html";
2533 $tabs_gui->$addcmd(
"cont_toc", $link,
2534 "",
"", $buttonTarget, $active[
"toc"]);
2538 if (!$requires_purchase_to_access && $this->object->isActivePrintView() && $ilAccess->checkAccess(
"read",
"", $_GET[
"ref_id"]))
2542 $ilCtrl->setParameterByClass(
"illmpresentationgui",
"obj_id", $_GET[
"obj_id"]);
2543 $link = $ilCtrl->getLinkTargetByClass(
"illmpresentationgui",
"showPrintViewSelection");
2544 $tabs_gui->$addcmd(
"cont_print_view", $link,
2545 "",
"", $buttonTarget, $active[
"print"]);
2550 if (!$requires_purchase_to_access && $ilUser->getId() == ANONYMOUS_USER_ID)
2552 $is_public = $this->
object->isActiveDownloadsPublic();
2554 else if(!$requires_purchase_to_access)
2559 if (!$requires_purchase_to_access && $this->object->isActiveDownloads() && !$a_offline && $is_public &&
2560 $ilAccess->checkAccess(
"read",
"", $_GET[
"ref_id"]))
2562 $ilCtrl->setParameterByClass(
"illmpresentationgui",
"obj_id", $_GET[
"obj_id"]);
2563 $link = $ilCtrl->getLinkTargetByClass(
"illmpresentationgui",
"showDownloadList");
2564 $tabs_gui->$addcmd(
"download", $link,
2565 "",
"", $buttonTarget, $active[
"download"]);
2569 if ($a_export_format !=
"scorm" && !$a_offline)
2573 $ilCtrl->setParameterByClass(
"illmpresentationgui",
"obj_id", $_GET[
"obj_id"]);
2574 $link = $this->ctrl->getLinkTargetByClass(
2575 array(
"illmpresentationgui",
"ilinfoscreengui"),
"showSummary");
2579 $link =
"./info.html";
2582 $tabs_gui->$addcmd(($requires_purchase_to_access ?
'buy' :
'info_short'), $link,
2583 "",
"", $buttonTarget, $active[
"info"]);
2587 if (!$a_offline && $a_cur_page > 0)
2589 if ($rbacsystem->checkAccess(
"write", $_GET[
"ref_id"]))
2592 $page_id = $a_cur_page;
2593 $tabs_gui->$addcmd(
"edit_page", ILIAS_HTTP_PATH.
"/ilias.php?baseClass=ilLMEditorGUI&ref_id=".$_GET[
"ref_id"].
2594 "&obj_id=".$page_id.
"&to_page=1",
2595 "",
"", $buttonTarget, $active[
"edit_page"]);
2599 if(!$requires_purchase_to_access)
2603 $entries = $this->lmme_obj->getMenuEntries(
true);
2605 if (count($entries) > 0 && $ilAccess->checkAccess(
"read",
"", $_GET[
"ref_id"]))
2607 foreach ($entries as $entry)
2610 if ($entry[
"type"] ==
"intern")
2612 $entry[
"link"] = ILIAS_HTTP_PATH.
"/goto.php?target=".$entry[
"link"];
2616 if (!strstr($entry[
"link"],
'://') && !strstr($entry[
"link"],
'mailto:'))
2618 $entry[
"link"] =
"http://".$entry[
"link"];
2621 if (!strstr($entry[
"link"],
'mailto:'))
2625 $tabs_gui->$addcmd($entry[
"title"],
2627 "",
"",
"_blank",
"",
true);
2633 $pl_names = $ilPluginAdmin->getActivePluginsForSlot(
IL_COMP_SERVICE,
"UIComponent",
"uihk");
2634 $plugin_html =
false;
2635 foreach ($pl_names as $pl)
2638 $gui_class = $ui_plugin->getUIClassInstance();
2639 $resp = $gui_class->modifyGUI(
"Modules/LearningModule",
"lm_menu_tabs",
2640 array(
"lm_menu_tabs" => $tabs_gui));
2644 return $tabs_gui->$getcmd();
2652 require_once(
"./Modules/LearningModule/classes/class.ilContObjectExport.php");
2654 $cont_exp->buildExportFile();
2655 $this->offlineList();
2663 require_once(
"./Modules/LearningModule/classes/class.ilContObjectExport.php");
2665 $cont_exp->buildExportFile();
2675 require_once(
"./Modules/LearningModule/classes/class.ilContObjectExport.php");
2677 $cont_exp->buildExportFile();
2693 $this->ctrl->addLocation(
2697 $par_id = $tree->getParentId(
$_GET[
"ref_id"]);
2698 $this->ctrl->addLocation(
2700 "repository.php?cmd=frameset&ref_id=".$par_id,
2702 if (!$a_omit_obj_id)
2706 $lmtree =& $this->
object->getTree();
2714 $path = $lmtree->getPathFull($lmtree->getRootId());
2717 $path[] = array(
"type" =>
"pg",
"child" => $this->obj_id,
2726 if (
$row[
"child"] == 1)
2728 $this->ctrl->setParameter($this,
"obj_id",
"");
2729 $this->ctrl->addLocation(
2730 $this->object->getTitle(),
2731 $this->ctrl->getLinkTarget($this,
"chapters"),
"",
$_GET[
"ref_id"]);
2736 switch(
$row[
"type"])
2739 $this->ctrl->setParameterByClass(
"ilstructureobjectgui",
"obj_id",
$row[
"child"]);
2740 $this->ctrl->addLocation(
2742 $this->ctrl->getLinkTargetByClass(
"ilstructureobjectgui",
"view"));
2746 $this->ctrl->setParameterByClass(
"illmpageobjectgui",
"obj_id",
$row[
"child"]);
2747 $this->ctrl->addLocation(
2749 $this->ctrl->getLinkTargetByClass(
"illmpageobjectgui",
"edit"));
2754 if (!$a_omit_obj_id)
2756 $this->ctrl->setParameter($this,
"obj_id",
$_GET[
"obj_id"]);
2777 include_once(
"./Modules/LearningModule/classes/class.ilLMQuestionListTableGUI.php");
2779 $tpl->setContent($table->getHTML());
2794 #include_once("classes/class.ilTabsGUI.php");
2795 #$tabs_gui =& new ilTabsGUI();
2796 $this->
getTabs($this->tabs_gui);
2797 $this->tpl->setCurrentBlock(
"header_image");
2799 $this->tpl->parseCurrentBlock();
2800 $this->tpl->setCurrentBlock(
"content");
2801 #$this->tpl->setVariable("TABS", $tabs_gui->getHTML());
2802 $this->tpl->setVariable(
"HEADER", $this->object->getTitle());
2815 $ilTabs->addSubtab(
"internal_links",
2816 $lng->txt(
"cont_internal_links"),
2817 $ilCtrl->getLinkTarget($this,
"listLinks"));
2819 if ($this->object->getType() ==
"lm")
2821 if(@include_once(
'HTTP/Request.php'))
2823 $ilTabs->addSubtab(
"link_check",
2824 $lng->txt(
"link_check"),
2825 $ilCtrl->getLinkTarget($this,
"linkChecker"));
2829 $ilTabs->activateSubTab($a_active);
2830 $ilTabs->activateTab(
"cont_links");
2841 global $rbacsystem,$ilUser;
2847 $tabs_gui->addTarget(
"cont_chapters",
2848 $this->ctrl->getLinkTarget($this,
"chapters"),
2849 "chapters", get_class($this));
2852 $tabs_gui->addTarget(
"cont_all_pages",
2853 $this->ctrl->getLinkTarget($this,
"pages"),
2854 "pages", get_class($this));
2857 $tabs_gui->addTarget(
"objs_qst",
2858 $this->ctrl->getLinkTarget($this,
"listQuestions"),
2859 "listQuestions", get_class($this));
2862 $tabs_gui->addTarget(
"info_short",
2863 $this->ctrl->getLinkTargetByClass(
"ilinfoscreengui",
'showSummary'),
2864 "",
"ilinfoscreengui");
2867 $tabs_gui->addTarget(
"settings",
2868 $this->ctrl->getLinkTarget($this,
'properties'),
2869 "properties", get_class($this));
2872 include_once
'./Services/Tracking/classes/class.ilLearningProgressAccess.php';
2875 $tabs_gui->addTarget(
'learning_progress',
2876 $this->ctrl->getLinkTargetByClass(array(
'illearningprogressgui'),
''),
2878 array(
'illplistofobjectsgui',
'illplistofsettingsgui',
'illearningprogressgui',
'illplistofprogressgui',
'illmstatisticsgui'));
2882 $tabs_gui->addTarget(
"cont_links",
2883 $this->ctrl->getLinkTarget($this,
'listLinks'),
2884 "listLinks", get_class($this));
2886 if ($this->object->getType() !=
"lm")
2889 $tabs_gui->addTarget(
"bib_data",
2890 $this->ctrl->getLinkTarget($this,
"editBibItem"),
2891 "editBibItem", get_class($this));
2894 $tabs_gui->addTarget(
"history", $this->ctrl->getLinkTarget($this,
"history")
2895 ,
"history", get_class($this));
2897 $tabs_gui->addTarget(
"meta_data",
2898 $this->ctrl->getLinkTargetByClass(
'ilmdeditorgui',
''),
2899 "",
"ilmdeditorgui");
2901 if ($this->object->getType() ==
"lm")
2904 $tabs_gui->addTarget(
"export",
2905 $this->ctrl->getLinkTargetByClass(
"ilexportgui",
""),
2910 if ($rbacsystem->checkAccess(
'edit_permission',$this->object->getRefId()))
2912 $tabs_gui->addTarget(
"perm_settings",
2913 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"), array(
"perm",
"info",
"owner"),
'ilpermissiongui');
2924 if (in_array($a_active,
2925 array(
"cont_general_properties",
"cont_style",
"cont_lm_menu",
"public_section")))
2928 $ilTabs->addSubTabTarget(
"cont_general_properties",
2929 $this->ctrl->getLinkTarget($this,
'properties'),
2933 $ilTabs->addSubTabTarget(
"cont_style",
2934 $this->ctrl->getLinkTarget($this,
'editStyleProperties'),
2938 $ilTabs->addSubTabTarget(
"cont_lm_menu",
2939 $this->ctrl->getLinkTarget($this,
'editMenuProperties'),
2942 if ($ilSetting->get(
"pub_section"))
2944 if ($this->object->getType() !=
"dbk")
2947 $ilTabs->addSubTabTarget(
"public_section",
2948 $this->ctrl->getLinkTarget($this,
'editPublicSection'),
2953 $ilTabs->setSubTabActive($a_active);
2963 $ilTabs->setTabActive(
"settings");
2965 switch ($this->object->getType())
2968 $gui_class =
"ilobjlearningmodulegui";
2972 $gui_class =
"ilobjdlbookgui";
2979 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.lm_public_selector.html");
2982 require_once (
"./Modules/LearningModule/classes/class.ilPublicSectionSelector.php");
2990 $output = $exp->getOutput();
2993 foreach ($exp->format_options as $node)
2995 if (!$node[
"container"])
2997 $pages[] = $node[
"child"];
3006 $this->tpl->setVariable(
"TXT_SET_PUBLIC_MODE", $this->lng->txt(
"set_public_mode"));
3007 $this->tpl->setVariable(
"TXT_CHOOSE_PUBLIC_MODE", $this->lng->txt(
"choose_public_mode"));
3008 $modes = array(
"complete" => $this->lng->txt(
"all_pages"),
"selected" => $this->lng->txt(
"selected_pages_only"));
3009 $select_public_mode =
ilUtil::formSelect ($this->object->getPublicAccessMode(),
"lm_public_mode",$modes,
false,
true);
3010 $this->tpl->setVariable(
"SELECT_PUBLIC_MODE", $select_public_mode);
3012 $this->tpl->setVariable(
"TXT_EXPLORER_HEADER", $this->lng->txt(
"choose_public_pages"));
3013 $this->tpl->setVariable(
"EXP_REFRESH", $this->lng->txt(
"refresh"));
3014 $this->tpl->setVariable(
"EXPLORER",$output);
3015 $this->tpl->setVariable(
"ONCLICK",$js_pages);
3016 $this->tpl->setVariable(
"TXT_CHECKALL", $this->lng->txt(
"check_all"));
3017 $this->tpl->setVariable(
"TXT_UNCHECKALL", $this->lng->txt(
"uncheck_all"));
3018 $this->tpl->setVariable(
"TXT_SAVE", $this->lng->txt(
"save"));
3019 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getLinkTarget($this,
"savePublicSection"));
3027 $this->
object->setPublicAccessMode(
$_POST[
"lm_public_mode"]);
3028 $this->
object->updateProperties();
3031 $this->ctrl->redirect($this,
"editPublicSection");
3043 require_once(
"classes/class.ilHistoryGUI.php");
3045 $this->
object->getType());
3047 $this->ctrl->getParameterArray($this,
"history"),
3048 $this->
object->isActiveHistoryUserComments()
3051 $this->tpl->setVariable(
"ADM_CONTENT", $hist_html);
3066 require_once
'Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php';
3068 $actions->setSelectionHeaderClass(
'small');
3069 $actions->setItemLinkClass(
'xsmall');
3070 $actions->setListTitle($this->lng->txt(
'actions'));
3072 $this->ctrl->setParameterByClass(
'ilLMPageObjectGUI',
'obj_id', $row[
'page_id']);
3074 $this->lng->txt(
'edit'),
3076 $this->ctrl->getLinkTargetByClass(
'ilLMPageObjectGUI',
'edit')
3078 $this->ctrl->clearParametersByClass(
'ilLMPageObjectGUI');
3079 $row[
'action_html'] =
$actions->getHTML();
3093 require_once
'Services/LinkChecker/classes/class.ilLinkCheckerTableGUI.php';
3097 if((
bool)$ilias->getSetting(
'cron_web_resource_check'))
3099 include_once
'classes/class.ilLinkCheckNotify.php';
3100 include_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
3102 $chb =
new ilCheckboxInputGUI($this->lng->txt(
'link_check_message_a'),
'link_check_message');
3105 $chb->setOptionTitle($this->lng->txt(
'link_check_message_b'));
3107 $toolbar->addInputItem($chb);
3108 $toolbar->addFormButton($this->lng->txt(
'save'),
'saveLinkCheck');
3109 $toolbar->setFormAction($this->ctrl->getLinkTarget($this,
'saveLinkCheck'));
3113 $tgui->setLinkChecker($this->link_checker_obj)
3114 ->setRowHandler($this)
3115 ->setRefreshButton($this->lng->txt(
'refresh'),
'refreshLinkCheck');
3117 return $tpl->setContent($tgui->prepareHTML()->getHTML().$toolbar->getHTML());
3122 global
$ilDB,$ilUser;
3124 include_once
'./classes/class.ilLinkCheckNotify.php';
3127 $link_check_notify->setUserId($ilUser->getId());
3128 $link_check_notify->setObjId($this->object->getId());
3130 if(
$_POST[
'link_check_message'])
3133 $link_check_notify->addNotifier();
3138 $link_check_notify->deleteNotifier();
3151 if(!$this->link_checker_obj->checkPear())
3159 $this->link_checker_obj->checkLinks();
3171 include_once
'./classes/class.ilLinkChecker.php';
3174 $this->link_checker_obj->setObjId($this->object->getId());
3181 include_once
'./Modules/LearningModule/classes/class.ilLMMenuEditor.php';
3184 $this->lmme_obj->setObjId($this->object->getId());
3196 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.lm_menu_entry_form.html",
"Modules/LearningModule");
3198 if (isset(
$_GET[
"link_ref_id"]))
3204 $target_link = $obj_type.
"_".
$_GET[
"link_ref_id"];
3205 $this->tpl->setVariable(
"TITLE",
$title);
3206 $this->tpl->setVariable(
"TARGET", $target_link);
3207 $this->tpl->setVariable(
"LINK_REF_ID",
$_GET[
"link_ref_id"]);
3211 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this,
"saveMenuEntry"));
3212 $this->tpl->setVariable(
"TXT_NEW_ENTRY", $this->lng->txt(
"lm_menu_new_entry"));
3213 $this->tpl->setVariable(
"TXT_TARGET", $this->lng->txt(
"lm_menu_entry_target"));
3214 $this->tpl->setVariable(
"TXT_TITLE", $this->lng->txt(
"lm_menu_entry_title"));
3215 $this->tpl->setVariable(
"BTN_NAME",
"saveMenuEntry");
3216 $this->tpl->setVariable(
"BTN_TEXT", $this->lng->txt(
"save"));
3217 $this->tpl->setVariable(
"BTN_NAME2",
"showEntrySelector");
3218 $this->tpl->setVariable(
"BTN_TEXT2", $this->lng->txt(
"lm_menu_select_internal_object"));
3231 if (empty(
$_POST[
"title"]))
3235 $ilCtrl->redirect($this,
"addMenuEntry");
3237 if (empty(
$_POST[
"target"]))
3241 $ilCtrl->redirect($this,
"addMenuEntry");
3245 $this->lmme_obj->setTitle(
$_POST[
"title"]);
3246 $this->lmme_obj->setTarget(
$_POST[
"target"]);
3247 $this->lmme_obj->setLinkRefId(
$_POST[
"link_ref_id"]);
3249 if (
$_POST[
"link_ref_id"])
3251 $this->lmme_obj->setLinkType(
"intern");
3254 $this->lmme_obj->create();
3257 $this->ctrl->redirect($this,
"editMenuProperties");
3265 if (empty(
$_GET[
"menu_entry"]))
3267 $this->ilias->raiseError($this->lng->txt(
"no_menu_entry_id"),$this->ilias->error_obj->MESSAGE);
3271 $this->lmme_obj->delete(
$_GET[
"menu_entry"]);
3274 $this->ctrl->redirect($this,
"editMenuProperties");
3282 if (empty(
$_GET[
"menu_entry"]))
3284 $this->ilias->raiseError($this->lng->txt(
"no_menu_entry_id"),$this->ilias->error_obj->MESSAGE);
3288 $this->lmme_obj->readEntry(
$_GET[
"menu_entry"]);
3292 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.lm_menu_entry_form.html",
"Modules/LearningModule");
3294 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
3295 $this->tpl->setVariable(
"TXT_NEW_ENTRY", $this->lng->txt(
"lm_menu_edit_entry"));
3296 $this->tpl->setVariable(
"TXT_TARGET", $this->lng->txt(
"lm_menu_entry_target"));
3297 $this->tpl->setVariable(
"TXT_TITLE", $this->lng->txt(
"lm_menu_entry_title"));
3298 $this->tpl->setVariable(
"TITLE", $this->lmme_obj->getTitle());
3299 $this->tpl->setVariable(
"TARGET", $this->lmme_obj->getTarget());
3300 $this->tpl->setVariable(
"ENTRY_ID", $this->lmme_obj->getEntryId());
3301 $this->tpl->setVariable(
"BTN_NAME",
"updateMenuEntry");
3302 $this->tpl->setVariable(
"BTN_TEXT", $this->lng->txt(
"save"));
3303 $this->tpl->setVariable(
"BTN_NAME2",
"showEntrySelector");
3304 $this->tpl->setVariable(
"BTN_TEXT2", $this->lng->txt(
"lm_menu_select_internal_object"));
3313 if (empty(
$_POST[
"menu_entry"]))
3315 $this->ilias->raiseError($this->lng->txt(
"no_menu_entry_id"),$this->ilias->error_obj->MESSAGE);
3319 if (empty(
$_POST[
"title"]))
3321 $this->ilias->raiseError($this->lng->txt(
"please_enter_title"),$this->ilias->error_obj->MESSAGE);
3323 if (empty(
$_POST[
"target"]))
3325 $this->ilias->raiseError($this->lng->txt(
"please_enter_target"),$this->ilias->error_obj->MESSAGE);
3329 $this->lmme_obj->readEntry(
$_POST[
"menu_entry"]);
3330 $this->lmme_obj->setTitle(
$_POST[
"title"]);
3331 $this->lmme_obj->setTarget(
$_POST[
"target"]);
3332 $this->lmme_obj->update();
3335 $this->ctrl->redirect($this,
"editMenuProperties");
3342 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.lm_menu_object_selector.html",
"Modules/LearningModule");
3346 require_once (
"./Modules/LearningModule/classes/class.ilLMMenuObjectSelector.php");
3349 $exp->
setExpand(
$_GET[
"lm_menu_expand"] ?
$_GET[
"lm_menu_expand"] : $this->tree->readRootId());
3350 $exp->setExpandTarget($this->ctrl->getLinkTarget($this,
'showEntrySelector'));
3351 $exp->setTargetGet(
"ref_id");
3352 $exp->setRefId($this->cur_ref_id);
3354 $sel_types = array(
'mcst',
'mep',
'cat',
'lm',
'dbk',
'glo',
'exc',
'tst',
'svy',
'sahs',
3355 "crs",
"grp",
"book",
"tst",
"file");
3356 $exp->setSelectableTypes($sel_types);
3362 $output = $exp->getOutput();
3365 foreach ($exp->format_options as $node)
3367 if (!$node[
"container"])
3369 $pages[] = $node[
"child"];
3376 $this->tpl->setVariable(
"TXT_SET_PUBLIC_MODE", $this->lng->txt(
"set_public_mode"));
3377 $this->tpl->setVariable(
"TXT_CHOOSE_PUBLIC_MODE", $this->lng->txt(
"choose_public_mode"));
3378 $modes = array(
"complete" => $this->lng->txt(
"all_pages"),
"selected" => $this->lng->txt(
"selected_pages_only"));
3379 $select_public_mode =
ilUtil::formSelect ($this->object->getPublicAccessMode(),
"lm_public_mode",$modes,
false,
true);
3380 $this->tpl->setVariable(
"SELECT_PUBLIC_MODE", $select_public_mode);
3382 $this->tpl->setVariable(
"TXT_EXPLORER_HEADER", $this->lng->txt(
"choose_public_pages"));
3383 $this->tpl->setVariable(
"EXP_REFRESH", $this->lng->txt(
"refresh"));
3384 $this->tpl->setVariable(
"EXPLORER",$output);
3385 $this->tpl->setVariable(
"ONCLICK",$js_pages);
3386 $this->tpl->setVariable(
"TXT_CHECKALL", $this->lng->txt(
"check_all"));
3387 $this->tpl->setVariable(
"TXT_UNCHECKALL", $this->lng->txt(
"uncheck_all"));
3388 $this->tpl->setVariable(
"TXT_SAVE", $this->lng->txt(
"save"));
3389 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getLinkTarget($this,
"savePublicSection"));
3400 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
3402 if(count(
$_POST[
"id"]) > 1)
3404 $this->ilias->raiseError($this->lng->txt(
"cont_select_max_one_item"),$this->ilias->error_obj->MESSAGE);
3406 if (
$_POST[
"id"][0] != $this->object->getHeaderPage())
3408 $this->
object->setHeaderPage(
$_POST[
"id"][0]);
3412 $this->
object->setHeaderPage(0);
3414 $this->
object->updateProperties();
3415 $this->ctrl->redirect($this,
"pages");
3425 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
3427 if(count(
$_POST[
"id"]) > 1)
3429 $this->ilias->raiseError($this->lng->txt(
"cont_select_max_one_item"),$this->ilias->error_obj->MESSAGE);
3431 if (
$_POST[
"id"][0] != $this->object->getFooterPage())
3433 $this->
object->setFooterPage(
$_POST[
"id"][0]);
3437 $this->
object->setFooterPage(0);
3439 $this->
object->updateProperties();
3440 $this->ctrl->redirect($this,
"pages");
3452 $ilCtrl->redirect($this,
"chapters");
3462 include_once(
"./Modules/LearningModule/classes/class.ilChapterHierarchyFormGUI.php");
3469 $parent_id = $this->lm_tree->getParentId($node_id);
3474 $parent_id = $node_id;
3478 for ($i = 1; $i <= $num; $i++)
3481 $chap->setType(
"st");
3482 $chap->setTitle($lng->txt(
"cont_new_chap"));
3483 $chap->setLMId($this->object->getId());
3488 $ilCtrl->redirect($this,
"chapters");
3498 include_once(
"./Modules/LearningModule/classes/class.ilChapterHierarchyFormGUI.php");
3500 if ($ilUser->getPref(
"lm_js_chapter_editing") !=
"disable")
3510 $node_id = $this->lm_tree->getRootId();
3511 $first_child =
true;
3515 $node_id =
$_POST[
"id"][0];
3516 $first_child =
false;
3520 $ilLog->write(
"InsertChapterClip, num: $num, node_id: $node_id, ".
3525 $parent_id = $this->lm_tree->getParentId($node_id);
3530 $parent_id = $node_id;
3535 $chapters = $ilUser->getClipboardObjects(
"st",
true);
3536 $copied_nodes = array();
3537 foreach ($chapters as $chap)
3539 $ilLog->write(
"Call pasteTree, Target LM: ".$this->object->getId().
", Chapter ID: ".$chap[
"id"]
3540 .
", Parent ID: ".$parent_id.
", Target: ".$target);
3542 $target, $chap[
"insert_time"], $copied_nodes,
3550 $ilUser->clipboardDeleteObjectsOfType(
"pg");
3551 $ilUser->clipboardDeleteObjectsOfType(
"st");
3555 $this->
object->checkTree();
3556 $ilCtrl->redirect($this,
"chapters");
3568 if ($ilAccess->checkAccess(
"read",
"", $a_target))
3570 $_GET[
"baseClass"] =
"ilLMPresentationGUI";
3571 $_GET[
"ref_id"] = $a_target;
3572 include(
"ilias.php");
3574 }
else if ($ilAccess->checkAccess(
"visible",
"", $a_target))
3576 $_GET[
"baseClass"] =
"ilLMPresentationGUI";
3577 $_GET[
"ref_id"] = $a_target;
3578 $_GET[
"cmd"] =
"infoScreen";
3579 include(
"ilias.php");
3582 else if ($ilAccess->checkAccess(
"read",
"", ROOT_FOLDER_ID))
3584 $_GET[
"cmd"] =
"frameset";
3585 $_GET[
"target"] =
"";
3586 $_GET[
"ref_id"] = ROOT_FOLDER_ID;
3589 include(
"repository.php");
3594 $ilErr->raiseError($lng->txt(
"msg_no_perm_read_lm"), $ilErr->FATAL);
3605 if (!is_array($items))
3608 $ilCtrl->redirect($this, $a_return);
3612 foreach($items as $k => $item)
3619 foreach($todel as $k)
3627 $ilCtrl->redirect($this, $a_return);
3638 if (!is_array($items))
3641 $ilCtrl->redirect($this,
"chapters");
3645 foreach($items as $k => $item)
3652 foreach($todel as $k)
3659 $ilCtrl->redirect($this,
"chapters");