42 protected \ILIAS\Wiki\InternalDomainService
$domain;
43 protected \ILIAS\Wiki\InternalGUIService
$gui;
45 protected \ILIAS\Wiki\Navigation\ImportantPageManager
$imp_pages;
46 protected \ILIAS\Wiki\Page\PageManager
$pm;
53 protected \ILIAS\DI\UIServices
$ui;
62 bool $a_call_by_reference,
63 bool $a_prepare_output =
true 67 $gui = $DIC->wiki()->internal()->gui();
68 $domain = $DIC->wiki()->internal()->domain();
72 $this->
ctrl = $gui->ctrl();
73 $this->
lng = $domain->lng();
74 $this->
tabs = $gui->tabs();
75 $this->
help = $gui->help();
76 $this->
locator = $gui->locator();
82 $this->tool_context = $gui->globalScreen()->tool()->context();
83 $this->
ui = $gui->ui();
85 $this->edit_request = $gui->request();
86 $this->content_gui = $gui->content();
89 $this->
lng->loadLanguageModule(
"obj");
90 $this->
lng->loadLanguageModule(
"wiki");
92 $this->requested_page = $this->edit_request->getPage();
93 if ($this->requested_page !==
"") {
96 $this->
ctrl->saveParameterByClass(self::class,
"transl");
97 $this->
ctrl->saveParameterByClass(self::class,
"wpg_id");
98 $this->req_with_comments = $this->edit_request->getWithComments();
99 $cs = $DIC->contentStyle();
100 $this->content_style_gui = $cs->gui();
101 if (is_object($this->
object)) {
102 $this->content_style_domain = $cs->domain()->styleForRefId($this->
object->getRefId());
103 $this->pm = $this->domain->page()->page($this->
object->getRefId());
104 $this->imp_pages = $this->domain->importantPage($this->
object->getRefId());
115 $next_class = $this->
ctrl->getNextClass($this);
116 $cmd = $this->
ctrl->getCmd();
121 $this->gui->initFetch();
125 if ($cmd ===
"printView") {
129 switch ($next_class) {
130 case "ilinfoscreengui":
136 case 'ilpermissiongui':
138 $ilTabs->activateTab(
"perm_settings");
140 $this->
ctrl->forwardCommand($perm_gui);
143 case 'ilsettingspermissiongui':
146 $ilTabs->activateTab(
"settings");
149 $perm_gui->setPermissions(array(
"edit_wiki_navigation",
"add_pages",
"delete_wiki_pages",
"activate_wiki_protection",
150 "wiki_html_export"));
151 $perm_gui->setRoleRequiredPermissions(array(
"edit_content"));
152 $perm_gui->setRoleProhibitedPermissions(array(
"write"));
153 $this->
ctrl->forwardCommand($perm_gui);
156 case strtolower(TranslationGUI::class):
159 $ilTabs->activateTab(
"settings");
174 $transgui->forceContentTranslation();
175 $this->
ctrl->forwardCommand($transgui);
178 case 'ilwikipagegui':
181 if ($this->edit_request->getWikiPageId() > 0) {
182 $requested_page = $this->pm->getTitle(
183 $this->edit_request->getWikiPageId(),
184 $this->edit_request->getTranslation()
187 $wpage_gui = $this->content_gui->getCurrentPageGUI();
188 $wpage_gui->setStyleId($this->content_style_domain->getEffectiveStyleId());
190 if (!$ilAccess->checkAccess(
"write",
"", $this->object->getRefId()) &&
192 !$ilAccess->checkAccess(
"edit_content",
"", $this->object->getRefId()) ||
193 $wpage_gui->getPageObject()->getBlocked()
195 $wpage_gui->setEnableEditing(
false);
201 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
202 $wpage_gui->activateMetaDataEditor($this->
object,
"wpg", $wpage_gui->getId());
205 $ret = $this->
ctrl->forwardCommand($wpage_gui);
211 case 'ilobjectcopygui':
213 $cp->setType(
'wiki');
214 $this->
ctrl->forwardCommand($cp);
217 case 'ilpublicuserprofilegui':
219 $this->edit_request->getUserId()
221 $ret = $this->
ctrl->forwardCommand($profile_gui);
225 case "ilobjectcontentstylesettingsgui":
228 $ilTabs->activateTab(
"settings");
231 $settings_gui = $this->content_style_gui
232 ->objectSettingsGUIForRefId(
236 $this->
ctrl->forwardCommand($settings_gui);
241 $ilTabs->activateTab(
"export");
243 $this->
ctrl->forwardCommand($exp_gui);
246 case "ilcommonactiondispatchergui":
248 $this->
ctrl->forwardCommand($gui);
255 $ilTabs->activateTab(
"settings");
258 $gui->setObject($this->
object->getId(), $this->
object->getType());
259 $gui->setExportCallback(array($this,
"getSubObjectTitle"), $this->
lng->txt(
"page"));
260 $this->
ctrl->forwardCommand($gui);
263 case "ilwikistatgui":
267 $ilTabs->activateTab(
"statistics");
269 $this->
ctrl->forwardCommand($gui);
272 case "ilwikipagetemplategui":
275 $ilTabs->activateTab(
"settings");
278 $this->
ctrl->forwardCommand($wptgui);
281 case 'ilobjectmetadatagui':
284 $ilTabs->activateTab(
"advmd");
286 $this->
ctrl->forwardCommand($md_gui);
289 case 'ilrepositoryobjectsearchgui':
292 $ilTabs->setTabActive(
"wiki_search_results");
293 $ilCtrl->setReturn($this,
'view');
294 $ilCtrl->setParameterByClass(ilWikiPageGUI::class,
"wpg_id",
null);
295 $ilCtrl->setParameterByClass(ilObjWikiGUI::class,
"wpg_id",
null);
297 $this->
object->getRefId(),
301 $ilCtrl->forwardCommand($search_gui);
304 case 'ilobjnotificationsettingsgui':
306 $ilTabs->activateTab(
"settings");
309 $this->
ctrl->forwardCommand($gui);
312 case 'illtiproviderobjectsettinggui':
314 $ilTabs->activateTab(
"settings");
318 $lti_gui->offerLTIRolesForSelection(
false);
319 $this->
ctrl->forwardCommand($lti_gui);
322 case strtolower(SettingsGUI::class):
324 $ilTabs->activateTab(
"settings");
327 $gui = $this->gui->settings()->settingsGUI(
329 $this->
object->getRefId()
331 $this->
ctrl->forwardCommand($gui);
340 if ($cmd !==
"cancelObject") {
341 if ($cmd !==
"infoScreenObject") {
342 if (!in_array($cmd, array(
"createObject",
"saveObject",
"routeImportCmdObject"))) {
362 $f = $this->gui->ui()->factory();
364 $form = parent::initCreateForm($new_type);
366 $inputs[
"start_page"] =
$f->input()->field()->text(
368 )->withRequired(
true);
369 return $this->ui_factory->input()->container()->form()->standard(
370 $this->
ctrl->getFormAction($this,
'save'),
372 )->withSubmitLabel($this->
lng->txt($new_type .
'_add'));
378 ->initCreateForm($this->requested_new_type)
379 ->withRequest($this->request);
380 $data = $form->getData();
381 $new_object->setStartPage(
$data[
"start_page"]);
385 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"object_added"),
true);
386 $this->
ctrl->setParameterByClass(
391 $this->
ctrl->redirectByClass([
392 ilWikiHandlerGUI::class,
406 $this->
ctrl->redirectByClass(ilInfoScreenGUI::class,
"showSummary");
416 $ilTabs->activateTab(
"info_short");
418 if (!$ilAccess->checkAccess(
"visible",
"", $this->object->getRefId())) {
423 $info->enablePrivateNotes();
424 if (trim($this->
object->getIntroduction()) !==
"") {
425 $info->addSection(
$lng->
txt(
"wiki_introduction"));
426 $info->addProperty(
"", nl2br($this->
object->getIntroduction()));
434 $info->addSection($this->
lng->txt(
"wiki_feedback_from_tutor"));
435 if ($lpcomment !==
"") {
437 $this->
lng->txt(
"wiki_comment"),
443 $this->
lng->txt(
"wiki_mark"),
450 $this->
lng->txt(
"status"),
451 $this->
lng->txt(
"wiki_passed")
456 $this->
lng->txt(
"status"),
457 $this->
lng->txt(
"wiki_failed")
462 if ($ilAccess->checkAccess(
"read",
"", $this->object->getRefId())) {
463 $info->addButton(
$lng->
txt(
"wiki_start_page"), self::getGotoLink($this->
object->getRefId()));
467 $this->
lng->loadLanguageModule(
"meta");
468 $this->
lng->loadLanguageModule(
"wiki");
471 $this->
ctrl->forwardCommand($info);
491 "wiki_what_links_here",
492 $this->
ctrl->getLinkTargetByClass(
500 $this->
ctrl->getLinkTargetByClass(
513 $ilTabs->activateTab(
"wiki_pages");
524 $ilTabs->addSubTabTarget(
526 $this->
ctrl->getLinkTarget($this,
"allPages"),
529 $ilTabs->addSubTabTarget(
530 "wiki_recent_changes",
531 $this->
ctrl->getLinkTarget($this,
"recentChanges"),
534 $ilTabs->addSubTabTarget(
536 $this->
ctrl->getLinkTarget($this,
"newPages"),
539 $ilTabs->addSubTabTarget(
540 "wiki_popular_pages",
541 $this->
ctrl->getLinkTarget($this,
"popularPages"),
544 $ilTabs->addSubTabTarget(
545 "wiki_orphaned_pages",
546 $this->
ctrl->getLinkTarget($this,
"orphanedPages"),
561 if (in_array(strtolower($ilCtrl->getNextClass($this)), [strtolower(SettingsGUI::class)]) ||
563 strtolower($ilCtrl->getCmdClass()),
564 array(
"",
"ilobjectcontentstylesettingsgui",
"ilobjwikigui",
565 "ilinfoscreengui",
"ilpermissiongui",
"ilexportgui",
"ilratingcategorygui",
"ilobjnotificationsettingsgui",
"iltaxmdgui",
566 "ilwikistatgui",
"ilwikipagetemplategui",
"iladvancedmdsettingsgui",
"ilsettingspermissiongui",
'ilrepositoryobjectsearchgui')
567 ) || in_array($ilCtrl->getNextClass(), [
"ilpermissiongui", strtolower(TranslationGUI::class)])) {
568 if ($this->requested_page !==
"") {
569 $page_id = ($this->edit_request->getWikiPageId() > 0)
570 ? $this->edit_request->getWikiPageId()
571 : $this->pm->getPageIdForTitle(
572 $this->requested_page,
573 $this->edit_request->getTranslation()
575 if (is_null($page_id) && $this->edit_request->getFromPage() !==
"") {
576 $page_id = $this->pm->getPageIdForTitle(
577 $this->edit_request->getFromPage(),
578 $this->edit_request->getTranslation()
581 if (!is_null($page_id)) {
582 $this->tabs_gui->setBackTarget(
583 $lng->
txt(
"wiki_last_visited_page"),
584 $this->pm->getPermaLink(
586 $this->edit_request->getTranslation()
593 if ($ilAccess->checkAccess(
'read',
"", $this->object->getRefId())) {
594 $this->tabs_gui->addTab(
597 $this->
ctrl->getLinkTarget($this,
"allPages")
602 if ($ilAccess->checkAccess(
'visible',
"", $this->object->getRefId())) {
603 $this->tabs_gui->addTab(
606 $this->
ctrl->getLinkTargetByClass(
"ilinfoscreengui",
"showSummary")
611 if ($ilAccess->checkAccess(
'write',
"", $this->object->getRefId())) {
612 $this->tabs_gui->addTab(
615 $this->
ctrl->getLinkTargetByClass(SettingsGUI::class)
620 $mdtab = $mdgui->getTab();
622 $this->tabs_gui->addTab(
624 $this->
lng->txt(
"meta_data"),
631 if ($ilAccess->checkAccess(
'write',
"", $this->object->getRefId())) {
632 $this->tabs_gui->addTab(
634 $lng->
txt(
"wiki_contributors"),
635 $this->
ctrl->getLinkTarget($this,
"listContributors")
640 if ($ilAccess->checkAccess(
'statistics_read',
"", $this->object->getRefId())) {
641 $this->tabs_gui->addTab(
644 $this->
ctrl->getLinkTargetByClass(
"ilWikiStatGUI",
"initial")
648 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
649 $this->tabs_gui->addTab(
652 $this->
ctrl->getLinkTargetByClass(
"ilexportgui",
"")
657 if ($ilAccess->checkAccess(
'edit_permission',
"", $this->object->getRefId())) {
658 $this->tabs_gui->addTab(
661 $this->
ctrl->getLinkTargetByClass(
"ilpermissiongui",
"perm")
675 array(
"general_settings",
"style",
"imp_pages",
"rating_categories",
"obj_multilinguality",
676 "page_templates",
"advmd",
"permission_settings",
"notifications",
"lti_provider")
678 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
682 $lng->
txt(
"wiki_general_settings"),
683 $ilCtrl->getLinkTarget($this,
'editSettings')
688 "permission_settings",
689 $lng->
txt(
"obj_permission_settings"),
690 $this->
ctrl->getLinkTargetByClass(
"ilsettingspermissiongui",
"")
697 $ilCtrl->getLinkTargetByClass(
"ilObjectContentStyleSettingsGUI",
"")
701 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
706 $ilCtrl->getLinkTarget($this,
'editImportantPages')
710 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
714 $lng->
txt(
"wiki_page_templates"),
715 $ilCtrl->getLinkTargetByClass(
"ilwikipagetemplategui",
"")
719 if ($this->
object->getRatingPages() && $this->
object->getRatingCategories()) {
723 $lng->
txt(
"rating_categories"),
724 $ilCtrl->getLinkTargetByClass(array(
'ilratinggui',
'ilratingcategorygui'),
'')
731 $ilCtrl->getLinkTargetByClass(
"ilobjnotificationsettingsgui",
'')
735 'obj_multilinguality',
736 $lng->
txt(
"obj_multilinguality"),
737 $this->
ctrl->getLinkTargetByClass(TranslationGUI::class,
"")
743 if ($lti_settings->hasSettingsAccess()) {
744 $ilTabs->addSubTabTarget(
746 $this->
ctrl->getLinkTargetByClass(ilLTIProviderObjectSettingGUI::class)
750 $ilTabs->activateSubTab($a_active);
756 $this->
ctrl->redirectByClass(SettingsGUI::class);
765 $ilTabs->activateTab(
"wiki_contributors");
785 $users = $this->edit_request->getUserIds();
786 $marks = $this->edit_request->getMarks();
787 $comments = $this->edit_request->getComments();
788 $status = $this->edit_request->getStatus();
792 if ($user_id !=
"") {
798 if ($marks_obj->getMark() !== $new_mark ||
802 $marks_obj->setMark($new_mark);
803 $marks_obj->setComment($new_comment);
804 $marks_obj->update();
810 $this->tpl->setOnScreenMessage(
'success',
$lng->
txt(
"msg_obj_modified"),
true);
813 $ilCtrl->redirect($this,
"listContributors");
821 if (is_object($this->
object)) {
823 $this->
object->getTitle(),
824 self::getGotoLink($this->
object->getRefId()),
826 $this->requested_ref_id
831 public static function _goto(
string $a_target): void
834 $main_tpl = $DIC->ui()->mainTemplate();
838 $ilAccess = $DIC->access();
839 $lng = $DIC->language();
840 $ctrl = $DIC->ctrl();
841 $transl = $DIC->wiki()->internal()->gui()->request()->getTranslation();
845 $i = strpos($a_target,
"_");
848 $a_page = substr($a_target, $i + 1);
849 $a_target = substr($a_target, 0, $i);
852 if ($a_target ===
"wpage") {
853 $a_page_arr = explode(
"_", $a_page);
854 $wpg_id = (
int) $a_page_arr[0];
856 $lang = ($a_page_arr[2] ??
"");
863 foreach ($refs as
$r) {
864 if ($ilAccess->checkAccess(
"read",
"", $r)) {
871 if ($ilAccess->checkAccess(
"read",
"", $a_target)) {
899 [
"ilwikihandlergui",
"ilobjwikigui"],
904 [
"ilwikihandlergui"],
908 } elseif ($ilAccess->checkAccess(
"visible",
"", $a_target)) {
911 $main_tpl->setOnScreenMessage(
'failure', sprintf(
912 $lng->
txt(
"msg_no_perm_read_item"),
926 if ($a_page ===
"") {
930 $append = (!in_array(
$lang, [
"",
"-"]))
933 $goto =
"goto.php?target=wiki_" . $a_ref_id .
"_" .
948 $ilTabs->clearTargets();
951 $wpage_gui = $this->gui->content()->getCurrentPageGUI();
954 $ilCtrl->setParameter(
960 $wpage_gui->setStyleId($this->content_style_domain->getEffectiveStyleId());
965 $ilCtrl->redirectByClass(ilWikiPageGUI::class,
"preview");
1039 if ($a_page ===
"") {
1043 if ($this->pm->existsByTitle(
1045 $this->edit_request->getTranslation()
1048 ilUtil::redirect(self::getGotoLink($this->
object->getRefId(), $a_page, $this->edit_request->getTranslation()));
1050 if (!$this->
access->checkAccess(
"add_pages",
"", $this->object->getRefId())) {
1051 $this->tpl->setOnScreenMessage(
"failure", $this->
lng->txt(
"no_permission"),
true);
1052 $from_page_id = $this->pm->getPageIdForTitle($this->edit_request->getFromPage(), $this->edit_request->getTranslation());
1053 ilUtil::redirect($this->pm->getPermaLink($from_page_id, $this->edit_request->getTranslation()));
1058 if (!$this->
object->getTemplateSelectionOnCreation()) {
1061 $this->tpl->setOnScreenMessage(
1063 $this->
lng->txt(
"wiki_page_title_too_long") .
" (" . $a_page .
")",
1066 $ilCtrl->setParameterByClass(
1071 $ilCtrl->redirectByClass(
"ilwikipagegui",
"preview");
1074 $this->pm->createWikiPage(
1077 $this->edit_request->getTranslation()
1082 $ilCtrl->redirectByClass(
"ilwikipagegui",
"edit");
1085 $ilCtrl->setParameter(
1090 $ilCtrl->redirect($this,
"showTemplateSelection");
1097 if (in_array($this->edit_request->getTranslation(), [
"-",
""])) {
1104 $this->edit_request->getTranslation()
1106 $this->tabs_gui->clearTargets();
1107 $this->tabs_gui->setBackTarget(
1108 $this->
lng->txt(
"back"),
1109 $this->pm->getPermaLink(
1110 $this->pm->getPageIdForTitle(
1111 $this->edit_request->getFromPage(),
1112 $this->edit_request->getTranslation()
1114 $this->edit_request->getTranslation()
1126 $mess = $this->gui->ui()->factory()->messageBox()->info(
1127 $this->
lng->txt(
"wiki_translate_page_master_info")
1129 return $this->gui->ui()->renderer()->render($mess);
1134 $pm = $this->domain->page()->page($this->
object->getRefId());
1136 foreach ($pm->getMasterPagesWithoutTranslation($this->edit_request->getTranslation()) as $page) {
1137 $options[$page->getId()] = $page->getTitle();
1139 $append =
" '" . $this->edit_request->getPage() .
"'";
1140 $append .=
" (" . $this->
lng->txt(
"meta_l_" . $this->edit_request->getTranslation()) .
")";
1141 $append2 =
" (" . $this->
lng->txt(
"meta_l_" . $this->
object->getObjectProperties()->getPropertyTranslations()->getBaseLanguage()) .
")";
1142 $form = $this->gui->form([self::class],
"createNewTranslatedPage")
1143 ->section(
"sec", $this->
lng->txt(
"wiki_translation_page") . $append)
1144 ->
switch(
"type", $this->
lng->txt(
"wiki_page_in_master_language") . $append2,
"",
"existing")
1145 ->group(
"existing", $this->
lng->txt(
"wiki_master_existing"))
1146 ->select(
"master_id", $this->
lng->txt(
"wiki_master_title"), $options)
1148 ->group(
"new", $this->
lng->txt(
"wiki_no_master"))
1149 ->text(
"master_title", $this->
lng->txt(
"wiki_master_title"))
1152 if ($this->
object->getTemplateSelectionOnCreation($this->edit_request->getTranslation())) {
1153 $form = $form->radio(
"page_templ", $this->
lng->txt(
"wiki_page_template"),
"",
"0")->required();
1154 if ($this->
object->getEmptyPageTemplate()) {
1155 $form = $form->radioOption(
"0", $this->
lng->txt(
"wiki_empty_page"));
1159 foreach ($ts as $t) {
1160 $form = $form->radioOption($t[
"wpage_id"], $t[
"title"]);
1170 if ($form->isValid()) {
1171 $page_template_id = 0;
1172 if ($this->
object->getTemplateSelectionOnCreation($this->edit_request->getTranslation())) {
1173 $page_template_id = (
int) $form->getData(
"page_templ");
1175 if ($form->getData(
"type") ===
"new") {
1176 $wpg_id = $this->pm->createWikiPage(
1177 $form->getData(
"master_title")
1180 $wpg_id = $form->getData(
"master_id");
1182 $wpg_id = $this->pm->createWikiPage(
1183 $this->edit_request->getPage(),
1185 $this->edit_request->getTranslation(),
1189 $this->
ctrl->setParameterByClass(ilWikiPageGUI::class,
"wpg_id", $wpg_id);
1190 $this->
ctrl->redirectByClass(ilWikiPageGUI::class,
"preview");
1221 self::renderSideBlock($a_wpg_id, $this->
object->getRefId());
1232 $lng = $DIC->language();
1233 $ilAccess = $DIC->access();
1234 $ilCtrl = $DIC->ctrl();
1245 $tpl->
addOnLoadCode(
"il.Wiki.Pres.init('" . $ilCtrl->getLinkTargetByClass(
"ilobjwikigui",
"",
"",
false,
false) .
"');");
1247 if ($a_wpg_id > 0 && !$a_wp) {
1256 if ($a_wpg_id > 0) {
1261 $a_wp->getRating()) {
1263 $rgui->setObject($wiki_id,
"wiki", $a_wpg_id,
"wpg");
1265 $rgui->setYourRatingText(
"#");
1266 $rcontent .= $rgui->getBlockHTML(
$lng->
txt(
"wiki_rate_page"));
1272 if ($ilAccess->checkAccess(
"write",
"", $a_wiki_ref_id) ||
1273 $ilAccess->checkAccess(
"edit_page_meta",
"", $a_wiki_ref_id)) {
1275 "edit" => $ilCtrl->getLinkTargetByClass(
"ilwikipagegui",
"editAdvancedMetaData"),
1276 "hide" => $ilCtrl->getLinkTargetByClass(
"ilwikipagegui",
"hideAdvancedMetaData")
1280 $callback = $wiki->getLinkMetadataValues()
1281 ? array($wiki,
"decorateAdvMDValue")
1284 $rcontent .= $mdgui->getBlockHTML($cmd, $callback);
1290 $rcontent .= $imp_pages_block->getHTML();
1293 if ($a_wpg_id > 0) {
1295 $wiki_functions_block->setPageObject($a_wp);
1296 $rcontent .= $wiki_functions_block->getHTML();
1324 $ordering = $this->edit_request->getPrintOrdering();
1327 if (count($ordering) > 0) {
1329 $page_ids = array_keys($ordering);
1332 elseif ($this->edit_request->getWikiPageId()) {
1333 $page_ids = array($this->edit_request->getWikiPageId());
1343 $provider = new \ILIAS\Wiki\WikiPrintViewProviderGUI(
1346 $this->
object->getRefId(),
1350 return new \ILIAS\Export\PrintProcessGUI(
1361 $print_view->sendPrintView();
1373 $ilTabs->setTabActive(
"wiki_search_results");
1375 if ($this->edit_request->getSearchTerm() ===
"") {
1376 $this->tpl->setOnScreenMessage(
'failure',
$lng->
txt(
"wiki_please_enter_search_term"),
true);
1377 $ilCtrl->redirectByClass(
"ilwikipagegui",
"preview");
1382 $this->edit_request->getSearchTerm()
1389 $this->edit_request->getSearchTerm()
1423 $this->tpl->setOnScreenMessage(
'info',
$lng->
txt(
"wiki_navigation_info"));
1425 $ipages_ids = $this->imp_pages->getImportantPageIds();
1428 $pages = $this->pm->getAllPagesInfo();
1429 $options = array(
"" =>
$lng->
txt(
"please_select"));
1430 foreach ($pages as $p) {
1431 if (!in_array($p->getId(), $ipages_ids)) {
1435 if (count($options) > 0) {
1439 $ilToolbar->addInputItem($si);
1440 $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
1441 $ilToolbar->addFormButton(
$lng->
txt(
"add"),
"addImportantPage");
1445 $ilTabs->activateTab(
"settings");
1460 $imp_page_id = $this->edit_request->getImportantPageId();
1461 if ($imp_page_id > 0) {
1462 $this->imp_pages->add($imp_page_id);
1463 $this->tpl->setOnScreenMessage(
'success',
$lng->
txt(
"wiki_imp_page_added"),
true);
1465 $ilCtrl->redirect($this,
"editImportantPages");
1474 $imp_page_ids = $this->edit_request->getImportantPageIds();
1475 if (count($imp_page_ids) === 0) {
1476 $this->tpl->setOnScreenMessage(
'info',
$lng->
txt(
"no_checkbox"),
true);
1477 $ilCtrl->redirect($this,
"editImportantPages");
1480 $cgui->setFormAction($ilCtrl->getFormAction($this));
1481 $cgui->setHeaderText(
$lng->
txt(
"wiki_sure_remove_imp_pages"));
1482 $cgui->setCancel(
$lng->
txt(
"cancel"),
"editImportantPages");
1483 $cgui->setConfirm(
$lng->
txt(
"remove"),
"removeImportantPages");
1485 foreach ($imp_page_ids as $i) {
1500 $imp_page_ids = $this->edit_request->getImportantPageIds();
1501 foreach ($imp_page_ids as $i) {
1502 $this->imp_pages->removeImportantPage($i);
1504 $this->tpl->setOnScreenMessage(
'success',
$lng->
txt(
"wiki_removed_imp_pages"),
true);
1505 $ilCtrl->redirect($this,
"editImportantPages");
1515 $ordering = $this->edit_request->getImportantPageOrdering();
1516 $indentation = $this->edit_request->getImportantPageIndentation();
1517 $this->imp_pages->saveOrderingAndIndentation($ordering, $indentation);
1518 $this->tpl->setOnScreenMessage(
'success',
$lng->
txt(
"wiki_ordering_and_indent_saved"),
true);
1519 $ilCtrl->redirect($this,
"editImportantPages");
1529 $imp_page_ids = $this->edit_request->getImportantPageIds();
1530 if (count($imp_page_ids) !== 1) {
1531 $this->tpl->setOnScreenMessage(
'info',
$lng->
txt(
"wiki_select_one_item"),
true);
1533 $this->imp_pages->removeImportantPage($imp_page_ids[0]);
1535 $this->
object->update();
1536 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"msg_obj_modified"),
true);
1538 $ilCtrl->redirect($this,
"editImportantPages");
1547 public function exportHTML():
void 1551 $cont_exp =
new Export\WikiHtmlExport($wiki);
1553 $format = explode(
"_", $this->edit_request->getFormat());
1554 if (($format[1] ??
"") ===
"comments") {
1555 $cont_exp->setMode(Export\WikiHtmlExport::MODE_COMMENTS);
1558 $cont_exp->buildExportFile();
1569 if ($page->getWikiId() === $a_wiki_id) {
1570 return $page->getTitle();
1597 $ilTabs->clearTargets();
1598 $this->tpl->setOnScreenMessage(
'info',
$lng->
txt(
"wiki_page_not_exist_select_templ"));
1613 $hi->setValue($this->requested_page);
1614 $form->addItem($hi);
1620 if ($this->
object->getEmptyPageTemplate()) {
1622 $radg->addOption($op1);
1627 foreach ($ts as $t) {
1629 $radg->addOption($op);
1632 $form->addItem($radg);
1635 $form->addCommandButton(
"createPageUsingTemplate",
$lng->
txt(
"wiki_create_page"));
1636 $form->addCommandButton(
"cancelCreationPageUsingTemplate",
$lng->
txt(
"cancel"));
1639 $form->setFormAction($ilCtrl->getFormAction($this));
1651 if ($form->checkInput()) {
1652 $a_page = $this->edit_request->getPage();
1653 $this->pm->createWikiPage(
1656 $this->edit_request->getTranslation(),
1657 $this->edit_request->getPageTemplateId()
1662 $ilCtrl->redirectByClass(
"ilwikipagegui",
"edit");
1664 $this->tpl->setOnScreenMessage(
'success',
$lng->
txt(
"msg_obj_modified"),
true);
1665 $ilCtrl->redirect($this,
"");
1667 $form->setValuesByPost();
1682 $ilCtrl->redirectByClass(
"ilwikipagegui",
"preview");
1687 if ($perm ===
"create") {
1688 return parent::checkPermissionBool($perm, $cmd,
$type,
$ref_id);
1691 $ref_id = $this->
object->getRefId();
1719 $this->log->debug(
"init: " . $this->req_with_comments);
1721 $this->
object->initUserHTMLExport($this->req_with_comments);
1729 $this->log->debug(
"start: " . $this->req_with_comments);
1731 $this->
object->startUserHTMLExport($this->req_with_comments);
1739 $this->log->debug(
"get progress: " . $this->req_with_comments);
1741 $p = $this->
object->getUserHTMLExportProgress($this->req_with_comments);
1744 $pb->setCurrent($p[
"progress"]);
1747 $r->progressBar = $pb->render();
1748 $r->status = $p[
"status"];
1749 $this->log->debug(
"status: " .
$r->status);
1750 echo(json_encode(
$r, JSON_THROW_ON_ERROR));
1756 $this->log->debug(
"download");
1758 $this->
object->deliverUserHTMLExport();
1763 $this->log->debug(
"download");
1765 $this->
object->deliverUserHTMLExport(
true);
1770 if (!is_object($this->
object)) {
1774 $this->
object->getRefId(),
1775 $this->
user->getId()
1777 if (count($ass_info) > 0) {
1778 $ass_ids =
array_map(
static function ($i):
int {
1783 $this->tool_context->current()->addAdditionalData(
1800 $this->
object->getRefId(),
1801 $this->
user->getId()
1804 foreach ($ass_info as $i) {
1810 $ilCtrl->setParameterByClass(
"ilwikipagegui",
"ass", $ass->getId());
1811 $submit_link = $ilCtrl->getLinkTargetByClass(
"ilwikipagegui",
"finalizeAssignment");
1812 $ilCtrl->setParameterByClass(
"ilwikipagegui",
"ass",
"");
1814 $buttons[$i->getId()][] = $ui->factory()->button()->primary(
$lng->
txt(
"wiki_finalize_wiki"), $submit_link);
1819 if ($submission->hasSubmitted()) {
1821 if ($submitted?->getTimestamp() !=
"") {
1822 $ilCtrl->setParameterByClass(
"ilwikipagegui",
"ass", $ass->getId());
1824 $dl_link = $ilCtrl->getLinkTargetByClass(
"ilwikipagegui",
"downloadExcSubFile");
1825 $ilCtrl->setParameterByClass(
"ilwikipagegui",
"ass",
"");
1826 $buttons[$i->getId()][] = $ui->factory()->button()->standard(
$lng->
txt(
"wiki_download_submission"), $dl_link);
UI class for handling permissions that can be configured having the write permission for an object...
setRightContent(string $a_html)
Sets content of right column.
This class represents an option in a radio group.
WikiGUIRequest $edit_request
ILIAS Style Content Object ObjectFacade $content_style_domain
ILIAS Wiki Page PageManager $pm
static _lookupComment(int $a_usr_id, int $a_obj_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getUserHTMLExportProgressObject()
Get user html export progress.
const IL_WIKI_POPULAR_PAGES
static getLogger(string $a_component_id)
Get component logger.
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...
Wiki page template gui class.
GUI class for the workflow of copying objects.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
prepareOutput(bool $show_sub_objects=true)
static _writeStatus(int $a_obj_id, int $a_user_id, int $a_status)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Interface Observer Contains several chained tasks and infos about them.
Wiki statistics GUI class.
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
addOnLoadCode(string $a_code, int $a_batch=2)
Add on load code.
static _getAllReferences(int $id)
get all reference ids for object ID
GUI class for object translation handling.
static renderSideBlock(int $a_wpg_id, int $a_wiki_ref_id, ?ilWikiPage $a_wp=null)
static lookupTitle(int $a_page_id, string $lang="-")
afterDeadlineStrict(bool $a_include_personal=true)
ILIAS Style Content GUIService $content_style_gui
infoScreenObject()
this one is called from the info button in the repository
initCreateForm(string $new_type)
static _gotoRepositoryNode(int $ref_id, string $cmd="")
TableGUI class for wiki pages table.
setContent(string $a_html)
Sets content for standard template.
setParameterByClass(string $a_class, string $a_parameter, $a_value)
static _performSearch(int $a_wiki_id, string $a_searchterm)
Search in Wiki.
getSubObjectTitle(int $a_id, string $a_type)
Used for rating export.
loadLanguageModule(string $a_module)
Load language module.
downloadUserHTMLExportObject()
static _lookupRatingCategories(int $a_wiki_id)
Lookup whether rating categories are activated.
static lookupWikiId(int $a_page_id)
downloadUserHTMLExportWithCommentsObject()
static lookupSubObjectTitle(int $a_wiki_id, string $a_page_id)
Get title for wiki page (used in ilNotesGUI)
getAllInfo(int $a_type=self::TYPE_ALL, string $lang="-")
redirectByClass( $a_class, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false)
confirmRemoveImportantPagesObject()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ILIAS Wiki Content GUIService $content_gui
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupObjId(int $ref_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
startUserHTMLExportObject()
Export html (as user)
static _lookupRating(int $a_wiki_id)
Lookup whether rating is activated.
static _lookupStatus(int $a_obj_id, int $a_user_id)
Lookup current success status (STATUS_NOT_GRADED|STATUS_PASSED|STATUS_FAILED)
static strLen(string $a_string)
ContextServices $tool_context
GUI class for public user profile presentation.
static http()
Fetches the global http state from ILIAS.
editImportantPagesObject()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilGlobalTemplateInterface $tpl
static _lookupTitle(int $obj_id)
getPrintView(bool $export=false)
GUI class for LTI provider object settings.
initTemplateSelectionForm()
__construct( $a_data, int $a_id, bool $a_call_by_reference, bool $a_prepare_output=true)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setScreenIdComponent(string $a_comp)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilObjectGUI Basic methods of all Output classes.
cancelCreationPageUsingTemplateObject()
static lookupAdvancedMetadataHidden(int $a_page_id)
initUserHTMLExportObject()
Current process:
createPageUsingTemplateObject()
getAssignmentButtons()
Get assignment buttons.
ILIAS Wiki Navigation ImportantPageManager $imp_pages
static getRandomPage(int $a_wiki_id)
getRenderedTranslationInfo()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupStartPage(int $a_wiki_id)
static getSyntaxStylePath()
static getGotoLink(int $a_ref_id, string $a_page="", string $lang="-")
ILIAS Wiki InternalGUIService $gui
showTemplateSelectionObject()
ilPropertyFormGUI $form_gui
getNewTranslatedPageForm()
setCustomRolesForSelection(array $a_roles)
Set custom roles for mapping to LTI roles.
setSettingsSubTabs(string $a_active)
static redirect(string $a_script)
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
static _lookupMark(int $a_usr_id, int $a_obj_id)
static makeUrlTitle(string $a_par)
static makeDbTitle(string $a_par)
static getPageIdForTitle(int $a_wiki_id, string $a_title, string $lang="-")
Get wiki page object for id and title.
addCss(string $a_css_file, string $media="screen")
Add a css file that should be included in the header.
static _wikiPageExists(int $a_wiki_id, string $a_title, string $lang="-")
setHeaderActionMenu(string $a_header)
Set header action menu.
__construct(Container $dic, ilPlugin $plugin)
addJavaScript(string $a_js_file, bool $a_add_version_parameter=true, int $a_batch=2)
Add a javascript file that should be included in the header.
static shortenTextExtended(string $a_str, int $a_len, bool $a_dots=false, bool $a_next_blank=false, bool $a_keep_extension=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const IL_WIKI_ORPHANED_PAGES
ILIAS Wiki InternalDomainService $domain
afterSave(ilObject $new_object)
static check(string $a_perm, int $a_ref_id, string $a_cmd="")
Exercise submission //TODO: This class has many static methods related to delivered "files"...
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
TableGUI class for recent changes in wiki.
removeImportantPagesObject()
setSideBlock(int $a_wpg_id=0)
static getSearchBlockHTML(string $a_title)
saveOrderingAndIndentObject()
addHeaderAction()
Add header action menu.
createNewTranslatedPageObject()
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
static _gotoRepositoryRoot(bool $raise_error=false)
Goto repository root.
gotoPageObject(string $a_page="")
static _goto(string $a_target)