44 protected \ILIAS\DI\UIServices
$ui;
83 bool $a_call_by_reference =
true,
84 bool $a_prepare_output =
false 88 $this->
lng = $DIC->language();
89 $this->
access = $DIC->access();
90 $this->
tabs = $DIC->tabs();
92 $this->
user = $DIC->user();
93 $this->tpl = $DIC[
"tpl"];
94 $this->
toolbar = $DIC->toolbar();
95 $this->rbacsystem = $DIC->rbac()->system();
96 $this->tree = $DIC->repositoryTree();
97 $this->
help = $DIC[
"ilHelp"];
98 $this->
locator = $DIC[
"ilLocator"];
99 $this->db = $DIC->database();
100 $this->log = $DIC[
"ilLog"];
101 $this->
ui = $DIC->ui();
102 $lng = $DIC->language();
103 $ilCtrl = $DIC->ctrl();
104 $this->
ctrl = $ilCtrl;
105 $this->component_repository = $DIC[
"component.repository"];
110 $this->edit_request = $DIC
118 $this->to_props =
$req->getToProps();
119 $this->requested_obj_id =
$req->getObjId();
120 $this->requested_ref_id =
$req->getRefId();
121 $this->requested_root_id =
$req->getRootId();
122 $this->requested_glo_id =
$req->getGlossaryId();
123 $this->requested_glo_ref_id =
$req->getGlossaryRefId();
124 $this->requested_menu_entry =
$req->getMenuEntry();
125 $this->requested_lm_menu_expand =
$req->getLMMenuExpand();
126 $this->requested_search_root_expand =
$req->getSearchRootExpand();
127 $this->requested_new_type =
$req->getNewType();
128 $this->requested_baseClass =
$req->getBaseClass();
129 $this->requested_transl =
$req->getTranslation();
130 $this->requested_backcmd =
$req->getBackCmd();
131 $this->requested_hierarchy =
$req->getHierarchy();
132 $this->lang_switch_mode =
$req->getLangSwitchMode();
133 $this->requested_active_node =
$req->getActiveNode();
134 $this->requested_lmexpand =
$req->getLMExpand();
135 $this->requested_link_ref_id =
$req->getLinkRefId();
136 $this->requested_totransl =
$req->getToTranslation();
137 $this->requested_lmmovecopy =
$req->getLMMoveCopy();
138 $this->content_style_service = $DIC
141 $id = (isset($this->
object))
144 $this->reading_time_gui = new \ILIAS\LearningModule\ReadingTime\SettingsGUI(
$id);
150 $baseclass = strtolower($this->requested_baseClass);
151 $next_class = strtolower($this->
ctrl->getNextClass());
154 if (!in_array($baseclass, [
"illmpresentationgui",
"illmeditorgui"])) {
157 if (in_array($next_class, [
"ilcommonactiondispatchergui"])) {
178 if ($this->
ctrl->getRedirectSource() ==
"ilinternallinkgui") {
184 if ($this->
ctrl->getCmdClass() ==
"ilinternallinkgui") {
185 $this->
ctrl->setReturn($this,
"explorer");
189 $next_class = $this->
ctrl->getNextClass($this);
192 if ($this->to_props) {
193 $cmd = $this->
ctrl->getCmd(
"properties");
195 $cmd = $this->
ctrl->getCmd(
"chapters");
199 switch ($next_class) {
200 case 'illtiproviderobjectsettinggui':
203 $ilTabs->setTabActive(
"settings");
208 $lti_gui->offerLTIRolesForSelection(
true);
209 $this->
ctrl->forwardCommand($lti_gui);
214 case "illearningprogressgui":
217 $this->
setTabs(
"learning_progress");
220 $this->
ctrl->forwardCommand($new_gui);
224 case 'ilobjectmetadatagui':
225 if (!$ilAccess->checkAccess(
'write',
'', $this->lm->getRefId())) {
234 $md_gui->addMDObserver($this->lm,
'MDUpdateListener',
'Educational');
235 $md_gui->addMDObserver($this->lm,
'MDUpdateListener',
'General');
236 $this->
ctrl->forwardCommand($md_gui);
239 case "ilobjectcontentstylesettingsgui":
247 $settings_gui = $this->content_style_service
249 ->objectSettingsGUIForRefId(
253 $this->
ctrl->forwardCommand($settings_gui);
257 case "illmpageobjectgui":
259 $ilTabs->setBackTarget(
261 $ilCtrl->getLinkTarget($this,
"chapters")
263 $this->
ctrl->saveParameter($this, array(
"obj_id"));
265 $this->
ctrl->setReturn($this,
"chapters");
268 if ($this->requested_obj_id > 0) {
271 $pg_gui->setLMPageObject($obj);
273 $this->
ctrl->forwardCommand($pg_gui);
276 case "ilstructureobjectgui":
277 $ilTabs->setBackTarget(
279 $ilCtrl->getLinkTarget($this,
"chapters")
282 $this->
ctrl->saveParameter($this, array(
"obj_id"));
284 $this->
ctrl->setReturn($this,
"chapters");
286 if ($this->requested_obj_id > 0) {
289 $st_gui->setStructureObject($obj);
291 $this->
ctrl->forwardCommand($st_gui);
292 if ($cmd ==
"save" || $cmd ==
"cancel") {
293 if ($this->requested_obj_id == 0) {
294 $this->
ctrl->redirect($this,
"chapters");
296 $this->
ctrl->setCmd(
"subchap");
302 case 'ilpermissiongui':
303 if (strtolower($this->requested_baseClass) ==
"iladministrationgui") {
311 $this->
ctrl->forwardCommand($perm_gui);
315 case 'ilinfoscreengui':
316 if (!$this->
object->isInfoEnabled()) {
323 $info->enablePrivateNotes();
324 $info->enableLearningProgress();
326 if ($ilAccess->checkAccess(
"write",
"", $this->requested_ref_id)) {
327 $info->enableNewsEditing();
328 $info->setBlockProperty(
"news",
"settings",
true);
332 $info->addMetaDataSections(
338 $this->
ctrl->forwardCommand($info);
344 $this->
ctrl->setParameterByClass(ilObjLearningModuleGUI::class,
"transl",
"");
345 $this->
ctrl->setParameterByClass(ilLMEditorGUI::class,
"transl",
"");
347 $exp_gui->addFormat(
"xml");
349 if ($ot->getContentActivated()) {
350 $exp_gui->addFormat(
"xml_master",
"XML (" .
$lng->
txt(
"cont_master_language_only") .
")", $this,
"export");
351 $exp_gui->addFormat(
"xml_masternomedia",
"XML (" .
$lng->
txt(
"cont_master_language_only_no_media") .
")", $this,
"export");
354 $langs = $ot->getLanguages();
355 foreach ($langs as $l => $ldata) {
356 $exp_gui->addFormat(
"html_" . $l,
"HTML (" .
$lng->
txt(
"meta_l_" . $l) .
")", $this,
"exportHTML");
358 $exp_gui->addFormat(
"html_all",
"HTML (" .
$lng->
txt(
"cont_all_languages") .
")", $this,
"exportHTML");
360 $exp_gui->addFormat(
"html",
"", $this,
"exportHTML");
363 $exp_gui->addCustomColumn(
364 $lng->
txt(
"cont_public_access"),
366 "getPublicAccessColValue" 368 $exp_gui->addCustomMultiCommand(
369 $lng->
txt(
"cont_public_access"),
373 $this->
ctrl->forwardCommand($exp_gui);
374 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
"lm_only_one_download_per_type"));
380 case 'ilobjecttranslationgui':
386 $transgui->setTitleDescrOnlyMode(
false);
387 $this->
ctrl->forwardCommand($transgui);
391 case "ilcommonactiondispatchergui":
394 $this->
ctrl->forwardCommand($gui);
397 case 'ilobjectcopygui':
401 $this->
ctrl->forwardCommand($cp);
404 case "ilmobmultisrtuploadgui":
410 $this->
ctrl->forwardCommand($gui);
413 case "illmimportgui":
419 $this->
ctrl->forwardCommand($gui);
422 case "illmeditshorttitlesgui":
431 $this->edit_request->getTranslation()
433 $this->
ctrl->forwardCommand($gui);
439 if ($cmd ==
"create" &&
440 !in_array($new_type, array(
"lm"))) {
444 $this->
ctrl->setCmdClass(
"ilLMPageObjectGUI");
450 $this->
ctrl->setCmdClass(
"ilStructureObjectGUI");
457 $new_type ===
"lm") {
490 $ecs->addSettingsToForm($this->
form,
'lm');
492 $this->tpl->setContent($this->
form->getHTML());
510 $ti->setRequired(
true);
511 $this->
form->addItem($ti);
515 $this->
form->addItem($ta);
519 $section->setTitle($this->
lng->txt(
'rep_activation_availability'));
520 $this->
form->addItem($section);
524 $this->
form->addItem($online);
528 $section->setTitle($this->
lng->txt(
'cont_presentation'));
529 $this->
form->addItem($section);
532 $obj_service->commonSettings()->legacyForm($this->
form, $this->lm)->addTileImage();
536 $option = array(
"st_title" => $this->
lng->txt(
"cont_st_title"),
537 "pg_title" => $this->
lng->txt(
"cont_pg_title"),
538 "none" => $this->
lng->txt(
"cont_none"));
540 $this->
form->addItem($page_header);
544 $this->
form->addItem($chap_num);
548 $option = array(
"chapters" => $this->
lng->txt(
"cont_chapters_only"),
549 "pages" => $this->
lng->txt(
"cont_chapters_and_pages"));
551 $this->
form->addItem($toc_mode);
555 $progr_icons->setInfo($this->
lng->txt(
"cont_progress_icons_info"));
556 $this->
form->addItem($progr_icons);
558 $this->reading_time_gui->addSettingToForm($this->
form);
562 $section->setTitle($this->
lng->txt(
'cont_self_assessment'));
563 $this->
form->addItem($section);
569 $radg->addOption($op1);
571 $radg->addOption($op2);
572 $this->
form->addItem($radg);
576 $qfeed->setInfo($this->
lng->txt(
"cont_restrict_forw_nav_info"));
577 $this->
form->addItem($qfeed);
581 $not->setInfo($this->
lng->txt(
"cont_notify_on_blocked_users_info"));
582 $qfeed->addSubItem($not);
586 $qfeed->setInfo($this->
lng->txt(
"cont_disable_def_feedback_info"));
587 $this->
form->addItem($qfeed);
591 $section->setTitle($this->
lng->txt(
'obj_features'));
592 $this->
form->addItem($section);
596 $this->
lng->loadLanguageModule(
"notes");
598 $pub_nodes->setInfo($this->
lng->txt(
"cont_lm_comments_desc"));
599 $this->
form->addItem($pub_nodes);
604 $com->setInfo($this->
lng->txt(
"enable_hist_user_comments_desc"));
605 $this->
form->addItem($com);
608 $this->
lng->loadLanguageModule(
'rating');
610 $rate->setInfo($this->
lng->txt(
'rating_activate_rating_info'));
611 $this->
form->addItem($rate);
613 $this->
form->addItem($ratep);
615 $this->
form->setTitle(
$lng->
txt(
"cont_lm_properties"));
616 $this->
form->addCommandButton(
"saveProperties",
$lng->
txt(
"save"));
617 $this->
form->setFormAction($ilCtrl->getFormAction($this));
637 $title = $this->lm->getTitle();
638 $description = $this->lm->getLongDescription();
640 if ($ot->getContentActivated()) {
641 $title = $ot->getDefaultTitle();
642 $description = $ot->getDefaultDescription();
645 $values[
"title"] = $title;
646 $values[
"description"] = $description;
647 if (!$this->lm->getOfflineStatus()) {
648 $values[
"cobj_online"] =
true;
651 $values[
"lm_pg_header"] = $this->lm->getPageHeader();
652 if ($this->lm->isActiveNumbering()) {
653 $values[
"cobj_act_number"] =
true;
655 $values[
"toc_mode"] = $this->lm->getTOCMode();
656 if ($this->lm->publicNotes()) {
657 $values[
"cobj_pub_notes"] =
true;
659 if ($this->lm->cleanFrames()) {
660 $values[
"cobj_clean_frames"] =
true;
662 if ($this->lm->isActiveHistoryUserComments()) {
663 $values[
"cobj_user_comments"] =
true;
666 $values[
"rating"] = $this->lm->hasRating();
667 $values[
"rating_pages"] = $this->lm->hasRatingPages();
668 $values[
"disable_def_feedback"] = $this->lm->getDisableDefaultFeedback();
669 $values[
"progr_icons"] = $this->lm->getProgressIcons();
670 $values[
"store_tries"] = (string) (
int) $this->lm->getStoreTries();
671 $values[
"restrict_forw_nav"] = $this->lm->getRestrictForwardNavigation();
679 $values[
"cont_show_info_tab"] = $this->
object->isInfoEnabled();
680 $this->
form->setValuesByArray($values,
true);
700 if ($ot->getContentActivated()) {
701 $ot->setDefaultTitle($form->
getInput(
'title'));
702 $ot->setDefaultDescription($form->
getInput(
'description'));
706 $this->lm->setTitle($form->
getInput(
'title'));
707 $this->lm->setDescription($form->
getInput(
'description'));
708 $this->lm->setPageHeader($form->
getInput(
"lm_pg_header"));
709 $this->lm->setTOCMode($form->
getInput(
"toc_mode"));
710 $this->lm->setOfflineStatus(!($form->
getInput(
'cobj_online')));
711 $this->lm->setActiveNumbering((
bool) $form->
getInput(
"cobj_act_number"));
712 $this->lm->setCleanFrames((
bool) $form->
getInput(
"cobj_clean_frames"));
714 $this->lm->setPublicNotes($form->
getInput(
"cobj_pub_notes"));
716 $this->lm->setHistoryUserComments((
bool) $form->
getInput(
"cobj_user_comments"));
717 $this->lm->setRating((
bool) $form->
getInput(
"rating"));
718 $this->lm->setRatingPages((
bool) $form->
getInput(
"rating_pages"));
719 $this->lm->setDisableDefaultFeedback((
int) $form->
getInput(
"disable_def_feedback"));
720 $this->lm->setProgressIcons((
int) $form->
getInput(
"progr_icons"));
721 $this->reading_time_gui->saveSettingFromForm($this->
form);
724 $store_tries = $form->
getInput(
"store_tries");
725 if ($form->
getInput(
"restrict_forw_nav") && !$form->
getInput(
"store_tries")) {
727 $add_info =
"</br>" .
$lng->
txt(
"cont_automatically_set_store_tries");
728 $add_info = str_replace(
"$1",
$lng->
txt(
"cont_tries_store"), $add_info);
729 $add_info = str_replace(
"$2",
$lng->
txt(
"cont_restrict_forw_nav"), $add_info);
732 $this->lm->setStoreTries((
int) $store_tries);
733 $this->lm->setRestrictForwardNavigation((
int) $form->
getInput(
"restrict_forw_nav"));
734 $this->lm->updateProperties();
738 $obj_service->commonSettings()->legacyForm($this->
form, $this->lm)->saveTileImage();
744 (bool) $this->
form->getInput(
"notification_blocked_users")
759 if ($ecs->handleSettingsUpdate($form)) {
765 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"msg_obj_modified") . $add_info,
true);
766 $this->
ctrl->redirect($this,
"properties");
772 $this->
form->setValuesByPost();
773 $this->tpl->setContent($this->
form->getHTML());
786 $menu->setChecked($this->lm->isActiveLMMenu());
798 $print->setChecked($this->lm->isActivePrintView());
802 $glo =
new ilCheckboxInputGUI($this->
lng->txt(
"cont_print_view_pre_glo"),
"cobj_act_print_prev_glo");
803 $glo->setChecked($this->lm->isActivePreventGlossaryAppendix());
804 $print->addSubItem($glo);
807 $hhfp =
new ilCheckboxInputGUI($this->
lng->txt(
"cont_hide_head_foot_print"),
"hide_head_foot_print");
808 $hhfp->setChecked($this->lm->getHideHeaderFooterPrint());
809 $print->addSubItem($hhfp);
812 $no_download_file_available =
813 " " .
$lng->
txt(
"cont_no_download_file_available") .
814 " <a href='" . $ilCtrl->getLinkTargetByClass(
"ilexportgui",
"") .
"'>" .
$lng->
txt(
"change") .
"</a>";
815 $types = array(
"xml",
"html");
816 foreach ($types as
$type) {
817 if ($this->lm->getPublicExportFile($type) !=
"") {
818 if (is_file($this->lm->getExportDirectory($type) .
"/" .
819 $this->lm->getPublicExportFile($type))) {
820 $no_download_file_available =
"";
825 $dl->setInfo($this->
lng->txt(
"cont_downloads_desc") . $no_download_file_available);
826 $dl->setChecked($this->lm->isActiveDownloads());
830 $pdl =
new ilCheckboxInputGUI($this->
lng->txt(
"cont_downloads_public_desc"),
"cobj_act_downloads_public");
831 $pdl->setChecked($this->lm->isActiveDownloadsPublic());
832 $dl->addSubItem($pdl);
852 $ilTabs->setTabActive(
"settings");
855 $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
856 $ilToolbar->addFormButton($this->
lng->txt(
"add_menu_entry"),
"addMenuEntry");
857 $ilToolbar->setCloseFormTag(
false);
864 $entries = $this->lmme_obj->getMenuEntries();
866 $table->setOpenFormTag(
false);
875 $this->lm->setActiveLMMenu((
int) $form->
getInput(
"cobj_act_lm_menu"));
877 $this->lm->setActivePrintView((
int) $form->
getInput(
"cobj_act_print"));
878 $this->lm->setActivePreventGlossaryAppendix((
int) $form->
getInput(
"cobj_act_print_prev_glo"));
879 $this->lm->setHideHeaderFooterPrint((
int) $form->
getInput(
"hide_head_foot_print"));
880 $this->lm->setActiveDownloads((
int) $form->
getInput(
"cobj_act_downloads"));
881 $this->lm->setActiveDownloadsPublic((
int) $form->
getInput(
"cobj_act_downloads_public"));
882 $this->lm->updateProperties();
886 $this->lmme_obj->updateActiveStatus($this->edit_request->getMenuEntries());
888 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"msg_obj_modified"),
true);
889 $this->
ctrl->redirect($this,
"editMenuProperties");
897 $this->lm->executeDragDrop(
898 $req->getHFormPar(
"source_id"),
899 $req->getHFormPar(
"target_id"),
900 $req->getHFormPar(
"fc"),
901 $req->getHFormPar(
"as_subitem")
903 $ilCtrl->redirect($this,
"chapters");
908 $new_object->setCleanFrames(
true);
912 $new_object->createLMTree();
915 $new_object->addFirstChapterAndPage();
918 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt($this->type .
"_added"),
true);
919 $this->
ctrl->setParameterByClass(ilObjLearningModuleGUI::class,
"ref_id", $new_object->
getRefId());
920 $this->
ctrl->redirectByClass([ilLMEditorGUI::class, ilObjLearningModuleGUI::class],
"");
925 $form = parent::initImportForm($new_type);
929 $cb->setInfo($this->
lng->txt(
""));
942 parent::importFileObject(null);
949 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"obj_import_file_error") .
" <br />" . $e->getMessage());
959 throw new ilLMOldExportFileException(
"This file seems to be from ILIAS version 5.0.x or lower. Import is not supported anymore.");
973 $ilCtrl->setParameter($this,
"backcmd",
"chapters");
977 $form_gui->setTitle($this->lm->getTitle());
979 $form_gui->setTree($this->lm_tree);
980 $form_gui->setMaxDepth(0);
981 $this->tree->readRootId();
982 $form_gui->setCurrentTopNodeId($this->tree->getRootId());
983 $form_gui->addMultiCommand(
$lng->
txt(
"delete"),
"delete");
984 $form_gui->addMultiCommand(
$lng->
txt(
"cut"),
"cutItems");
985 $form_gui->addMultiCommand(
$lng->
txt(
"copy"),
"copyItems");
986 if ($this->lm->getLayoutPerPage()) {
987 $form_gui->addMultiCommand(
$lng->
txt(
"cont_set_layout"),
"setPageLayoutInHierarchy");
990 $form_gui->addCommand(
$lng->
txt(
"cont_save_all_titles"),
"saveAllTitles");
991 $up_gui =
"ilobjlearningmodulegui";
993 $ctpl =
new ilTemplate(
"tpl.chap_and_pages.html",
true,
true,
"Modules/LearningModule");
994 $ctpl->setVariable(
"HIERARCHY_FORM", $form_gui->getHTML());
995 $ilCtrl->setParameter($this,
"obj_id", null);
997 $ml_head = self::getMultiLangHeader($this->lm->getId(), $this);
999 $this->tpl->setContent($ml_head . $ctpl->get());
1004 object $a_gui_class,
1009 $lng = $DIC->language();
1010 $ilCtrl = $DIC->ctrl();
1012 $edit_request = $DIC
1029 if ($ot->getContentActivated()) {
1030 $ilCtrl->setParameter($a_gui_class,
"lang_switch_mode", $a_mode);
1035 $ml_head = $ml_gui->getMultiLangInfo($requested_transl);
1041 if (!in_array($requested_transl, array(
"",
"-"))) {
1042 $l = $ot->getMasterLanguage();
1044 $lng->
txt(
"cont_edit_language_version") .
": " .
1046 $ilCtrl->getLinkTarget($a_gui_class,
"editMasterLanguage")
1051 foreach ($ot->getLanguages() as $al =>
$lang) {
1052 if ($requested_transl != $al &&
1053 $al != $ot->getMasterLanguage()) {
1054 $ilCtrl->setParameter($a_gui_class,
"totransl", $al);
1056 $lng->
txt(
"cont_edit_language_version") .
": " .
1058 $ilCtrl->getLinkTarget($a_gui_class,
"switchToLanguage")
1060 $ilCtrl->setParameter($a_gui_class,
"totransl", $requested_totransl);
1068 $ml_head =
'<div class="ilFloatLeft">' . $ml_head .
'</div><div style="margin: 5px 0;" class="small ilRight">' .
$ui_renderer->render($dd) .
"</div>";
1070 $ilCtrl->setParameter($a_gui_class,
"lang_switch_mode",
"");
1086 $ilCtrl->setParameter($this,
"backcmd",
"pages");
1087 $ilCtrl->setParameterByClass(
"illmpageobjectgui",
"new_type",
"pg");
1088 $ilToolbar->addButton(
1090 $ilCtrl->getLinkTargetByClass(
"illmpageobjectgui",
"create")
1092 $ilCtrl->setParameterByClass(
"illmpageobjectgui",
"new_type",
"");
1112 $this->lm->getType()
1128 $ilToolbar->addButton(
1129 $this->
lng->txt(
"cont_fix_tree"),
1130 $this->
ctrl->getLinkTarget($this,
"fixTreeConfirm")
1139 $ids = $this->edit_request->getIds();
1140 foreach ($ids as
$id) {
1145 $this->
ctrl->redirect($this,
"pages");
1151 public function pastePage():
void 1154 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"no_page_in_clipboard"),
true);
1155 $this->
ctrl->redirect($this,
"pages");
1165 == $this->lm->getId()) {
1167 $new_page = $lm_page->copy($this->lm);
1168 $id = $new_page->getId();
1175 $copied_nodes = array();
1176 $new_page = $lm_page->copyToOtherContObject($this->lm, $copied_nodes);
1177 $id = $new_page->getId();
1186 != $this->lm->getId()) {
1191 $lm_page->setLMId($this->lm->getId());
1193 $page = $lm_page->getPageObject();
1195 $page->setParentId($this->lm->getId());
1202 $this->
ctrl->redirect($this,
"pages");
1207 $ids = $this->edit_request->getIds();
1208 if (count($ids) == 0) {
1209 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"no_checkbox"));
1210 $this->
ctrl->redirect($this,
"pages");
1216 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
"cont_selected_items_have_been_copied"),
true);
1218 $this->
ctrl->redirect($this,
"pages");
1227 public function delete(
int $a_parent_subobj_id = 0):
void 1229 $ids = $this->edit_request->getIds();
1231 if (count($ids) == 0) {
1232 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"no_checkbox"),
true);
1237 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"cont_select_item"),
true);
1241 if ($a_parent_subobj_id == 0) {
1245 if ($a_parent_subobj_id != 0) {
1246 $this->
ctrl->setParameterByClass(
"ilStructureObjectGUI",
"backcmd", $this->requested_backcmd);
1247 $this->
ctrl->setParameterByClass(
"ilStructureObjectGUI",
"obj_id", $a_parent_subobj_id);
1250 $this->
ctrl->setParameter($this,
"backcmd", $this->requested_backcmd);
1257 $cgui->setHeaderText($this->
lng->txt(
"info_delete_sure"));
1258 $cgui->setCancel($this->
lng->txt(
"cancel"),
"cancelDelete");
1259 $cgui->setConfirm($this->
lng->txt(
"confirm"),
"confirmedDelete");
1261 foreach ($ids as
$id) {
1264 $caption = $obj->getTitle();
1266 $cgui->addItem(
"id[]", $id, $caption);
1270 $this->tpl->setContent($cgui->getHTML());
1275 $this->
ctrl->redirect($this, $this->requested_backcmd);
1289 $ids = $this->edit_request->getIds();
1292 if (count($ids) == 0) {
1293 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"no_checkbox"));
1294 $this->
ctrl->redirect($this,
"cancelDelete");
1298 foreach ($ids as
$id) {
1302 if (is_object($obj)) {
1303 $obj->setLMId($this->lm->getId());
1307 "delete_" . $obj->getType(),
1309 $this->lm->getType()
1321 $this->lm->checkTree();
1324 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"info_deleted"),
true);
1326 if ($a_parent_subobj_id == 0) {
1327 $this->
ctrl->redirect($this, $this->requested_backcmd);
1333 int $a_startnode_id = 1
1337 $tmpPath = $this->lm_tree->getPathFull($a_endnode_id, $a_startnode_id);
1340 for ($i = 1; $i < (count($tmpPath) - 1); $i++) {
1345 $path .= $tmpPath[$i][
"title"];
1354 foreach ($a_actions as $name =>
$lng) {
1355 $d[$name] = array(
"name" => $name,
"lng" =>
$lng);
1358 $notoperations = array();
1360 $operations = array();
1363 foreach (
$d as $row) {
1364 if (!in_array($row[
"name"], $notoperations)) {
1365 $operations[] = $row;
1370 if (count($operations) > 0) {
1371 foreach ($operations as $val) {
1372 $this->tpl->setCurrentBlock(
"operation_btn");
1373 $this->tpl->setVariable(
"BTN_NAME", $val[
"name"]);
1374 $this->tpl->setVariable(
"BTN_VALUE", $this->
lng->txt($val[
"lng"]));
1375 $this->tpl->parseCurrentBlock();
1378 $this->tpl->setCurrentBlock(
"operation");
1380 $this->tpl->parseCurrentBlock();
1386 if (strtolower($this->requested_baseClass) ==
"iladministrationgui") {
1388 parent::viewObject();
1400 $ids = $this->edit_request->getIds();
1401 if (count($ids) == 0) {
1402 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"no_checkbox"));
1403 if ($a_parent_subobj_id == 0) {
1404 $this->
ctrl->redirect($this,
"chapters");
1408 if (count($ids) > 1) {
1409 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"cont_select_max_one_item"));
1410 if ($a_parent_subobj_id == 0) {
1411 $this->
ctrl->redirect($this,
"chapters");
1417 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"cont_select_item"));
1418 if ($a_parent_subobj_id == 0) {
1419 $this->
ctrl->redirect($this,
"chapters");
1426 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
"cont_chap_select_target_now"),
true);
1428 if ($a_parent_subobj_id == 0) {
1429 $this->
ctrl->redirect($this,
"chapters");
1445 $ids = $this->edit_request->getIds();
1446 if (count($ids) == 0) {
1447 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"no_checkbox"),
true);
1448 $this->
ctrl->redirect($this,
"pages");
1451 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
"cont_selected_items_have_been_cut"),
true);
1456 $this->
ctrl->redirect($this,
"pages");
1461 if ($this->requested_new_type ==
"pg") {
1462 $this->
ctrl->redirect($this,
"pages");
1464 $this->
ctrl->redirect($this,
"chapters");
1472 if ($ot->getContentActivated()) {
1473 $format = explode(
"_", $this->edit_request->getFormat());
1479 $cont_exp->buildExportFile($opt);
1493 $changelink =
"<a href='" . $ilCtrl->
getLinkTarget($this,
"editMenuProperties") .
"'>" .
$lng->
txt(
"change") .
"</a>";
1494 if (!$this->lm->isActiveLMMenu()) {
1495 $add =
"<br />" .
$lng->
txt(
"cont_download_no_menu") .
" " . $changelink;
1496 } elseif (!$this->lm->isActiveDownloads()) {
1497 $add =
"<br />" .
$lng->
txt(
"cont_download_no_download") .
" " . $changelink;
1500 $basetype = explode(
"_", $a_type);
1501 $basetype = $basetype[0];
1503 if ($this->lm->getPublicExportFile($basetype) == $a_file) {
1504 return $lng->
txt(
"yes") . $add;
1515 if (!isset($a_files)) {
1516 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"no_checkbox"),
true);
1518 foreach ($a_files as
$f) {
1519 $file = explode(
":", $f);
1520 if (is_int(strpos($file[0],
"_"))) {
1521 $file[0] = explode(
"_", $file[0])[0];
1523 $export_dir = $this->lm->getExportDirectory($file[0]);
1525 if ($this->lm->getPublicExportFile($file[0]) ==
1527 $this->lm->setPublicExportFile($file[0],
"");
1529 $this->lm->setPublicExportFile($file[0], $file[1]);
1532 $this->lm->update();
1534 $ilCtrl->redirectByClass(
"ilexportgui");
1544 $cgui->setFormAction($this->
ctrl->getFormAction($this));
1545 $cgui->setHeaderText($this->
lng->txt(
"cont_fix_tree_confirm"));
1546 $cgui->setCancel($this->
lng->txt(
"cancel"),
"showMaintenance");
1547 $cgui->setConfirm($this->
lng->txt(
"cont_fix_tree"),
"fixTree");
1548 $issues = $this->lm->checkStructure();
1550 if (count($issues) > 0) {
1551 $mess =
"Found Issues: <br>" . implode(
"<br>", $issues);
1553 $this->tpl->setContent($cgui->getHTML() . $mess);
1558 $this->lm->fixTree();
1559 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"cont_tree_fixed"),
true);
1560 $this->
ctrl->redirect($this,
"showMaintenance");
1567 if ($ot->getContentActivated()) {
1568 $format = explode(
"_", $this->edit_request->getFormat());
1572 $cont_exp->buildExportFile();
1580 bool $a_omit_obj_id =
false 1585 if (!$a_omit_obj_id) {
1588 $lmtree = $this->lm->getTree();
1592 $path = $lmtree->getPathFull($lmtree->getRootId());
1594 $path[] = array(
"type" =>
"pg",
"child" => $this->obj_id,
1600 if ($row[
"child"] == 1) {
1601 $this->
ctrl->setParameter($this,
"obj_id", null);
1604 $title = $row[
"title"];
1605 switch ($row[
"type"]) {
1607 $this->
ctrl->setParameterByClass(
"ilstructureobjectgui",
"obj_id", $row[
"child"]);
1608 $locator->
addItem($title, $this->
ctrl->getLinkTargetByClass(
"ilstructureobjectgui",
"view"));
1612 $this->
ctrl->setParameterByClass(
"illmpageobjectgui",
"obj_id", $row[
"child"]);
1613 $locator->
addItem($title, $this->
ctrl->getLinkTargetByClass(
"illmpageobjectgui",
"edit"));
1618 if (!$a_omit_obj_id) {
1619 $this->
ctrl->setParameter($this,
"obj_id", $this->requested_obj_id);
1655 $user_q_ids = $this->edit_request->getUserQuestionIds();
1656 if (count($user_q_ids) > 0) {
1657 foreach ($user_q_ids as $uqid) {
1658 $uqid = explode(
":", $uqid);
1661 $this->tpl->setOnScreenMessage(
'success',
$lng->
txt(
"msg_obj_modified"),
true);
1663 $ilCtrl->redirect($this,
"listBlockedUsers");
1671 $user_q_ids = $this->edit_request->getUserQuestionIds();
1672 if (count($user_q_ids) > 0) {
1673 foreach ($user_q_ids as $uqid) {
1674 $uqid = explode(
":", $uqid);
1677 $this->tpl->setOnScreenMessage(
'success',
$lng->
txt(
"msg_obj_modified"),
true);
1679 $ilCtrl->redirect($this,
"listBlockedUsers");
1686 $user_q_ids = $this->edit_request->getUserQuestionIds();
1687 if (count($user_q_ids) == 0) {
1688 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"no_checkbox"), 1);
1689 $ilCtrl->
redirect($this,
"listBlockedUsers");
1693 foreach ($user_q_ids as $uqid) {
1694 $uqid = explode(
":", $uqid);
1696 if (!in_array($login, $rcps)) {
1706 'rcp_to' => implode(
',', $rcps),
1714 $link = chr(13) . chr(10) . chr(13) . chr(10);
1715 $link .= $this->
lng->txt(
'cont_blocked_users_mail_link');
1716 $link .= chr(13) . chr(10) . chr(13) . chr(10);
1717 $link .= ilLink::_getLink($this->lm->getRefId());
1718 return rawurlencode(base64_encode($link));
1726 protected function setTabs(
string $a_act =
""): void
1728 parent::setTitleAndDescription();
1746 $ilCtrl->getLinkTarget($this,
"chapters")
1753 $ilCtrl->getLinkTarget($this,
"pages")
1759 $lng->
txt(
"cont_short_titles"),
1760 $ilCtrl->getLinkTargetByClass(
"illmeditshorttitlesgui",
"")
1764 if (
$lm_set->get(
"html_export_ids")) {
1768 $lng->
txt(
"cont_html_export_ids"),
1769 $ilCtrl->getLinkTarget($this,
"showExportIDsOverview")
1777 $lng->
txt(
"cont_online_help_ids"),
1778 $ilCtrl->getLinkTarget($this,
"showExportIDsOverview")
1784 $ilCtrl->getLinkTarget($this,
"showTooltipList")
1791 $lng->
txt(
"cont_internal_links"),
1792 $ilCtrl->getLinkTarget($this,
"listLinks")
1798 $this->
ctrl->getLinkTarget($this,
"history")
1804 $lng->
txt(
"cont_maintenance"),
1805 $ilCtrl->getLinkTarget($this,
"showMaintenance")
1811 $lng->
txt(
"cont_subtitle_files"),
1812 $ilCtrl->getLinkTargetByClass(
"ilmobmultisrtuploadgui",
"")
1819 $ilCtrl->getLinkTargetByClass(
"illmimportgui",
"")
1822 $ilTabs->activateSubTab($a_active);
1823 $ilTabs->activateTab(
"content");
1835 $lng->
txt(
"cont_question_stats"),
1836 $ilCtrl->getLinkTarget($this,
"listQuestions")
1842 $lng->
txt(
"cont_blocked_users"),
1843 $ilCtrl->getLinkTarget($this,
"listBlockedUsers")
1846 $ilTabs->activateSubTab($a_active);
1859 $this->
ctrl->getLinkTarget($this,
"chapters")
1863 if ($this->
object->isInfoEnabled()) {
1867 $this->
ctrl->getLinkTargetByClass(
"ilinfoscreengui",
'showSummary')
1875 $this->
ctrl->getLinkTarget($this,
'properties')
1882 $this->
ctrl->getLinkTarget($this,
"listQuestions")
1888 'learning_progress',
1889 $lng->
txt(
"learning_progress"),
1890 $this->
ctrl->getLinkTargetByClass(array(
'illearningprogressgui'),
'')
1896 $mdtab = $mdgui->getTab();
1909 $this->
ctrl->getLinkTargetByClass(
"ilexportgui",
"")
1913 if ($rbacsystem->
checkAccess(
'edit_permission', $this->lm->getRefId())) {
1917 $this->
ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm")
1922 $ilTabs->activateTab($a_act);
1926 $ilTabs->addNonTabbedLink(
1928 $lng->
txt(
"cont_presentation_view"),
1929 "ilias.php?baseClass=ilLMPresentationGUI&ref_id=" . $this->lm->getRefId(),
1941 array(
"settings",
"cont_style",
"cont_lm_menu",
"public_section",
1942 "cont_glossaries",
"cont_multilinguality",
"obj_multilinguality",
1946 $ilTabs->addSubTabTarget(
1948 $this->
ctrl->getLinkTarget($this,
'properties'),
1954 $ilTabs->addSubTabTarget(
1956 $this->
ctrl->getLinkTargetByClass(
"ilObjectContentStyleSettingsGUI",
""),
1958 "ilObjectContentStyleSettingsGUI" 1962 $ilTabs->addSubTabTarget(
1964 $this->
ctrl->getLinkTarget($this,
'editMenuProperties'),
1970 $ilTabs->addSubTabTarget(
1972 $this->
ctrl->getLinkTarget($this,
'editGlossaries'),
1979 $ilTabs->addSubTabTarget(
1981 $this->
ctrl->getLinkTarget($this,
'editPublicSection'),
1987 $ilTabs->addSubTabTarget(
1988 "obj_multilinguality",
1989 $this->
ctrl->getLinkTargetByClass(
"ilobjecttranslationgui",
"")
1993 if ($lti_settings->hasSettingsAccess()) {
1994 $ilTabs->addSubTabTarget(
1996 $this->
ctrl->getLinkTargetByClass(ilLTIProviderObjectSettingGUI::class)
2000 $ilTabs->setSubTabActive($a_active);
2011 if (!$ilAccess->checkAccessOfUser(
ANONYMOUS_USER_ID,
"read",
"", $this->lm->getRefId())) {
2012 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
"cont_anonymous_user_missing_perm"));
2017 $ilTabs->setTabActive(
"settings");
2019 $this->tpl->addBlockFile(
2022 "tpl.lm_public_selector.html",
2023 "Modules/LearningModule" 2031 $modes = array(
"complete" => $this->
lng->txt(
"all_pages"),
"selected" => $this->
lng->txt(
"selected_pages_only"));
2034 $si->setValue($this->lm->getPublicAccessMode());
2035 $ilToolbar->addInputItem($si,
true);
2036 $ilToolbar->addFormButton($this->
lng->txt(
"save"),
"savePublicSectionAccess");
2037 $ilToolbar->setFormAction($this->
ctrl->getFormAction($this,
"savePublicSectionAccess"));
2039 if ($this->lm->getPublicAccessMode() ==
"selected") {
2040 $this->tpl->setCurrentBlock(
"select_pages");
2041 $this->tpl->setVariable(
"FORMACTION", $this->
ctrl->getLinkTarget($this,
"savePublicSectionPages"));
2045 "editPublicSection",
2047 $this->edit_request->getTranslation()
2049 $tree->setSelectMode(
"pages",
true);
2050 $tree->setSkipRootNode(
true);
2052 $this->tpl->setVariable(
"EXPLORER",
$tree->getHTML());
2053 $this->tpl->setVariable(
"TXT_SAVE", $this->
lng->txt(
"save"));
2055 $this->tpl->parseCurrentBlock();
2061 $this->lm->setPublicAccessMode(
2062 $this->edit_request->getLMPublicMode()
2064 $this->lm->updateProperties();
2066 $this->edit_request->getPublicPages(),
2069 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"msg_obj_modified"),
true);
2070 $this->
ctrl->redirect($this,
"editPublicSection");
2078 $this->lm->setPublicAccessMode(
2079 $this->edit_request->getLMPublicMode()
2081 $this->lm->updateProperties();
2082 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"msg_obj_modified"),
true);
2083 $this->
ctrl->redirect($this,
"editPublicSection");
2092 $this->edit_request->getPublicPages(),
2095 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"msg_obj_modified"),
true);
2096 $this->
ctrl->redirect($this,
"editPublicSection");
2108 $this->lm->getType()
2111 $hist_gui->setCommentVisibility($this->lm->isActiveHistoryUserComments());
2113 $this->tpl->setContent($hist_gui->getHTML());
2119 $this->lmme_obj->setObjId($this->lm->getId());
2133 $ilTabs->setTabActive(
"settings");
2136 $ilToolbar->addButton(
2137 $this->
lng->txt(
"lm_menu_select_internal_object"),
2138 $ilCtrl->getLinkTarget($this,
"showEntrySelector")
2141 if (is_null($form)) {
2144 $this->tpl->setContent($form->
getHTML());
2156 $ti->setMaxLength(255);
2158 $ti->setRequired(
true);
2163 $ta->setMaxLength(255);
2165 $ta->setRequired(
true);
2168 if ($a_mode ==
"edit") {
2170 $this->lmme_obj->readEntry($this->edit_request->getMenuEntry());
2171 $ti->setValue($this->lmme_obj->getTitle());
2172 $ta->setValue($this->lmme_obj->getTarget());
2175 if ($this->requested_link_ref_id > 0) {
2181 $target_link = $obj_type .
"_" . $link_ref_id;
2182 $ti->setValue($title);
2183 $ta->setValue($target_link);
2187 $hi->setValue($link_ref_id);
2193 if ($a_mode ==
"create") {
2213 $this->lmme_obj->setTitle($form->
getInput(
"title"));
2214 $this->lmme_obj->setTarget($form->
getInput(
"target"));
2215 $this->lmme_obj->setLinkRefId((
int) $form->
getInput(
"link_ref_id"));
2217 if ($form->
getInput(
"link_ref_id")) {
2218 $this->lmme_obj->setLinkType(
"intern");
2221 $this->lmme_obj->create();
2223 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"msg_entry_added"),
true);
2224 $this->
ctrl->redirect($this,
"editMenuProperties");
2233 if (empty($this->requested_menu_entry)) {
2234 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"no_menu_entry_id"),
true);
2235 $this->
ctrl->redirect($this,
"editMenuProperties");
2239 $this->lmme_obj->delete($this->requested_menu_entry);
2241 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"msg_entry_removed"),
true);
2242 $this->
ctrl->redirect($this,
"editMenuProperties");
2253 $ilTabs->setTabActive(
"settings");
2257 if (empty($this->requested_menu_entry)) {
2258 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"no_menu_entry_id"),
true);
2259 $this->
ctrl->redirect($this,
"editMenuProperties");
2262 $ilCtrl->saveParameter($this, array(
"menu_entry"));
2263 $ilToolbar->addButton(
2264 $this->
lng->txt(
"lm_menu_select_internal_object"),
2265 $ilCtrl->getLinkTarget($this,
"showEntrySelector")
2268 if (is_null($form)) {
2271 $this->tpl->setContent($form->
getHTML());
2278 if ($this->edit_request->getMenuEntry() ==
"") {
2279 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"no_menu_entry_id"),
true);
2280 $this->
ctrl->redirect($this,
"editMenuProperties");
2284 $this->lmme_obj->readEntry($this->edit_request->getMenuEntry());
2285 $this->lmme_obj->setTitle($form->
getInput(
"title"));
2286 $this->lmme_obj->setTarget($form->
getInput(
"target"));
2287 if ($form->
getInput(
"link_ref_id")) {
2288 $this->lmme_obj->setLinkType(
"intern");
2290 if (is_int(strpos($form->
getInput(
"target"),
"."))) {
2291 $this->lmme_obj->setLinkType(
"extern");
2293 $this->lmme_obj->update();
2294 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"msg_entry_updated"),
true);
2295 $this->
ctrl->redirect($this,
"editMenuProperties");
2309 $ilTabs->setTabActive(
"settings");
2312 $ilCtrl->saveParameter($this, array(
"menu_entry"));
2314 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
"lm_menu_select_object_to_add"));
2318 "showEntrySelector",
2324 $exp->setClickableTypes(array(
'mcst',
'mep',
'cat',
'lm',
'glo',
'frm',
'exc',
'tst',
'svy',
'chat',
'wiki',
'sahs',
"crs",
"grp",
"book",
"tst",
"file"));
2325 if (!$exp->handleCommand()) {
2326 $this->tpl->setContent($exp->getHTML());
2335 $ids = $this->edit_request->getIds();
2336 if (count($ids) == 0) {
2337 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"no_checkbox"),
true);
2338 $this->
ctrl->redirect($this,
"pages");
2340 if (count($ids) > 1) {
2341 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"cont_select_max_one_item"),
true);
2342 $this->
ctrl->redirect($this,
"pages");
2344 if ($ids[0] != $this->lm->getHeaderPage()) {
2345 $this->lm->setHeaderPage($ids[0]);
2347 $this->lm->setHeaderPage(0);
2349 $this->lm->updateProperties();
2350 $this->
ctrl->redirect($this,
"pages");
2358 $ids = $this->edit_request->getIds();
2359 if (count($ids) == 0) {
2360 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"no_checkbox"),
true);
2361 $this->
ctrl->redirect($this,
"pages");
2363 if (count($ids) > 1) {
2364 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"cont_select_max_one_item"),
true);
2365 $this->
ctrl->redirect($this,
"pages");
2367 if ($ids[0] != $this->lm->getFooterPage()) {
2368 $this->lm->setFooterPage($ids[0]);
2370 $this->lm->setFooterPage(0);
2372 $this->lm->updateProperties();
2373 $this->
ctrl->redirect($this,
"pages");
2385 $this->edit_request->getTitles(),
2389 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"lm_save_titles"),
true);
2390 $ilCtrl->redirect($this,
"chapters");
2405 $parent_id = $this->lm_tree->getParentId($node_id);
2408 $parent_id = $node_id;
2412 for ($i = 1; $i <= $num; $i++) {
2414 $chap->setType(
"st");
2415 $chap->setTitle(
$lng->
txt(
"cont_new_chap"));
2416 $chap->setLMId($this->lm->getId());
2421 $ilCtrl->redirect($this,
"chapters");
2436 if (!$first_child) {
2437 $parent_id = $this->lm_tree->getParentId($node_id);
2440 $parent_id = $node_id;
2445 $chapters = $ilUser->getClipboardObjects(
"st",
true);
2446 $copied_nodes = array();
2447 foreach ($chapters as $chap) {
2448 $ilLog->write(
"Call pasteTree, Target LM: " . $this->lm->getId() .
", Chapter ID: " . $chap[
"id"]
2449 .
", Parent ID: " . $parent_id .
", Target: " . $target);
2450 $cid = ilLMObject::pasteTree(
2455 (
string) ($chap[
"insert_time"] ??
""),
2464 $ilUser->clipboardDeleteObjectsOfType(
"pg");
2465 $ilUser->clipboardDeleteObjectsOfType(
"st");
2469 $this->lm->checkTree();
2470 $ilCtrl->redirect($this,
"chapters");
2473 public static function _goto(
string $a_target): void
2476 $main_tpl = $DIC->ui()->mainTemplate();
2478 $ilAccess = $DIC->access();
2480 $lng = $DIC->language();
2481 $ctrl = $DIC->ctrl();
2483 if ($ilAccess->checkAccess(
"read",
"", $a_target)) {
2490 } elseif ($ilAccess->checkAccess(
"visible",
"", $a_target)) {
2494 $main_tpl->setOnScreenMessage(
'failure', sprintf(
2495 $lng->
txt(
"msg_no_perm_read_item"),
2505 public function cutItems(
string $a_return =
"chapters"): void
2510 $ids = $this->edit_request->getIds();
2511 if (count($ids) == 0) {
2512 $this->tpl->setOnScreenMessage(
'failure',
$lng->
txt(
"no_checkbox"),
true);
2513 $ilCtrl->redirect($this, $a_return);
2517 foreach ($ids as $k => $item) {
2522 foreach ($todel as $k) {
2527 $this->tpl->setOnScreenMessage(
'info',
$lng->
txt(
"cont_selected_items_have_been_cut"),
true);
2529 $ilCtrl->redirect($this, $a_return);
2540 $ids = $this->edit_request->getIds();
2541 if (count($ids) == 0) {
2542 $this->tpl->setOnScreenMessage(
'failure',
$lng->
txt(
"no_checkbox"),
true);
2543 $ilCtrl->redirect($this,
"chapters");
2547 foreach ($ids as $k => $item) {
2552 foreach ($todel as $k) {
2557 $this->tpl->setOnScreenMessage(
'info',
$lng->
txt(
"cont_selected_items_have_been_copied"),
true);
2558 $ilCtrl->redirect($this,
"chapters");
2585 $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
2586 $lm_tree = $this->lm->getTree();
2588 $options = array(
"" =>
$lng->
txt(
"all"));
2589 foreach ($childs as
$c) {
2590 $options[$c[
"child"]] = $c[
"title"];
2595 $ilToolbar->addInputItem($si,
true);
2596 $ilToolbar->addFormButton(
$lng->
txt(
"help_filter"),
"filterHelpChapters");
2610 $ilCtrl->redirect($this,
"showExportIDsOverview");
2620 foreach ($this->edit_request->getExportIds() as $exp_id) {
2621 if ($exp_id !=
"" && !preg_match(
2622 "/^([a-zA-Z]+)[0-9a-zA-Z_]*$/",
2629 $this->tpl->setOnScreenMessage(
'failure',
$lng->
txt(
"cont_exp_ids_not_resp_format1") .
": a-z, A-Z, 0-9, '_'. " .
2630 $lng->
txt(
"cont_exp_ids_not_resp_format3") .
" " .
2631 $lng->
txt(
"cont_exp_ids_not_resp_format2"));
2637 foreach ($this->edit_request->getExportIds() as $pg_id => $exp_id) {
2646 $this->tpl->setOnScreenMessage(
'success',
$lng->
txt(
"cont_saved_export_ids"),
true);
2647 $ilCtrl->redirect($this,
"showExportIdsOverview");
2654 $help_map = $this->
help->internal()->domain()->map();
2656 foreach ($this->edit_request->getScreenIds() as $chap => $ids) {
2657 $ids = explode(
"\n", $ids);
2658 $help_map->saveScreenIdsForChapter($chap, $ids);
2660 $this->tpl->setOnScreenMessage(
'success',
$lng->
txt(
"msg_obj_modified"),
true);
2661 $ilCtrl->redirect($this,
"showExportIdsOverview");
2678 $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
2680 $ti->setMaxLength(200);
2682 $ilToolbar->addInputItem($ti,
true);
2683 $ilToolbar->addFormButton(
$lng->
txt(
"add"),
"addTooltip");
2684 $ilToolbar->addSeparator();
2686 $options = $this->
help->internal()->domain()->tooltips()->getTooltipComponents();
2693 $ilToolbar->addInputItem($si,
true);
2694 $ilToolbar->addFormButton(
$lng->
txt(
"help_filter"),
"filterTooltips");
2706 $tt_id = $this->edit_request->getTooltipId();
2707 if (trim($tt_id) !=
"") {
2708 if (is_int(strpos($tt_id,
"_"))) {
2709 $this->
help->internal()->domain()->tooltips()->addTooltip(trim($tt_id),
"");
2710 $this->tpl->setOnScreenMessage(
'success',
$lng->
txt(
"msg_obj_modified"),
true);
2712 $fu = strpos($tt_id,
"_");
2713 $comp = substr($tt_id, 0, $fu);
2716 $this->tpl->setOnScreenMessage(
'failure',
$lng->
txt(
"cont_help_no_valid_tooltip_id"),
true);
2719 $ilCtrl->redirect($this,
"showTooltipList");
2728 $this->edit_request->getTooltipComponent()
2730 $ilCtrl->redirect($this,
"showTooltipList");
2738 $tooltip_ids = $this->edit_request->getTooltipIds();
2739 foreach ($this->edit_request->getTooltipTexts() as
$id => $text) {
2740 $this->
help->internal()->domain()->tooltips()->updateTooltip(
2743 $tooltip_ids[(
int) $id]
2746 $this->tpl->setOnScreenMessage(
'success',
$lng->
txt(
"msg_obj_modified"),
true);
2747 $ilCtrl->redirect($this,
"showTooltipList");
2755 $ids = $this->edit_request->getIds();
2756 if (count($ids) > 0) {
2757 foreach ($ids as
$id) {
2758 $this->
help->internal()->domain()->tooltips()->deleteTooltip($id);
2760 $this->tpl->setOnScreenMessage(
'success',
$lng->
txt(
"msg_obj_modified"),
true);
2762 $ilCtrl->redirect($this,
"showTooltipList");
2772 string $a_def_option =
"" 2778 $lng = $DIC->language();
2782 if ($a_def_option !=
"") {
2786 $layout->addOption(
new ilRadioOption(
"<table><tr><td>" . $im_tag .
"</td><td><strong>" .
2787 $lng->
txt(
"cont_lm_default_layout") .
2788 "</strong>: " .
$lng->
txt(
"cont_layout_" . $a_def_option) .
2789 "</td></tr></table>",
""));
2796 $layout->addOption(
new ilRadioOption(
"<table><tr><td style='padding: 0px 5px 5px;'>" .
2797 $im_tag .
"</td><td style='padding:5px;'><strong>" .
$lng->
txt(
"cont_layout_" . $l) .
"</strong>: " .
2798 $lng->
txt(
"cont_layout_" . $l .
"_desc") .
"</td></tr></table>", $l));
2819 bool $a_in_hierarchy =
false 2825 $ids = $this->edit_request->getIds();
2826 if (count($ids) == 0) {
2827 $this->tpl->setOnScreenMessage(
'failure',
$lng->
txt(
"no_checkbox"),
true);
2829 if ($a_in_hierarchy) {
2830 $ilCtrl->redirect($this,
"chapters");
2832 $ilCtrl->redirect($this,
"pages");
2848 $ids = $this->edit_request->getIds();
2849 foreach ($ids as
$id) {
2852 $this->
form->addItem($hi);
2854 $layout = self::getLayoutOption(
2857 $this->lm->getLayout()
2859 $this->
form->addItem($layout);
2861 $this->
form->addCommandButton(
"savePageLayout",
$lng->
txt(
"save"));
2862 $this->
form->addCommandButton(
"pages",
$lng->
txt(
"cancel"));
2864 $this->
form->setTitle(
$lng->
txt(
"cont_set_layout"));
2865 $this->
form->setFormAction($ilCtrl->getFormAction($this));
2873 $ilCtrl->
setParameter($this,
"hierarchy", $this->requested_hierarchy);
2875 $ids = $this->edit_request->getIds();
2876 foreach ($ids as
$id) {
2879 $this->edit_request->getLayout(),
2883 $this->tpl->setOnScreenMessage(
'success',
$lng->
txt(
"msg_obj_modified"),
true);
2885 if ($this->requested_hierarchy) {
2886 $ilCtrl->redirect($this,
"chapters");
2888 $ilCtrl->redirect($this,
"pages");
2908 $ilTabs->setTabActive(
"settings");
2911 $ilToolbar->addButton(
2913 $ilCtrl->getLinkTarget($this,
"showLMGlossarySelector")
2929 $ilTabs->setTabActive(
"settings");
2934 $exp->setPathOpen($this->
object->getRefId());
2935 $exp->setExpandTarget($ilCtrl->getLinkTarget($this,
'showLMGlossarySelector'));
2936 $exp->setTargetClass(get_class($this));
2937 $exp->setCmd(
'confirmGlossarySelection');
2938 $exp->setClickableTypes(array(
"glo"));
2939 $exp->addFilter(
"glo");
2953 $ilCtrl->setParameter($this,
"glo_ref_id", $this->requested_root_id);
2954 $cgui->setFormAction($ilCtrl->getFormAction($this));
2955 $cgui->setHeaderText(
$lng->
txt(
"cont_link_glo_in_lm"));
2956 $cgui->setCancel(
$lng->
txt(
"no"),
"selectLMGlossary");
2957 $cgui->setConfirm(
$lng->
txt(
"yes"),
"selectLMGlossaryLink");
2964 $this->lm->autoLinkGlossaryTerms($glo_ref_id);
2973 $glos = $this->lm->getAutoGlossaries();
2976 if (!in_array($glo_id, $glos)) {
2979 $this->lm->setAutoGlossaries($glos);
2980 $this->lm->update();
2982 $this->tpl->setOnScreenMessage(
'success',
$lng->
txt(
"msg_obj_modified"),
true);
2983 $ilCtrl->redirect($this,
"editGlossaries");
2991 $this->lm->removeAutoGlossary($this->requested_glo_id);
2992 $this->lm->update();
2994 $this->tpl->setOnScreenMessage(
'success',
$lng->
txt(
"msg_obj_modified"),
true);
2995 $ilCtrl->redirect($this,
"editGlossaries");
3003 if ($this->lang_switch_mode ==
"short_titles") {
3004 $ilCtrl->redirectByClass(
"illmeditshorttitlesgui",
"");
3006 $ilCtrl->redirect($this,
"chapters");
3013 $ilCtrl->
setParameter($this,
"transl", $this->requested_totransl);
3014 if ($this->lang_switch_mode ==
"short_titles") {
3015 $ilCtrl->redirectByClass(
"illmeditshorttitlesgui",
"");
3017 $ilCtrl->redirect($this,
"chapters");
3023 parent::redrawHeaderActionObject();
3031 $this->
ctrl->redirectByClass(array(
'illearningprogressgui'),
'');
static updateInternalLinks(array $a_copied_nodes, string $a_parent_type="lm")
Update internal links, after multiple pages have been copied.
showExportIDsOverview(bool $a_validation=false)
static get(string $a_var)
static _lookupActive(int $a_id, string $a_parent_type, bool $a_check_scheduled_activation=false, string $a_lang="-")
lookup activation status
static setAction(string $a_action)
static resetTries(int $a_q_id, int $a_user_id)
Reset tries for user and question.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setQuestionsSubTabs(string $a_active)
Readable part of repository interface to ilComponentDataDB.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getLayoutOption(string $a_txt, string $a_var, string $a_def_option="")
getNodeData(int $a_node_id, ?int $a_tree_pk=null)
get all information of a node.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Import related features for learning modules.
redirectByClass( $a_class, string $a_cmd=null, string $a_anchor=null, bool $is_async=false)
setPageLayoutInHierarchy()
Set layout for multiple pages.
static _writePublicAccessStatus(array $a_pages, int $a_cont_obj_id)
update public access flags in lm_data for all pages of a content object
Explorer for selecting repository items.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
moveChapter(int $a_parent_subobj_id=0)
move a single chapter (selection)
redirect(object $a_gui_obj, string $a_cmd=null, string $a_anchor=null, bool $is_async=false)
static _createEntry(int $a_obj_id, string $a_action, array $a_info_params=[], string $a_obj_type="", string $a_user_comment="", bool $a_update_last=false)
Creates a new history entry for an object.
string $requested_new_type
static storeContentObject(string $a_type, int $a_id, string $a_action="cut")
GUI class for the workflow of copying objects.
const TYPE_LM_BLOCKED_USERS
static saveTitles(ilObjLearningModule $a_lm, array $a_titles, string $a_lang="-")
Save titles for lm objects.
int $requested_link_ref_id
int $requested_search_root_expand
setPageLayout(bool $a_in_hierarchy=false)
Set layout for multiple pages.
prepareOutput(bool $show_sub_objects=true)
showMaintenance()
Show maintenance.
EditingGUIRequest $edit_request
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
getChilds(int $a_node_id, string $a_order="", string $a_direction="ASC")
get child nodes of given node
string $requested_totransl
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
listLinks()
List all broken links.
static getInstance(ilObjLearningModule $a_content_obj, int $a_id=0, bool $a_halt=true)
activatePages()
activates or deactivates pages
int $requested_menu_entry
isInTree(?int $a_node_id)
get all information of a node.
static getAvailableLayouts()
get all available lm layouts
addLocations(bool $a_omit_obj_id=false)
display locator
User Interface for Structure Objects Editing.
ilComponentRepository $component_repository
setParameterByClass(string $a_class, string $a_parameter, $a_value)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
deleteTree(array $a_node)
delete node and the whole subtree under this node
loadLanguageModule(string $a_module)
Load language module.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
viewObject()
viewObject container presentation for "administration -> repository, trash, permissions" ...
static clipboardCut(int $a_cont_obj_id, array $a_ids)
Copy a set of chapters/pages into the clipboard.
static updateServiceSettingsForm(int $obj_id, ilPropertyFormGUI $form, array $services)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static checkAccess(int $a_ref_id, bool $a_allow_only_read=true)
check access to learning progress
importFileObject(int $parent_id=null)
afterSave(ilObject $new_object)
string $requested_baseClass
getContextPath(int $a_endnode_id, int $a_startnode_id=1)
static img(string $a_src, ?string $a_alt=null, $a_width="", $a_height="", $a_border=0, $a_id="", $a_class="")
Build img tag.
getPublicAccessColValue(string $a_type, string $a_file)
Get public access value for export table.
saveAllTitles()
Save all titles of chapters/pages.
getPropertiesFormValues()
Get values for properties form.
static putInTree(ilLMObject $a_obj, int $a_parent_id=0, int $a_target_node_id=0)
put this object into content object tree
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupObjId(int $ref_id)
catch(\Exception $e) $req
static _lookupTitle(int $a_obj_id)
Export User Interface Class.
checkAccess(string $a_operations, int $a_ref_id, string $a_type="")
checkAccess represents the main method of the RBAC-system in ILIAS3 developers want to use With this ...
ilObjLearningModule $lm_obj
static _goto(string $a_target)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
selectFooter()
select page as footer
saveProperties()
save properties
static _lookupSetting(string $a_set)
ILIAS LearningModule ReadingTime SettingsGUI $reading_time_gui
publishExportFile(?array $a_files)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilGlobalTemplateInterface $tpl
string $requested_backcmd
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupTitle(int $obj_id)
setContent(string $a_html)
Sets content for standard template.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static setNotification(int $type, int $user_id, int $id, bool $status=true)
Set notification status for object and user.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static writeLayout(int $a_obj_id, string $a_layout, ?ilObjLearningModule $a_lm=null)
Write layout setting.
properties()
edit properties form
copyItems()
Copy items to clipboard.
savePublicSectionAccess()
Saves lm access mode.
selectHeader()
select page as header
setScreenIdComponent(string $a_comp)
Class ilObjectGUI Basic methods of all Output classes.
static getInstance(int $obj_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
insertChapterClip()
Insert Chapter from clipboard.
static _lookupObjectId(int $ref_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilObjectService $object_service
int $requested_lm_menu_expand
addMenuEntry(?ilPropertyFormGUI $form=null)
display add menu entry form
showActions(array $a_actions)
int $requested_glo_ref_id
setTabs(string $a_act="")
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static initServiceSettingsForm(int $obj_id, ilPropertyFormGUI $form, array $services)
setCustomRolesForSelection(array $a_roles)
Set custom roles for mapping to LTI roles.
static getContentObjectType()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _writeActive(int $a_id, string $a_parent_type, bool $a_active)
write activation status
static getMultiLangHeader(int $a_lm_id, object $a_gui_class, string $a_mode="")
static redirect(string $a_script)
ILIAS Style Content Service $content_style_service
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
User Interface for Learning Module Page Objects Editing.
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id
setContentSubTabs(string $a_active)
static unlock(int $a_q_id, int $a_user_id)
Unlock question for user.
form( $class_path, string $cmd, string $submit_caption="")
setSubTabs(string $a_active)
getLinkTarget(object $a_gui_obj, string $a_cmd=null, string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
static saveExportId(int $a_lm_id, int $a_lmobj_id, string $a_exp_id, string $a_type="pg")
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getContentObjectId()
static _getPresentationTitle(int $a_pg_id, string $a_mode=self::CHAPTER_TITLE, bool $a_include_numbers=false, bool $a_time_scheduled_activation=false, bool $a_force_content=false, int $a_lm_id=0, string $a_lang="-", bool $a_include_short=false)
presentation title doesn't have to be page title, it may be chapter title + page title or chapter tit...
string $requested_lang_switch_mode
initMenuEntryForm(string $a_mode="edit")
confirmGlossarySelection()
cutItems(string $a_return="chapters")
const LP_CONTEXT_REPOSITORY
learningProgress()
Learning progress.
This class represents a text area property in a property form.
__construct( $a_data, int $a_id=0, bool $a_call_by_reference=true, bool $a_prepare_output=false)
static _lookupType(int $a_obj_id, int $a_lm_id=0)
getBlockedUsersMailSignature()
initPropertiesForm()
Init properties form.
addItem(string $a_title, string $a_link, string $a_frame="", int $a_ref_id=0, ?string $type=null)
static hasNotification(int $type, int $user_id, int $id)
Check notification status for object and user.
Class ilObjContentObjectGUI.
bool $requested_lmmovecopy
static _lookupContObjID(int $a_id)
get learning module id for lm object
const INFO_TAB_VISIBILITY
bool $requested_hierarchy
savePublicSectionPages()
Saves public lm pages.
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
int $requested_active_node
editGlossaries()
Edit automatically linked glossaries.
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
initImportForm(string $new_type)
static _lookupType(int $id, bool $reference=false)
cutChapter()
Cut chapter(s)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
addHeaderAction()
Add header action menu.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
static set(string $a_var, $a_val)
Set a value.
confirmedDelete(int $a_parent_subobj_id=0)
delete page object or structure objects
addTabs(string $a_act="")
editMenuEntry(?ilPropertyFormGUI $form=null)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
setExpand($a_node_id)
set the expand option this value is stored in a SESSION variable to save it different view (lo view...
GUI class for object translation handling.
static isOnlineHelpModule(int $a_id, bool $a_as_obj_id=false)
Is module an online module.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _gotoRepositoryRoot(bool $raise_error=false)
Goto repository root.
insertChapter()
Insert (multiple) chapters at node.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static clipboardCopy(int $a_cont_obj_id, array $a_ids)
Copy a set of chapters/pages into the clipboard.
static _lookupLogin(int $a_user_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...