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");
34 $lng->loadLanguageModule(
"content");
45 if ($this->ctrl->getRedirectSource() ==
"ilinternallinkgui")
51 if ($this->ctrl->getCmdClass() ==
"ilinternallinkgui")
53 $this->ctrl->setReturn($this,
"explorer");
57 $next_class = $this->ctrl->getNextClass($this);
60 $cmd = $this->ctrl->getCmd(
"", array(
"downloadExportFile"));
64 case "illearningprogressgui":
66 include_once
'./Services/Tracking/classes/class.ilLearningProgressGUI.php';
71 $this->ctrl->forwardCommand($new_gui);
77 include_once
'Services/MetaData/classes/class.ilMDEditorGUI.php';
79 $md_gui =&
new ilMDEditorGUI($this->object->getId(), 0, $this->
object->getType());
80 $md_gui->
addObserver($this->
object,
'MDUpdateListener',
'General');
82 $this->ctrl->forwardCommand($md_gui);
85 case "ilobjstylesheetgui":
87 include_once (
"./Services/Style/classes/class.ilObjStyleSheetGUI.php");
88 $this->ctrl->setReturn($this,
"editStyleProperties");
89 $style_gui =&
new ilObjStyleSheetGUI(
"", $this->object->getStyleSheetId(),
false,
false);
91 if (
$cmd ==
"create" ||
$_GET[
"new_type"]==
"sty")
93 $style_gui->setCreationMode(
true);
95 $ret =& $this->ctrl->forwardCommand($style_gui);
98 if (
$cmd ==
"save" ||
$cmd ==
"copyStyle" ||
$cmd ==
"importStyle")
101 $this->
object->setStyleSheetId($style_id);
102 $this->
object->update();
103 $this->ctrl->redirectByClass(
"ilobjstylesheetgui",
"edit");
107 case "illmpageobjectgui":
108 $this->ctrl->saveParameter($this, array(
"obj_id"));
110 $this->ctrl->setReturn($this,
"chapters");
115 if (
$_GET[
"obj_id"] !=
"")
118 $pg_gui->setLMPageObject($obj);
121 $ret =& $this->ctrl->forwardCommand($pg_gui);
122 if (
$cmd ==
"save" ||
$cmd ==
"cancel")
124 $this->ctrl->redirect($this,
"pages");
128 case "ilstructureobjectgui":
129 $this->ctrl->saveParameter($this, array(
"obj_id"));
131 $this->ctrl->setReturn($this,
"chapters");
133 if (
$_GET[
"obj_id"] !=
"")
136 $st_gui->setStructureObject($obj);
139 $ret =& $this->ctrl->forwardCommand($st_gui);
140 if (
$cmd ==
"save" ||
$cmd ==
"cancel")
142 if (
$_GET[
"obj_id"] ==
"")
144 $this->ctrl->redirect($this,
"chapters");
148 $this->ctrl->setCmd(
"subchap");
154 case 'ilpermissiongui':
155 if (strtolower(
$_GET[
"baseClass"]) ==
"iladministrationgui")
164 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
166 $ret =& $this->ctrl->forwardCommand($perm_gui);
170 case 'ilinfoscreengui':
173 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
175 $info->enablePrivateNotes();
176 $info->enableLearningProgress();
179 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"]))
181 $info->enableNewsEditing();
182 $info->setBlockProperty(
"news",
"settings",
true);
186 $info->addMetaDataSections($this->object->getId(), 0,
187 $this->
object->getType());
189 $ret =& $this->ctrl->forwardCommand($info);
193 $new_type =
$_POST[
"new_type"]
198 if (
$cmd ==
"create" &&
199 !in_array($new_type, array(
"dbk",
"lm")))
206 $this->ctrl->setCmdClass(
"ilLMPageObjectGUI");
212 $this->ctrl->setCmdClass(
"ilStructureObjectGUI");
221 in_array($new_type, array(
"dbk",
"lm")))
244 return array(
"ilLMPageObjectGUI",
"ilStructureObjectGUI",
"ilObjStyleSheetGUI");
254 $lng->loadLanguageModule(
"style");
259 $showViewInFrameset =
true;
261 if ($showViewInFrameset)
267 $buttonTarget =
"ilContObj".$this->object->getID();
271 $this->tpl->addBlockfile(
"BUTTONS",
"buttons",
"tpl.buttons.html");
274 $this->tpl->setCurrentBlock(
"btn_cell");
275 $this->tpl->setVariable(
"BTN_LINK",
"ilias.php?baseClass=ilLMPresentationGUI&ref_id=".$this->object->getRefID());
276 $this->tpl->setVariable(
"BTN_TARGET",
" target=\"".$buttonTarget.
"\" ");
277 $this->tpl->setVariable(
"BTN_TXT",$this->lng->txt(
"view"));
278 $this->tpl->parseCurrentBlock();
280 $this->tpl->setCurrentBlock(
"btn_cell");
281 $this->tpl->setVariable(
"BTN_LINK", $this->ctrl->getLinkTarget($this,
"fixTreeConfirm"));
283 $this->tpl->setVariable(
"BTN_TXT", $this->lng->txt(
"cont_fix_tree"));
284 $this->tpl->parseCurrentBlock();
291 $this->tpl->setContent($this->form->getHTML());
301 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
306 $this->form->addItem($online);
318 $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>";
321 $this->form->addItem($layout);
324 $page_header =
new ilSelectInputGUI($lng->txt(
"cont_page_header"),
"lm_pg_header");
325 $option = array (
"st_title" => $this->lng->txt(
"cont_st_title"),
326 "pg_title" => $this->lng->txt(
"cont_pg_title"),
327 "none" => $this->lng->txt(
"cont_none"));
329 $this->form->addItem($page_header);
333 $this->form->addItem($chap_num);
337 $option = array (
"chapters" => $this->lng->txt(
"cont_chapters_only"),
338 "pages" => $this->lng->txt(
"cont_chapters_and_pages"));
340 $this->form->addItem($toc_mode);
343 if (!$this->ilias->getSetting(
'disable_notes'))
345 $pub_nodes =
new ilCheckboxInputGUI($lng->txt(
"cont_public_notes"),
"cobj_pub_notes");
346 $pub_nodes->
setInfo($this->lng->txt(
"cont_public_notes_desc"));
347 $this->form->addItem($pub_nodes);
352 $lpp->
setInfo($this->lng->txt(
"cont_layout_per_page_info"));
353 $this->form->addItem($lpp);
356 $synch =
new ilCheckboxInputGUI($lng->txt(
"cont_synchronize_frames"),
"cobj_clean_frames");
357 $synch->
setInfo($this->lng->txt(
"cont_synchronize_frames_desc"));
358 $this->form->addItem($synch);
361 $com =
new ilCheckboxInputGUI($lng->txt(
"enable_hist_user_comments"),
"cobj_user_comments");
362 $com->
setInfo($this->lng->txt(
"enable_hist_user_comments_desc"));
363 $this->form->addItem($com);
365 $this->form->setTitle($lng->txt(
"cont_general_properties"));
366 $this->form->addCommandButton(
"saveProperties", $lng->txt(
"save"));
367 $this->form->setFormAction($ilCtrl->getFormAction($this));
376 if ($this->object->getOnline())
378 $values[
"cobj_online"] =
true;
380 $values[
"lm_layout"] = $this->
object->getLayout();
381 $values[
"lm_pg_header"] = $this->
object->getPageHeader();
382 if ($this->object->isActiveNumbering())
384 $values[
"cobj_act_number"] =
true;
386 $values[
"toc_mode"] = $this->
object->getTOCMode();
387 if ($this->object->publicNotes())
389 $values[
"cobj_pub_notes"] =
true;
391 if ($this->object->cleanFrames())
393 $values[
"cobj_clean_frames"] =
true;
395 if ($this->object->isActiveHistoryUserComments())
397 $values[
"cobj_user_comments"] =
true;
399 $values[
"layout_per_page"] = $this->
object->getLayoutPerPage();
401 $this->form->setValuesByArray($values);
412 if ($this->form->checkInput())
414 $this->
object->setLayout(
$_POST[
"lm_layout"]);
415 $this->
object->setPageHeader(
$_POST[
"lm_pg_header"]);
416 $this->
object->setTOCMode(
$_POST[
"toc_mode"]);
417 $this->
object->setOnline(
$_POST[
"cobj_online"]);
418 $this->
object->setActiveNumbering(
$_POST[
"cobj_act_number"]);
419 $this->
object->setCleanFrames(
$_POST[
"cobj_clean_frames"]);
420 $this->
object->setPublicNotes(
$_POST[
"cobj_pub_notes"]);
421 $this->
object->setHistoryUserComments(
$_POST[
"cobj_user_comments"]);
422 $this->
object->setLayoutPerPage(
$_POST[
"layout_per_page"]);
423 $this->
object->updateProperties();
425 $this->ctrl->redirect($this,
"properties");
429 $this->form->setValuesByPost();
430 $tpl->setContent($this->form->getHTML());
442 $tpl->setContent($this->form->getHTML());
452 $lng->loadLanguageModule(
"style");
454 $ilTabs->setTabActive(
"properties");
457 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
460 $fixed_style = $ilSetting->get(
"fixed_content_style_id");
461 $style_id = $this->
object->getStyleSheetId();
463 if ($fixed_style > 0)
467 $this->lng->txt(
"global_fixed").
")");
468 $this->form->addItem($st);
475 $st_styles[0] = $this->lng->txt(
"default");
485 $this->form->addItem($st);
490 $this->form->addCommandButton(
"editStyle",
491 $lng->txt(
"cont_edit_style"));
492 $this->form->addCommandButton(
"deleteStyle",
493 $lng->txt(
"cont_delete_style"));
501 $st_styles,
false,
true);
502 $style_sel =
new ilSelectInputGUI($lng->txt(
"cont_current_style"),
"style_id");
504 $style_sel->setValue($style_id);
505 $this->form->addItem($style_sel);
507 $this->form->addCommandButton(
"saveStyleSettings",
509 $this->form->addCommandButton(
"createStyle",
510 $lng->txt(
"sty_create_ind_style"));
513 $this->form->setTitle($lng->txt(
"cont_style"));
514 $this->form->setFormAction($ilCtrl->getFormAction($this));
524 $ilCtrl->redirectByClass(
"ilobjstylesheetgui",
"create");
534 $ilCtrl->redirectByClass(
"ilobjstylesheetgui",
"edit");
544 $ilCtrl->redirectByClass(
"ilobjstylesheetgui",
"delete");
554 if ($ilSetting->get(
"fixed_content_style_id") <= 0 &&
556 || $this->object->getStyleSheetId() == 0))
559 $this->
object->update();
562 $this->ctrl->redirect($this,
"editStyleProperties");
570 global
$lng, $ilTabs;
572 $lng->loadLanguageModule(
"style");
574 $ilTabs->setTabActive(
"properties");
578 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.lm_properties.html",
"Modules/LearningModule");
579 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
581 $this->tpl->setVariable(
"TXT_LM_MENU", $this->lng->txt(
"cont_lm_menu"));
582 $this->tpl->setVariable(
"TXT_ACT_MENU", $this->lng->txt(
"cont_active"));
583 $this->tpl->setVariable(
"CBOX_LM_MENU",
"cobj_act_lm_menu");
584 $this->tpl->setVariable(
"VAL_LM_MENU",
"y");
585 if ($this->object->isActiveLMMenu())
587 $this->tpl->setVariable(
"CHK_LM_MENU",
"checked");
591 $this->tpl->setVariable(
"TXT_TOC", $this->lng->txt(
"cont_toc"));
592 $this->tpl->setVariable(
"CBOX_TOC",
"cobj_act_toc");
593 $this->tpl->setVariable(
"VAL_TOC",
"y");
594 if ($this->object->isActiveTOC())
596 $this->tpl->setVariable(
"CHK_TOC",
"checked");
600 $this->tpl->setVariable(
"TXT_PRINT", $this->lng->txt(
"cont_print_view"));
601 $this->tpl->setVariable(
"CBOX_PRINT",
"cobj_act_print");
602 $this->tpl->setVariable(
"VAL_PRINT",
"y");
603 if ($this->object->isActivePrintView())
605 $this->tpl->setVariable(
"CHK_PRINT",
"checked");
609 $this->tpl->setVariable(
"TXT_PRINT_PREV_GLO", $this->lng->txt(
"cont_print_view_pre_glo"));
610 $this->tpl->setVariable(
"CBOX_PRINT_PREV_GLO",
"cobj_act_print_prev_glo");
611 $this->tpl->setVariable(
"VAL_PRINT_PREV_GLO",
"y");
612 if ($this->object->isActivePreventGlossaryAppendix())
614 $this->tpl->setVariable(
"CHK_PRINT_PREV_GLO",
"checked");
618 $this->tpl->setVariable(
"TXT_DOWNLOADS", $this->lng->txt(
"cont_downloads"));
619 $this->tpl->setVariable(
"TXT_DOWNLOADS_DESC", $this->lng->txt(
"cont_downloads_desc"));
620 $this->tpl->setVariable(
"CBOX_DOWNLOADS",
"cobj_act_downloads");
621 $this->tpl->setVariable(
"VAL_DOWNLOADS",
"y");
623 if ($this->object->isActiveDownloads())
625 $this->tpl->setVariable(
"CHK_DOWNLOADS",
"checked=\"checked\"");
628 $this->tpl->setVariable(
"TXT_DOWNLOADS_PUBLIC_DESC", $this->lng->txt(
"cont_downloads_public_desc"));
629 $this->tpl->setVariable(
"CBOX_DOWNLOADS_PUBLIC",
"cobj_act_downloads_public");
630 $this->tpl->setVariable(
"VAL_DOWNLOADS_PUBLIC",
"y");
632 if ($this->object->isActiveDownloadsPublic())
634 $this->tpl->setVariable(
"CHK_DOWNLOADS_PUBLIC",
"checked=\"checked\"");
637 if (!$this->object->isActiveDownloads())
639 $this->tpl->setVariable(
"CHK2_DOWNLOADS_PUBLIC",
"disabled=\"disabled\"");
644 $entries = $this->lmme_obj->getMenuEntries();
646 if (count($entries) > 0)
648 foreach ($entries as $entry)
650 $this->ctrl->setParameter($this,
"menu_entry", $entry[
"id"]);
652 $this->tpl->setCurrentBlock(
"menu_entries");
654 if ($entry[
"type"] ==
"intern")
656 $entry[
"link"] = ILIAS_HTTP_PATH.
"/goto.php?target=".$entry[
"link"];
660 if (!strstr($entry[
"link"],
'://') && !strstr($entry[
"link"],
'mailto:'))
662 $entry[
"link"] =
"http://".$entry[
"link"];
665 $this->tpl->setVariable(
"ENTRY_LINK", $entry[
"link"]);
666 $this->tpl->setVariable(
"ENTRY_TITLE", $entry[
"title"]);
668 $this->tpl->setVariable(
"CBOX_ENTRY",
"menu_entries[]");
669 $this->tpl->setVariable(
"VAL_ENTRY", $entry[
"id"]);
673 $this->tpl->setVariable(
"CHK_ENTRY",
"checked=\"checked\"");
677 $this->tpl->setVariable(
"LINK_EDIT", $this->ctrl->getLinkTarget($this,
"editMenuEntry"));
678 $this->tpl->setVariable(
"TARGET_EDIT",
"content");
679 $this->tpl->setVariable(
"TXT_EDIT", $this->lng->txt(
"edit"));
682 $this->tpl->setVariable(
"LINK_DROP", $this->ctrl->getLinkTarget($this,
"deleteMenuEntry"));
683 $this->tpl->setVariable(
"TARGET_DROP",
"content");
684 $this->tpl->setVariable(
"TXT_DROP", $this->lng->txt(
"drop"));
687 $this->tpl->parseCurrentBlock();
694 $this->tpl->setCurrentBlock(
"commands");
695 $this->tpl->setVariable(
"BTN_NAME",
"saveMenuProperties");
696 $this->tpl->setVariable(
"BTN_TEXT", $this->lng->txt(
"save"));
697 $this->tpl->setVariable(
"BTN_NAME2",
"addMenuEntry");
698 $this->tpl->setVariable(
"BTN_TEXT2", $this->lng->txt(
"add_menu_entry"));
699 $this->tpl->parseCurrentBlock();
712 $this->
object->setActivePreventGlossaryAppendix(
ilUtil::yn2tf(
$_POST[
"cobj_act_print_prev_glo"]));
714 $this->
object->setActiveDownloadsPublic(
ilUtil::yn2tf(
$_POST[
"cobj_act_downloads_public"]));
715 $this->
object->updateProperties();
719 $this->lmme_obj->updateActiveStatus(
$_POST[
"menu_entries"]);
722 $this->ctrl->redirect($this,
"editMenuProperties");
732 switch ($this->object->getType())
735 $gui_class =
"ilobjlearningmodulegui";
739 $gui_class =
"ilobjdlbookgui";
743 $ilCtrl->setParameterByClass($gui_class,
"active_node",
$_GET[
"active_node"]);
745 $this->tpl =
new ilTemplate(
"tpl.main.html",
true,
true);
752 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.explorer.html");
755 require_once (
"./Modules/LearningModule/classes/class.ilLMEditorExplorer.php");
760 $exp->setExpandTarget($this->ctrl->getLinkTarget($this,
"explorer"));
762 if (
$_GET[
"lmmovecopy"] ==
"1")
768 if (
$_GET[
"lmexpand"] ==
"")
770 $mtree =
new ilTree($this->object->getId());
772 $mtree->setTreeTablePK(
"lm_id");
773 $expanded = $mtree->readRootId();
777 $expanded =
$_GET[
"lmexpand"];
779 if (
$_GET[
"active_node"] !=
"")
781 $path = $this->lm_tree->getPathId(
$_GET[
"active_node"]);
782 $exp->setForceOpenPath($path);
784 $exp->highlightNode(
$_GET[
"active_node"]);
786 $exp->setExpand($expanded);
790 $output = $exp->getOutput();
793 if ($ilCtrl->isAsynch())
798 include_once(
"./Services/COPage/classes/class.ilPageEditorGUI.php");
817 $this->tpl->setCurrentBlock(
"content");
818 $this->tpl->setVariable(
"TXT_EXPLORER_HEADER", $this->lng->txt(
"cont_chap_and_pages"));
819 $this->tpl->setVariable(
"EXP_REFRESH", $this->lng->txt(
"refresh"));
820 $this->tpl->setVariable(
"EXPLORER",$output);
821 $this->ctrl->setParameter($this,
"lmexpand",
$_GET[
"lmexpand"]);
822 $this->tpl->setVariable(
"ACTION", $this->ctrl->getLinkTarget($this,
"explorer"));
823 $this->tpl->parseCurrentBlock();
824 $this->tpl->show(
false);
833 include_once
"./Services/COPage/classes/class.ilWysiwygUtil.php";
835 $popup->show(
$_GET[
"ptype"]);
846 $this->
object->executeDragDrop(
$_POST[
"il_hform_source_id"],
$_POST[
"il_hform_target_id"],
848 $ilCtrl->redirect($this,
"chapters");
856 global $rbacsystem,
$tpl;
860 if (!$rbacsystem->checkAccess(
"create",
$_GET[
"ref_id"], $new_type))
862 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
867 $f1 = $this->form->getHTML();
869 $f2 = $this->form->getHTML();
870 $this->tpl->setContent($f1.
"<br />".$f2);
877 $data[
"fields"] = array();
883 $this->tpl->setVariable(
"TYPE_IMG",
885 $this->tpl->setVariable(
"ALT_IMG",
886 $this->lng->txt(
"obj_".$new_type));
888 foreach (
$data[
"fields"] as
$key => $val)
890 $this->tpl->setVariable(
"TXT_".strtoupper(
$key), $this->lng->txt(
$key));
891 $this->tpl->setVariable(strtoupper(
$key), $val);
893 if ($this->prepare_output)
895 $this->tpl->parseCurrentBlock();
903 $this->ctrl->setParameter($this,
"new_type", $new_type);
904 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this,
"save"));
907 $this->tpl->setVariable(
"TXT_HEADER", $this->lng->txt($new_type.
"_new"));
908 $this->tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
909 $this->tpl->setVariable(
"TXT_SUBMIT", $this->lng->txt($new_type.
"_add"));
910 $this->tpl->setVariable(
"CMD_SUBMIT",
"save");
911 $this->tpl->setVariable(
"TARGET",
' target="'.
913 $this->tpl->setVariable(
"TXT_REQUIRED_FLD", $this->lng->txt(
"required_field"));
915 $this->tpl->setVariable(
"TXT_IMPORT_LM", $this->lng->txt(
"import_".$new_type));
916 $this->tpl->setVariable(
"TXT_LM_FILE", $this->lng->txt(
"file"));
917 $this->tpl->setVariable(
"TXT_IMPORT", $this->lng->txt(
"import"));
920 $umf=get_cfg_var(
"upload_max_filesize");
922 $pms=get_cfg_var(
"post_max_size");
925 $max_filesize = ((int) $umf < (
int) $pms)
928 if ((
int) $pms == 0) $max_filesize = $umf;
930 if (!$max_filesize) $max_filesize=max($umf, $pms);
933 $this->tpl->setVariable(
"TXT_FILE_INFO", $this->lng->txt(
"file_notice").
" $max_filesize.");
947 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
951 $this->ctrl->setParameter($this,
"new_type", $new_type);
954 $this->form->setTableWidth(
"600px");
959 $ti->setRequired(
true);
961 $this->form->addItem($ti);
967 $this->form->addItem($ta);
969 $this->form->addCommandButton(
"save", $this->lng->txt($new_type.
"_add"));
970 $this->form->addCommandButton(
"cancel", $lng->txt(
"cancel"));
971 $this->form->
setTitle($this->lng->txt($new_type.
"_new"));
972 $this->form->setFormAction($this->ctrl->getFormAction($this,
"save"));
982 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
986 $this->ctrl->setParameter($this,
"new_type", $new_type);
989 $this->form->setTableWidth(
"600px");
994 $fi->setRequired(
true);
996 $this->form->addItem($fi);
1000 $cb->
setInfo($this->lng->txt(
""));
1001 $this->form->addItem($cb);
1003 $this->form->addCommandButton(
"importFile", $lng->txt(
"import"));
1004 $this->form->addCommandButton(
"cancel", $lng->txt(
"cancel"));
1006 $this->form->setTitle($this->lng->txt(
"import_".$new_type));
1007 $this->form->setFormAction($ilCtrl->getFormAction($this));
1016 global $rbacadmin, $rbacsystem,
$tpl;
1021 if (!$rbacsystem->checkAccess(
"create",
$_GET[
"ref_id"],
$_GET[
"new_type"]))
1023 $this->ilias->raiseError($this->lng->txt(
"no_create_permission"), $this->ilias->error_obj->MESSAGE);
1028 if ($this->form->checkInput())
1031 include_once(
"./Modules/LearningModule/classes/class.ilObjContentObject.php");
1033 $newObj->setType($this->type);
1034 $newObj->setTitle(
$_POST[
"title"]);#
"content object ".$newObj->getId());
1035 $newObj->setDescription(
$_POST[
"desc"]);
1037 $newObj->createReference();
1038 $newObj->putInTree(
$_GET[
"ref_id"]);
1039 $newObj->setPermissions(
$_GET[
"ref_id"]);
1040 $newObj->notify(
"new",
$_GET[
"ref_id"],
$_GET[
"parent_non_rbac_id"],
$_GET[
"ref_id"],$newObj->getRefId());
1041 $newObj->setCleanFrames(
true);
1049 $newObj->createLMTree();
1054 "&baseClass=ilLMEditorGUI");
1059 $this->form->setValuesByPost();
1060 $tpl->setContent($this->form->getHtml());
1069 include_once
"./Modules/LearningModule/classes/class.ilBibItemGUI.php";
1071 $bib_gui->setObject($this->
object);
1072 $bibItemName =
$_POST[
"bibItemName"] ?
$_POST[
"bibItemName"] :
$_GET[
"bibItemName"];
1073 $bibItemIndex =
$_POST[
"bibItemIndex"] ?
$_POST[
"bibItemIndex"] :
$_GET[
"bibItemIndex"];
1074 if ($bibItemIndex ==
"")
1076 $bibItemPath =
$_POST[
"bibItemPath"] ?
$_POST[
"bibItemPath"] :
$_GET[
"bibItemPath"];
1077 if ($bibItemName !=
"")
1079 $bib_gui->bib_obj->add($bibItemName, $bibItemPath, $bibItemIndex);
1080 $data = $bib_gui->bib_obj->getElement(
"BibItem");
1081 $bibItemIndex = (count(
$data) - 1);
1087 if ($a_target ==
"")
1089 $a_target =
"adm_object.php?ref_id=" . $this->
object->getRefId();
1092 $bib_gui->edit(
"ADM_CONTENT",
"adm_content", $a_target, $bibItemIndex);
1113 include_once
"./Modules/LearningModule/classes/class.ilBibItemGUI.php";
1115 $bib_gui->setObject($this->
object);
1116 $bibItemIndex =
$_POST[
"bibItemIndex"] ?
$_POST[
"bibItemIndex"] :
$_GET[
"bibItemIndex"];
1117 $bib_gui->bib_obj->delete(
$_GET[
"bibItemName"],
$_GET[
"bibItemPath"], $bibItemIndex);
1118 if (strpos($bibItemIndex,
",") > 0)
1120 $bibItemIndex = substr($bibItemIndex, 0, strpos($bibItemIndex,
","));
1122 if ($a_target ==
"")
1124 $a_target =
"adm_object.php?ref_id=" . $this->
object->getRefId();
1127 $bib_gui->edit(
"ADM_CONTENT",
"adm_content", $a_target, $bibItemIndex);
1149 include_once
"./Modules/LearningModule/classes/class.ilBibItemGUI.php";
1151 $bib_gui->setObject($this->
object);
1152 $bibItemIndex =
$_POST[
"bibItemIndex"] ?
$_POST[
"bibItemIndex"] :
$_GET[
"bibItemIndex"];
1154 if ($bibItemIndex < 0)
1158 if ($a_target ==
"")
1160 $a_target =
"adm_object.php?ref_id=" . $this->
object->getRefId();
1163 $bib_gui->edit(
"ADM_CONTENT",
"adm_content", $a_target, $bibItemIndex);
1184 include_once
"./Modules/LearningModule/classes/class.ilBibItemGUI.php";
1186 $bib_gui->setObject($this->
object);
1187 $bibItemIndex =
$_POST[
"bibItemIndex"] ?
$_POST[
"bibItemIndex"] :
$_GET[
"bibItemIndex"];
1189 if ($bibItemIndex < 0)
1193 $bibItemIndex = $bib_gui->save($bibItemIndex);
1195 if ($a_target ==
"")
1197 $a_target =
"adm_object.php?ref_id=" . $this->
object->getRefId();
1200 $bib_gui->edit(
"ADM_CONTENT",
"adm_content", $a_target, $bibItemIndex);
1246 global $_FILES, $rbacsystem,
$ilDB,
$tpl;
1248 include_once
"./Modules/LearningModule/classes/class.ilObjLearningModule.php";
1250 if (!$rbacsystem->checkAccess(
"create",
$_GET[
"ref_id"],
$_GET[
"new_type"]))
1252 $this->ilias->raiseError($this->lng->txt(
"no_create_permission"), $this->ilias->error_obj->MESSAGE);
1257 if ($this->form->checkInput())
1260 include_once(
"./Modules/LearningModule/classes/class.ilObjContentObject.php");
1262 $newObj->setType(
$_GET[
"new_type"]);
1263 $newObj->setTitle($_FILES[
"xmldoc"][
"name"]);
1264 $newObj->setDescription(
"");
1265 $newObj->create(
true);
1266 $newObj->createReference();
1267 $newObj->putInTree(
$_GET[
"ref_id"]);
1268 $newObj->setPermissions(
$_GET[
"ref_id"]);
1269 $newObj->notify(
"new",
$_GET[
"ref_id"],
$_GET[
"parent_non_rbac_id"],
$_GET[
"ref_id"],$newObj->getRefId());
1272 $newObj->createLMTree();
1275 $newObj->createImportDirectory();
1278 $file = pathinfo($_FILES[
"xmldoc"][
"name"]);
1279 $full_path = $newObj->getImportDirectory().
"/".$_FILES[
"xmldoc"][
"name"];
1282 $_FILES[
"xmldoc"][
"name"], $full_path);
1290 $subdir = basename(
$file[
"basename"],
".".
$file[
"extension"]);
1291 $xml_file = $newObj->getImportDirectory().
"/".$subdir.
"/".$subdir.
".xml";
1294 if (!is_dir($newObj->getImportDirectory().
"/".$subdir))
1296 $this->ilias->raiseError(sprintf($this->lng->txt(
"cont_no_subdir_in_zip"), $subdir),
1297 $this->ilias->error_obj->MESSAGE);
1301 if (!is_file($xml_file))
1303 $this->ilias->raiseError(sprintf($this->lng->txt(
"cont_zip_file_invalid"), $subdir.
"/".$subdir.
".xml"),
1304 $this->ilias->error_obj->MESSAGE);
1307 include_once (
"./Modules/LearningModule/classes/class.ilContObjParser.php");
1309 $contParser->startParsing();
1311 $newObj->MDUpdateListener(
'General');
1314 $style_file = $newObj->getImportDirectory().
"/".$subdir.
"/style.xml";
1315 $style_zip_file = $newObj->getImportDirectory().
"/".$subdir.
"/style.zip";
1316 if (is_file($style_zip_file))
1318 require_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
1320 $style->import($style_zip_file);
1321 $newObj->writeStyleSheetId($style->getId());
1323 else if (is_file($style_file))
1325 require_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
1327 $style->import($style_file);
1328 $newObj->writeStyleSheetId($style->getId());
1337 $mess = $newObj->validatePages();
1345 include_once(
"./Services/COPage/classes/class.ilPageObject.php");
1347 $newObj->getType(), $newObj->getRefId());
1349 "&baseClass=ilLMEditorGUI");
1353 $link =
'<a href="'.
"ilias.php?ref_id=".$newObj->getRefId().
1354 "&baseClass=ilLMEditorGUI".
'" target="_top">'.$this->lng->txt(
"btn_next").
'</a>';
1355 $tpl->setContent(
"<br />".$link.
"<br /><br />".$mess.$link);
1360 $this->form->setValuesByPost();
1361 $tpl->setContent($this->form->getHtml());
1374 if ($ilUser->getPref(
"lm_js_chapter_editing") !=
"disable")
1376 $ilCtrl->setParameter($this,
"backcmd",
"chapters");
1378 include_once(
"./Modules/LearningModule/classes/class.ilChapterHierarchyFormGUI.php");
1381 $form_gui->setTitle($this->object->getTitle());
1383 $form_gui->setTree($this->lm_tree);
1384 $form_gui->setMaxDepth(0);
1385 $form_gui->setCurrentTopNodeId($this->tree->getRootId());
1386 $form_gui->addMultiCommand($lng->txt(
"delete"),
"delete");
1387 $form_gui->addMultiCommand($lng->txt(
"cut"),
"cutItems");
1388 $form_gui->addMultiCommand($lng->txt(
"copy"),
"copyItems");
1390 $form_gui->addCommand($lng->txt(
"cont_save_all_titles"),
"saveAllTitles");
1391 $up_gui = ($this->
object->getType() ==
"dbk")
1393 :
"ilobjlearningmodulegui";
1394 $form_gui->setExplorerUpdater(
"tree",
"tree_div",
1395 $ilCtrl->getLinkTargetByClass($up_gui,
"explorer",
"",
true));
1397 $ctpl =
new ilTemplate(
"tpl.chap_and_pages.html",
true,
true,
"Modules/LearningModule");
1398 $ctpl->setVariable(
"HIERARCHY_FORM", $form_gui->getHTML());
1399 $ilCtrl->setParameter($this,
"obj_id",
"");
1400 $ctpl->setVariable(
"HREF_NO_JS_EDIT",
1401 $ilCtrl->getLinkTarget($this,
"deactivateJSChapterEditing"));
1402 $ctpl->setVariable(
"TXT_NO_JS_EDIT",
1403 $lng->txt(
"cont_not_js_chap_editing"));
1405 $this->tpl->setContent($ctpl->get());
1409 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.structure_edit.html",
"Modules/LearningModule");
1412 $this->ctrl->setParameter($this,
"backcmd",
"chapters");
1413 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
1414 $this->tpl->setVariable(
"HEADER_TEXT", $this->lng->txt(
"cont_chapters"));
1418 $childs = $this->lm_tree->getChilds($this->lm_tree->getRootId());
1419 foreach ($childs as $child)
1421 if($child[
"type"] !=
"st")
1426 $this->tpl->setCurrentBlock(
"table_row");
1431 $this->tpl->setVariable(
"CHECKBOX_ID", $child[
"obj_id"]);
1432 $this->tpl->setVariable(
"CSS_ROW", $css_row);
1436 $this->ctrl->setParameter($this,
"backcmd",
"");
1437 $this->ctrl->setParameterByClass(
"ilStructureObjectGUI",
"obj_id", $child[
"obj_id"]);
1438 $this->tpl->setVariable(
"LINK_TARGET",
1439 $this->ctrl->getLinkTargetByClass(
"ilStructureObjectGUI",
"view"));
1442 $this->tpl->setVariable(
"TEXT_CONTENT",
1444 $this->object->isActiveNumbering()));
1446 $this->tpl->parseCurrentBlock();
1449 $paste_active =
false;
1450 if ($ilUser->clipboardHasObjectsOfType(
"st"))
1452 $paste_active =
true;
1455 if($cnt == 0 && !$paste_active)
1457 $this->tpl->setCurrentBlock(
"notfound");
1458 $this->tpl->setVariable(
"NUM_COLS", 3);
1459 $this->tpl->setVariable(
"TXT_OBJECT_NOT_FOUND", $this->lng->txt(
"obj_not_found"));
1460 $this->tpl->parseCurrentBlock();
1465 $this->tpl->setVariable(
"NUM_COLS", 3);
1468 $acts = array(
"delete" =>
"delete",
"cutChapter" =>
"cut",
1469 "copyChapter" =>
"copyChapter");
1473 $acts[
"pasteChapter"] =
"pasteChapter";
1479 $this->tpl->setVariable(
"NUM_COLS", 3);
1480 $subobj = array(
"st");
1482 $this->tpl->setCurrentBlock(
"add_object");
1483 $this->tpl->setVariable(
"SELECT_OBJTYPE", $opts);
1484 $this->tpl->setVariable(
"BTN_NAME",
"create");
1485 $this->tpl->setVariable(
"TXT_ADD", $this->lng->txt(
"insert"));
1486 $this->tpl->parseCurrentBlock();
1488 $this->tpl->setCurrentBlock(
"form");
1489 $this->tpl->parseCurrentBlock();
1491 $this->tpl->setVariable(
"HREF_JS_EDIT",
1492 $ilCtrl->getLinkTarget($this,
"activateJSChapterEditing"));
1493 $this->tpl->setVariable(
"TXT_JS_EDIT",
1494 $lng->txt(
"cont_js_chap_editing"));
1508 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.all_pages.html",
"Modules/LearningModule");
1511 $this->tpl->setCurrentBlock(
"form");
1512 $this->ctrl->setParameter($this,
"backcmd",
"pages");
1513 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
1514 $this->tpl->setVariable(
"HEADER_TEXT", $this->lng->txt(
"cont_pages"));
1515 $this->tpl->setVariable(
"CONTEXT", $this->lng->txt(
"cont_usage"));
1520 foreach ($pages as $page)
1522 $this->tpl->setCurrentBlock(
"table_row");
1525 include_once(
"./Services/COPage/classes/class.ilPageObject.php");
1528 $lm_set->get(
"time_scheduled_page_activation"));
1531 $img_sc = ($lm_set->get(
"time_scheduled_page_activation") &&
1539 $this->tpl->setVariable(
"IMG_ALT",
1540 $this->lng->txt(
"cont_page_deactivated"));
1545 $this->object->getType()))
1548 $this->tpl->setVariable(
"IMG_ALT",
1549 $this->lng->txt(
"cont_page_deactivated_elements"));
1554 $this->tpl->setVariable(
"IMG_ALT",
1555 $this->lng->txt(
"pg"));
1563 $this->tpl->setVariable(
"CHECKBOX_ID", $page[
"obj_id"]);
1564 $this->tpl->setVariable(
"CSS_ROW", $css_row);
1567 $this->ctrl->setParameter($this,
"backcmd",
"");
1568 $this->ctrl->setParameterByClass(
"ilLMPageObjectGUI",
"obj_id", $page[
"obj_id"]);
1570 $this->tpl->setVariable(
"LINK_TARGET",
1571 $this->ctrl->getLinkTargetByClass(
"ilLMPageObjectGUI",
"edit"));
1574 $this->tpl->setVariable(
"TEXT_CONTENT", $page[
"title"]);
1577 if ($this->lm_tree->isInTree($page[
"obj_id"]))
1588 if ($page[
"obj_id"] == $this->object->getHeaderPage())
1590 $add_str =
" <b>(".$this->lng->txt(
"cont_header").
")</b>";
1592 if ($page[
"obj_id"] == $this->object->getFooterPage())
1594 $add_str =
" <b>(".$this->lng->txt(
"cont_footer").
")</b>";
1597 $this->tpl->setVariable(
"TEXT_CONTEXT", $path_str.$add_str);
1600 $this->tpl->parseCurrentBlock();
1604 $this->tpl->setCurrentBlock(
"notfound");
1605 $this->tpl->setVariable(
"NUM_COLS", 4);
1606 $this->tpl->setVariable(
"TXT_OBJECT_NOT_FOUND", $this->lng->txt(
"obj_not_found"));
1607 $this->tpl->parseCurrentBlock();
1611 $acts = array(
"delete" =>
"delete",
"movePage" =>
"movePage",
"copyPage" =>
"copyPage",
1612 "selectHeader" =>
"selectHeader",
"selectFooter" =>
"selectFooter",
1613 "activatePages" =>
"cont_de_activate");
1617 $acts[
"pastePage"] =
"pastePage";
1625 $this->tpl->setVariable(
"NUM_COLS", 4);
1638 $this->tpl->setVariable(
"NUM_COLS", 4);
1640 $subobj = array(
"pg");
1642 $this->tpl->setCurrentBlock(
"add_object");
1643 $this->tpl->setVariable(
"SELECT_OBJTYPE", $opts);
1644 $this->tpl->setVariable(
"BTN_NAME",
"create");
1645 $this->tpl->setVariable(
"TXT_ADD", $this->lng->txt(
"create"));
1646 $this->tpl->parseCurrentBlock();
1649 $this->tpl->setCurrentBlock(
"form");
1650 $this->tpl->parseCurrentBlock();
1663 include_once(
"./Modules/LearningModule/classes/class.ilLinksTableGUI.php");
1665 $this->object->getId(), $this->
object->getType());
1667 $tpl->setContent($table_gui->getHTML());
1676 if (is_array(
$_POST[
"id"]))
1678 foreach(
$_POST[
"id"] as $id)
1680 include_once(
"./Services/COPage/classes/class.ilPageObject.php");
1686 $this->ctrl->redirect($this,
"pages");
1696 $ilUser->writePref(
"lm_js_chapter_editing",
"disable");
1697 $ilCtrl->redirect($this,
"chapters");
1707 $ilUser->writePref(
"lm_js_chapter_editing",
"enable");
1708 $ilCtrl->redirect($this,
"chapters");
1718 $this->ilias->raiseError($this->lng->txt(
"no_page_in_clipboard"),$this->ilias->error_obj->MESSAGE);
1729 == $this->object->getID())
1732 $new_page =& $lm_page->copy();
1733 $id = $new_page->getId();
1739 $lm_obj =& $this->ilias->obj_factory->getInstanceByObjId($lm_id);
1741 $copied_nodes = array();
1742 $new_page =& $lm_page->copyToOtherContObject($this->
object, $copied_nodes);
1743 $id = $new_page->getId();
1753 != $this->object->getID())
1756 $lm_obj =& $this->ilias->obj_factory->getInstanceByObjId($lm_id);
1758 $lm_page->setLMId($this->object->getID());
1760 $page =& $lm_page->getPageObject();
1762 $page->setParentId($this->object->getID());
1769 $this->ctrl->redirect($this,
"pages");
1779 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
1788 $this->ctrl->redirect($this,
"pages");
1798 function delete($a_parent_subobj_id = 0)
1802 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
1807 $this->ilias->raiseError($this->lng->txt(
"cont_select_item"), $this->ilias->error_obj->MESSAGE);
1810 if ($a_parent_subobj_id == 0)
1818 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.confirm_deletion.html",
"Modules/LearningModule");
1822 if ($a_parent_subobj_id != 0)
1824 $this->ctrl->setParameterByClass(
"ilStructureObjectGUI",
"backcmd",
$_GET[
"backcmd"]);
1825 $this->ctrl->setParameterByClass(
"ilStructureObjectGUI",
"obj_id", $a_parent_subobj_id);
1826 $this->tpl->setVariable(
"FORMACTION",
1827 $this->ctrl->getFormActionByClass(
"ilStructureObjectGUI"));
1831 $this->ctrl->setParameter($this,
"backcmd",
$_GET[
"backcmd"]);
1832 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
1835 $this->tpl->setCurrentBlock(
"table_header");
1836 $this->tpl->setVariable(
"TEXT",$this->lng->txt(
"objects"));
1837 $this->tpl->parseCurrentBlock();
1844 foreach(
$_POST[
"id"] as $id)
1849 switch($obj->getType())
1858 $this->tpl->setCurrentBlock(
"table_row");
1860 $this->tpl->setVariable(
"TEXT_CONTENT", $obj->getTitle());
1861 $this->tpl->parseCurrentBlock();
1867 $buttons = array(
"cancelDelete" => $this->lng->txt(
"cancel"),
1868 "confirmedDelete" => $this->lng->txt(
"confirm"));
1869 foreach ($buttons as
$name => $value)
1871 $this->tpl->setCurrentBlock(
"operation_btn");
1872 $this->tpl->setVariable(
"BTN_NAME",
$name);
1873 $this->tpl->setVariable(
"BTN_VALUE",$value);
1874 $this->tpl->parseCurrentBlock();
1883 session_unregister(
"saved_post");
1885 $this->ctrl->redirect($this,
$_GET[
"backcmd"]);
1899 $tree->setTableNames(
'lm_tree',
'lm_data');
1900 $tree->setTreeTablePK(
"lm_id");
1905 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
1909 foreach (
$_SESSION[
"saved_post"] as $id)
1914 $node_data =
$tree->getNodeData($id);
1915 if (is_object($obj))
1917 $obj->setLMId($this->object->getId());
1919 include_once(
"classes/class.ilHistory.php");
1922 $this->
object->getType());
1926 if(
$tree->isInTree($id))
1928 $tree->deleteTree($node_data);
1934 $this->
object->checkTree();
1939 if ($a_parent_subobj_id == 0)
1941 $this->ctrl->redirect($this,
$_GET[
"backcmd"]);
1957 $tmpPath = $this->lm_tree->getPathFull($a_endnode_id, $a_startnode_id);
1960 for ($i = 1; $i < (count($tmpPath) - 1); $i++)
1967 $path .= $tmpPath[$i][
"title"];
1987 $notoperations = array();
1989 $operations = array();
1995 if (!in_array($row[
"name"], $notoperations))
1997 $operations[] =
$row;
2002 if (count($operations)>0)
2004 foreach ($operations as $val)
2006 $this->tpl->setCurrentBlock(
"operation_btn");
2007 $this->tpl->setVariable(
"BTN_NAME", $val[
"name"]);
2008 $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt($val[
"lng"]));
2009 $this->tpl->parseCurrentBlock();
2012 $this->tpl->setCurrentBlock(
"operation");
2014 $this->tpl->parseCurrentBlock();
2025 $this->
setFormAction(
"addRole", $this->ctrl->getLinkTarget($this,
"addRole"));
2026 $this->
setFormAction(
"permSave", $this->ctrl->getLinkTarget($this,
"permSave"));
2027 $this->permObject();
2036 $this->
setReturnLocation(
"permSave", $this->ctrl->getLinkTarget($this,
"perm"));
2037 $this->permSaveObject();
2046 $this->infoObject();
2056 $this->addRoleObject();
2066 $this->ownerObject();
2075 if (strtolower(
$_GET[
"baseClass"]) ==
"iladministrationgui")
2094 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
2097 if(count(
$_POST[
"id"]) > 1)
2099 $this->ilias->raiseError($this->lng->txt(
"cont_select_max_one_item"),$this->ilias->error_obj->MESSAGE);
2104 $this->ilias->raiseError($this->lng->txt(
"cont_select_item"), $this->ilias->error_obj->MESSAGE);
2112 if ($a_parent_subobj_id == 0)
2114 $this->ctrl->redirect($this,
"chapters");
2129 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
2132 if(count(
$_POST[
"id"]) > 1)
2134 $this->ilias->raiseError($this->lng->txt(
"cont_select_max_one_item"),$this->ilias->error_obj->MESSAGE);
2139 $this->ilias->raiseError($this->lng->txt(
"cont_select_item"), $this->ilias->error_obj->MESSAGE);
2145 ilUtil::sendInfo($this->lng->txt(
"cont_chap_copy_select_target_now"),
true);
2147 if ($a_parent_subobj_id == 0)
2149 $this->ctrl->redirect($this,
"chapters");
2163 $this->ilias->raiseError($this->lng->txt(
"no_chapter_in_clipboard"),$this->ilias->error_obj->MESSAGE);
2166 $target_tree =
new ilTree($this->object->getId());
2168 $target_tree->setTreeTablePK(
"lm_id");
2172 != $this->object->getID())
2175 $source_tree->setTableNames(
'lm_tree',
'lm_data');
2176 $source_tree->setTreeTablePK(
"lm_id");
2180 $source_tree =& $target_tree;
2185 $node = $source_tree->getNodeData($id);
2186 $subnodes = $source_tree->getSubtree($node);
2187 foreach ($subnodes as $subnode)
2189 if($subnode[
"obj_id"] == $a_parent_subobj_id)
2191 $this->ilias->raiseError($this->lng->txt(
"cont_target_within_source"),$this->ilias->error_obj->MESSAGE);
2194 if(
$_POST[
"id"][0] == $id)
2197 $this->ctrl->redirect($this,
"chapters");
2201 $parent = ($a_parent_subobj_id == 0)
2202 ? $target_tree->getRootId()
2203 : $a_parent_subobj_id;
2212 $target =
$_POST[
"id"][0];
2216 $childs =& $target_tree->getChildsByType($parent,
"pg");
2217 if (count($childs) != 0)
2219 $target = $childs[count($childs) - 1][
"obj_id"];
2229 != $this->object->getID())
2234 if ($a_parent_subobj_id == 0)
2236 $this->ctrl->redirect($this,
"chapters");
2241 $target_tree->deleteTree($node);
2243 if (!$target_tree->isInTree($id))
2245 $target_tree->insertNode($id, $parent, $target);
2247 foreach ($subnodes as $node)
2251 if($node[
"obj_id"] != $id)
2253 $target_tree->insertNode($node[
"obj_id"], $node[
"parent"]);
2262 $copied_nodes = array();
2264 == $this->object->getID())
2267 $source_obj->setLMId($this->object->getId());
2268 $source_obj->copy($target_tree, $parent, $target, $copied_nodes);
2276 $source_obj->setLMId($lm_id);
2277 $source_obj->copy($target_tree, $parent, $target, $copied_nodes);
2286 $this->
object->checkTree();
2288 if ($a_parent_subobj_id == 0)
2290 $this->ctrl->redirect($this,
"chapters");
2301 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
2308 $this->ctrl->redirect($this,
"pages");
2316 if (
$_GET[
"new_type"] ==
"pg")
2318 $this->ctrl->redirect($this,
"pages");
2322 $this->ctrl->redirect($this,
"chapters");
2332 require_once(
"./Modules/LearningModule/classes/class.ilContObjectExport.php");
2334 $cont_exp->buildExportFile();
2335 $this->ctrl->redirect($this,
"exportList");
2344 $this->tpl->setCurrentBlock(
"btn_cell");
2345 $this->tpl->setVariable(
"BTN_LINK", $this->ctrl->getLinkTarget($this,
"export"));
2346 $this->tpl->setVariable(
"BTN_TXT", $this->lng->txt(
"cont_create_export_file_xml"));
2347 $this->tpl->parseCurrentBlock();
2350 $this->tpl->setCurrentBlock(
"btn_cell");
2351 $this->tpl->setVariable(
"BTN_LINK", $this->ctrl->getLinkTarget($this,
"exportHTML"));
2352 $this->tpl->setVariable(
"BTN_TXT", $this->lng->txt(
"cont_create_export_file_html"));
2353 $this->tpl->parseCurrentBlock();
2356 $this->tpl->setCurrentBlock(
"btn_cell");
2357 $this->tpl->setVariable(
"BTN_LINK", $this->ctrl->getLinkTarget($this,
"exportSCORM"));
2358 $this->tpl->setVariable(
"BTN_TXT", $this->lng->txt(
"cont_create_export_file_scorm"));
2359 $this->tpl->parseCurrentBlock();
2362 if (is_file($this->object->getExportDirectory().
"/export.log"))
2364 $this->tpl->setCurrentBlock(
"btn_cell");
2365 $this->tpl->setVariable(
"BTN_LINK", $this->ctrl->getLinkTarget($this,
"viewExportLog"));
2366 $this->tpl->setVariable(
"BTN_TXT", $this->lng->txt(
"cont_view_last_export_log"));
2367 $this->tpl->parseCurrentBlock();
2382 $this->tpl->addBlockfile(
"BUTTONS",
"buttons",
"tpl.buttons.html");
2386 $export_files = $this->
object->getExportFiles();
2389 require_once(
"./Services/Table/classes/class.ilTableGUI.php");
2393 $this->tpl->addBlockfile(
"ADM_CONTENT",
"adm_content",
"tpl.table.html");
2396 $this->tpl->addBlockfile(
"TBL_CONTENT",
"tbl_content",
"tpl.export_file_row.html",
"Modules/LearningModule");
2400 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
2402 $tbl->setTitle($this->lng->txt(
"cont_export_files"));
2404 $tbl->setHeaderNames(array(
"", $this->lng->txt(
"type"),
2405 $this->lng->txt(
"cont_file"),
2406 $this->lng->txt(
"cont_size"), $this->lng->txt(
"date") ));
2408 $cols = array(
"",
"type",
"file",
"size",
"date");
2409 $header_params = array(
"ref_id" =>
$_GET[
"ref_id"],
"baseClass" =>
$_GET[
"baseClass"],
2410 "cmd" =>
"exportList",
"cmdClass" => strtolower(get_class($this)));
2411 $tbl->setHeaderVars($cols, $header_params);
2412 $tbl->setColumnWidth(array(
"1%",
"9%",
"40%",
"25%",
"25%"));
2415 $tbl->setOrderColumn(
$_GET[
"sort_by"]);
2416 $tbl->setOrderDirection(
$_GET[
"sort_order"]);
2417 $tbl->setLimit(
$_GET[
"limit"]);
2418 $tbl->setOffset(
$_GET[
"offset"]);
2419 $tbl->setMaxCount($this->maxcount);
2420 $tbl->disable(
"sort");
2423 $this->tpl->setVariable(
"COLUMN_COUNTS", 5);
2427 $this->tpl->setCurrentBlock(
"tbl_action_btn");
2428 $this->tpl->setVariable(
"BTN_NAME",
"confirmDeleteExportFile");
2429 $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"delete"));
2430 $this->tpl->parseCurrentBlock();
2432 $this->tpl->setCurrentBlock(
"tbl_action_btn");
2433 $this->tpl->setVariable(
"BTN_NAME",
"downloadExportFile");
2434 $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"download"));
2435 $this->tpl->parseCurrentBlock();
2437 $this->tpl->setCurrentBlock(
"tbl_action_btn");
2438 $this->tpl->setVariable(
"BTN_NAME",
"publishExportFile");
2439 $this->tpl->setVariable(
"BTN_VALUE", $this->lng->txt(
"cont_public_access"));
2440 $this->tpl->parseCurrentBlock();
2443 $tbl->setFooter(
"tblfooter",$this->lng->txt(
"previous"),$this->lng->txt(
"next"));
2446 $tbl->setMaxCount(count($export_files));
2447 $export_files = array_slice($export_files,
$_GET[
"offset"],
$_GET[
"limit"]);
2449 if(count($export_files) > 0)
2452 foreach($export_files as $exp_file)
2454 $this->tpl->setCurrentBlock(
"tbl_content");
2455 $this->tpl->setVariable(
"TXT_FILENAME", $exp_file[
"file"]);
2458 $this->tpl->setVariable(
"CSS_ROW", $css_row);
2460 $this->tpl->setVariable(
"TXT_SIZE", $exp_file[
"size"]);
2461 $public_str = ($exp_file[
"file"] == $this->
object->getPublicExportFile($exp_file[
"type"]))
2462 ?
" <b>(".$this->lng->txt(
"public").
")<b>"
2464 $this->tpl->setVariable(
"TXT_TYPE", $exp_file[
"type"].$public_str);
2465 $this->tpl->setVariable(
"CHECKBOX_ID", $exp_file[
"type"].
":".$exp_file[
"file"]);
2467 $file_arr = explode(
"__", $exp_file[
"file"]);
2468 $this->tpl->setVariable(
"TXT_DATE", date(
"Y-m-d H:i:s",$file_arr[0]));
2470 $this->tpl->parseCurrentBlock();
2475 $this->tpl->setCurrentBlock(
"notfound");
2476 $this->tpl->setVariable(
"TXT_OBJECT_NOT_FOUND", $this->lng->txt(
"obj_not_found"));
2477 $this->tpl->setVariable(
"NUM_COLS", 4);
2478 $this->tpl->parseCurrentBlock();
2481 $this->tpl->parseCurrentBlock();
2494 $this->tpl->addBlockfile(
"BUTTONS",
"buttons",
"tpl.buttons.html");
2499 $this->tpl->setVariable(
"ADM_CONTENT",
2500 nl2br(file_get_contents($this->object->getExportDirectory().
"/export.log")));
2502 $this->tpl->parseCurrentBlock();
2510 if(!isset(
$_POST[
"file"]))
2512 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
2515 if (count(
$_POST[
"file"]) > 1)
2517 $this->ilias->raiseError($this->lng->txt(
"cont_select_max_one_item"),$this->ilias->error_obj->MESSAGE);
2521 $export_dir = $this->
object->getExportDirectory(
$file[0]);
2531 if(!isset(
$_POST[
"file"]))
2533 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
2535 if (count(
$_POST[
"file"]) > 1)
2537 $this->ilias->raiseError($this->lng->txt(
"cont_select_max_one_item"),$this->ilias->error_obj->MESSAGE);
2541 $export_dir = $this->
object->getExportDirectory(
$file[0]);
2543 if ($this->object->getPublicExportFile(
$file[0]) ==
2546 $this->
object->setPublicExportFile(
$file[0],
"");
2550 $this->
object->setPublicExportFile(
$file[0],
$file[1]);
2552 $this->
object->update();
2553 $this->ctrl->redirect($this,
"exportList");
2561 if(!isset(
$_POST[
"file"]))
2563 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
2566 if (count(
$_POST[
"file"]) > 1)
2568 $this->ilias->raiseError($this->lng->txt(
"cont_select_max_one_item"),$this->ilias->error_obj->MESSAGE);
2572 $export_dir = $this->
object->getOfflineDirectory();
2582 if(!isset(
$_POST[
"file"]))
2584 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
2592 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.confirm_deletion.html",
"Modules/LearningModule");
2596 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
2599 $this->tpl->setCurrentBlock(
"table_header");
2600 $this->tpl->setVariable(
"TEXT",$this->lng->txt(
"objects"));
2601 $this->tpl->parseCurrentBlock();
2607 $file = explode(
":", $file);
2608 $this->tpl->setCurrentBlock(
"table_row");
2610 $this->tpl->setVariable(
"TEXT_CONTENT", $file[1].
" (".$file[0].
")");
2611 $this->tpl->parseCurrentBlock();
2616 $buttons = array(
"cancelDeleteExportFile" => $this->lng->txt(
"cancel"),
2617 "deleteExportFile" => $this->lng->txt(
"confirm"));
2618 foreach ($buttons as
$name => $value)
2620 $this->tpl->setCurrentBlock(
"operation_btn");
2621 $this->tpl->setVariable(
"BTN_NAME",
$name);
2622 $this->tpl->setVariable(
"BTN_VALUE",$value);
2623 $this->tpl->parseCurrentBlock();
2633 session_unregister(
"ilExportFiles");
2634 $this->ctrl->redirect($this,
"exportList");
2645 $file = explode(
":", $file);
2646 $export_dir = $this->
object->getExportDirectory($file[0]);
2648 $exp_file = $export_dir.
"/".$file[1];
2649 $exp_dir = $export_dir.
"/".substr($file[1], 0, strlen($file[1]) - 4);
2650 if (@is_file($exp_file))
2654 if (@is_dir($exp_dir))
2659 $this->ctrl->redirect($this,
"exportList");
2670 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.confirm.html");
2672 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
2675 $this->tpl->setVariable(
"TXT_CONFIRM", $this->lng->txt(
"confirmation"));
2676 $this->tpl->setVariable(
"TXT_CONTENT", $this->lng->txt(
"cont_fix_tree_confirm"));
2677 $this->tpl->setVariable(
"CMD_CANCEL",
"cancelFixTree");
2678 $this->tpl->setVariable(
"CMD_OK",
"fixTree");
2679 $this->tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
2680 $this->tpl->setVariable(
"TXT_OK", $this->lng->txt(
"cont_fix_tree"));
2699 $this->ctrl->redirect($this,
"properties");
2707 $this->
object->fixTree();
2709 $this->ctrl->redirect($this,
"properties");
2716 $a_active =
"content", $a_use_global_tabs =
false, $a_as_subtabs =
false)
2718 global
$ilCtrl,$ilUser, $ilAccess, $ilTabs;
2722 $addcmd =
"addSubTabTarget";
2723 $getcmd =
"getSubTabHTML";
2727 $addcmd =
"addTarget";
2728 $getcmd =
"getHTML";
2731 $active[$a_active] =
true;
2733 if (!$this->object->isActiveLMMenu())
2738 if ($a_use_global_tabs)
2740 $tabs_gui = $ilTabs;
2750 $showViewInFrameset =
true;
2752 if ($showViewInFrameset && !$a_offline)
2758 $buttonTarget =
"_top";
2761 if ($a_export_format ==
"scorm")
2769 if ($a_export_format !=
"scorm" && !$a_offline)
2773 $ilCtrl->setParameterByClass(
"illmpresentationgui",
"obj_id", $_GET[
"obj_id"]);
2774 $link = $this->ctrl->getLinkTargetByClass(
2775 array(
"illmpresentationgui",
"ilinfoscreengui"),
"showSummary");
2779 $link =
"./info.html";
2782 $tabs_gui->$addcmd(($requires_purchase_to_access ?
'buy' :
'info_short'), $link,
2783 "",
"", $buttonTarget, $active[
"info"]);
2787 if (!$a_offline && $ilAccess->checkAccess(
"read",
"", $_GET[
"ref_id"]))
2789 $ilCtrl->setParameterByClass(
"illmpresentationgui",
"obj_id", $_GET[
"obj_id"]);
2790 $tabs_gui->$addcmd(
"content",
2791 $ilCtrl->getLinkTargetByClass(
"illmpresentationgui",
"layout"),
2792 "",
"", $buttonTarget, $active[
"content"]);
2796 if (!$requires_purchase_to_access && $this->object->isActiveTOC() && $ilAccess->checkAccess(
"read",
"", $_GET[
"ref_id"]))
2800 $ilCtrl->setParameterByClass(
"illmpresentationgui",
"obj_id", $_GET[
"obj_id"]);
2801 $link = $ilCtrl->getLinkTargetByClass(
"illmpresentationgui",
"showTableOfContents");
2805 $link =
"./table_of_contents.html";
2808 $tabs_gui->$addcmd(
"cont_toc", $link,
2809 "",
"", $buttonTarget, $active[
"toc"]);
2813 if (!$requires_purchase_to_access && $this->object->isActivePrintView() && $ilAccess->checkAccess(
"read",
"", $_GET[
"ref_id"]))
2817 $ilCtrl->setParameterByClass(
"illmpresentationgui",
"obj_id", $_GET[
"obj_id"]);
2818 $link = $ilCtrl->getLinkTargetByClass(
"illmpresentationgui",
"showPrintViewSelection");
2819 $tabs_gui->$addcmd(
"cont_print_view", $link,
2820 "",
"", $buttonTarget, $active[
"print"]);
2825 if (!$requires_purchase_to_access && $ilUser->getId() == ANONYMOUS_USER_ID)
2827 $is_public = $this->
object->isActiveDownloadsPublic();
2829 else if(!$requires_purchase_to_access)
2834 if (!$requires_purchase_to_access && $this->object->isActiveDownloads() && !$a_offline && $is_public &&
2835 $ilAccess->checkAccess(
"read",
"", $_GET[
"ref_id"]))
2837 $ilCtrl->setParameterByClass(
"illmpresentationgui",
"obj_id", $_GET[
"obj_id"]);
2838 $link = $ilCtrl->getLinkTargetByClass(
"illmpresentationgui",
"showDownloadList");
2839 $tabs_gui->$addcmd(
"download", $link,
2840 "",
"", $buttonTarget, $active[
"download"]);
2843 if(!$requires_purchase_to_access)
2847 $entries = $this->lmme_obj->getMenuEntries(
true);
2849 if (count($entries) > 0 && $ilAccess->checkAccess(
"read",
"", $_GET[
"ref_id"]))
2851 foreach ($entries as $entry)
2854 if ($entry[
"type"] ==
"intern")
2856 $entry[
"link"] = ILIAS_HTTP_PATH.
"/goto.php?target=".$entry[
"link"];
2860 if (!strstr($entry[
"link"],
'://') && !strstr($entry[
"link"],
'mailto:'))
2862 $entry[
"link"] =
"http://".$entry[
"link"];
2865 if (!strstr($entry[
"link"],
'mailto:'))
2869 $tabs_gui->$addcmd($entry[
"title"],
2871 "",
"",
"_blank",
"",
true);
2876 return $tabs_gui->$getcmd();
2884 require_once(
"./Modules/LearningModule/classes/class.ilContObjectExport.php");
2886 $cont_exp->buildExportFile();
2887 $this->offlineList();
2895 require_once(
"./Modules/LearningModule/classes/class.ilContObjectExport.php");
2897 $cont_exp->buildExportFile();
2899 $this->ctrl->redirect($this,
"exportList");
2907 require_once(
"./Modules/LearningModule/classes/class.ilContObjectExport.php");
2909 $cont_exp->buildExportFile();
2911 $this->ctrl->redirect($this,
"exportList");
2925 $this->ctrl->addLocation(
2929 $par_id = $tree->getParentId(
$_GET[
"ref_id"]);
2930 $this->ctrl->addLocation(
2932 "repository.php?cmd=frameset&ref_id=".$par_id,
2934 if (!$a_omit_obj_id)
2938 $lmtree =& $this->
object->getTree();
2942 $path = $lmtree->getPathFull(
$obj_id);
2946 $path = $lmtree->getPathFull($lmtree->getRootId());
2949 $path[] = array(
"type" =>
"pg",
"child" => $this->obj_id,
2958 if (
$row[
"child"] == 1)
2960 $this->ctrl->setParameter($this,
"obj_id",
"");
2961 $this->ctrl->addLocation(
2962 $this->object->getTitle(),
2963 $this->ctrl->getLinkTarget($this,
"chapters"),
"",
$_GET[
"ref_id"]);
2968 switch(
$row[
"type"])
2971 $this->ctrl->setParameterByClass(
"ilstructureobjectgui",
"obj_id",
$row[
"child"]);
2972 $this->ctrl->addLocation(
2974 $this->ctrl->getLinkTargetByClass(
"ilstructureobjectgui",
"view"));
2978 $this->ctrl->setParameterByClass(
"illmpageobjectgui",
"obj_id",
$row[
"child"]);
2979 $this->ctrl->addLocation(
2981 $this->ctrl->getLinkTargetByClass(
"illmpageobjectgui",
"edit"));
2986 if (!$a_omit_obj_id)
2988 $this->ctrl->setParameter($this,
"obj_id",
$_GET[
"obj_id"]);
2999 #include_once("classes/class.ilTabsGUI.php");
3000 #$tabs_gui =& new ilTabsGUI();
3001 $this->
getTabs($this->tabs_gui);
3002 $this->tpl->setCurrentBlock(
"header_image");
3004 $this->tpl->parseCurrentBlock();
3005 $this->tpl->setCurrentBlock(
"content");
3006 #$this->tpl->setVariable("TABS", $tabs_gui->getHTML());
3007 $this->tpl->setVariable(
"HEADER", $this->object->getTitle());
3017 global $rbacsystem,$ilUser;
3023 $tabs_gui->addTarget(
"info_short",
3024 $this->ctrl->getLinkTargetByClass(
"ilinfoscreengui",
'showSummary'),
3025 "",
"ilinfoscreengui");
3028 $tabs_gui->addTarget(
"cont_chapters",
3029 $this->ctrl->getLinkTarget($this,
"chapters"),
3030 "chapters", get_class($this));
3033 $tabs_gui->addTarget(
"cont_all_pages",
3034 $this->ctrl->getLinkTarget($this,
"pages"),
3035 "pages", get_class($this));
3038 $tabs_gui->addTarget(
"properties",
3039 $this->ctrl->getLinkTarget($this,
'properties'),
3040 "properties", get_class($this));
3043 $tabs_gui->addTarget(
"meta_data",
3044 $this->ctrl->getLinkTargetByClass(
'ilmdeditorgui',
''),
3045 "",
"ilmdeditorgui");
3048 $tabs_gui->addTarget(
"cont_links",
3049 $this->ctrl->getLinkTarget($this,
'listLinks'),
3050 "listLinks", get_class($this));
3052 if ($this->object->getType() ==
"lm")
3055 $tabs_gui->addTarget(
"export",
3056 $this->ctrl->getLinkTarget($this,
"exportList"),
3057 array(
"exportList",
"viewExportLog"), get_class($this));
3060 if(@include_once(
'HTTP/Request.php'))
3063 $tabs_gui->addTarget(
"link_check",
3064 $this->ctrl->getLinkTarget($this,
"linkChecker"),
3065 array(
"linkChecker",
"refreshLinkCheck"), get_class($this));
3071 $tabs_gui->addTarget(
"bib_data",
3072 $this->ctrl->getLinkTarget($this,
"editBibItem"),
3073 "editBibItem", get_class($this));
3076 include_once
'./Services/Tracking/classes/class.ilLearningProgressAccess.php';
3079 $tabs_gui->addTarget(
'learning_progress',
3080 $this->ctrl->getLinkTargetByClass(array(
'illearningprogressgui'),
''),
3082 array(
'illplistofobjectsgui',
'illplistofsettingsgui',
'illearningprogressgui',
'illplistofprogressgui',
'illmstatisticsgui'));
3085 $tabs_gui->addTarget(
"history", $this->ctrl->getLinkTarget($this,
"history")
3086 ,
"history", get_class($this));
3090 if ($rbacsystem->checkAccess(
'edit_permission',$this->object->getRefId()))
3092 $tabs_gui->addTarget(
"perm_settings",
3093 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"), array(
"perm",
"info",
"owner"),
'ilpermissiongui');
3104 if (in_array($a_active,
3105 array(
"cont_general_properties",
"cont_style",
"cont_lm_menu",
"public_section")))
3108 $ilTabs->addSubTabTarget(
"cont_general_properties",
3109 $this->ctrl->getLinkTarget($this,
'properties'),
3113 $ilTabs->addSubTabTarget(
"cont_style",
3114 $this->ctrl->getLinkTarget($this,
'editStyleProperties'),
3118 $ilTabs->addSubTabTarget(
"cont_lm_menu",
3119 $this->ctrl->getLinkTarget($this,
'editMenuProperties'),
3122 if ($ilSetting->get(
"pub_section"))
3124 if ($this->object->getType() !=
"dbk")
3127 $ilTabs->addSubTabTarget(
"public_section",
3128 $this->ctrl->getLinkTarget($this,
'editPublicSection'),
3133 $ilTabs->setSubTabActive($a_active);
3143 $ilTabs->setTabActive(
"properties");
3145 switch ($this->object->getType())
3148 $gui_class =
"ilobjlearningmodulegui";
3152 $gui_class =
"ilobjdlbookgui";
3159 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.lm_public_selector.html");
3162 require_once (
"./Modules/LearningModule/classes/class.ilPublicSectionSelector.php");
3170 $output = $exp->getOutput();
3173 foreach ($exp->format_options as $node)
3175 if (!$node[
"container"])
3177 $pages[] = $node[
"child"];
3186 $this->tpl->setVariable(
"TXT_SET_PUBLIC_MODE", $this->lng->txt(
"set_public_mode"));
3187 $this->tpl->setVariable(
"TXT_CHOOSE_PUBLIC_MODE", $this->lng->txt(
"choose_public_mode"));
3188 $modes = array(
"complete" => $this->lng->txt(
"all_pages"),
"selected" => $this->lng->txt(
"selected_pages_only"));
3189 $select_public_mode =
ilUtil::formSelect ($this->object->getPublicAccessMode(),
"lm_public_mode",$modes,
false,
true);
3190 $this->tpl->setVariable(
"SELECT_PUBLIC_MODE", $select_public_mode);
3192 $this->tpl->setVariable(
"TXT_EXPLORER_HEADER", $this->lng->txt(
"choose_public_pages"));
3193 $this->tpl->setVariable(
"EXP_REFRESH", $this->lng->txt(
"refresh"));
3194 $this->tpl->setVariable(
"EXPLORER",$output);
3195 $this->tpl->setVariable(
"ONCLICK",$js_pages);
3196 $this->tpl->setVariable(
"TXT_CHECKALL", $this->lng->txt(
"check_all"));
3197 $this->tpl->setVariable(
"TXT_UNCHECKALL", $this->lng->txt(
"uncheck_all"));
3198 $this->tpl->setVariable(
"TXT_SAVE", $this->lng->txt(
"save"));
3199 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getLinkTarget($this,
"savePublicSection"));
3207 $this->
object->setPublicAccessMode(
$_POST[
"lm_public_mode"]);
3208 $this->
object->updateProperties();
3211 $this->ctrl->redirect($this,
"editPublicSection");
3223 require_once(
"classes/class.ilHistoryGUI.php");
3225 $this->
object->getType());
3227 $this->ctrl->getParameterArray($this,
"history"),
3228 $this->
object->isActiveHistoryUserComments()
3231 $this->tpl->setVariable(
"ADM_CONTENT", $hist_html);
3241 $invalid_links = $this->link_checker_obj->getInvalidLinksFromDB();
3246 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.link_check.html",
"Modules/LearningModule");
3248 if($last_access = $this->link_checker_obj->getLastCheckTimestamp())
3250 $this->tpl->setCurrentBlock(
"LAST_MODIFIED");
3251 $this->tpl->setVariable(
"AS_OF",$this->lng->txt(
'last_change').
": ");
3252 $this->tpl->setVariable(
"LAST_CHECK",date(
'Y-m-d H:i:s',$last_access));
3253 $this->tpl->parseCurrentBlock();
3257 $this->tpl->setVariable(
"F_ACTION",$this->ctrl->getFormAction($this));
3260 $this->tpl->setVariable(
"ALT_IMG",$this->lng->txt(
'learning_module'));
3261 $this->tpl->setVariable(
"TITLE",$this->object->getTitle().
' ('.$this->lng->txt(
'link_check').
')');
3262 $this->tpl->setVariable(
"PAGE_TITLE",$this->lng->txt(
'cont_pg_title'));
3263 $this->tpl->setVariable(
"URL",$this->lng->txt(
'url'));
3264 $this->tpl->setVariable(
"OPTIONS",$this->lng->txt(
'edit'));
3266 if(!count($invalid_links))
3268 $this->tpl->setCurrentBlock(
"no_invalid");
3269 $this->tpl->setVariable(
"TXT_NO_INVALID",$this->lng->txt(
'no_invalid_links'));
3270 $this->tpl->parseCurrentBlock();
3275 foreach($invalid_links as $invalid)
3277 $this->tpl->setCurrentBlock(
"invalid_row");
3279 $this->tpl->setVariable(
"ROW_PAGE_TITLE",
3281 $this->tpl->setVariable(
"ROW_URL",$invalid[
'url']);
3285 $this->ctrl->setParameterByClass(
'ilLMPageObjectGUI',
'obj_id',$invalid[
'page_id']);
3286 $this->tpl->setVariable(
"ROW_EDIT_LINK",$this->ctrl->getLinkTargetByClass(
'ilLMPageObjectGUI',
'edit'));
3289 $this->tpl->setVariable(
"ROW_ALT_IMG",$this->lng->txt(
'edit'));
3290 $this->tpl->parseCurrentBlock();
3293 if((
bool) $ilias->getSetting(
'cron_link_check'))
3295 include_once
'./classes/class.ilLinkCheckNotify.php';
3298 $this->tpl->setCurrentBlock(
"MESSAGE_BLOCK");
3299 $this->tpl->setVariable(
"INFO_MESSAGE",$this->lng->txt(
'link_check_message_a'));
3302 'link_check_message',
3304 $this->tpl->setVariable(
"INFO_MESSAGE_LONG",$this->lng->txt(
'link_check_message_b'));
3305 $this->tpl->parseCurrentBlock();
3308 $this->tpl->setCurrentBlock(
"CRON_ENABLED");
3310 $this->tpl->setVariable(
"BTN_SUBMIT_LINK_CHECK",$this->lng->txt(
'save'));
3311 $this->tpl->parseCurrentBlock();
3313 $this->tpl->setVariable(
"BTN_REFRESH",$this->lng->txt(
'refresh'));
3320 global
$ilDB,$ilUser;
3322 include_once
'./classes/class.ilLinkCheckNotify.php';
3325 $link_check_notify->setUserId($ilUser->getId());
3326 $link_check_notify->setObjId($this->object->getId());
3328 if(
$_POST[
'link_check_message'])
3331 $link_check_notify->addNotifier();
3336 $link_check_notify->deleteNotifier();
3349 if(!$this->link_checker_obj->checkPear())
3357 $this->link_checker_obj->checkLinks();
3369 include_once
'./classes/class.ilLinkChecker.php';
3372 $this->link_checker_obj->setObjId($this->object->getId());
3379 include_once
'./Modules/LearningModule/classes/class.ilLMMenuEditor.php';
3382 $this->lmme_obj->setObjId($this->object->getId());
3394 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.lm_menu_entry_form.html",
"Modules/LearningModule");
3396 if (isset(
$_GET[
"link_ref_id"]))
3402 $target_link = $obj_type.
"_".
$_GET[
"link_ref_id"];
3403 $this->tpl->setVariable(
"TITLE",
$title);
3404 $this->tpl->setVariable(
"TARGET", $target_link);
3405 $this->tpl->setVariable(
"LINK_REF_ID",
$_GET[
"link_ref_id"]);
3409 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this,
"saveMenuEntry"));
3410 $this->tpl->setVariable(
"TXT_NEW_ENTRY", $this->lng->txt(
"lm_menu_new_entry"));
3411 $this->tpl->setVariable(
"TXT_TARGET", $this->lng->txt(
"lm_menu_entry_target"));
3412 $this->tpl->setVariable(
"TXT_TITLE", $this->lng->txt(
"lm_menu_entry_title"));
3413 $this->tpl->setVariable(
"BTN_NAME",
"saveMenuEntry");
3414 $this->tpl->setVariable(
"BTN_TEXT", $this->lng->txt(
"save"));
3415 $this->tpl->setVariable(
"BTN_NAME2",
"showEntrySelector");
3416 $this->tpl->setVariable(
"BTN_TEXT2", $this->lng->txt(
"lm_menu_select_internal_object"));
3429 if (empty(
$_POST[
"title"]))
3433 $ilCtrl->redirect($this,
"addMenuEntry");
3435 if (empty(
$_POST[
"target"]))
3439 $ilCtrl->redirect($this,
"addMenuEntry");
3443 $this->lmme_obj->setTitle(
$_POST[
"title"]);
3444 $this->lmme_obj->setTarget(
$_POST[
"target"]);
3445 $this->lmme_obj->setLinkRefId(
$_POST[
"link_ref_id"]);
3447 if (
$_POST[
"link_ref_id"])
3449 $this->lmme_obj->setLinkType(
"intern");
3452 $this->lmme_obj->create();
3455 $this->ctrl->redirect($this,
"editMenuProperties");
3463 if (empty(
$_GET[
"menu_entry"]))
3465 $this->ilias->raiseError($this->lng->txt(
"no_menu_entry_id"),$this->ilias->error_obj->MESSAGE);
3469 $this->lmme_obj->delete(
$_GET[
"menu_entry"]);
3472 $this->ctrl->redirect($this,
"editMenuProperties");
3480 if (empty(
$_GET[
"menu_entry"]))
3482 $this->ilias->raiseError($this->lng->txt(
"no_menu_entry_id"),$this->ilias->error_obj->MESSAGE);
3486 $this->lmme_obj->readEntry(
$_GET[
"menu_entry"]);
3490 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.lm_menu_entry_form.html",
"Modules/LearningModule");
3492 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
3493 $this->tpl->setVariable(
"TXT_NEW_ENTRY", $this->lng->txt(
"lm_menu_edit_entry"));
3494 $this->tpl->setVariable(
"TXT_TARGET", $this->lng->txt(
"lm_menu_entry_target"));
3495 $this->tpl->setVariable(
"TXT_TITLE", $this->lng->txt(
"lm_menu_entry_title"));
3496 $this->tpl->setVariable(
"TITLE", $this->lmme_obj->getTitle());
3497 $this->tpl->setVariable(
"TARGET", $this->lmme_obj->getTarget());
3498 $this->tpl->setVariable(
"ENTRY_ID", $this->lmme_obj->getEntryId());
3499 $this->tpl->setVariable(
"BTN_NAME",
"updateMenuEntry");
3500 $this->tpl->setVariable(
"BTN_TEXT", $this->lng->txt(
"save"));
3501 $this->tpl->setVariable(
"BTN_NAME2",
"showEntrySelector");
3502 $this->tpl->setVariable(
"BTN_TEXT2", $this->lng->txt(
"lm_menu_select_internal_object"));
3511 if (empty(
$_POST[
"menu_entry"]))
3513 $this->ilias->raiseError($this->lng->txt(
"no_menu_entry_id"),$this->ilias->error_obj->MESSAGE);
3517 if (empty(
$_POST[
"title"]))
3519 $this->ilias->raiseError($this->lng->txt(
"please_enter_title"),$this->ilias->error_obj->MESSAGE);
3521 if (empty(
$_POST[
"target"]))
3523 $this->ilias->raiseError($this->lng->txt(
"please_enter_target"),$this->ilias->error_obj->MESSAGE);
3527 $this->lmme_obj->readEntry(
$_POST[
"menu_entry"]);
3528 $this->lmme_obj->setTitle(
$_POST[
"title"]);
3529 $this->lmme_obj->setTarget(
$_POST[
"target"]);
3530 $this->lmme_obj->update();
3533 $this->ctrl->redirect($this,
"editMenuProperties");
3540 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.lm_menu_object_selector.html",
"Modules/LearningModule");
3544 require_once (
"./Modules/LearningModule/classes/class.ilLMMenuObjectSelector.php");
3547 $exp->
setExpand(
$_GET[
"lm_menu_expand"] ?
$_GET[
"lm_menu_expand"] : $this->tree->readRootId());
3548 $exp->setExpandTarget($this->ctrl->getLinkTarget($this,
'showEntrySelector'));
3549 $exp->setTargetGet(
"ref_id");
3550 $exp->setRefId($this->cur_ref_id);
3552 $sel_types = array(
'mcst',
'mep',
'cat',
'lm',
'dbk',
'glo',
'frm',
'exc',
'tst',
'svy',
'chat',
'wiki',
'sahs',
3553 "crs",
"grp",
"book",
"tst",
"file");
3554 $exp->setSelectableTypes($sel_types);
3560 $output = $exp->getOutput();
3563 foreach ($exp->format_options as $node)
3565 if (!$node[
"container"])
3567 $pages[] = $node[
"child"];
3574 $this->tpl->setVariable(
"TXT_SET_PUBLIC_MODE", $this->lng->txt(
"set_public_mode"));
3575 $this->tpl->setVariable(
"TXT_CHOOSE_PUBLIC_MODE", $this->lng->txt(
"choose_public_mode"));
3576 $modes = array(
"complete" => $this->lng->txt(
"all_pages"),
"selected" => $this->lng->txt(
"selected_pages_only"));
3577 $select_public_mode =
ilUtil::formSelect ($this->object->getPublicAccessMode(),
"lm_public_mode",$modes,
false,
true);
3578 $this->tpl->setVariable(
"SELECT_PUBLIC_MODE", $select_public_mode);
3580 $this->tpl->setVariable(
"TXT_EXPLORER_HEADER", $this->lng->txt(
"choose_public_pages"));
3581 $this->tpl->setVariable(
"EXP_REFRESH", $this->lng->txt(
"refresh"));
3582 $this->tpl->setVariable(
"EXPLORER",$output);
3583 $this->tpl->setVariable(
"ONCLICK",$js_pages);
3584 $this->tpl->setVariable(
"TXT_CHECKALL", $this->lng->txt(
"check_all"));
3585 $this->tpl->setVariable(
"TXT_UNCHECKALL", $this->lng->txt(
"uncheck_all"));
3586 $this->tpl->setVariable(
"TXT_SAVE", $this->lng->txt(
"save"));
3587 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getLinkTarget($this,
"savePublicSection"));
3598 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
3600 if(count(
$_POST[
"id"]) > 1)
3602 $this->ilias->raiseError($this->lng->txt(
"cont_select_max_one_item"),$this->ilias->error_obj->MESSAGE);
3604 if (
$_POST[
"id"][0] != $this->object->getHeaderPage())
3606 $this->
object->setHeaderPage(
$_POST[
"id"][0]);
3610 $this->
object->setHeaderPage(0);
3612 $this->
object->updateProperties();
3613 $this->ctrl->redirect($this,
"pages");
3623 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
3625 if(count(
$_POST[
"id"]) > 1)
3627 $this->ilias->raiseError($this->lng->txt(
"cont_select_max_one_item"),$this->ilias->error_obj->MESSAGE);
3629 if (
$_POST[
"id"][0] != $this->object->getFooterPage())
3631 $this->
object->setFooterPage(
$_POST[
"id"][0]);
3635 $this->
object->setFooterPage(0);
3637 $this->
object->updateProperties();
3638 $this->ctrl->redirect($this,
"pages");
3650 $ilCtrl->redirect($this,
"chapters");
3660 include_once(
"./Modules/LearningModule/classes/class.ilChapterHierarchyFormGUI.php");
3667 $parent_id = $this->lm_tree->getParentId($node_id);
3672 $parent_id = $node_id;
3676 for ($i = 1; $i <= $num; $i++)
3679 $chap->setType(
"st");
3680 $chap->setTitle(
"");
3681 $chap->setLMId($this->object->getId());
3686 $ilCtrl->redirect($this,
"chapters");
3696 include_once(
"./Modules/LearningModule/classes/class.ilChapterHierarchyFormGUI.php");
3698 if ($ilUser->getPref(
"lm_js_chapter_editing") !=
"disable")
3708 $node_id = $this->lm_tree->getRootId();
3709 $first_child =
true;
3713 $node_id =
$_POST[
"id"][0];
3714 $first_child =
false;
3718 $ilLog->write(
"InsertChapterClip, num: $num, node_id: $node_id, ".
3723 $parent_id = $this->lm_tree->getParentId($node_id);
3728 $parent_id = $node_id;
3733 $chapters = $ilUser->getClipboardObjects(
"st",
true);
3734 $copied_nodes = array();
3735 foreach ($chapters as $chap)
3737 $ilLog->write(
"Call pasteTree, Target LM: ".$this->object->getId().
", Chapter ID: ".$chap[
"id"]
3738 .
", Parent ID: ".$parent_id.
", Target: ".$target);
3740 $target, $chap[
"insert_time"], $copied_nodes,
3748 $ilUser->clipboardDeleteObjectsOfType(
"pg");
3749 $ilUser->clipboardDeleteObjectsOfType(
"st");
3753 $this->
object->checkTree();
3754 $ilCtrl->redirect($this,
"chapters");
3766 if ($ilAccess->checkAccess(
"read",
"", $a_target))
3768 $_GET[
"baseClass"] =
"ilLMPresentationGUI";
3769 $_GET[
"ref_id"] = $a_target;
3770 include(
"ilias.php");
3772 }
else if ($ilAccess->checkAccess(
"visible",
"", $a_target))
3774 $_GET[
"baseClass"] =
"ilLMPresentationGUI";
3775 $_GET[
"ref_id"] = $a_target;
3776 $_GET[
"cmd"] =
"infoScreen";
3777 include(
"ilias.php");
3780 else if ($ilAccess->checkAccess(
"read",
"", ROOT_FOLDER_ID))
3782 $_GET[
"cmd"] =
"frameset";
3783 $_GET[
"target"] =
"";
3784 $_GET[
"ref_id"] = ROOT_FOLDER_ID;
3787 include(
"repository.php");
3792 $ilErr->raiseError($lng->txt(
"msg_no_perm_read_lm"), $ilErr->FATAL);
3803 if (!is_array($items))
3806 $ilCtrl->redirect($this, $a_return);
3810 foreach($items as $k => $item)
3817 foreach($todel as $k)
3825 $ilCtrl->redirect($this, $a_return);
3836 if (!is_array($items))
3839 $ilCtrl->redirect($this,
"chapters");
3843 foreach($items as $k => $item)
3850 foreach($todel as $k)
3857 $ilCtrl->redirect($this,
"chapters");