41 protected \ILIAS\Wiki\InternalDomainService
$domain;
42 protected \ILIAS\Wiki\InternalGUIService
$gui;
44 protected \ILIAS\Wiki\Navigation\ImportantPageManager
$imp_pages;
45 protected \ILIAS\Wiki\Page\PageManager
$pm;
47 protected \ILIAS\HTTP\Services
$http;
54 protected \ILIAS\DI\UIServices
$ui;
63 bool $a_call_by_reference,
64 bool $a_prepare_output =
true 68 $gui = $DIC->wiki()->internal()->gui();
69 $domain = $DIC->wiki()->internal()->domain();
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();
78 $this->
http = $gui->http();
79 $this->ot = $gui->wiki()->translation();
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 'ilobjecttranslationgui':
162 $ilTabs->activateTab(
"settings");
165 $transgui->setTitleDescrOnlyMode(
false);
166 $this->
ctrl->forwardCommand($transgui);
169 case 'ilwikipagegui':
172 if ($this->edit_request->getWikiPageId() > 0) {
173 $requested_page = $this->pm->getTitle(
174 $this->edit_request->getWikiPageId(),
175 $this->edit_request->getTranslation()
178 $wpage_gui = $this->content_gui->getCurrentPageGUI();
179 $wpage_gui->setStyleId($this->content_style_domain->getEffectiveStyleId());
181 if (!$ilAccess->checkAccess(
"write",
"", $this->object->getRefId()) &&
183 !$ilAccess->checkAccess(
"edit_content",
"", $this->object->getRefId()) ||
184 $wpage_gui->getPageObject()->getBlocked()
186 $wpage_gui->setEnableEditing(
false);
192 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
193 $wpage_gui->activateMetaDataEditor($this->
object,
"wpg", $wpage_gui->getId());
196 $ret = $this->
ctrl->forwardCommand($wpage_gui);
202 case 'ilobjectcopygui':
204 $cp->setType(
'wiki');
205 $this->
ctrl->forwardCommand($cp);
208 case 'ilpublicuserprofilegui':
210 $this->edit_request->getUserId()
212 $ret = $this->
ctrl->forwardCommand($profile_gui);
216 case "ilobjectcontentstylesettingsgui":
219 $ilTabs->activateTab(
"settings");
222 $settings_gui = $this->content_style_gui
223 ->objectSettingsGUIForRefId(
227 $this->
ctrl->forwardCommand($settings_gui);
232 $ilTabs->activateTab(
"export");
234 $this->
ctrl->forwardCommand($exp_gui);
237 case "ilcommonactiondispatchergui":
239 $this->
ctrl->forwardCommand($gui);
246 $ilTabs->activateTab(
"settings");
249 $gui->setObject($this->
object->getId(), $this->
object->getType());
250 $gui->setExportCallback(array($this,
"getSubObjectTitle"), $this->
lng->txt(
"page"));
251 $this->
ctrl->forwardCommand($gui);
254 case "ilwikistatgui":
258 $ilTabs->activateTab(
"statistics");
260 $this->
ctrl->forwardCommand($gui);
263 case "ilwikipagetemplategui":
266 $ilTabs->activateTab(
"settings");
269 $this->
ctrl->forwardCommand($wptgui);
272 case 'ilobjectmetadatagui':
275 $ilTabs->activateTab(
"advmd");
277 $this->
ctrl->forwardCommand($md_gui);
280 case 'ilrepositoryobjectsearchgui':
283 $ilTabs->setTabActive(
"wiki_search_results");
284 $ilCtrl->setReturn($this,
'view');
285 $ilCtrl->setParameterByClass(ilWikiPageGUI::class,
"wpg_id", null);
286 $ilCtrl->setParameterByClass(ilObjWikiGUI::class,
"wpg_id", null);
288 $this->
object->getRefId(),
292 $ilCtrl->forwardCommand($search_gui);
295 case 'ilobjnotificationsettingsgui':
297 $ilTabs->activateTab(
"settings");
300 $this->
ctrl->forwardCommand($gui);
303 case 'illtiproviderobjectsettinggui':
305 $ilTabs->activateTab(
"settings");
309 $lti_gui->offerLTIRolesForSelection(
false);
310 $this->
ctrl->forwardCommand($lti_gui);
313 case strtolower(SettingsGUI::class):
315 $ilTabs->activateTab(
"settings");
318 $gui = $this->gui->settings()->settingsGUI(
320 $this->
object->getRefId()
322 $this->
ctrl->forwardCommand($gui);
331 if ($cmd !==
"cancelObject") {
332 if ($cmd !==
"infoScreenObject") {
333 if (!in_array($cmd, array(
"createObject",
"saveObject",
"routeImportCmdObject"))) {
353 $f = $this->gui->ui()->factory();
355 $form = parent::initCreateForm($new_type);
357 $inputs[
"start_page"] =
$f->input()->field()->text(
359 )->withRequired(
true);
360 return $this->ui_factory->input()->container()->form()->standard(
361 $this->
ctrl->getFormAction($this,
'save'),
363 )->withSubmitLabel($this->
lng->txt($new_type .
'_add'));
369 ->initCreateForm($this->requested_new_type)
370 ->withRequest($this->request);
371 $data = $form->getData();
372 $new_object->setStartPage(
$data[
"start_page"]);
376 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"object_added"),
true);
377 $this->
ctrl->setParameterByClass(
382 $this->
ctrl->redirectByClass([
383 ilWikiHandlerGUI::class,
397 $this->
ctrl->redirectByClass(ilInfoScreenGUI::class,
"showSummary");
407 $ilTabs->activateTab(
"info_short");
409 if (!$ilAccess->checkAccess(
"visible",
"", $this->object->getRefId())) {
414 $info->enablePrivateNotes();
415 if (trim($this->
object->getIntroduction()) !==
"") {
416 $info->addSection(
$lng->
txt(
"wiki_introduction"));
417 $info->addProperty(
"", nl2br($this->
object->getIntroduction()));
425 $info->addSection($this->
lng->txt(
"wiki_feedback_from_tutor"));
426 if ($lpcomment !==
"") {
428 $this->
lng->txt(
"wiki_comment"),
434 $this->
lng->txt(
"wiki_mark"),
441 $this->
lng->txt(
"status"),
442 $this->
lng->txt(
"wiki_passed")
447 $this->
lng->txt(
"status"),
448 $this->
lng->txt(
"wiki_failed")
453 if ($ilAccess->checkAccess(
"read",
"", $this->object->getRefId())) {
454 $info->addButton(
$lng->
txt(
"wiki_start_page"), self::getGotoLink($this->
object->getRefId()));
458 $this->
lng->loadLanguageModule(
"meta");
459 $this->
lng->loadLanguageModule(
"wiki");
462 $this->
ctrl->forwardCommand($info);
482 "wiki_what_links_here",
483 $this->
ctrl->getLinkTargetByClass(
491 $this->
ctrl->getLinkTargetByClass(
504 $ilTabs->activateTab(
"wiki_pages");
515 $ilTabs->addSubTabTarget(
517 $this->
ctrl->getLinkTarget($this,
"allPages"),
520 $ilTabs->addSubTabTarget(
521 "wiki_recent_changes",
522 $this->
ctrl->getLinkTarget($this,
"recentChanges"),
525 $ilTabs->addSubTabTarget(
527 $this->
ctrl->getLinkTarget($this,
"newPages"),
530 $ilTabs->addSubTabTarget(
531 "wiki_popular_pages",
532 $this->
ctrl->getLinkTarget($this,
"popularPages"),
535 $ilTabs->addSubTabTarget(
536 "wiki_orphaned_pages",
537 $this->
ctrl->getLinkTarget($this,
"orphanedPages"),
553 if (in_array(strtolower($ilCtrl->getNextClass($this)), [strtolower(SettingsGUI::class)]) ||
555 strtolower($ilCtrl->getCmdClass()),
556 array(
"",
"ilobjectcontentstylesettingsgui",
"ilobjwikigui",
557 "ilinfoscreengui",
"ilpermissiongui",
"ilexportgui",
"ilratingcategorygui",
"ilobjnotificationsettingsgui",
"iltaxmdgui",
558 "ilwikistatgui",
"ilwikipagetemplategui",
"iladvancedmdsettingsgui",
"ilsettingspermissiongui",
'ilrepositoryobjectsearchgui',
559 'ilobjecttranslationgui')
560 ) || $ilCtrl->getNextClass() ===
"ilpermissiongui") {
561 if ($this->requested_page !==
"") {
562 $page_id = ($this->edit_request->getWikiPageId() > 0)
563 ? $this->edit_request->getWikiPageId()
564 : $this->pm->getPageIdForTitle(
565 $this->requested_page,
566 $this->edit_request->getTranslation()
568 if (is_null($page_id) && $this->edit_request->getFromPage() !==
"") {
569 $page_id = $this->pm->getPageIdForTitle(
570 $this->edit_request->getFromPage(),
571 $this->edit_request->getTranslation()
574 if (!is_null($page_id)) {
575 $this->tabs_gui->setBackTarget(
576 $lng->
txt(
"wiki_last_visited_page"),
577 $this->pm->getPermaLink(
579 $this->edit_request->getTranslation()
586 if ($ilAccess->checkAccess(
'read',
"", $this->object->getRefId())) {
587 $this->tabs_gui->addTab(
590 $this->
ctrl->getLinkTarget($this,
"allPages")
595 if ($ilAccess->checkAccess(
'visible',
"", $this->object->getRefId())) {
596 $this->tabs_gui->addTab(
599 $this->
ctrl->getLinkTargetByClass(
"ilinfoscreengui",
"showSummary")
604 if ($ilAccess->checkAccess(
'write',
"", $this->object->getRefId())) {
605 $this->tabs_gui->addTab(
608 $this->
ctrl->getLinkTargetByClass(SettingsGUI::class)
613 $mdtab = $mdgui->getTab();
615 $this->tabs_gui->addTab(
617 $this->
lng->txt(
"meta_data"),
624 if ($ilAccess->checkAccess(
'write',
"", $this->object->getRefId())) {
625 $this->tabs_gui->addTab(
627 $lng->
txt(
"wiki_contributors"),
628 $this->
ctrl->getLinkTarget($this,
"listContributors")
633 if ($ilAccess->checkAccess(
'statistics_read',
"", $this->object->getRefId())) {
634 $this->tabs_gui->addTab(
637 $this->
ctrl->getLinkTargetByClass(
"ilWikiStatGUI",
"initial")
641 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
642 $this->tabs_gui->addTab(
645 $this->
ctrl->getLinkTargetByClass(
"ilexportgui",
"")
650 if ($ilAccess->checkAccess(
'edit_permission',
"", $this->object->getRefId())) {
651 $this->tabs_gui->addTab(
654 $this->
ctrl->getLinkTargetByClass(
"ilpermissiongui",
"perm")
668 array(
"general_settings",
"style",
"imp_pages",
"rating_categories",
"obj_multilinguality",
669 "page_templates",
"advmd",
"permission_settings",
"notifications",
"lti_provider")
671 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
675 $lng->
txt(
"wiki_general_settings"),
676 $ilCtrl->getLinkTarget($this,
'editSettings')
681 "permission_settings",
682 $lng->
txt(
"obj_permission_settings"),
683 $this->
ctrl->getLinkTargetByClass(
"ilsettingspermissiongui",
"")
690 $ilCtrl->getLinkTargetByClass(
"ilObjectContentStyleSettingsGUI",
"")
694 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
699 $ilCtrl->getLinkTarget($this,
'editImportantPages')
703 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
707 $lng->
txt(
"wiki_page_templates"),
708 $ilCtrl->getLinkTargetByClass(
"ilwikipagetemplategui",
"")
712 if ($this->
object->getRatingPages() && $this->
object->getRatingCategories()) {
716 $lng->
txt(
"rating_categories"),
717 $ilCtrl->getLinkTargetByClass(array(
'ilratinggui',
'ilratingcategorygui'),
'')
724 $ilCtrl->getLinkTargetByClass(
"ilobjnotificationsettingsgui",
'')
728 'obj_multilinguality',
729 $lng->
txt(
"obj_multilinguality"),
730 $this->
ctrl->getLinkTargetByClass(
"ilobjecttranslationgui",
"")
736 if ($lti_settings->hasSettingsAccess()) {
737 $ilTabs->addSubTabTarget(
739 $this->
ctrl->getLinkTargetByClass(ilLTIProviderObjectSettingGUI::class)
743 $ilTabs->activateSubTab($a_active);
749 $this->
ctrl->redirectByClass(SettingsGUI::class);
758 $ilTabs->activateTab(
"wiki_contributors");
778 $users = $this->edit_request->getUserIds();
779 $marks = $this->edit_request->getMarks();
780 $comments = $this->edit_request->getComments();
781 $status = $this->edit_request->getStatus();
785 if ($user_id !=
"") {
791 if ($marks_obj->getMark() !== $new_mark ||
795 $marks_obj->setMark($new_mark);
796 $marks_obj->setComment($new_comment);
797 $marks_obj->update();
803 $this->tpl->setOnScreenMessage(
'success',
$lng->
txt(
"msg_obj_modified"),
true);
806 $ilCtrl->redirect($this,
"listContributors");
814 if (is_object($this->
object)) {
816 $this->
object->getTitle(),
817 self::getGotoLink($this->
object->getRefId()),
819 $this->requested_ref_id
824 public static function _goto(
string $a_target): void
827 $main_tpl = $DIC->ui()->mainTemplate();
831 $ilAccess = $DIC->access();
832 $lng = $DIC->language();
833 $ctrl = $DIC->ctrl();
834 $transl = $DIC->wiki()->internal()->gui()->request()->getTranslation();
838 $i = strpos($a_target,
"_");
841 $a_page = substr($a_target, $i + 1);
842 $a_target = substr($a_target, 0, $i);
845 if ($a_target ===
"wpage") {
846 $a_page_arr = explode(
"_", $a_page);
847 $wpg_id = (
int) $a_page_arr[0];
849 $lang = ($a_page_arr[2] ??
"");
856 foreach ($refs as
$r) {
857 if ($ilAccess->checkAccess(
"read",
"", $r)) {
864 if ($ilAccess->checkAccess(
"read",
"", $a_target)) {
892 [
"ilwikihandlergui",
"ilobjwikigui"],
897 [
"ilwikihandlergui"],
901 } elseif ($ilAccess->checkAccess(
"visible",
"", $a_target)) {
904 $main_tpl->setOnScreenMessage(
'failure', sprintf(
905 $lng->
txt(
"msg_no_perm_read_item"),
919 if ($a_page ===
"") {
923 $append = (!in_array($lang, [
"",
"-"]))
926 $goto =
"goto.php?target=wiki_" . $a_ref_id .
"_" .
941 $ilTabs->clearTargets();
944 $wpage_gui = $this->gui->content()->getCurrentPageGUI();
947 $ilCtrl->setParameter(
953 $wpage_gui->setStyleId($this->content_style_domain->getEffectiveStyleId());
958 $ilCtrl->redirectByClass(ilWikiPageGUI::class,
"preview");
1032 if ($a_page ===
"") {
1036 if ($this->pm->existsByTitle(
1038 $this->edit_request->getTranslation()
1041 ilUtil::redirect(self::getGotoLink($this->
object->getRefId(), $a_page, $this->edit_request->getTranslation()));
1043 if (!$this->
access->checkAccess(
"add_pages",
"", $this->object->getRefId())) {
1044 $this->tpl->setOnScreenMessage(
"failure", $this->
lng->txt(
"no_permission"),
true);
1045 $from_page_id = $this->pm->getPageIdForTitle($this->edit_request->getFromPage(), $this->edit_request->getTranslation());
1046 ilUtil::redirect($this->pm->getPermaLink($from_page_id, $this->edit_request->getTranslation()));
1051 if (!$this->
object->getTemplateSelectionOnCreation()) {
1054 $this->tpl->setOnScreenMessage(
1056 $this->
lng->txt(
"wiki_page_title_too_long") .
" (" . $a_page .
")",
1059 $ilCtrl->setParameterByClass(
1064 $ilCtrl->redirectByClass(
"ilwikipagegui",
"preview");
1067 $this->pm->createWikiPage(
1070 $this->edit_request->getTranslation()
1075 $ilCtrl->redirectByClass(
"ilwikipagegui",
"edit");
1078 $ilCtrl->setParameter(
1083 $ilCtrl->redirect($this,
"showTemplateSelection");
1090 if (in_array($this->edit_request->getTranslation(), [
"-",
""])) {
1097 $this->edit_request->getTranslation()
1099 $this->tabs_gui->clearTargets();
1100 $this->tabs_gui->setBackTarget(
1101 $this->
lng->txt(
"back"),
1102 $this->pm->getPermaLink(
1103 $this->pm->getPageIdForTitle(
1104 $this->edit_request->getFromPage(),
1105 $this->edit_request->getTranslation()
1107 $this->edit_request->getTranslation()
1119 $mess = $this->gui->ui()->factory()->messageBox()->info(
1120 $this->
lng->txt(
"wiki_translate_page_master_info")
1122 return $this->gui->ui()->renderer()->render($mess);
1127 $pm = $this->domain->page()->page($this->
object->getRefId());
1129 foreach ($pm->getMasterPagesWithoutTranslation($this->edit_request->getTranslation()) as $page) {
1130 $options[$page->getId()] = $page->getTitle();
1132 $append =
" '" . $this->edit_request->getPage() .
"'";
1133 $append .=
" (" . $this->
lng->txt(
"meta_l_" . $this->edit_request->getTranslation()) .
")";
1134 $append2 =
" (" . $this->
lng->txt(
"meta_l_" . $this->ot->getMasterLanguage()) .
")";
1135 $form = $this->gui->form([self::class],
"createNewTranslatedPage")
1136 ->section(
"sec", $this->
lng->txt(
"wiki_translation_page") . $append)
1137 ->
switch(
"type", $this->
lng->txt(
"wiki_page_in_master_language") . $append2,
"",
"existing")
1138 ->group(
"existing", $this->
lng->txt(
"wiki_master_existing"))
1139 ->select(
"master_id", $this->
lng->txt(
"wiki_master_title"), $options)
1141 ->group(
"new", $this->
lng->txt(
"wiki_no_master"))
1142 ->text(
"master_title", $this->
lng->txt(
"wiki_master_title"))
1145 if ($this->
object->getTemplateSelectionOnCreation($this->edit_request->getTranslation())) {
1146 $form = $form->radio(
"page_templ", $this->
lng->txt(
"wiki_page_template"),
"",
"0")->required();
1147 if ($this->
object->getEmptyPageTemplate()) {
1148 $form = $form->radioOption(
"0", $this->
lng->txt(
"wiki_empty_page"));
1152 foreach ($ts as $t) {
1153 $form = $form->radioOption($t[
"wpage_id"], $t[
"title"]);
1163 if ($form->isValid()) {
1164 $page_template_id = 0;
1165 if ($this->
object->getTemplateSelectionOnCreation($this->edit_request->getTranslation())) {
1166 $page_template_id = (
int) $form->getData(
"page_templ");
1168 if ($form->getData(
"type") ===
"new") {
1169 $wpg_id = $this->pm->createWikiPage(
1170 $form->getData(
"master_title")
1173 $wpg_id = $form->getData(
"master_id");
1175 $wpg_id = $this->pm->createWikiPage(
1176 $this->edit_request->getPage(),
1178 $this->edit_request->getTranslation(),
1182 $this->
ctrl->setParameterByClass(ilWikiPageGUI::class,
"wpg_id", $wpg_id);
1183 $this->
ctrl->redirectByClass(ilWikiPageGUI::class,
"preview");
1214 self::renderSideBlock($a_wpg_id, $this->
object->getRefId());
1225 $lng = $DIC->language();
1226 $ilAccess = $DIC->access();
1227 $ilCtrl = $DIC->ctrl();
1238 $tpl->
addOnLoadCode(
"il.Wiki.Pres.init('" . $ilCtrl->getLinkTargetByClass(
"ilobjwikigui",
"",
"",
false,
false) .
"');");
1240 if ($a_wpg_id > 0 && !$a_wp) {
1249 if ($a_wpg_id > 0) {
1254 $a_wp->getRating()) {
1256 $rgui->setObject($wiki_id,
"wiki", $a_wpg_id,
"wpg");
1258 $rgui->setYourRatingText(
"#");
1259 $rcontent .= $rgui->getBlockHTML(
$lng->
txt(
"wiki_rate_page"));
1265 if ($ilAccess->checkAccess(
"write",
"", $a_wiki_ref_id) ||
1266 $ilAccess->checkAccess(
"edit_page_meta",
"", $a_wiki_ref_id)) {
1268 "edit" => $ilCtrl->getLinkTargetByClass(
"ilwikipagegui",
"editAdvancedMetaData"),
1269 "hide" => $ilCtrl->getLinkTargetByClass(
"ilwikipagegui",
"hideAdvancedMetaData")
1273 $callback = $wiki->getLinkMetadataValues()
1274 ? array($wiki,
"decorateAdvMDValue")
1277 $rcontent .= $mdgui->getBlockHTML($cmd, $callback);
1283 $rcontent .= $imp_pages_block->getHTML();
1286 if ($a_wpg_id > 0) {
1288 $wiki_functions_block->setPageObject($a_wp);
1289 $rcontent .= $wiki_functions_block->getHTML();
1317 $ordering = $this->edit_request->getPrintOrdering();
1320 if (count($ordering) > 0) {
1322 $page_ids = array_keys($ordering);
1325 elseif ($this->edit_request->getWikiPageId()) {
1326 $page_ids = array($this->edit_request->getWikiPageId());
1336 $provider = new \ILIAS\Wiki\WikiPrintViewProviderGUI(
1339 $this->
object->getRefId(),
1343 return new \ILIAS\Export\PrintProcessGUI(
1354 $print_view->sendPrintView();
1366 $ilTabs->setTabActive(
"wiki_search_results");
1368 if ($this->edit_request->getSearchTerm() ===
"") {
1369 $this->tpl->setOnScreenMessage(
'failure',
$lng->
txt(
"wiki_please_enter_search_term"),
true);
1370 $ilCtrl->redirectByClass(
"ilwikipagegui",
"preview");
1375 $this->edit_request->getSearchTerm()
1382 $this->edit_request->getSearchTerm()
1416 $this->tpl->setOnScreenMessage(
'info',
$lng->
txt(
"wiki_navigation_info"));
1418 $ipages_ids = $this->imp_pages->getImportantPageIds();
1421 $pages = $this->pm->getAllPagesInfo();
1422 $options = array(
"" =>
$lng->
txt(
"please_select"));
1423 foreach ($pages as $p) {
1424 if (!in_array($p->getId(), $ipages_ids)) {
1428 if (count($options) > 0) {
1432 $ilToolbar->addInputItem($si);
1433 $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
1434 $ilToolbar->addFormButton(
$lng->
txt(
"add"),
"addImportantPage");
1438 $ilTabs->activateTab(
"settings");
1453 $imp_page_id = $this->edit_request->getImportantPageId();
1454 if ($imp_page_id > 0) {
1455 $this->imp_pages->add($imp_page_id);
1456 $this->tpl->setOnScreenMessage(
'success',
$lng->
txt(
"wiki_imp_page_added"),
true);
1458 $ilCtrl->redirect($this,
"editImportantPages");
1467 $imp_page_ids = $this->edit_request->getImportantPageIds();
1468 if (count($imp_page_ids) === 0) {
1469 $this->tpl->setOnScreenMessage(
'info',
$lng->
txt(
"no_checkbox"),
true);
1470 $ilCtrl->redirect($this,
"editImportantPages");
1473 $cgui->setFormAction($ilCtrl->getFormAction($this));
1474 $cgui->setHeaderText(
$lng->
txt(
"wiki_sure_remove_imp_pages"));
1475 $cgui->setCancel(
$lng->
txt(
"cancel"),
"editImportantPages");
1476 $cgui->setConfirm(
$lng->
txt(
"remove"),
"removeImportantPages");
1478 foreach ($imp_page_ids as $i) {
1493 $imp_page_ids = $this->edit_request->getImportantPageIds();
1494 foreach ($imp_page_ids as $i) {
1495 $this->imp_pages->removeImportantPage($i);
1497 $this->tpl->setOnScreenMessage(
'success',
$lng->
txt(
"wiki_removed_imp_pages"),
true);
1498 $ilCtrl->redirect($this,
"editImportantPages");
1508 $ordering = $this->edit_request->getImportantPageOrdering();
1509 $indentation = $this->edit_request->getImportantPageIndentation();
1510 $this->imp_pages->saveOrderingAndIndentation($ordering, $indentation);
1511 $this->tpl->setOnScreenMessage(
'success',
$lng->
txt(
"wiki_ordering_and_indent_saved"),
true);
1512 $ilCtrl->redirect($this,
"editImportantPages");
1522 $imp_page_ids = $this->edit_request->getImportantPageIds();
1523 if (count($imp_page_ids) !== 1) {
1524 $this->tpl->setOnScreenMessage(
'info',
$lng->
txt(
"wiki_select_one_item"),
true);
1526 $this->imp_pages->removeImportantPage($imp_page_ids[0]);
1528 $this->
object->update();
1529 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"msg_obj_modified"),
true);
1531 $ilCtrl->redirect($this,
"editImportantPages");
1540 public function exportHTML():
void 1544 $cont_exp =
new Export\WikiHtmlExport($wiki);
1546 $format = explode(
"_", $this->edit_request->getFormat());
1547 if (($format[1] ??
"") ===
"comments") {
1548 $cont_exp->setMode(Export\WikiHtmlExport::MODE_COMMENTS);
1551 $cont_exp->buildExportFile();
1562 if ($page->getWikiId() === $a_wiki_id) {
1563 return $page->getTitle();
1590 $ilTabs->clearTargets();
1591 $this->tpl->setOnScreenMessage(
'info',
$lng->
txt(
"wiki_page_not_exist_select_templ"));
1606 $hi->setValue($this->requested_page);
1607 $form->addItem($hi);
1613 if ($this->
object->getEmptyPageTemplate()) {
1615 $radg->addOption($op1);
1620 foreach ($ts as $t) {
1622 $radg->addOption($op);
1625 $form->addItem($radg);
1628 $form->addCommandButton(
"createPageUsingTemplate",
$lng->
txt(
"wiki_create_page"));
1629 $form->addCommandButton(
"cancelCreationPageUsingTemplate",
$lng->
txt(
"cancel"));
1632 $form->setFormAction($ilCtrl->getFormAction($this));
1644 if ($form->checkInput()) {
1645 $a_page = $this->edit_request->getPage();
1646 $this->pm->createWikiPage(
1649 $this->edit_request->getTranslation(),
1650 $this->edit_request->getPageTemplateId()
1655 $ilCtrl->redirectByClass(
"ilwikipagegui",
"edit");
1657 $this->tpl->setOnScreenMessage(
'success',
$lng->
txt(
"msg_obj_modified"),
true);
1658 $ilCtrl->redirect($this,
"");
1660 $form->setValuesByPost();
1675 $ilCtrl->redirectByClass(
"ilwikipagegui",
"preview");
1680 if ($perm ===
"create") {
1681 return parent::checkPermissionBool($perm, $cmd,
$type,
$ref_id);
1684 $ref_id = $this->
object->getRefId();
1712 $this->log->debug(
"init: " . $this->req_with_comments);
1714 $this->
object->initUserHTMLExport($this->req_with_comments);
1722 $this->log->debug(
"start: " . $this->req_with_comments);
1724 $this->
object->startUserHTMLExport($this->req_with_comments);
1732 $this->log->debug(
"get progress: " . $this->req_with_comments);
1734 $p = $this->
object->getUserHTMLExportProgress($this->req_with_comments);
1737 $pb->setCurrent($p[
"progress"]);
1740 $r->progressBar = $pb->render();
1741 $r->status = $p[
"status"];
1742 $this->log->debug(
"status: " .
$r->status);
1743 echo(json_encode(
$r, JSON_THROW_ON_ERROR));
1749 $this->log->debug(
"download");
1751 $this->
object->deliverUserHTMLExport();
1756 $this->log->debug(
"download");
1758 $this->
object->deliverUserHTMLExport(
true);
1763 if (!is_object($this->
object)) {
1767 $this->
object->getRefId(),
1768 $this->
user->getId()
1770 if (count($ass_info) > 0) {
1771 $ass_ids =
array_map(
static function ($i):
int {
1776 $this->tool_context->current()->addAdditionalData(
1793 $this->
object->getRefId(),
1794 $this->
user->getId()
1797 foreach ($ass_info as $i) {
1803 $ilCtrl->setParameterByClass(
"ilwikipagegui",
"ass", $ass->getId());
1804 $submit_link = $ilCtrl->getLinkTargetByClass(
"ilwikipagegui",
"finalizeAssignment");
1805 $ilCtrl->setParameterByClass(
"ilwikipagegui",
"ass",
"");
1807 $buttons[$i->getId()][] = $ui->factory()->button()->primary(
$lng->
txt(
"wiki_finalize_wiki"), $submit_link);
1812 if ($submission->hasSubmitted()) {
1814 if ($submitted?->getTimestamp() !=
"") {
1815 $ilCtrl->setParameterByClass(
"ilwikipagegui",
"ass", $ass->getId());
1817 $dl_link = $ilCtrl->getLinkTargetByClass(
"ilwikipagegui",
"downloadExcSubFile");
1818 $ilCtrl->setParameterByClass(
"ilwikipagegui",
"ass",
"");
1819 $buttons[$i->getId()][] = $ui->factory()->button()->standard(
$lng->
txt(
"wiki_download_submission"), $dl_link);
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...
WikiGUIRequest $edit_request
ILIAS Style Content Object ObjectFacade $content_style_domain
ILIAS Wiki Page PageManager $pm
ILIAS HTTP Services $http
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.
redirectByClass( $a_class, string $a_cmd=null, string $a_anchor=null, bool $is_async=false)
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="")
static _getAllReferences(int $id)
get all reference ids for object ID
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.
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="-")
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...
setHeaderActionMenu(string $a_header)
Set header action menu.
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
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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)
setContent(string $a_html)
Sets content for standard template.
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)
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 getSyntaxStylePath()
static getGotoLink(int $a_ref_id, string $a_page="", string $lang="-")
ILIAS Wiki InternalGUIService $gui
showTemplateSelectionObject()
addOnLoadCode(string $a_code, int $a_batch=2)
Add on load code.
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)
const IL_WIKI_ALL_PAGES
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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.
static _wikiPageExists(int $a_wiki_id, string $a_title, string $lang="-")
__construct(Container $dic, ilPlugin $plugin)
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
setRightContent(string $a_html)
Sets content of right column.
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)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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
GUI class for object translation handling.
static _gotoRepositoryRoot(bool $raise_error=false)
Goto repository root.
gotoPageObject(string $a_page="")
addCss(string $a_css_file, string $media="screen")
Add a css file that should be included in the header.
static _goto(string $a_target)