38 protected \ILIAS\HTTP\Services
$http;
45 protected \ILIAS\DI\UIServices
$ui;
54 bool $a_call_by_reference,
55 bool $a_prepare_output =
true 59 $this->
ctrl = $DIC->ctrl();
60 $this->
lng = $DIC->language();
61 $this->
tabs = $DIC->tabs();
62 $this->
help = $DIC->help();
63 $this->
locator = $DIC[
"ilLocator"];
64 $ilCtrl = $DIC->ctrl();
65 $lng = $DIC->language();
66 $this->
http = $DIC->http();
72 $this->tool_context = $DIC->globalScreen()->tool()->context();
73 $this->
ui = $DIC->ui();
75 $this->edit_request = $DIC
86 $this->requested_page = $this->edit_request->getPage();
87 if ($this->requested_page !==
"") {
91 $this->req_with_comments = $this->edit_request->getWithComments();
92 $cs = $DIC->contentStyle();
93 $this->content_style_gui = $cs->gui();
94 if (is_object($this->
object)) {
95 $this->content_style_domain = $cs->domain()->styleForRefId($this->
object->getRefId());
106 $next_class = $this->
ctrl->getNextClass($this);
107 $cmd = $this->
ctrl->getCmd();
115 if ($cmd ===
"printView") {
119 switch ($next_class) {
120 case "ilinfoscreengui":
126 case 'ilpermissiongui':
128 $ilTabs->activateTab(
"perm_settings");
130 $this->
ctrl->forwardCommand($perm_gui);
133 case 'ilsettingspermissiongui':
136 $ilTabs->activateTab(
"settings");
139 $perm_gui->setPermissions(array(
"edit_wiki_navigation",
"delete_wiki_pages",
"activate_wiki_protection",
140 "wiki_html_export"));
141 $perm_gui->setRoleRequiredPermissions(array(
"edit_content"));
142 $perm_gui->setRoleProhibitedPermissions(array(
"write"));
143 $this->
ctrl->forwardCommand($perm_gui);
146 case 'ilwikipagegui':
151 $this->edit_request->getOldNr(),
152 $this->
object->getRefId()
154 $wpage_gui->setStyleId($this->content_style_domain->getEffectiveStyleId());
156 if (!$ilAccess->checkAccess(
"write",
"", $this->object->getRefId()) &&
158 !$ilAccess->checkAccess(
"edit_content",
"", $this->object->getRefId()) ||
159 $wpage_gui->getPageObject()->getBlocked()
161 $wpage_gui->setEnableEditing(
false);
167 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
168 $wpage_gui->activateMetaDataEditor($this->
object,
"wpg", $wpage_gui->getId());
171 $ret = $this->
ctrl->forwardCommand($wpage_gui);
177 case 'ilobjectcopygui':
179 $cp->setType(
'wiki');
180 $this->
ctrl->forwardCommand($cp);
183 case 'ilpublicuserprofilegui':
185 $this->edit_request->getUserId()
187 $ret = $this->
ctrl->forwardCommand($profile_gui);
191 case "ilobjectcontentstylesettingsgui":
194 $ilTabs->activateTab(
"settings");
197 $settings_gui = $this->content_style_gui
198 ->objectSettingsGUIForRefId(
202 $this->
ctrl->forwardCommand($settings_gui);
207 $ilTabs->activateTab(
"export");
209 $exp_gui->addFormat(
"xml");
210 $exp_gui->addFormat(
"html",
"", $this,
"exportHTML");
211 if ($this->
object->isCommentsExportPossible()) {
212 $exp_gui->addFormat(
"html_comments",
"HTML (" . $this->
lng->txt(
"wiki_incl_comments") .
")", $this,
"exportHTML");
214 $this->
ctrl->forwardCommand($exp_gui);
217 case "ilcommonactiondispatchergui":
219 $this->
ctrl->forwardCommand($gui);
226 $ilTabs->activateTab(
"settings");
229 $gui->setObject($this->
object->getId(), $this->
object->getType());
230 $gui->setExportCallback(array($this,
"getSubObjectTitle"), $this->
lng->txt(
"page"));
231 $this->
ctrl->forwardCommand($gui);
234 case "ilwikistatgui":
238 $ilTabs->activateTab(
"statistics");
240 $this->
ctrl->forwardCommand($gui);
243 case "ilwikipagetemplategui":
246 $ilTabs->activateTab(
"settings");
249 $this->
ctrl->forwardCommand($wptgui);
252 case 'ilobjectmetadatagui':
255 $ilTabs->activateTab(
"advmd");
257 $this->
ctrl->forwardCommand($md_gui);
260 case 'ilrepositoryobjectsearchgui':
263 $ilTabs->setTabActive(
"wiki_search_results");
264 $ilCtrl->setReturn($this,
'view');
266 $this->
object->getRefId(),
270 $ilCtrl->forwardCommand($search_gui);
273 case 'ilobjnotificationsettingsgui':
275 $ilTabs->activateTab(
"settings");
278 $this->
ctrl->forwardCommand($gui);
281 case 'illtiproviderobjectsettinggui':
283 $ilTabs->activateTab(
"settings");
287 $lti_gui->offerLTIRolesForSelection(
false);
288 $this->
ctrl->forwardCommand($lti_gui);
297 if ($cmd !==
"cancelObject") {
298 if ($cmd !==
"infoScreenObject") {
299 if (!in_array($cmd, array(
"createObject",
"saveObject",
"importFileObject"))) {
322 $forms = array(self::CFORM_NEW => $this->form_gui,
339 if ($this->form_gui->checkInput()) {
341 $short_item = $this->form_gui->getItemByPostVar(
"shorttitle");
342 $short_item->setAlert(
$lng->
txt(
"wiki_short_title_already_in_use"));
344 parent::saveObject();
349 $this->form_gui->setValuesByPost();
357 $new_object->
setTitle($this->form_gui->getInput(
"title"));
358 $new_object->
setDescription($this->form_gui->getInput(
"description"));
359 $new_object->setIntroduction($this->form_gui->getInput(
"intro"));
360 $new_object->setStartPage($this->form_gui->getInput(
"startpage"));
361 $new_object->setShortTitle((
string) $this->form_gui->getInput(
"shorttitle"));
362 $new_object->setRating($this->form_gui->getInput(
"rating"));
364 $new_object->setRatingForNewPages($this->form_gui->getInput(
"rating_new"));
365 $new_object->setRatingCategories($this->form_gui->getInput(
"rating_ext"));
367 $new_object->setRatingOverall($this->form_gui->getInput(
"rating_overall"));
368 $new_object->setPageToc($this->form_gui->getInput(
"page_toc"));
373 $new_object->setPublicNotes($this->form_gui->getInput(
"public_notes"));
375 $new_object->setOnline($this->form_gui->getInput(
"online"));
379 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"object_added"),
true);
391 $this->
ctrl->setCmd(
"showSummary");
392 $this->
ctrl->setCmdClass(
"ilinfoscreengui");
403 $ilTabs->activateTab(
"info_short");
405 if (!$ilAccess->checkAccess(
"visible",
"", $this->object->getRefId())) {
410 $info->enablePrivateNotes();
411 if (trim($this->
object->getIntroduction()) !==
"") {
412 $info->addSection(
$lng->
txt(
"wiki_introduction"));
413 $info->addProperty(
"", nl2br($this->
object->getIntroduction()));
421 $info->addSection($this->
lng->txt(
"wiki_feedback_from_tutor"));
422 if ($lpcomment !==
"") {
424 $this->
lng->txt(
"wiki_comment"),
430 $this->
lng->txt(
"wiki_mark"),
437 $this->
lng->txt(
"status"),
438 $this->
lng->txt(
"wiki_passed")
443 $this->
lng->txt(
"status"),
444 $this->
lng->txt(
"wiki_failed")
449 if ($ilAccess->checkAccess(
"read",
"", $this->object->getRefId())) {
450 $info->addButton(
$lng->
txt(
"wiki_start_page"), self::getGotoLink($this->
object->getRefId()));
454 $this->
lng->loadLanguageModule(
"meta");
455 $this->
lng->loadLanguageModule(
"wiki");
458 $this->
ctrl->forwardCommand($info);
478 "wiki_what_links_here",
479 $this->
ctrl->getLinkTargetByClass(
487 $this->
ctrl->getLinkTargetByClass(
500 $ilTabs->activateTab(
"wiki_pages");
511 $ilTabs->addSubTabTarget(
513 $this->
ctrl->getLinkTarget($this,
"allPages"),
516 $ilTabs->addSubTabTarget(
517 "wiki_recent_changes",
518 $this->
ctrl->getLinkTarget($this,
"recentChanges"),
521 $ilTabs->addSubTabTarget(
523 $this->
ctrl->getLinkTarget($this,
"newPages"),
526 $ilTabs->addSubTabTarget(
527 "wiki_popular_pages",
528 $this->
ctrl->getLinkTarget($this,
"popularPages"),
531 $ilTabs->addSubTabTarget(
532 "wiki_orphaned_pages",
533 $this->
ctrl->getLinkTarget($this,
"orphanedPages"),
548 if (in_array(strtolower($ilCtrl->getCmdClass()), array(
"",
"ilobjectcontentstylesettingsgui",
"ilobjwikigui",
549 "ilinfoscreengui",
"ilpermissiongui",
"ilexportgui",
"ilratingcategorygui",
"ilobjnotificationsettingsgui",
"iltaxmdgui",
550 "ilwikistatgui",
"ilwikipagetemplategui",
"iladvancedmdsettingsgui",
"ilsettingspermissiongui",
'ilrepositoryobjectsearchgui' 551 ),
true) || $ilCtrl->getNextClass() ===
"ilpermissiongui") {
552 if ($this->requested_page !==
"") {
553 $this->tabs_gui->setBackTarget(
554 $lng->
txt(
"wiki_last_visited_page"),
556 $this->requested_ref_id,
563 if ($ilAccess->checkAccess(
'read',
"", $this->object->getRefId())) {
564 $this->tabs_gui->addTab(
567 $this->
ctrl->getLinkTarget($this,
"allPages")
572 if ($ilAccess->checkAccess(
'visible',
"", $this->object->getRefId())) {
573 $this->tabs_gui->addTab(
576 $this->
ctrl->getLinkTargetByClass(
"ilinfoscreengui",
"showSummary")
581 if ($ilAccess->checkAccess(
'write',
"", $this->object->getRefId())) {
582 $this->tabs_gui->addTab(
585 $this->
ctrl->getLinkTarget($this,
"editSettings")
590 $mdtab = $mdgui->getTab();
592 $this->tabs_gui->addTab(
594 $this->
lng->txt(
"meta_data"),
601 if ($ilAccess->checkAccess(
'write',
"", $this->object->getRefId())) {
602 $this->tabs_gui->addTab(
604 $lng->
txt(
"wiki_contributors"),
605 $this->
ctrl->getLinkTarget($this,
"listContributors")
610 if ($ilAccess->checkAccess(
'statistics_read',
"", $this->object->getRefId())) {
611 $this->tabs_gui->addTab(
614 $this->
ctrl->getLinkTargetByClass(
"ilWikiStatGUI",
"initial")
618 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
619 $this->tabs_gui->addTab(
622 $this->
ctrl->getLinkTargetByClass(
"ilexportgui",
"")
627 if ($ilAccess->checkAccess(
'edit_permission',
"", $this->object->getRefId())) {
628 $this->tabs_gui->addTab(
631 $this->
ctrl->getLinkTargetByClass(
"ilpermissiongui",
"perm")
646 array(
"general_settings",
"style",
"imp_pages",
"rating_categories",
647 "page_templates",
"advmd",
"permission_settings",
"notifications",
"lti_provider")
649 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
653 $lng->
txt(
"wiki_general_settings"),
654 $ilCtrl->getLinkTarget($this,
'editSettings')
659 "permission_settings",
660 $lng->
txt(
"obj_permission_settings"),
661 $this->
ctrl->getLinkTargetByClass(
"ilsettingspermissiongui",
"")
668 $ilCtrl->getLinkTargetByClass(
"ilObjectContentStyleSettingsGUI",
"")
672 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
677 $ilCtrl->getLinkTarget($this,
'editImportantPages')
681 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
685 $lng->
txt(
"wiki_page_templates"),
686 $ilCtrl->getLinkTargetByClass(
"ilwikipagetemplategui",
"")
690 if ($this->
object->getRating() && $this->
object->getRatingCategories()) {
694 $lng->
txt(
"rating_categories"),
695 $ilCtrl->getLinkTargetByClass(array(
'ilratinggui',
'ilratingcategorygui'),
'')
702 $ilCtrl->getLinkTargetByClass(
"ilobjnotificationsettingsgui",
'')
708 if ($lti_settings->hasSettingsAccess()) {
709 $ilTabs->addSubTabTarget(
711 $this->
ctrl->getLinkTargetByClass(ilLTIProviderObjectSettingGUI::class)
715 $ilTabs->activateSubTab($a_active);
732 $ecs->addSettingsToForm($this->form_gui,
'wiki');
747 $ilTabs->activateTab(
"settings");
753 $tit->setRequired(
true);
754 $this->form_gui->addItem($tit);
758 $this->form_gui->addItem($des);
764 $this->form_gui->addItem($intro);
768 if ($a_mode ===
"edit") {
770 foreach ($pages as $p) {
774 $si->setOptions($options);
775 $this->form_gui->addItem($si);
778 if ($a_mode ===
"edit") {
779 $sp->setInfo(
$lng->
txt(
"wiki_start_page_info"));
781 $sp->setMaxLength(200);
782 $sp->setRequired(
true);
783 $this->form_gui->addItem($sp);
788 $this->form_gui->addItem($online);
796 $this->form_gui->addItem($rate);
799 $this->form_gui->addItem($rating);
826 $this->form_gui->addItem($page_toc);
828 if ($a_mode ===
"edit") {
833 $this->form_gui->addItem($link_md);
838 $section->setTitle($this->
lng->txt(
'obj_presentation'));
839 $this->form_gui->addItem($section);
842 $obj_service->commonSettings()->legacyForm($this->form_gui, $this->
object)->addTileImage();
847 $feat->setTitle($this->
lng->txt(
'obj_features'));
848 $this->form_gui->addItem($feat);
863 if ($a_mode !==
"create") {
864 $this->form_gui->setTitle(
$lng->
txt(
"wiki_settings"));
865 $this->form_gui->addCommandButton(
"saveSettings",
$lng->
txt(
"save"));
867 $this->form_gui->setTitle(
$lng->
txt(
"wiki_new"));
868 $this->form_gui->addCommandButton(
"save",
$lng->
txt(
"wiki_add"));
869 $this->form_gui->addCommandButton(
"cancel",
$lng->
txt(
"cancel"));
873 if ($a_mode ===
"create") {
874 $ilCtrl->setParameter($this,
"new_type",
"wiki");
877 $this->form_gui->setFormAction($ilCtrl->getFormAction($this,
"saveSettings"));
883 if ($a_mode ===
"create") {
884 $values[
"rating_new"] =
true;
887 $values[
"rating_overall"] = $parent->selfOrParentWithRatingEnabled();
889 $values[
"online"] = $this->
object->getOnline();
890 $values[
"title"] = $this->
object->getTitle();
893 $values[
"shorttitle"] = $this->
object->getShortTitle();
894 $values[
"description"] = $this->
object->getLongDescription();
895 $values[
"rating_overall"] = $this->
object->getRatingOverall();
896 $values[
"rating"] = $this->
object->getRating();
897 $values[
"rating_new"] = $this->
object->getRatingForNewPages();
898 $values[
"rating_ext"] = $this->
object->getRatingCategories();
899 $values[
"public_notes"] = $this->
object->getPublicNotes();
900 $values[
"intro"] = $this->
object->getIntroduction();
901 $values[
"page_toc"] = $this->
object->getPageToc();
902 $values[
"link_md_values"] = $this->
object->getLinkMetadataValues();
906 $this->form_gui->setValuesByArray($values,
true);
921 if ($this->form_gui->checkInput()) {
923 $this->form_gui->getInput(
"shorttitle") !== $this->
object->getShortTitle()) {
924 $short_item = $this->form_gui->getItemByPostVar(
"shorttitle");
925 $short_item->setAlert(
$lng->
txt(
"wiki_short_title_already_in_use"));
927 $this->
object->setTitle($this->form_gui->getInput(
"title"));
928 $this->
object->setDescription($this->form_gui->getInput(
"description"));
929 $this->
object->setOnline($this->form_gui->getInput(
"online"));
931 $this->
object->setShortTitle((
string) $this->form_gui->getInput(
"shorttitle"));
932 $this->
object->setRatingOverall($this->form_gui->getInput(
"rating_overall"));
933 $this->
object->setRating($this->form_gui->getInput(
"rating"));
935 $this->
object->setRatingForNewPages($this->form_gui->getInput(
"rating_new"));
936 $this->
object->setRatingCategories($this->form_gui->getInput(
"rating_ext"));
939 $this->
object->setPublicNotes($this->form_gui->getInput(
"public_notes"));
941 $this->
object->setIntroduction($this->form_gui->getInput(
"intro"));
942 $this->
object->setPageToc($this->form_gui->getInput(
"page_toc"));
943 $this->
object->setLinkMetadataValues($this->form_gui->getInput(
"link_md_values"));
944 $this->
object->update();
947 $obj_service->commonSettings()->legacyForm($this->form_gui, $this->
object)->saveTileImage();
959 if ($ecs->handleSettingsUpdate()) {
960 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"msg_obj_modified"),
true);
961 $ilCtrl->redirect($this,
"editSettings");
966 $this->form_gui->setValuesByPost();
967 $this->tpl->setContent($this->form_gui->getHTML());
976 $ilTabs->activateTab(
"wiki_contributors");
996 $users = $this->edit_request->getUserIds();
997 $marks = $this->edit_request->getMarks();
998 $comments = $this->edit_request->getComments();
999 $status = $this->edit_request->getStatus();
1002 foreach ($users as $user_id) {
1003 if ($user_id !=
"") {
1009 if ($marks_obj->getMark() !== $new_mark ||
1013 $marks_obj->setMark($new_mark);
1014 $marks_obj->setComment($new_comment);
1015 $marks_obj->update();
1021 $this->tpl->setOnScreenMessage(
'success',
$lng->
txt(
"msg_obj_modified"),
true);
1024 $ilCtrl->redirect($this,
"listContributors");
1032 if (is_object($this->
object)) {
1034 $this->
object->getTitle(),
1035 self::getGotoLink($this->
object->getRefId()),
1037 $this->requested_ref_id
1042 public static function _goto(
string $a_target): void
1045 $main_tpl = $DIC->ui()->mainTemplate();
1047 $ilAccess = $DIC->access();
1048 $lng = $DIC->language();
1049 $ctrl = $DIC->ctrl();
1051 $i = strpos($a_target,
"_");
1054 $a_page = substr($a_target,
$i + 1);
1055 $a_target = substr($a_target, 0,
$i);
1058 if ($a_target ===
"wpage") {
1059 $a_page_arr = explode(
"_", $a_page);
1060 $wpg_id = (
int) $a_page_arr[0];
1068 foreach ($refs as $r) {
1069 if ($ilAccess->checkAccess(
"read",
"", $r)) {
1076 if ($ilAccess->checkAccess(
"read",
"", $a_target)) {
1087 if ($a_page !=
"") {
1089 [
"ilwikihandlergui",
"ilobjwikigui"],
1094 [
"ilwikihandlergui"],
1098 } elseif ($ilAccess->checkAccess(
"visible",
"", $a_target)) {
1101 $main_tpl->setOnScreenMessage(
'failure', sprintf(
1102 $lng->
txt(
"msg_no_perm_read_item"),
1115 if ($a_page ===
"") {
1119 $goto =
"goto.php?target=wiki_" . $a_ref_id .
"_" .
1135 $ilTabs->clearTargets();
1138 $page = ($this->requested_page !==
"")
1139 ? $this->requested_page
1140 : $this->
object->getStartPage();
1143 $page = $this->
object->getStartPage();
1147 $this->tpl->setOnScreenMessage(
'info',
$lng->
txt(
"wiki_no_start_page"),
true);
1148 $ilCtrl->redirect($this,
"infoScreen");
1159 $this->
object->getRefId()
1161 $wpage_gui->setStyleId($this->content_style_domain->getEffectiveStyleId());
1166 $ilCtrl->setCmdClass(
"ilwikipagegui");
1167 $ilCtrl->setCmd(
"preview");
1168 if (!$ilAccess->checkAccess(
"write",
"", $this->object->getRefId()) &&
1170 !$ilAccess->checkAccess(
"edit_content",
"", $this->object->getRefId()) ||
1171 $wpage_gui->getPageObject()->getBlocked()
1173 $wpage_gui->setEnableEditing(
false);
1177 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
1178 $wpage_gui->activateMetaDataEditor($this->
object,
"wpg", $wpage_gui->getId());
1181 $html = $ilCtrl->forwardCommand($wpage_gui);
1257 if ($a_page ===
"") {
1268 if (!$this->
access->checkAccess(
"edit_content",
"", $this->object->getRefId())) {
1269 $this->tpl->setOnScreenMessage(
"failure", $this->
lng->txt(
"no_permission"),
true);
1272 if (!$this->
object->getTemplateSelectionOnCreation()) {
1275 $this->tpl->setOnScreenMessage(
1277 $this->
lng->txt(
"wiki_page_title_too_long") .
" (" . $a_page .
")",
1280 $ilCtrl->setParameterByClass(
1285 $ilCtrl->redirectByClass(
"ilwikipagegui",
"preview");
1287 $this->
object->createWikiPage($a_page);
1291 $ilCtrl->redirectByClass(
"ilwikipagegui",
"edit");
1294 $ilCtrl->setParameter(
1299 $ilCtrl->redirect($this,
"showTemplateSelection");
1332 self::renderSideBlock($a_wpg_id, $this->
object->getRefId());
1343 $lng = $DIC->language();
1344 $ilAccess = $DIC->access();
1345 $ilCtrl = $DIC->ctrl();
1351 $tpl->
addOnLoadCode(
"il.Wiki.Pres.init('" . $ilCtrl->getLinkTargetByClass(
"ilobjwikigui",
"",
"",
false,
false) .
"');");
1353 if ($a_wpg_id > 0 && !$a_wp) {
1362 if ($a_wpg_id > 0) {
1367 $a_wp->getRating()) {
1369 $rgui->setObject($wiki_id,
"wiki", $a_wpg_id,
"wpg");
1371 $rgui->setYourRatingText(
"#");
1372 $rcontent .= $rgui->getBlockHTML(
$lng->
txt(
"wiki_rate_page"));
1378 if ($ilAccess->checkAccess(
"write",
"", $a_wiki_ref_id) ||
1379 $ilAccess->checkAccess(
"edit_page_meta",
"", $a_wiki_ref_id)) {
1381 "edit" => $ilCtrl->getLinkTargetByClass(
"ilwikipagegui",
"editAdvancedMetaData"),
1382 "hide" => $ilCtrl->getLinkTargetByClass(
"ilwikipagegui",
"hideAdvancedMetaData")
1386 $callback = $wiki->getLinkMetadataValues()
1387 ? array($wiki,
"decorateAdvMDValue")
1390 $rcontent .= $mdgui->getBlockHTML($cmd, $callback);
1396 $rcontent .= $imp_pages_block->getHTML();
1399 if ($a_wpg_id > 0) {
1401 $wiki_functions_block->setPageObject($a_wp);
1402 $rcontent .= $wiki_functions_block->getHTML();
1430 $ordering = $this->edit_request->getPrintOrdering();
1433 if (count($ordering) > 0) {
1435 $page_ids = array_keys($ordering);
1438 elseif ($this->edit_request->getWikiPageId()) {
1439 $page_ids = array($this->edit_request->getWikiPageId());
1449 $provider = new \ILIAS\Wiki\WikiPrintViewProviderGUI(
1452 $this->
object->getRefId(),
1456 return new \ILIAS\Export\PrintProcessGUI(
1467 $print_view->sendPrintView();
1479 $ilTabs->setTabActive(
"wiki_search_results");
1481 if ($this->edit_request->getSearchTerm() ===
"") {
1482 $this->tpl->setOnScreenMessage(
'failure',
$lng->
txt(
"wiki_please_enter_search_term"),
true);
1483 $ilCtrl->redirectByClass(
"ilwikipagegui",
"preview");
1488 $this->edit_request->getSearchTerm()
1495 $this->edit_request->getSearchTerm()
1529 $this->tpl->setOnScreenMessage(
'info',
$lng->
txt(
"wiki_navigation_info"));
1532 $ipages_ids = array();
1533 foreach ($ipages as
$i) {
1534 $ipages_ids[] = $i[
"page_id"];
1539 $options = array(
"" =>
$lng->
txt(
"please_select"));
1540 foreach ($pages as $p) {
1541 if (!in_array($p[
"id"], $ipages_ids)) {
1545 if (count($options) > 0) {
1547 $si->setOptions($options);
1549 $ilToolbar->addInputItem($si);
1550 $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
1551 $ilToolbar->addFormButton(
$lng->
txt(
"add"),
"addImportantPage");
1555 $ilTabs->activateTab(
"settings");
1570 $imp_page_id = $this->edit_request->getImportantPageId();
1571 if ($imp_page_id > 0) {
1572 $this->
object->addImportantPage($imp_page_id);
1573 $this->tpl->setOnScreenMessage(
'success',
$lng->
txt(
"wiki_imp_page_added"),
true);
1575 $ilCtrl->redirect($this,
"editImportantPages");
1584 $imp_page_ids = $this->edit_request->getImportantPageIds();
1585 if (count($imp_page_ids) === 0) {
1586 $this->tpl->setOnScreenMessage(
'info',
$lng->
txt(
"no_checkbox"),
true);
1587 $ilCtrl->redirect($this,
"editImportantPages");
1590 $cgui->setFormAction($ilCtrl->getFormAction($this));
1591 $cgui->setHeaderText(
$lng->
txt(
"wiki_sure_remove_imp_pages"));
1592 $cgui->setCancel(
$lng->
txt(
"cancel"),
"editImportantPages");
1593 $cgui->setConfirm(
$lng->
txt(
"remove"),
"removeImportantPages");
1595 foreach ($imp_page_ids as
$i) {
1610 $imp_page_ids = $this->edit_request->getImportantPageIds();
1611 foreach ($imp_page_ids as
$i) {
1612 $this->
object->removeImportantPage((
int) $i);
1614 $this->tpl->setOnScreenMessage(
'success',
$lng->
txt(
"wiki_removed_imp_pages"),
true);
1615 $ilCtrl->redirect($this,
"editImportantPages");
1625 $ordering = $this->edit_request->getImportantPageOrdering();
1626 $indentation = $this->edit_request->getImportantPageIndentation();
1627 $this->
object->saveOrderingAndIndentation($ordering, $indentation);
1628 $this->tpl->setOnScreenMessage(
'success',
$lng->
txt(
"wiki_ordering_and_indent_saved"),
true);
1629 $ilCtrl->redirect($this,
"editImportantPages");
1639 $imp_page_ids = $this->edit_request->getImportantPageIds();
1640 if (count($imp_page_ids) !== 1) {
1641 $this->tpl->setOnScreenMessage(
'info',
$lng->
txt(
"wiki_select_one_item"),
true);
1643 $this->
object->removeImportantPage($imp_page_ids[0]);
1645 $this->
object->update();
1646 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"msg_obj_modified"),
true);
1648 $ilCtrl->redirect($this,
"editImportantPages");
1657 public function exportHTML():
void 1661 $cont_exp =
new Export\WikiHtmlExport($wiki);
1663 $format = explode(
"_", $this->edit_request->getFormat());
1664 if ((
$format[1] ??
"") ===
"comments") {
1665 $cont_exp->setMode(Export\WikiHtmlExport::MODE_COMMENTS);
1668 $cont_exp->buildExportFile();
1679 if ($page->getWikiId() === $a_wiki_id) {
1680 return $page->getTitle();
1707 $ilTabs->clearTargets();
1708 $this->tpl->setOnScreenMessage(
'info',
$lng->
txt(
"wiki_page_not_exist_select_templ"));
1723 $hi->setValue($this->requested_page);
1724 $form->addItem($hi);
1730 if ($this->
object->getEmptyPageTemplate()) {
1732 $radg->addOption($op1);
1737 foreach ($ts as $t) {
1739 $radg->addOption($op);
1742 $form->addItem($radg);
1745 $form->addCommandButton(
"createPageUsingTemplate",
$lng->
txt(
"wiki_create_page"));
1746 $form->addCommandButton(
"cancelCreationPageUsingTemplate",
$lng->
txt(
"cancel"));
1749 $form->setFormAction($ilCtrl->getFormAction($this));
1761 if ($form->checkInput()) {
1762 $a_page = $this->edit_request->getPage();
1763 $this->
object->createWikiPage(
1765 $this->edit_request->getPageTemplateId()
1770 $ilCtrl->redirectByClass(
"ilwikipagegui",
"edit");
1772 $this->tpl->setOnScreenMessage(
'success',
$lng->
txt(
"msg_obj_modified"),
true);
1773 $ilCtrl->redirect($this,
"");
1775 $form->setValuesByPost();
1790 $ilCtrl->redirectByClass(
"ilwikipagegui",
"preview");
1795 if ($perm ===
"create") {
1796 return parent::checkPermissionBool($perm, $cmd,
$type,
$ref_id);
1799 $ref_id = $this->
object->getRefId();
1815 $this->log->debug(
"init: " . $this->req_with_comments);
1817 $this->
object->initUserHTMLExport($this->req_with_comments);
1825 $this->log->debug(
"start: " . $this->req_with_comments);
1827 $this->
object->startUserHTMLExport($this->req_with_comments);
1835 $this->log->debug(
"get progress: " . $this->req_with_comments);
1837 $p = $this->
object->getUserHTMLExportProgress($this->req_with_comments);
1840 $pb->setCurrent($p[
"progress"]);
1843 $r->progressBar = $pb->render();
1844 $r->status = $p[
"status"];
1845 $this->log->debug(
"status: " . $r->status);
1846 echo(json_encode($r, JSON_THROW_ON_ERROR));
1852 $this->log->debug(
"download");
1854 $this->
object->deliverUserHTMLExport();
1859 $this->log->debug(
"download");
1861 $this->
object->deliverUserHTMLExport(
true);
1866 if (!is_object($this->
object)) {
1870 $this->
object->getRefId(),
1871 $this->
user->getId()
1873 if (count($ass_info) > 0) {
1874 $ass_ids = array_map(
static function (
$i):
int {
1879 $this->tool_context->current()->addAdditionalData(
1896 $this->
object->getRefId(),
1897 $this->
user->getId()
1900 foreach ($ass_info as
$i) {
1906 $ilCtrl->setParameterByClass(
"ilwikipagegui",
"ass", $ass->getId());
1907 $submit_link = $ilCtrl->getLinkTargetByClass(
"ilwikipagegui",
"finalizeAssignment");
1908 $ilCtrl->setParameterByClass(
"ilwikipagegui",
"ass",
"");
1910 $buttons[$i->getId()][] = $ui->factory()->button()->primary(
$lng->
txt(
"wiki_finalize_wiki"), $submit_link);
1915 if ($submission->hasSubmitted()) {
1917 if ($submitted[
"ts"] !=
"") {
1918 $ilCtrl->setParameterByClass(
"ilwikipagegui",
"ass", $ass->getId());
1920 $dl_link = $ilCtrl->getLinkTargetByClass(
"ilwikipagegui",
"downloadExcSubFile");
1921 $ilCtrl->setParameterByClass(
"ilwikipagegui",
"ass",
"");
1922 $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...
ILIAS Style Content Object ObjectFacade $content_style_domain
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)
initImportForm(string $new_type)
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...
Class ChatMainBarProvider .
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 getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
static renderSideBlock(int $a_wpg_id, int $a_wiki_ref_id, ?ilWikiPage $a_wp=null)
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
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.
static _getSelectedRecordsByObject(string $a_obj_type, int $a_id, string $a_sub_type="", bool $is_ref_id=true)
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)
static getAllWikiPages(int $a_wiki_id)
static updateServiceSettingsForm(int $obj_id, ilPropertyFormGUI $form, array $services)
downloadUserHTMLExportWithCommentsObject()
static lookupSubObjectTitle(int $a_wiki_id, string $a_page_id)
Get title for wiki page (used in ilNotesGUI)
confirmRemoveImportantPagesObject()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupImportantPagesList(int $a_wiki_id)
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.
static _getPageIdForWikiTitle(int $a_wiki_id, string $a_title)
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)
setDescription(string $desc)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ContextServices $tool_context
static getPageIdForTitle(int $a_wiki_id, string $a_title)
Get wiki page object for id and title.
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...
static checkShortTitleAvailability(string $a_short_title)
static http()
Fetches the global http state from ILIAS.
fillCloneTemplate(?string $tpl_name, string $type)
Fill object clone template This method can be called from any object GUI class that wants to offer ob...
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)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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...
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.
static getInstanceByRefId(int $ref_id, bool $stop_on_error=true)
get an instance of an Ilias object by reference id
cancelCreationPageUsingTemplateObject()
static lookupAdvancedMetadataHidden(int $a_page_id)
initUserHTMLExportObject()
Export html (as user)
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
createPageUsingTemplateObject()
getAssignmentButtons()
Get assignment buttons.
static getRandomPage(int $a_wiki_id)
ilObjectService $object_service
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 getGUIForTitle(int $a_wiki_id, string $a_title, int $a_old_nr=0, int $a_wiki_ref_id=0)
Get wiki page gui for id and title.
static getSyntaxStylePath()
static initServiceSettingsForm(int $obj_id, ilPropertyFormGUI $form, array $services)
showTemplateSelectionObject()
addOnLoadCode(string $a_code, int $a_batch=2)
Add on load code.
ilPropertyFormGUI $form_gui
static getGotoLink(int $a_ref_id, string $a_page="")
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 lookupTitle(int $a_page_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)
__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...
This class represents a text area property in a property form.
const IL_WIKI_ORPHANED_PAGES
addItem(string $a_title, string $a_link, string $a_frame="", int $a_ref_id=0, ?string $type=null)
static _wikiPageExists(int $a_wiki_id, string $a_title)
setRightContent(string $a_html)
Sets content of right column.
initCreationForms(string $new_type)
afterSave(ilObject $new_object)
static check(string $a_perm, int $a_ref_id, string $a_cmd="")
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
static exists(int $a_wiki_id, string $a_title)
Checks whether a page with given title exists.
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)
getSettingsFormValues(string $a_mode="edit")
static getSearchBlockHTML(string $a_title)
saveOrderingAndIndentObject()
addHeaderAction()
Add header action menu.
getAllInfo(int $a_type=self::TYPE_ALL)
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
EditingGUIRequest $edit_request
initSettingsForm(string $a_mode="edit")
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
static _gotoRepositoryRoot(bool $raise_error=false)
Goto repository root.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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)