43 protected \ILIAS\Wiki\InternalDomainService
$domain;
44 protected \ILIAS\Wiki\InternalGUIService
$gui;
46 protected \ILIAS\Wiki\Navigation\ImportantPageManager
$imp_pages;
47 protected \ILIAS\Wiki\Page\PageManager
$pm;
54 protected \ILIAS\DI\UIServices
$ui;
63 bool $a_call_by_reference,
64 bool $a_prepare_output =
true
68 $gui =
$DIC->wiki()->internal()->gui();
73 $this->
ctrl = $gui->ctrl();
74 $this->
lng = $domain->lng();
75 $this->
tabs = $gui->tabs();
76 $this->
help = $gui->help();
77 $this->
locator = $gui->locator();
83 $this->tool_context =
$gui->globalScreen()->tool()->context();
84 $this->
ui = $gui->ui();
86 $this->edit_request =
$gui->request();
87 $this->content_gui =
$gui->content();
90 $this->
lng->loadLanguageModule(
"obj");
91 $this->
lng->loadLanguageModule(
"wiki");
93 $this->requested_page = $this->edit_request->getPage();
94 if ($this->requested_page !==
"") {
97 $this->
ctrl->saveParameterByClass(self::class,
"transl");
98 $this->
ctrl->saveParameterByClass(self::class,
"wpg_id");
99 $this->req_with_comments = $this->edit_request->getWithComments();
100 $cs =
$DIC->contentStyle();
101 $this->content_style_gui = $cs->gui();
102 if (is_object($this->
object)) {
103 $this->content_style_domain = $cs->domain()->styleForRefId($this->
object->getRefId());
104 $this->pm = $this->domain->page()->page($this->
object->getRefId());
105 $this->imp_pages = $this->domain->importantPage($this->
object->getRefId());
116 $next_class = $this->
ctrl->getNextClass($this);
117 $cmd = $this->
ctrl->getCmd();
122 $this->gui->initFetch();
126 if ($cmd ===
"printView") {
130 switch ($next_class) {
131 case "ilinfoscreengui":
137 case 'ilpermissiongui':
139 $ilTabs->activateTab(
"perm_settings");
141 $this->
ctrl->forwardCommand($perm_gui);
144 case 'ilsettingspermissiongui':
147 $ilTabs->activateTab(
"settings");
150 $perm_gui->setPermissions(array(
"edit_wiki_navigation",
"add_pages",
"delete_wiki_pages",
"activate_wiki_protection",
151 "wiki_html_export"));
152 $perm_gui->setRoleRequiredPermissions(array(
"edit_content"));
153 $perm_gui->setRoleProhibitedPermissions(array(
"write"));
154 $this->
ctrl->forwardCommand($perm_gui);
157 case strtolower(TranslationGUI::class):
160 $ilTabs->activateTab(
"settings");
175 $transgui->forceContentTranslation();
176 $this->
ctrl->forwardCommand($transgui);
179 case 'ilwikipagegui':
182 if ($this->edit_request->getWikiPageId() > 0) {
184 $this->edit_request->getWikiPageId(),
185 $this->edit_request->getTranslation()
188 $wpage_gui = $this->content_gui->getCurrentPageGUI();
189 $wpage_gui->setStyleId($this->content_style_domain->getEffectiveStyleId());
191 if (!$ilAccess->checkAccess(
"write",
"", $this->object->getRefId()) &&
193 !$ilAccess->checkAccess(
"edit_content",
"", $this->object->getRefId()) ||
194 $wpage_gui->getPageObject()->getBlocked()
196 $wpage_gui->setEnableEditing(
false);
202 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
203 $wpage_gui->activateMetaDataEditor($this->
object,
"wpg", $wpage_gui->getId());
206 $ret = $this->
ctrl->forwardCommand($wpage_gui);
212 case 'ilobjectcopygui':
214 $cp->setType(
'wiki');
215 $this->
ctrl->forwardCommand($cp);
218 case strtolower(PublicProfileGUI::class):
220 $this->edit_request->getUserId()
222 $ret = $this->
ctrl->forwardCommand($profile_gui);
226 case "ilobjectcontentstylesettingsgui":
229 $ilTabs->activateTab(
"settings");
232 $settings_gui = $this->content_style_gui
233 ->objectSettingsGUIForRefId(
237 $this->
ctrl->forwardCommand($settings_gui);
242 $ilTabs->activateTab(
"export");
244 $this->
ctrl->forwardCommand($exp_gui);
247 case "ilcommonactiondispatchergui":
249 $this->
ctrl->forwardCommand($gui);
256 $ilTabs->activateTab(
"settings");
259 $gui->setObject($this->
object->getId(), $this->object->getType());
260 $gui->setExportCallback(array($this,
"getSubObjectTitle"), $this->
lng->txt(
"page"));
261 $this->
ctrl->forwardCommand($gui);
264 case "ilwikistatgui":
268 $ilTabs->activateTab(
"statistics");
270 $this->
ctrl->forwardCommand($gui);
273 case "ilwikipagetemplategui":
276 $ilTabs->activateTab(
"settings");
279 $this->
ctrl->forwardCommand($wptgui);
282 case 'ilobjectmetadatagui':
285 $ilTabs->activateTab(
"advmd");
287 $this->
ctrl->forwardCommand($md_gui);
290 case 'ilrepositoryobjectsearchgui':
293 $ilTabs->setTabActive(
"wiki_search_results");
294 $ilCtrl->setReturn($this,
'view');
295 $ilCtrl->setParameterByClass(ilWikiPageGUI::class,
"wpg_id",
null);
296 $ilCtrl->setParameterByClass(ilObjWikiGUI::class,
"wpg_id",
null);
298 $this->
object->getRefId(),
302 $ilCtrl->forwardCommand($search_gui);
305 case 'ilobjnotificationsettingsgui':
307 $ilTabs->activateTab(
"settings");
310 $this->
ctrl->forwardCommand($gui);
313 case 'illtiproviderobjectsettinggui':
315 $ilTabs->activateTab(
"settings");
318 $lti_gui->setCustomRolesForSelection(
$GLOBALS[
'DIC']->
rbac()->review()->getLocalRoles($this->
object->getRefId()));
319 $lti_gui->offerLTIRolesForSelection(
false);
320 $this->
ctrl->forwardCommand($lti_gui);
323 case strtolower(SettingsGUI::class):
325 $ilTabs->activateTab(
"settings");
328 $gui = $this->gui->settings()->settingsGUI(
330 $this->object->getRefId()
332 $this->
ctrl->forwardCommand($gui);
341 if ($cmd !==
"cancelObject") {
342 if ($cmd !==
"infoScreenObject") {
343 if (!in_array($cmd, array(
"createObject",
"saveObject",
"routeImportCmdObject"))) {
363 $f = $this->gui->ui()->factory();
365 $form = parent::initCreateForm($new_type);
367 $inputs[
"start_page"] =
$f->input()->field()->text(
369 )->withRequired(
true);
370 return $this->ui_factory->input()->container()->form()->standard(
371 $this->
ctrl->getFormAction($this,
'save'),
373 )->withSubmitLabel($this->
lng->txt($new_type .
'_add'));
379 ->initCreateForm($this->requested_new_type)
380 ->withRequest($this->request);
381 $data = $form->getData();
382 $new_object->setStartPage(
$data[
"start_page"]);
386 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"object_added"),
true);
387 $this->
ctrl->setParameterByClass(
392 $this->
ctrl->redirectByClass([
393 ilWikiHandlerGUI::class,
407 $this->
ctrl->redirectByClass(ilInfoScreenGUI::class,
"showSummary");
417 $ilTabs->activateTab(
"info_short");
419 if (!$ilAccess->checkAccess(
"visible",
"", $this->object->getRefId())) {
424 $info->enablePrivateNotes();
425 if (trim($this->
object->getIntroduction()) !==
"") {
427 $info->addProperty(
"", nl2br($this->
object->getIntroduction()));
435 $info->addSection($this->
lng->txt(
"wiki_feedback_from_tutor"));
436 if ($lpcomment !==
"") {
438 $this->
lng->txt(
"wiki_comment"),
444 $this->
lng->txt(
"wiki_mark"),
451 $this->
lng->txt(
"status"),
452 $this->lng->txt(
"wiki_passed")
457 $this->
lng->txt(
"status"),
458 $this->lng->txt(
"wiki_failed")
463 if ($ilAccess->checkAccess(
"read",
"", $this->object->getRefId())) {
464 $info->addButton(
$lng->
txt(
"wiki_start_page"), self::getGotoLink($this->object->getRefId()));
468 $this->
lng->loadLanguageModule(
"meta");
469 $this->
lng->loadLanguageModule(
"wiki");
494 "wiki_what_links_here",
495 $this->
ctrl->getLinkTargetByClass(
503 $this->
ctrl->getLinkTargetByClass(
516 $ilTabs->activateTab(
"wiki_pages");
527 $ilTabs->addSubTabTarget(
529 $this->
ctrl->getLinkTarget($this,
"allPages"),
532 $ilTabs->addSubTabTarget(
533 "wiki_recent_changes",
534 $this->
ctrl->getLinkTarget($this,
"recentChanges"),
537 $ilTabs->addSubTabTarget(
539 $this->
ctrl->getLinkTarget($this,
"newPages"),
542 $ilTabs->addSubTabTarget(
543 "wiki_popular_pages",
544 $this->
ctrl->getLinkTarget($this,
"popularPages"),
547 $ilTabs->addSubTabTarget(
548 "wiki_orphaned_pages",
549 $this->
ctrl->getLinkTarget($this,
"orphanedPages"),
564 if (in_array(strtolower($ilCtrl->getNextClass($this)), [strtolower(SettingsGUI::class)]) ||
566 strtolower($ilCtrl->getCmdClass()),
567 array(
"",
"ilobjectcontentstylesettingsgui",
"ilobjwikigui",
568 "ilinfoscreengui",
"ilpermissiongui",
"ilexportgui",
"ilratingcategorygui",
"ilobjnotificationsettingsgui",
"iltaxmdgui",
569 "ilwikistatgui",
"ilwikipagetemplategui",
"iladvancedmdsettingsgui",
"ilmdeditorgui",
"ilsettingspermissiongui",
'ilrepositoryobjectsearchgui')
570 ) || in_array($ilCtrl->getNextClass(), [
"ilpermissiongui", strtolower(TranslationGUI::class)])) {
571 if ($this->requested_page !==
"") {
572 $page_id = ($this->edit_request->getWikiPageId() > 0)
573 ? $this->edit_request->getWikiPageId()
574 : $this->pm->getPageIdForTitle(
575 $this->requested_page,
576 $this->edit_request->getTranslation()
578 if (is_null($page_id) && $this->edit_request->getFromPage() !==
"") {
579 $page_id = $this->pm->getPageIdForTitle(
580 $this->edit_request->getFromPage(),
581 $this->edit_request->getTranslation()
584 if (!is_null($page_id)) {
585 $this->tabs_gui->setBackTarget(
586 $lng->
txt(
"wiki_last_visited_page"),
587 $this->pm->getPermaLink(
589 $this->edit_request->getTranslation()
596 if ($ilAccess->checkAccess(
'read',
"", $this->object->getRefId())) {
597 $this->tabs_gui->addTab(
600 $this->
ctrl->getLinkTarget($this,
"allPages")
605 if ($ilAccess->checkAccess(
'visible',
"", $this->object->getRefId())) {
606 $this->tabs_gui->addTab(
609 $this->
ctrl->getLinkTargetByClass(
"ilinfoscreengui",
"showSummary")
614 if ($ilAccess->checkAccess(
'write',
"", $this->object->getRefId())) {
615 $this->tabs_gui->addTab(
618 $this->
ctrl->getLinkTargetByClass(SettingsGUI::class)
623 $mdtab = $mdgui->getTab();
625 $this->tabs_gui->addTab(
627 $this->
lng->txt(
"meta_data"),
634 if ($ilAccess->checkAccess(
'write',
"", $this->object->getRefId())) {
635 $this->tabs_gui->addTab(
637 $lng->
txt(
"wiki_contributors"),
638 $this->ctrl->getLinkTarget($this,
"listContributors")
643 if ($ilAccess->checkAccess(
'statistics_read',
"", $this->object->getRefId())) {
644 $this->tabs_gui->addTab(
647 $this->ctrl->getLinkTargetByClass(
"ilWikiStatGUI",
"initial")
651 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
652 $this->tabs_gui->addTab(
655 $this->ctrl->getLinkTargetByClass(
"ilexportgui",
"")
660 if ($ilAccess->checkAccess(
'edit_permission',
"", $this->object->getRefId())) {
661 $this->tabs_gui->addTab(
664 $this->ctrl->getLinkTargetByClass(
"ilpermissiongui",
"perm")
678 array(
"general_settings",
"style",
"imp_pages",
"rating_categories",
"obj_multilinguality",
679 "page_templates",
"advmd",
"permission_settings",
"notifications",
"lti_provider")
681 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
685 $lng->
txt(
"wiki_general_settings"),
686 $ilCtrl->getLinkTarget($this,
'editSettings')
691 "permission_settings",
692 $lng->
txt(
"obj_permission_settings"),
693 $this->ctrl->getLinkTargetByClass(
"ilsettingspermissiongui",
"")
700 $ilCtrl->getLinkTargetByClass(
"ilObjectContentStyleSettingsGUI",
"")
704 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
709 $ilCtrl->getLinkTarget($this,
'editImportantPages')
713 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
717 $lng->
txt(
"wiki_page_templates"),
718 $ilCtrl->getLinkTargetByClass(
"ilwikipagetemplategui",
"")
722 if ($this->
object->getRatingPages() && $this->object->getRatingCategories()) {
726 $lng->
txt(
"rating_categories"),
727 $ilCtrl->getLinkTargetByClass(array(
'ilratinggui',
'ilratingcategorygui'),
'')
734 $ilCtrl->getLinkTargetByClass(
"ilobjnotificationsettingsgui",
'')
738 'obj_multilinguality',
739 $lng->
txt(
"obj_multilinguality"),
740 $this->ctrl->getLinkTargetByClass(TranslationGUI::class,
"")
746 if ($lti_settings->hasSettingsAccess()) {
747 $ilTabs->addSubTabTarget(
749 $this->
ctrl->getLinkTargetByClass(ilLTIProviderObjectSettingGUI::class)
753 $ilTabs->activateSubTab($a_active);
759 $this->
ctrl->redirectByClass(SettingsGUI::class);
768 $ilTabs->activateTab(
"wiki_contributors");
788 $users = $this->edit_request->getUserIds();
789 $marks = $this->edit_request->getMarks();
790 $comments = $this->edit_request->getComments();
791 $status = $this->edit_request->getStatus();
801 if ($marks_obj->getMark() !== $new_mark ||
802 $marks_obj->getComment() !== $new_comment ||
805 $marks_obj->setMark($new_mark);
806 $marks_obj->setComment($new_comment);
807 $marks_obj->update();
813 $this->tpl->setOnScreenMessage(
'success',
$lng->
txt(
"msg_obj_modified"),
true);
816 $ilCtrl->redirect($this,
"listContributors");
824 if (is_object($this->
object)) {
826 $this->
object->getTitle(),
827 self::getGotoLink($this->object->getRefId()),
829 $this->requested_ref_id
834 public static function _goto(
string $a_target): void
837 $main_tpl =
$DIC->ui()->mainTemplate();
841 $ilAccess =
$DIC->access();
844 $transl =
$DIC->wiki()->internal()->gui()->request()->getTranslation();
845 $DIC->ctrl()->setParameterByClass(self::class,
"transl", $transl);
848 $i = strpos($a_target,
"_");
851 $a_page = substr($a_target, $i + 1);
852 $a_target = substr($a_target, 0, $i);
855 if ($a_target ===
"wpage") {
856 $a_page_arr = explode(
"_", $a_page);
857 $wpg_id = (
int) $a_page_arr[0];
859 $lang = ($a_page_arr[2] ??
"");
866 foreach ($refs as $r) {
867 if ($ilAccess->checkAccess(
"read",
"", $r)) {
874 if ($ilAccess->checkAccess(
"read",
"", $a_target)) {
902 [
"ilwikihandlergui",
"ilobjwikigui"],
907 [
"ilwikihandlergui"],
911 } elseif ($ilAccess->checkAccess(
"visible",
"", $a_target)) {
914 $main_tpl->setOnScreenMessage(
'failure', sprintf(
915 $lng->
txt(
"msg_no_perm_read_item"),
929 if ($a_page ===
"") {
933 $append = (!in_array(
$lang, [
"",
"-"]))
936 $goto =
"goto.php?target=wiki_" . $a_ref_id .
"_" .
944 $ilCtrl = $this->ctrl;
946 $ilTabs = $this->tabs;
947 $ilAccess = $this->access;
949 $this->checkPermission(
"read");
951 $ilTabs->clearTargets();
952 $tpl->setHeaderActionMenu(
"");
954 $wpage_gui = $this->gui->content()->getCurrentPageGUI();
957 $ilCtrl->setParameter(
963 $wpage_gui->setStyleId($this->content_style_domain->getEffectiveStyleId());
965 $this->setContentStyleSheet();
968 $ilCtrl->redirectByClass(ilWikiPageGUI::class,
"preview");
975 $this->checkPermission(
"read");
977 $this->addPagesSubTabs();
987 $tpl->setContent($table_gui->getHTML());
997 $this->checkPermission(
"read");
999 $this->addPagesSubTabs();
1009 $tpl->setContent($table_gui->getHTML());
1019 $this->checkPermission(
"read");
1021 $this->addPagesSubTabs();
1031 $tpl->setContent($table_gui->getHTML());
1040 $ilCtrl = $this->
ctrl;
1042 if ($a_page ===
"") {
1043 $a_page = $this->requested_page;
1046 if ($this->pm->existsByTitle(
1048 $this->edit_request->getTranslation()
1051 ilUtil::redirect(self::getGotoLink($this->
object->getRefId(), $a_page, $this->edit_request->getTranslation()));
1053 if (!$this->
access->checkAccess(
"add_pages",
"", $this->object->getRefId())) {
1054 $this->tpl->setOnScreenMessage(
"failure", $this->
lng->txt(
"no_permission"),
true);
1055 $from_page_id = $this->pm->getPageIdForTitle($this->edit_request->getFromPage(), $this->edit_request->getTranslation());
1056 ilUtil::redirect($this->pm->getPermaLink($from_page_id, $this->edit_request->getTranslation()));
1058 if ($this->isNewTranslatedPage()) {
1061 if (!$this->
object->getTemplateSelectionOnCreation()) {
1064 $this->tpl->setOnScreenMessage(
1066 $this->
lng->txt(
"wiki_page_title_too_long") .
" (" . $a_page .
")",
1069 $ilCtrl->setParameterByClass(
1074 $ilCtrl->redirectByClass(
"ilwikipagegui",
"preview");
1077 $this->pm->createWikiPage(
1080 $this->edit_request->getTranslation()
1085 $ilCtrl->redirectByClass(
"ilwikipagegui",
"edit");
1088 $ilCtrl->setParameter(
1093 $ilCtrl->redirect($this,
"showTemplateSelection");
1100 if (in_array($this->edit_request->getTranslation(), [
"-",
""])) {
1103 $page = $this->requested_page;
1107 $this->edit_request->getTranslation()
1109 $this->tabs_gui->clearTargets();
1110 $this->tabs_gui->setBackTarget(
1111 $this->
lng->txt(
"back"),
1112 $this->pm->getPermaLink(
1113 $this->pm->getPageIdForTitle(
1114 $this->edit_request->getFromPage(),
1115 $this->edit_request->getTranslation()
1117 $this->edit_request->getTranslation()
1120 $form = $this->getNewTranslatedPageForm();
1121 $this->tpl->setContent($this->getRenderedTranslationInfo() . $form->render());
1129 $mess = $this->gui->ui()->factory()->messageBox()->info(
1130 $this->
lng->txt(
"wiki_translate_page_master_info")
1132 return $this->gui->ui()->renderer()->render($mess);
1137 $pm = $this->domain->page()->page($this->
object->getRefId());
1139 foreach ($pm->getMasterPagesWithoutTranslation($this->edit_request->getTranslation()) as $page) {
1140 $options[$page->getId()] = $page->
getTitle();
1142 $append =
" '" . $this->edit_request->getPage() .
"'";
1143 $append .=
" (" . $this->
lng->txt(
"meta_l_" . $this->edit_request->getTranslation()) .
")";
1144 $append2 =
" (" . $this->
lng->txt(
"meta_l_" . $this->
object->getObjectProperties()->getPropertyTranslations()->getBaseLanguage()) .
")";
1145 $form = $this->gui->form([self::class],
"createNewTranslatedPage")
1146 ->section(
"sec", $this->
lng->txt(
"wiki_translation_page") . $append)
1147 ->switch(
"type", $this->
lng->txt(
"wiki_page_in_master_language") . $append2,
"",
"existing")
1148 ->group(
"existing", $this->
lng->txt(
"wiki_master_existing"))
1149 ->select(
"master_id", $this->
lng->txt(
"wiki_master_title"), $options)
1151 ->group(
"new", $this->
lng->txt(
"wiki_no_master"))
1152 ->text(
"master_title", $this->
lng->txt(
"wiki_master_title"))
1155 if ($this->
object->getTemplateSelectionOnCreation($this->edit_request->getTranslation())) {
1156 $form = $form->radio(
"page_templ", $this->
lng->txt(
"wiki_page_template"),
"",
"0")->required();
1157 if ($this->
object->getEmptyPageTemplate()) {
1158 $form = $form->radioOption(
"0", $this->
lng->txt(
"wiki_empty_page"));
1162 foreach ($ts as $t) {
1163 $form = $form->radioOption($t[
"wpage_id"], $t[
"title"]);
1172 $form = $this->getNewTranslatedPageForm();
1173 if ($form->isValid()) {
1174 $page_template_id = 0;
1175 if ($this->
object->getTemplateSelectionOnCreation($this->edit_request->getTranslation())) {
1176 $page_template_id = (
int) $form->getData(
"page_templ");
1178 if ($form->getData(
"type") ===
"new") {
1179 $wpg_id = $this->pm->createWikiPage(
1180 $form->getData(
"master_title")
1183 $wpg_id = $form->getData(
"master_id");
1185 $wpg_id = $this->pm->createWikiPage(
1186 $this->edit_request->getPage(),
1188 $this->edit_request->getTranslation(),
1192 $this->
ctrl->setParameterByClass(ilWikiPageGUI::class,
"wpg_id", $wpg_id);
1193 $this->
ctrl->redirectByClass(ilWikiPageGUI::class,
"preview");
1198 $this->checkPermission(
"read");
1201 $this->gotoPageObject($page);
1208 $this->checkPermission(
"read");
1210 $this->addPagesSubTabs();
1219 $tpl->setContent($table_gui->getHTML());
1224 self::renderSideBlock($a_wpg_id, $this->
object->getRefId());
1236 $ilAccess =
$DIC->access();
1237 $ilCtrl =
$DIC->ctrl();
1241 $tpl->addJavaScript(
"../components/ILIAS/Wiki/resources/WikiPres.js");
1243 $tpl->addJavaScript(
"assets/js/WikiPres.js");
1248 $tpl->addOnLoadCode(
"il.Wiki.Pres.init('" . $ilCtrl->getLinkTargetByClass(
"ilobjwikigui",
"",
"",
false,
false) .
"');");
1250 if ($a_wpg_id > 0 && !$a_wp) {
1259 if ($a_wpg_id > 0) {
1264 $a_wp->getRating()) {
1266 $rgui->setObject($wiki_id,
"wiki", $a_wpg_id,
"wpg");
1268 $rgui->setYourRatingText(
"#");
1269 $rcontent .= $rgui->getBlockHTML(
$lng->txt(
"wiki_rate_page"));
1275 if ($ilAccess->checkAccess(
"write",
"", $a_wiki_ref_id) ||
1276 $ilAccess->checkAccess(
"edit_page_meta",
"", $a_wiki_ref_id)) {
1278 "edit" => $ilCtrl->getLinkTargetByClass(
"ilwikipagegui",
"editAdvancedMetaData"),
1279 "hide" => $ilCtrl->getLinkTargetByClass(
"ilwikipagegui",
"hideAdvancedMetaData")
1283 $callback = $wiki->getLinkMetadataValues()
1284 ? array($wiki,
"decorateAdvMDValue")
1287 $rcontent .= $mdgui->getBlockHTML($cmd, $callback);
1293 $rcontent .= $imp_pages_block->getHTML();
1296 if ($a_wpg_id > 0) {
1298 $wiki_functions_block->setPageObject($a_wp);
1299 $rcontent .= $wiki_functions_block->getHTML();
1302 $tpl->setRightContent($rcontent);
1309 $this->checkPermission(
"read");
1311 $this->addPagesSubTabs();
1321 $tpl->setContent($table_gui->getHTML());
1327 $ordering = $this->edit_request->getPrintOrdering();
1330 if (count($ordering) > 0) {
1332 $page_ids = array_keys($ordering);
1335 elseif ($this->edit_request->getWikiPageId()) {
1336 $page_ids = array($this->edit_request->getWikiPageId());
1345 : $this->getPrintPageIds();
1346 $provider = new \ILIAS\Wiki\WikiPrintViewProviderGUI(
1349 $this->
object->getRefId(),
1353 return new \ILIAS\Export\PrintProcessGUI(
1363 $print_view = $this->getPrintView();
1364 $print_view->sendPrintView();
1370 $ilTabs = $this->tabs;
1371 $ilCtrl = $this->ctrl;
1374 $this->checkPermission(
"read");
1376 $ilTabs->setTabActive(
"wiki_search_results");
1378 if ($this->edit_request->getSearchTerm() ===
"") {
1379 $this->tpl->setOnScreenMessage(
'failure',
$lng->txt(
"wiki_please_enter_search_term"),
true);
1380 $ilCtrl->redirectByClass(
"ilwikipagegui",
"preview");
1385 $this->edit_request->getSearchTerm()
1392 $this->edit_request->getSearchTerm()
1395 $this->setSideBlock();
1396 $tpl->setContent($table_gui->getHTML());
1407 $this->content_style_gui->addCss($tpl, $this->
object->getRefId());
1419 $ilToolbar = $this->toolbar;
1420 $ilTabs = $this->tabs;
1422 $ilCtrl = $this->ctrl;
1424 $this->checkPermission(
"edit_wiki_navigation");
1426 $this->tpl->setOnScreenMessage(
'info',
$lng->txt(
"wiki_navigation_info"));
1428 $ipages_ids = $this->imp_pages->getImportantPageIds();
1431 $pages = $this->pm->getAllPagesInfo();
1432 $options = array(
"" =>
$lng->txt(
"please_select"));
1433 foreach ($pages as $p) {
1434 if (!in_array($p->getId(), $ipages_ids)) {
1438 if (count($options) > 0) {
1440 $si->setOptions($options);
1441 $si->setInfo(
$lng->txt(
""));
1442 $ilToolbar->addInputItem($si);
1443 $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
1444 $ilToolbar->addFormButton(
$lng->txt(
"add"),
"addImportantPage");
1448 $ilTabs->activateTab(
"settings");
1449 $this->setSettingsSubTabs(
"imp_pages");
1453 $tpl->setContent($imp_table->getHTML());
1458 $ilCtrl = $this->ctrl;
1461 $this->checkPermission(
"edit_wiki_navigation");
1463 $imp_page_id = $this->edit_request->getImportantPageId();
1464 if ($imp_page_id > 0) {
1465 $this->imp_pages->add($imp_page_id);
1466 $this->tpl->setOnScreenMessage(
'success',
$lng->txt(
"wiki_imp_page_added"),
true);
1468 $ilCtrl->redirect($this,
"editImportantPages");
1473 $ilCtrl = $this->ctrl;
1477 $imp_page_ids = $this->edit_request->getImportantPageIds();
1478 if (count($imp_page_ids) === 0) {
1479 $this->tpl->setOnScreenMessage(
'info',
$lng->txt(
"no_checkbox"),
true);
1480 $ilCtrl->redirect($this,
"editImportantPages");
1483 $cgui->setFormAction($ilCtrl->getFormAction($this));
1484 $cgui->setHeaderText(
$lng->txt(
"wiki_sure_remove_imp_pages"));
1485 $cgui->setCancel(
$lng->txt(
"cancel"),
"editImportantPages");
1486 $cgui->setConfirm(
$lng->txt(
"remove"),
"removeImportantPages");
1488 foreach ($imp_page_ids as $i) {
1492 $tpl->setContent($cgui->getHTML());
1498 $ilCtrl = $this->ctrl;
1501 $this->checkPermission(
"edit_wiki_navigation");
1503 $imp_page_ids = $this->edit_request->getImportantPageIds();
1504 foreach ($imp_page_ids as $i) {
1505 $this->imp_pages->removeImportantPage($i);
1507 $this->tpl->setOnScreenMessage(
'success',
$lng->txt(
"wiki_removed_imp_pages"),
true);
1508 $ilCtrl->redirect($this,
"editImportantPages");
1513 $ilCtrl = $this->ctrl;
1516 $this->checkPermission(
"edit_wiki_navigation");
1518 $ordering = $this->edit_request->getImportantPageOrdering();
1519 $indentation = $this->edit_request->getImportantPageIndentation();
1520 $this->imp_pages->saveOrderingAndIndentation($ordering, $indentation);
1521 $this->tpl->setOnScreenMessage(
'success',
$lng->txt(
"wiki_ordering_and_indent_saved"),
true);
1522 $ilCtrl->redirect($this,
"editImportantPages");
1527 $ilCtrl = $this->ctrl;
1530 $this->checkPermission(
"edit_wiki_navigation");
1532 $imp_page_ids = $this->edit_request->getImportantPageIds();
1533 if (count($imp_page_ids) !== 1) {
1534 $this->tpl->setOnScreenMessage(
'info',
$lng->txt(
"wiki_select_one_item"),
true);
1536 $this->imp_pages->removeImportantPage($imp_page_ids[0]);
1538 $this->
object->update();
1539 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"msg_obj_modified"),
true);
1541 $ilCtrl->redirect($this,
"editImportantPages");
1550 public function exportHTML(): void
1553 $wiki = $this->object;
1554 $cont_exp =
new Export\WikiHtmlExport($wiki);
1556 $format = explode(
"_", $this->edit_request->getFormat());
1557 if (($format[1] ??
"") ===
"comments") {
1558 $cont_exp->setMode(Export\WikiHtmlExport::MODE_COMMENTS);
1561 $cont_exp->buildExportFile();
1572 if ($page->getWikiId() === $a_wiki_id) {
1592 $ilTabs = $this->tabs;
1593 $ilCtrl = $this->ctrl;
1595 $ilCtrl->setParameterByClass(
1600 $ilTabs->clearTargets();
1601 $this->tpl->setOnScreenMessage(
'info',
$lng->txt(
"wiki_page_not_exist_select_templ"));
1603 $form = $this->initTemplateSelectionForm();
1604 $tpl->setContent($form->getHTML());
1610 $ilCtrl = $this->ctrl;
1616 $hi->setValue($this->requested_page);
1617 $form->addItem($hi);
1621 $radg->setRequired(
true);
1623 if ($this->
object->getEmptyPageTemplate()) {
1625 $radg->addOption($op1);
1630 foreach ($ts as $t) {
1632 $radg->addOption($op);
1635 $form->addItem($radg);
1638 $form->addCommandButton(
"createPageUsingTemplate",
$lng->txt(
"wiki_create_page"));
1639 $form->addCommandButton(
"cancelCreationPageUsingTemplate",
$lng->txt(
"cancel"));
1641 $form->setTitle(
$lng->txt(
"wiki_new_page") .
": " . $this->requested_page);
1642 $form->setFormAction($ilCtrl->getFormAction($this));
1651 $ilCtrl = $this->ctrl;
1653 $form = $this->initTemplateSelectionForm();
1654 if ($form->checkInput()) {
1655 $a_page = $this->edit_request->getPage();
1656 $this->pm->createWikiPage(
1659 $this->edit_request->getTranslation(),
1660 $this->edit_request->getPageTemplateId()
1665 $ilCtrl->redirectByClass(
"ilwikipagegui",
"edit");
1667 $this->tpl->setOnScreenMessage(
'success',
$lng->txt(
"msg_obj_modified"),
true);
1668 $ilCtrl->redirect($this,
"");
1670 $form->setValuesByPost();
1671 $tpl->setContent($form->getHTML());
1677 $ilCtrl = $this->ctrl;
1680 $ilCtrl->setParameterByClass(
1685 $ilCtrl->redirectByClass(
"ilwikipagegui",
"preview");
1690 if ($perm ===
"create") {
1691 return parent::checkPermissionBool($perm, $cmd, $type,
$ref_id);
1694 $ref_id = $this->
object->getRefId();
1722 $this->log->debug(
"init: " . $this->req_with_comments);
1723 $this->checkPermission(
"wiki_html_export");
1724 $this->
object->initUserHTMLExport($this->req_with_comments);
1732 $this->log->debug(
"start: " . $this->req_with_comments);
1733 $this->checkPermission(
"wiki_html_export");
1734 $this->
object->startUserHTMLExport($this->req_with_comments);
1742 $this->log->debug(
"get progress: " . $this->req_with_comments);
1743 $this->checkPermission(
"wiki_html_export");
1744 $p = $this->
object->getUserHTMLExportProgress($this->req_with_comments);
1747 $pb->setCurrent($p[
"progress"]);
1749 $r =
new stdClass();
1750 $r->progressBar = $pb->render();
1751 $r->status = $p[
"status"];
1752 $this->log->debug(
"status: " . $r->status);
1753 echo(json_encode($r, JSON_THROW_ON_ERROR));
1759 $this->log->debug(
"download");
1760 $this->checkPermission(
"wiki_html_export");
1761 $this->
object->deliverUserHTMLExport();
1766 $this->log->debug(
"download");
1767 $this->checkPermission(
"wiki_html_export");
1768 $this->
object->deliverUserHTMLExport(
true);
1773 if (!is_object($this->
object)) {
1777 $this->
object->getRefId(),
1778 $this->user->getId()
1780 if (count($ass_info) > 0) {
1781 $ass_ids = array_map(
static function ($i):
int {
1786 $this->tool_context->current()->addAdditionalData(
1788 $this->getAssignmentButtons()
1798 $ilCtrl = $this->ctrl;
1803 $this->
object->getRefId(),
1804 $this->user->getId()
1807 foreach ($ass_info as $i) {
1809 $times_up = $ass->afterDeadlineStrict();
1813 $ilCtrl->setParameterByClass(
"ilwikipagegui",
"ass", $ass->getId());
1814 $submit_link = $ilCtrl->getLinkTargetByClass(
"ilwikipagegui",
"finalizeAssignment");
1815 $ilCtrl->setParameterByClass(
"ilwikipagegui",
"ass",
"");
1817 $buttons[$i->getId()][] = $ui->factory()->button()->primary(
$lng->txt(
"wiki_finalize_wiki"), $submit_link);
1822 if ($submission->hasSubmitted()) {
1823 $submitted = $submission->getSelectedObject();
1824 if ($submitted?->getTimestamp() !=
"") {
1825 $ilCtrl->setParameterByClass(
"ilwikipagegui",
"ass", $ass->getId());
1827 $dl_link = $ilCtrl->getLinkTargetByClass(
"ilwikipagegui",
"downloadExcSubFile");
1828 $ilCtrl->setParameterByClass(
"ilwikipagegui",
"ass",
"");
1829 $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'))