45 protected \ILIAS\Wiki\InternalDomainService
$domain;
46 protected \ILIAS\Wiki\InternalGUIService
$gui;
48 protected \ILIAS\Wiki\Navigation\ImportantPageManager
$imp_pages;
49 protected \ILIAS\Wiki\Page\PageManager
$pm;
56 protected \ILIAS\DI\UIServices
$ui;
65 bool $a_call_by_reference,
66 bool $a_prepare_output =
true
70 $gui =
$DIC->wiki()->internal()->gui();
75 $this->
ctrl = $gui->ctrl();
76 $this->
lng = $domain->lng();
77 $this->
tabs = $gui->tabs();
78 $this->
help = $gui->help();
79 $this->
locator = $gui->locator();
85 $this->tool_context =
$gui->globalScreen()->tool()->context();
86 $this->
ui = $gui->ui();
88 $this->edit_request =
$gui->request();
89 $this->content_gui =
$gui->content();
92 $this->
lng->loadLanguageModule(
"obj");
93 $this->
lng->loadLanguageModule(
"wiki");
95 $this->requested_page = $this->edit_request->getPage();
96 if ($this->requested_page !==
"") {
99 $this->
ctrl->saveParameterByClass(self::class,
"transl");
100 $this->
ctrl->saveParameterByClass(self::class,
"wpg_id");
101 $this->req_with_comments = $this->edit_request->getWithComments();
102 $cs =
$DIC->contentStyle();
103 $this->content_style_gui = $cs->gui();
104 if (is_object($this->
object)) {
105 $this->content_style_domain = $cs->domain()->styleForRefId($this->
object->getRefId());
106 $this->pm = $this->domain->page()->page($this->
object->getRefId());
107 $this->imp_pages = $this->domain->importantPage($this->
object->getRefId());
118 $next_class = $this->
ctrl->getNextClass($this);
119 $cmd = $this->
ctrl->getCmd();
124 $this->gui->initFetch();
128 if ($cmd ===
"printView") {
132 switch ($next_class) {
133 case "ilinfoscreengui":
139 case 'ilpermissiongui':
141 $ilTabs->activateTab(
"perm_settings");
143 $this->
ctrl->forwardCommand($perm_gui);
146 case 'ilsettingspermissiongui':
149 $ilTabs->activateTab(
"settings");
152 $perm_gui->setPermissions(array(
"edit_wiki_navigation",
"add_pages",
"delete_wiki_pages",
"activate_wiki_protection",
153 "wiki_html_export"));
154 $perm_gui->setRoleRequiredPermissions(array(
"edit_content"));
155 $perm_gui->setRoleProhibitedPermissions(array(
"write"));
156 $this->
ctrl->forwardCommand($perm_gui);
159 case strtolower(TranslationGUI::class):
162 $ilTabs->activateTab(
"settings");
177 $transgui->forceContentTranslation();
178 $this->
ctrl->forwardCommand($transgui);
181 case 'ilwikipagegui':
184 if ($this->edit_request->getWikiPageId() > 0) {
186 $this->edit_request->getWikiPageId(),
187 $this->edit_request->getTranslation()
190 $wpage_gui = $this->content_gui->getCurrentPageGUI();
191 $wpage_gui->setStyleId($this->content_style_domain->getEffectiveStyleId());
193 if (!$ilAccess->checkAccess(
"write",
"", $this->object->getRefId()) &&
195 !$ilAccess->checkAccess(
"edit_content",
"", $this->object->getRefId()) ||
196 $wpage_gui->getPageObject()->getBlocked()
198 $wpage_gui->setEnableEditing(
false);
204 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
205 $wpage_gui->activateMetaDataEditor($this->
object,
"wpg", $wpage_gui->getId());
208 $ret = $this->
ctrl->forwardCommand($wpage_gui);
214 case 'ilobjectcopygui':
216 $cp->setType(
'wiki');
217 $this->
ctrl->forwardCommand($cp);
220 case strtolower(PublicProfileGUI::class):
222 $this->edit_request->getUserId()
224 $ret = $this->
ctrl->forwardCommand($profile_gui);
228 case "ilobjectcontentstylesettingsgui":
231 $ilTabs->activateTab(
"settings");
234 $settings_gui = $this->content_style_gui
235 ->objectSettingsGUIForRefId(
239 $this->
ctrl->forwardCommand($settings_gui);
244 $ilTabs->activateTab(
"export");
246 $this->
ctrl->forwardCommand($exp_gui);
249 case "ilcommonactiondispatchergui":
251 $this->
ctrl->forwardCommand($gui);
258 $ilTabs->activateTab(
"settings");
261 $gui->setObject($this->
object->getId(), $this->object->getType());
262 $gui->setExportCallback(array($this,
"getSubObjectTitle"), $this->
lng->txt(
"page"));
263 $this->
ctrl->forwardCommand($gui);
266 case "ilwikistatgui":
270 $ilTabs->activateTab(
"statistics");
272 $this->
ctrl->forwardCommand($gui);
275 case "ilwikipagetemplategui":
278 $ilTabs->activateTab(
"settings");
281 $this->
ctrl->forwardCommand($wptgui);
284 case 'ilobjectmetadatagui':
287 $ilTabs->activateTab(
"advmd");
289 $this->
ctrl->forwardCommand($md_gui);
292 case 'ilrepositoryobjectsearchgui':
295 $ilTabs->setTabActive(
"wiki_search_results");
296 $ilCtrl->setReturn($this,
'view');
297 $ilCtrl->setParameterByClass(ilWikiPageGUI::class,
"wpg_id",
null);
298 $ilCtrl->setParameterByClass(ilObjWikiGUI::class,
"wpg_id",
null);
300 $this->
object->getRefId(),
304 $ilCtrl->forwardCommand($search_gui);
307 case 'ilobjnotificationsettingsgui':
309 $ilTabs->activateTab(
"settings");
312 $this->
ctrl->forwardCommand($gui);
315 case 'illtiproviderobjectsettinggui':
317 $ilTabs->activateTab(
"settings");
320 $lti_gui->setCustomRolesForSelection(
$GLOBALS[
'DIC']->
rbac()->review()->getLocalRoles($this->
object->getRefId()));
321 $lti_gui->offerLTIRolesForSelection(
false);
322 $this->
ctrl->forwardCommand($lti_gui);
325 case strtolower(SettingsGUI::class):
327 $ilTabs->activateTab(
"settings");
330 $gui = $this->gui->settings()->settingsGUI(
332 $this->object->getRefId()
334 $this->
ctrl->forwardCommand($gui);
337 case strtolower(ilMediaObjectOverviewGUI::class):
340 $ilTabs->activateTab(
"media");
345 $this->
ctrl->forwardCommand($gui);
354 if ($cmd !==
"cancelObject") {
355 if ($cmd !==
"infoScreenObject") {
356 if (!in_array($cmd, array(
"createObject",
"saveObject",
"routeImportCmdObject"))) {
376 $f = $this->gui->ui()->factory();
378 $form = parent::initCreateForm($new_type);
380 $inputs[
"start_page"] =
$f->input()->field()->text(
382 )->withRequired(
true);
383 return $this->ui_factory->input()->container()->form()->standard(
384 $this->
ctrl->getFormAction($this,
'save'),
386 )->withSubmitLabel($this->
lng->txt($new_type .
'_add'));
392 ->initCreateForm($this->requested_new_type)
393 ->withRequest($this->request);
394 $data = $form->getData();
395 $new_object->setStartPage(
$data[
"start_page"]);
399 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"object_added"),
true);
400 $this->
ctrl->setParameterByClass(
405 $this->
ctrl->redirectByClass([
406 ilWikiHandlerGUI::class,
420 $this->
ctrl->redirectByClass(ilInfoScreenGUI::class,
"showSummary");
430 $ilTabs->activateTab(
"info_short");
432 if (!$ilAccess->checkAccess(
"visible",
"", $this->object->getRefId())) {
437 $info->enablePrivateNotes();
438 if (trim($this->
object->getIntroduction()) !==
"") {
440 $info->addProperty(
"", nl2br($this->
object->getIntroduction()));
448 $info->addSection($this->
lng->txt(
"wiki_feedback_from_tutor"));
449 if ($lpcomment !==
"") {
451 $this->
lng->txt(
"wiki_comment"),
457 $this->
lng->txt(
"wiki_mark"),
464 $this->
lng->txt(
"status"),
465 $this->lng->txt(
"wiki_passed")
470 $this->
lng->txt(
"status"),
471 $this->lng->txt(
"wiki_failed")
476 if ($ilAccess->checkAccess(
"read",
"", $this->object->getRefId())) {
477 $info->addButton(
$lng->
txt(
"wiki_start_page"), self::getGotoLink($this->object->getRefId()));
481 $this->
lng->loadLanguageModule(
"meta");
482 $this->
lng->loadLanguageModule(
"wiki");
507 "wiki_what_links_here",
508 $this->
ctrl->getLinkTargetByClass(
516 $this->
ctrl->getLinkTargetByClass(
529 $ilTabs->activateTab(
"wiki_pages");
540 $ilTabs->addSubTabTarget(
542 $this->
ctrl->getLinkTarget($this,
"allPages"),
545 $ilTabs->addSubTabTarget(
546 "wiki_recent_changes",
547 $this->
ctrl->getLinkTarget($this,
"recentChanges"),
550 $ilTabs->addSubTabTarget(
552 $this->
ctrl->getLinkTarget($this,
"newPages"),
555 $ilTabs->addSubTabTarget(
556 "wiki_popular_pages",
557 $this->
ctrl->getLinkTarget($this,
"popularPages"),
560 $ilTabs->addSubTabTarget(
561 "wiki_orphaned_pages",
562 $this->
ctrl->getLinkTarget($this,
"orphanedPages"),
577 if (in_array(strtolower($ilCtrl->getNextClass($this)), [strtolower(SettingsGUI::class), strtolower(ilMediaObjectOverviewGUI::class)]) ||
579 strtolower($ilCtrl->getCmdClass()),
580 array(
"",
"ilobjectcontentstylesettingsgui",
"ilobjwikigui",
581 "ilinfoscreengui",
"ilpermissiongui",
"ilexportgui",
"ilratingcategorygui",
"ilobjnotificationsettingsgui",
"iltaxmdgui",
582 "ilwikistatgui",
"ilwikipagetemplategui",
"iladvancedmdsettingsgui",
"ilmdeditorgui",
"ilsettingspermissiongui",
'ilrepositoryobjectsearchgui')
583 ) || in_array($ilCtrl->getNextClass(), [
"ilpermissiongui", strtolower(TranslationGUI::class)])) {
584 if ($this->requested_page !==
"") {
585 $page_id = ($this->edit_request->getWikiPageId() > 0)
586 ? $this->edit_request->getWikiPageId()
587 : $this->pm->getPageIdForTitle(
588 $this->requested_page,
589 $this->edit_request->getTranslation()
591 if (is_null($page_id) && $this->edit_request->getFromPage() !==
"") {
592 $page_id = $this->pm->getPageIdForTitle(
593 $this->edit_request->getFromPage(),
594 $this->edit_request->getTranslation()
597 if (!is_null($page_id)) {
598 $this->tabs_gui->setBackTarget(
599 $lng->
txt(
"wiki_last_visited_page"),
600 $this->pm->getPermaLink(
602 $this->edit_request->getTranslation()
609 if ($ilAccess->checkAccess(
'read',
"", $this->object->getRefId())) {
610 $this->tabs_gui->addTab(
613 $this->
ctrl->getLinkTarget($this,
"allPages")
618 if ($ilAccess->checkAccess(
'write',
"", $this->object->getRefId())) {
619 $this->
lng->loadLanguageModule(
'mob');
620 $this->tabs_gui->addTab(
622 $this->
lng->txt(
"mob_media"),
623 $this->
ctrl->getLinkTargetByClass(ilMediaObjectOverviewGUI::class,
"show")
628 if ($ilAccess->checkAccess(
'visible',
"", $this->object->getRefId())) {
629 $this->tabs_gui->addTab(
632 $this->
ctrl->getLinkTargetByClass(
"ilinfoscreengui",
"showSummary")
637 if ($ilAccess->checkAccess(
'write',
"", $this->object->getRefId())) {
638 $this->tabs_gui->addTab(
641 $this->
ctrl->getLinkTargetByClass(SettingsGUI::class)
646 $mdtab = $mdgui->getTab();
648 $this->tabs_gui->addTab(
650 $this->
lng->txt(
"meta_data"),
657 if ($ilAccess->checkAccess(
'write',
"", $this->object->getRefId())) {
658 $this->tabs_gui->addTab(
660 $lng->
txt(
"wiki_contributors"),
661 $this->ctrl->getLinkTarget($this,
"listContributors")
666 if ($ilAccess->checkAccess(
'statistics_read',
"", $this->object->getRefId())) {
667 $this->tabs_gui->addTab(
670 $this->ctrl->getLinkTargetByClass(
"ilWikiStatGUI",
"initial")
674 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
675 $this->tabs_gui->addTab(
678 $this->ctrl->getLinkTargetByClass(
"ilexportgui",
"")
683 if ($ilAccess->checkAccess(
'edit_permission',
"", $this->object->getRefId())) {
684 $this->tabs_gui->addTab(
687 $this->ctrl->getLinkTargetByClass(
"ilpermissiongui",
"perm")
701 array(
"general_settings",
"style",
"imp_pages",
"rating_categories",
"obj_multilinguality",
702 "page_templates",
"advmd",
"permission_settings",
"notifications",
"lti_provider")
704 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
708 $lng->
txt(
"wiki_general_settings"),
709 $ilCtrl->getLinkTarget($this,
'editSettings')
714 "permission_settings",
715 $lng->
txt(
"obj_permission_settings"),
716 $this->ctrl->getLinkTargetByClass(
"ilsettingspermissiongui",
"")
723 $ilCtrl->getLinkTargetByClass(
"ilObjectContentStyleSettingsGUI",
"")
727 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
732 $ilCtrl->getLinkTarget($this,
'editImportantPages')
736 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
740 $lng->
txt(
"wiki_page_templates"),
741 $ilCtrl->getLinkTargetByClass(
"ilwikipagetemplategui",
"")
745 if ($this->
object->getRatingPages() && $this->object->getRatingCategories()) {
749 $lng->
txt(
"rating_categories"),
750 $ilCtrl->getLinkTargetByClass(array(
'ilratinggui',
'ilratingcategorygui'),
'')
757 $ilCtrl->getLinkTargetByClass(
"ilobjnotificationsettingsgui",
'')
761 'obj_multilinguality',
762 $lng->
txt(
"obj_multilinguality"),
763 $this->ctrl->getLinkTargetByClass(TranslationGUI::class,
"")
769 if ($lti_settings->hasSettingsAccess()) {
770 $ilTabs->addSubTabTarget(
772 $this->
ctrl->getLinkTargetByClass(ilLTIProviderObjectSettingGUI::class)
776 $ilTabs->activateSubTab($a_active);
782 $this->
ctrl->redirectByClass(SettingsGUI::class);
791 $ilTabs->activateTab(
"wiki_contributors");
811 $users = $this->edit_request->getUserIds();
812 $marks = $this->edit_request->getMarks();
813 $comments = $this->edit_request->getComments();
814 $status = $this->edit_request->getStatus();
824 if ($marks_obj->getMark() !== $new_mark ||
825 $marks_obj->getComment() !== $new_comment ||
828 $marks_obj->setMark($new_mark);
829 $marks_obj->setComment($new_comment);
830 $marks_obj->update();
836 $this->tpl->setOnScreenMessage(
'success',
$lng->
txt(
"msg_obj_modified"),
true);
839 $ilCtrl->redirect($this,
"listContributors");
847 if (is_object($this->
object)) {
849 $this->
object->getTitle(),
850 self::getGotoLink($this->object->getRefId()),
852 $this->requested_ref_id
857 public static function _goto(
string $a_target): void
860 $main_tpl =
$DIC->ui()->mainTemplate();
864 $ilAccess =
$DIC->access();
867 $transl =
$DIC->wiki()->internal()->gui()->request()->getTranslation();
868 $DIC->ctrl()->setParameterByClass(self::class,
"transl", $transl);
871 $i = strpos($a_target,
"_");
874 $a_page = substr($a_target, $i + 1);
875 $a_target = substr($a_target, 0, $i);
878 if ($a_target ===
"wpage") {
879 $a_page_arr = explode(
"_", $a_page);
880 $wpg_id = (
int) $a_page_arr[0];
882 $lang = ($a_page_arr[2] ??
"");
889 foreach ($refs as $r) {
890 if ($ilAccess->checkAccess(
"read",
"", $r)) {
897 if ($ilAccess->checkAccess(
"read",
"", $a_target)) {
925 [
"ilwikihandlergui",
"ilobjwikigui"],
930 [
"ilwikihandlergui"],
934 } elseif ($ilAccess->checkAccess(
"visible",
"", $a_target)) {
937 $main_tpl->setOnScreenMessage(
'failure', sprintf(
938 $lng->
txt(
"msg_no_perm_read_item"),
952 if ($a_page ===
"") {
956 $append = (!in_array($lang, [
"",
"-"]))
959 $goto =
"goto.php?target=wiki_" . $a_ref_id .
"_" .
967 $ilCtrl = $this->ctrl;
969 $ilTabs = $this->tabs;
970 $ilAccess = $this->access;
972 $this->checkPermission(
"read");
974 $ilTabs->clearTargets();
975 $tpl->setHeaderActionMenu(
"");
977 $wpage_gui = $this->gui->content()->getCurrentPageGUI();
980 $ilCtrl->setParameter(
986 $wpage_gui->setStyleId($this->content_style_domain->getEffectiveStyleId());
988 $this->setContentStyleSheet();
991 $ilCtrl->redirectByClass(ilWikiPageGUI::class,
"preview");
998 $this->checkPermission(
"read");
1000 $this->addPagesSubTabs();
1010 $tpl->setContent($table_gui->getHTML());
1020 $this->checkPermission(
"read");
1022 $this->addPagesSubTabs();
1032 $tpl->setContent($table_gui->getHTML());
1042 $this->checkPermission(
"read");
1044 $this->addPagesSubTabs();
1054 $tpl->setContent($table_gui->getHTML());
1063 $ilCtrl = $this->
ctrl;
1065 if ($a_page ===
"") {
1066 $a_page = $this->requested_page;
1069 if ($this->pm->existsByTitle(
1071 $this->edit_request->getTranslation()
1074 ilUtil::redirect(self::getGotoLink($this->
object->getRefId(), $a_page, $this->edit_request->getTranslation()));
1076 if (!$this->
access->checkAccess(
"add_pages",
"", $this->object->getRefId())) {
1077 $this->tpl->setOnScreenMessage(
"failure", $this->
lng->txt(
"no_permission"),
true);
1078 $from_page_id = $this->pm->getPageIdForTitle($this->edit_request->getFromPage(), $this->edit_request->getTranslation());
1079 ilUtil::redirect($this->pm->getPermaLink($from_page_id, $this->edit_request->getTranslation()));
1081 if ($this->isNewTranslatedPage()) {
1084 if (!$this->
object->getTemplateSelectionOnCreation()) {
1087 $this->tpl->setOnScreenMessage(
1089 $this->
lng->txt(
"wiki_page_title_too_long") .
" (" . $a_page .
")",
1092 $ilCtrl->setParameterByClass(
1097 $ilCtrl->redirectByClass(
"ilwikipagegui",
"preview");
1100 $this->pm->createWikiPage(
1103 $this->edit_request->getTranslation()
1108 $ilCtrl->redirectByClass(
"ilwikipagegui",
"edit");
1111 $ilCtrl->setParameter(
1116 $ilCtrl->redirect($this,
"showTemplateSelection");
1123 if (in_array($this->edit_request->getTranslation(), [
"-",
""])) {
1126 $page = $this->requested_page;
1130 $this->edit_request->getTranslation()
1132 $this->tabs_gui->clearTargets();
1133 $this->tabs_gui->setBackTarget(
1134 $this->
lng->txt(
"back"),
1135 $this->pm->getPermaLink(
1136 $this->pm->getPageIdForTitle(
1137 $this->edit_request->getFromPage(),
1138 $this->edit_request->getTranslation()
1140 $this->edit_request->getTranslation()
1143 $form = $this->getNewTranslatedPageForm();
1144 $this->tpl->setContent($this->getRenderedTranslationInfo() . $form->render());
1152 $mess = $this->gui->ui()->factory()->messageBox()->info(
1153 $this->
lng->txt(
"wiki_translate_page_master_info")
1155 return $this->gui->ui()->renderer()->render($mess);
1160 $pm = $this->domain->page()->page($this->
object->getRefId());
1162 foreach ($pm->getMasterPagesWithoutTranslation($this->edit_request->getTranslation()) as $page) {
1163 $options[$page->getId()] = $page->getTitle();
1165 $append =
" '" . $this->edit_request->getPage() .
"'";
1166 $append .=
" (" . $this->
lng->txt(
"meta_l_" . $this->edit_request->getTranslation()) .
")";
1167 $append2 =
" (" . $this->
lng->txt(
"meta_l_" . $this->
object->getObjectProperties()->getPropertyTranslations()->getBaseLanguage()) .
")";
1168 $form = $this->gui->form([self::class],
"createNewTranslatedPage")
1169 ->section(
"sec", $this->
lng->txt(
"wiki_translation_page") . $append)
1170 ->switch(
"type", $this->
lng->txt(
"wiki_page_in_master_language") . $append2,
"",
"existing")
1171 ->group(
"existing", $this->
lng->txt(
"wiki_master_existing"))
1172 ->select(
"master_id", $this->
lng->txt(
"wiki_master_title"),
$options)
1174 ->group(
"new", $this->
lng->txt(
"wiki_no_master"))
1175 ->text(
"master_title", $this->
lng->txt(
"wiki_master_title"))
1178 if ($this->
object->getTemplateSelectionOnCreation($this->edit_request->getTranslation())) {
1179 $form = $form->radio(
"page_templ", $this->
lng->txt(
"wiki_page_template"),
"",
"0")->required();
1180 if ($this->
object->getEmptyPageTemplate()) {
1181 $form = $form->radioOption(
"0", $this->
lng->txt(
"wiki_empty_page"));
1185 foreach ($ts as $t) {
1186 $form = $form->radioOption($t[
"wpage_id"], $t[
"title"]);
1195 $form = $this->getNewTranslatedPageForm();
1196 if ($form->isValid()) {
1197 $page_template_id = 0;
1198 if ($this->
object->getTemplateSelectionOnCreation($this->edit_request->getTranslation())) {
1199 $page_template_id = (
int) $form->getData(
"page_templ");
1201 if ($form->getData(
"type") ===
"new") {
1202 $wpg_id = $this->pm->createWikiPage(
1203 $form->getData(
"master_title")
1206 $wpg_id = $form->getData(
"master_id");
1208 $wpg_id = $this->pm->createWikiPage(
1209 $this->edit_request->getPage(),
1211 $this->edit_request->getTranslation(),
1215 $this->
ctrl->setParameterByClass(ilWikiPageGUI::class,
"wpg_id", $wpg_id);
1216 $this->
ctrl->redirectByClass(ilWikiPageGUI::class,
"preview");
1221 $this->checkPermission(
"read");
1224 $this->gotoPageObject($page);
1231 $this->checkPermission(
"read");
1233 $this->addPagesSubTabs();
1242 $tpl->setContent($table_gui->getHTML());
1247 self::renderSideBlock($a_wpg_id, $this->
object->getRefId());
1259 $ilAccess =
$DIC->access();
1260 $ilCtrl =
$DIC->ctrl();
1264 $tpl->addJavaScript(
"../components/ILIAS/Wiki/resources/WikiPres.js");
1266 $tpl->addJavaScript(
"assets/js/WikiPres.js");
1271 $tpl->addOnLoadCode(
"il.Wiki.Pres.init('" . $ilCtrl->getLinkTargetByClass(
"ilobjwikigui",
"",
"",
false,
false) .
"');");
1273 if ($a_wpg_id > 0 && !$a_wp) {
1282 if ($a_wpg_id > 0) {
1287 $a_wp->getRating()) {
1289 $rgui->setObject($wiki_id,
"wiki", $a_wpg_id,
"wpg");
1291 $rgui->setYourRatingText(
"#");
1292 $rcontent .= $rgui->getBlockHTML(
$lng->txt(
"wiki_rate_page"));
1298 if ($ilAccess->checkAccess(
"write",
"", $a_wiki_ref_id) ||
1299 $ilAccess->checkAccess(
"edit_page_meta",
"", $a_wiki_ref_id)) {
1301 "edit" => $ilCtrl->getLinkTargetByClass(
"ilwikipagegui",
"editAdvancedMetaData"),
1302 "hide" => $ilCtrl->getLinkTargetByClass(
"ilwikipagegui",
"hideAdvancedMetaData")
1306 $callback = $wiki->getLinkMetadataValues()
1307 ? array($wiki,
"decorateAdvMDValue")
1310 $rcontent .= $mdgui->getBlockHTML($cmd, $callback);
1316 $rcontent .= $imp_pages_block->getHTML();
1319 if ($a_wpg_id > 0) {
1321 $wiki_functions_block->setPageObject($a_wp);
1322 $rcontent .= $wiki_functions_block->getHTML();
1325 $tpl->setRightContent($rcontent);
1332 $this->checkPermission(
"read");
1334 $this->addPagesSubTabs();
1344 $tpl->setContent($table_gui->getHTML());
1350 $ordering = $this->edit_request->getPrintOrdering();
1353 if (count($ordering) > 0) {
1355 $page_ids = array_keys($ordering);
1358 elseif ($this->edit_request->getWikiPageId()) {
1359 $page_ids = array($this->edit_request->getWikiPageId());
1368 : $this->getPrintPageIds();
1369 $provider = new \ILIAS\Wiki\WikiPrintViewProviderGUI(
1372 $this->
object->getRefId(),
1376 return new \ILIAS\Export\PrintProcessGUI(
1386 $print_view = $this->getPrintView();
1387 $print_view->sendPrintView();
1393 $ilTabs = $this->tabs;
1394 $ilCtrl = $this->ctrl;
1397 $this->checkPermission(
"read");
1399 $ilTabs->setTabActive(
"wiki_search_results");
1401 if ($this->edit_request->getSearchTerm() ===
"") {
1402 $this->tpl->setOnScreenMessage(
'failure',
$lng->txt(
"wiki_please_enter_search_term"),
true);
1403 $ilCtrl->redirectByClass(
"ilwikipagegui",
"preview");
1408 $this->edit_request->getSearchTerm()
1415 $this->edit_request->getSearchTerm()
1418 $this->setSideBlock();
1419 $tpl->setContent($table_gui->getHTML());
1430 $this->content_style_gui->addCss($tpl, $this->
object->getRefId());
1442 $ilToolbar = $this->toolbar;
1443 $ilTabs = $this->tabs;
1445 $ilCtrl = $this->ctrl;
1447 $this->checkPermission(
"edit_wiki_navigation");
1449 $this->tpl->setOnScreenMessage(
'info',
$lng->txt(
"wiki_navigation_info"));
1451 $ipages_ids = $this->imp_pages->getImportantPageIds();
1454 $pages = $this->pm->getAllPagesInfo();
1456 foreach ($pages as $p) {
1457 if (!in_array($p->getId(), $ipages_ids)) {
1464 $si->setInfo(
$lng->txt(
""));
1465 $ilToolbar->addInputItem($si);
1466 $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
1467 $ilToolbar->addFormButton(
$lng->txt(
"add"),
"addImportantPage");
1471 $ilTabs->activateTab(
"settings");
1472 $this->setSettingsSubTabs(
"imp_pages");
1476 $tpl->setContent($imp_table->getHTML());
1481 $ilCtrl = $this->ctrl;
1484 $this->checkPermission(
"edit_wiki_navigation");
1486 $imp_page_id = $this->edit_request->getImportantPageId();
1487 if ($imp_page_id > 0) {
1488 $this->imp_pages->add($imp_page_id);
1489 $this->tpl->setOnScreenMessage(
'success',
$lng->txt(
"wiki_imp_page_added"),
true);
1491 $ilCtrl->redirect($this,
"editImportantPages");
1496 $ilCtrl = $this->ctrl;
1500 $imp_page_ids = $this->edit_request->getImportantPageIds();
1501 if (count($imp_page_ids) === 0) {
1502 $this->tpl->setOnScreenMessage(
'info',
$lng->txt(
"no_checkbox"),
true);
1503 $ilCtrl->redirect($this,
"editImportantPages");
1506 $cgui->setFormAction($ilCtrl->getFormAction($this));
1507 $cgui->setHeaderText(
$lng->txt(
"wiki_sure_remove_imp_pages"));
1508 $cgui->setCancel(
$lng->txt(
"cancel"),
"editImportantPages");
1509 $cgui->setConfirm(
$lng->txt(
"remove"),
"removeImportantPages");
1511 foreach ($imp_page_ids as $i) {
1515 $tpl->setContent($cgui->getHTML());
1521 $ilCtrl = $this->ctrl;
1524 $this->checkPermission(
"edit_wiki_navigation");
1526 $imp_page_ids = $this->edit_request->getImportantPageIds();
1527 foreach ($imp_page_ids as $i) {
1528 $this->imp_pages->removeImportantPage($i);
1530 $this->tpl->setOnScreenMessage(
'success',
$lng->txt(
"wiki_removed_imp_pages"),
true);
1531 $ilCtrl->redirect($this,
"editImportantPages");
1536 $ilCtrl = $this->ctrl;
1539 $this->checkPermission(
"edit_wiki_navigation");
1541 $ordering = $this->edit_request->getImportantPageOrdering();
1542 $indentation = $this->edit_request->getImportantPageIndentation();
1543 $this->imp_pages->saveOrderingAndIndentation($ordering, $indentation);
1544 $this->tpl->setOnScreenMessage(
'success',
$lng->txt(
"wiki_ordering_and_indent_saved"),
true);
1545 $ilCtrl->redirect($this,
"editImportantPages");
1550 $ilCtrl = $this->ctrl;
1553 $this->checkPermission(
"edit_wiki_navigation");
1555 $imp_page_ids = $this->edit_request->getImportantPageIds();
1556 if (count($imp_page_ids) !== 1) {
1557 $this->tpl->setOnScreenMessage(
'info',
$lng->txt(
"wiki_select_one_item"),
true);
1559 $this->imp_pages->removeImportantPage($imp_page_ids[0]);
1561 $this->
object->update();
1562 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"msg_obj_modified"),
true);
1564 $ilCtrl->redirect($this,
"editImportantPages");
1573 public function exportHTML(): void
1576 $wiki = $this->object;
1577 $cont_exp =
new Export\WikiHtmlExport($wiki);
1579 $format = explode(
"_", $this->edit_request->getFormat());
1580 if (($format[1] ??
"") ===
"comments") {
1581 $cont_exp->setMode(Export\WikiHtmlExport::MODE_COMMENTS);
1584 $cont_exp->buildExportFile();
1595 if ($page->getWikiId() === $a_wiki_id) {
1615 $ilTabs = $this->tabs;
1616 $ilCtrl = $this->ctrl;
1618 $ilCtrl->setParameterByClass(
1623 $ilTabs->clearTargets();
1624 $this->tpl->setOnScreenMessage(
'info',
$lng->txt(
"wiki_page_not_exist_select_templ"));
1626 $form = $this->initTemplateSelectionForm();
1627 $tpl->setContent($form->getHTML());
1633 $ilCtrl = $this->ctrl;
1639 $hi->setValue($this->requested_page);
1640 $form->addItem($hi);
1644 $radg->setRequired(
true);
1646 if ($this->
object->getEmptyPageTemplate()) {
1648 $radg->addOption($op1);
1653 foreach ($ts as $t) {
1655 $radg->addOption($op);
1658 $form->addItem($radg);
1661 $form->addCommandButton(
"createPageUsingTemplate",
$lng->txt(
"wiki_create_page"));
1662 $form->addCommandButton(
"cancelCreationPageUsingTemplate",
$lng->txt(
"cancel"));
1664 $form->setTitle(
$lng->txt(
"wiki_new_page") .
": " . $this->requested_page);
1665 $form->setFormAction($ilCtrl->getFormAction($this));
1674 $ilCtrl = $this->ctrl;
1676 $form = $this->initTemplateSelectionForm();
1677 if ($form->checkInput()) {
1678 $a_page = $this->edit_request->getPage();
1679 $this->pm->createWikiPage(
1682 $this->edit_request->getTranslation(),
1683 $this->edit_request->getPageTemplateId()
1688 $ilCtrl->redirectByClass(
"ilwikipagegui",
"edit");
1690 $this->tpl->setOnScreenMessage(
'success',
$lng->txt(
"msg_obj_modified"),
true);
1691 $ilCtrl->redirect($this,
"");
1693 $form->setValuesByPost();
1694 $tpl->setContent($form->getHTML());
1700 $ilCtrl = $this->ctrl;
1703 $ilCtrl->setParameterByClass(
1708 $ilCtrl->redirectByClass(
"ilwikipagegui",
"preview");
1713 if ($perm ===
"create") {
1714 return parent::checkPermissionBool($perm, $cmd, $type,
$ref_id);
1717 $ref_id = $this->
object->getRefId();
1745 $this->log->debug(
"init: " . $this->req_with_comments);
1746 $this->checkPermission(
"wiki_html_export");
1747 $this->
object->initUserHTMLExport($this->req_with_comments);
1755 $this->log->debug(
"start: " . $this->req_with_comments);
1756 $this->checkPermission(
"wiki_html_export");
1757 $this->
object->startUserHTMLExport($this->req_with_comments);
1765 $this->log->debug(
"get progress: " . $this->req_with_comments);
1766 $this->checkPermission(
"wiki_html_export");
1767 $p = $this->
object->getUserHTMLExportProgress($this->req_with_comments);
1770 $pb->setCurrent($p[
"progress"]);
1772 $r =
new stdClass();
1773 $r->progressBar = $pb->render();
1774 $r->status = $p[
"status"];
1775 $this->log->debug(
"status: " . $r->status);
1776 echo(json_encode($r, JSON_THROW_ON_ERROR));
1782 $this->log->debug(
"download");
1783 $this->checkPermission(
"wiki_html_export");
1784 $this->
object->deliverUserHTMLExport();
1789 $this->log->debug(
"download");
1790 $this->checkPermission(
"wiki_html_export");
1791 $this->
object->deliverUserHTMLExport(
true);
1796 if (!is_object($this->
object)) {
1800 $this->
object->getRefId(),
1801 $this->user->getId()
1803 if (count($ass_info) > 0) {
1804 $ass_ids = array_map(
static function ($i):
int {
1809 $this->tool_context->current()->addAdditionalData(
1811 $this->getAssignmentButtons()
1821 $ilCtrl = $this->ctrl;
1826 $this->
object->getRefId(),
1827 $this->user->getId()
1830 foreach ($ass_info as $i) {
1832 $times_up = $ass->afterDeadlineStrict();
1836 $ilCtrl->setParameterByClass(
"ilwikipagegui",
"ass", $ass->getId());
1837 $submit_link = $ilCtrl->getLinkTargetByClass(
"ilwikipagegui",
"finalizeAssignment");
1838 $ilCtrl->setParameterByClass(
"ilwikipagegui",
"ass",
"");
1840 $buttons[$i->getId()][] = $ui->factory()->button()->primary(
$lng->txt(
"wiki_finalize_wiki"), $submit_link);
1845 if ($submission->hasSubmitted()) {
1846 $submitted = $submission->getSelectedObject();
1847 if ($submitted?->getTimestamp() !=
"") {
1848 $ilCtrl->setParameterByClass(
"ilwikipagegui",
"ass", $ass->getId());
1850 $dl_link = $ilCtrl->getLinkTargetByClass(
"ilwikipagegui",
"downloadExcSubFile");
1851 $ilCtrl->setParameterByClass(
"ilwikipagegui",
"ass",
"");
1852 $buttons[$i->getId()][] = $ui->factory()->button()->standard(
$lng->txt(
"wiki_download_submission"), $dl_link);
GUI class for object translation handling.
GUI class for public user profile presentation.
const IL_WIKI_POPULAR_PAGES
const IL_WIKI_ORPHANED_PAGES
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
redirectByClass( $a_class, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false)
@inheritDoc
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
@inheritDoc
setParameterByClass(string $a_class, string $a_parameter, $a_value)
@inheritDoc
Exercise submission //TODO: This class has many static methods related to delivered "files".
Export User Interface Class.
setScreenIdComponent(string $a_comp)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupComment(int $a_usr_id, int $a_obj_id)
static _lookupMark(int $a_usr_id, int $a_obj_id)
GUI class for LTI provider object settings.
loadLanguageModule(string $a_module)
Load language module.
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...
static getLogger(string $a_component_id)
Get component logger.
Component logger with individual log levels by component id.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getSyntaxStylePath()
ILIAS Wiki Content GUIService $content_gui
static lookupSubObjectTitle(int $a_wiki_id, string $a_page_id)
Get title for wiki page (used in ilNotesGUI)
getRenderedTranslationInfo()
getSubObjectTitle(int $a_id, string $a_type)
Used for rating export.
getPrintView(bool $export=false)
setSideBlock(int $a_wpg_id=0)
static getGotoLink(int $a_ref_id, string $a_page="", string $lang="-")
ILIAS Style Content Object ObjectFacade $content_style_domain
getAssignmentButtons()
Get assignment buttons.
getTabs()
@abstract overwrite in derived GUI class of your object type
addLocatorItems()
should be overwritten to add object specific items (repository items are preloaded)
downloadUserHTMLExportObject()
cancelCreationPageUsingTemplateObject()
ILIAS Wiki Page PageManager $pm
ILIAS Wiki InternalGUIService $gui
ILIAS Wiki Navigation ImportantPageManager $imp_pages
getNewTranslatedPageForm()
initCreateForm(string $new_type)
ilPropertyFormGUI $form_gui
downloadUserHTMLExportWithCommentsObject()
WikiGUIRequest $edit_request
createNewTranslatedPageObject()
ILIAS Wiki InternalDomainService $domain
gotoPageObject(string $a_page="")
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
__construct( $a_data, int $a_id, bool $a_call_by_reference, bool $a_prepare_output=true)
viewObject()
viewObject container presentation for "administration -> repository, trash, permissions"
setSettingsSubTabs(string $a_active)
initTemplateSelectionForm()
showTemplateSelectionObject()
afterSave(ilObject $new_object)
Post (successful) object creation hook.
startUserHTMLExportObject()
Export html (as user)
createPageUsingTemplateObject()
saveOrderingAndIndentObject()
removeImportantPagesObject()
static renderSideBlock(int $a_wpg_id, int $a_wiki_ref_id, ?ilWikiPage $a_wp=null)
ContextServices $tool_context
editImportantPagesObject()
getUserHTMLExportProgressObject()
Get user html export progress.
initUserHTMLExportObject()
Current process:
infoScreenObject()
this one is called from the info button in the repository
static _goto(string $a_target)
confirmRemoveImportantPagesObject()
ILIAS Style Content GUIService $content_style_gui
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupRating(int $a_wiki_id)
Lookup whether rating is activated.
static _lookupStartPage(int $a_wiki_id)
static _performSearch(int $a_wiki_id, string $a_searchterm)
Search in Wiki.
static _lookupRatingCategories(int $a_wiki_id)
Lookup whether rating categories are activated.
GUI class for the workflow of copying objects.
Class ilObjectGUI Basic methods of all Output classes.
ilGlobalTemplateInterface $tpl
static _gotoRepositoryRoot(bool $raise_error=false)
Goto repository root.
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
addHeaderAction()
Add header action menu.
static _gotoRepositoryNode(int $ref_id, string $cmd="")
prepareOutput(bool $show_sub_objects=true)
Class ilObject Basic functions for all objects.
static _getAllReferences(int $id)
get all reference ids for object ID
static _lookupObjId(int $ref_id)
static _lookupTitle(int $obj_id)
This class represents an option in a radio group.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getSearchBlockHTML(string $a_title)
UI class for handling permissions that can be configured having the write permission for an object.
static shortenTextExtended(string $a_str, int $a_len, bool $a_dots=false, bool $a_next_blank=false, bool $a_keep_extension=false)
static strLen(string $a_string)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
static redirect(string $a_script)
static _writeStatus(int $a_obj_id, int $a_user_id, int $a_status)
static _lookupStatus(int $a_obj_id, int $a_user_id)
Lookup current success status (STATUS_NOT_GRADED|STATUS_PASSED|STATUS_FAILED)
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...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Wiki page template gui class.
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 getPageIdForTitle(int $a_wiki_id, string $a_title, string $lang="-")
Get wiki page object for id and title.
static lookupWikiId(int $a_page_id)
static lookupAdvancedMetadataHidden(int $a_page_id)
static lookupTitle(int $a_page_id, string $lang="-")
static _wikiPageExists(int $a_wiki_id, string $a_title, string $lang="-")
static getRandomPage(int $a_wiki_id)
TableGUI class for wiki pages table.
static check(string $a_perm, int $a_ref_id, string $a_cmd="")
TableGUI class for recent changes in wiki.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Wiki statistics GUI class.
static makeUrlTitle(string $a_par)
static makeDbTitle(string $a_par)
return['delivery_method'=> 'php',]
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setContent(string $a_html)
Sets content for standard template.
static http()
Fetches the global http state from ILIAS.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.
if(!file_exists('../ilias.ini.php'))