38 protected \ILIAS\Wiki\InternalDomainService
$domain;
39 protected \ILIAS\Wiki\InternalGUIService
$gui;
41 protected \ILIAS\Wiki\Navigation\ImportantPageManager
$imp_pages;
42 protected \ILIAS\Wiki\Page\PageManager
$pm;
44 protected \ILIAS\HTTP\Services
$http;
51 protected \ILIAS\DI\UIServices
$ui;
60 bool $a_call_by_reference,
61 bool $a_prepare_output =
true 65 $gui = $DIC->wiki()->internal()->gui();
66 $domain = $DIC->wiki()->internal()->domain();
70 $this->
ctrl = $gui->ctrl();
71 $this->
lng = $domain->lng();
72 $this->
tabs = $gui->tabs();
73 $this->
help = $gui->help();
74 $this->
locator = $gui->locator();
75 $this->
http = $gui->http();
76 $this->ot = $gui->wiki()->translation();
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();
124 if ($cmd ===
"printView") {
128 switch ($next_class) {
129 case "ilinfoscreengui":
135 case 'ilpermissiongui':
137 $ilTabs->activateTab(
"perm_settings");
139 $this->
ctrl->forwardCommand($perm_gui);
142 case 'ilsettingspermissiongui':
145 $ilTabs->activateTab(
"settings");
148 $perm_gui->setPermissions(array(
"edit_wiki_navigation",
"add_pages",
"delete_wiki_pages",
"activate_wiki_protection",
149 "wiki_html_export"));
150 $perm_gui->setRoleRequiredPermissions(array(
"edit_content"));
151 $perm_gui->setRoleProhibitedPermissions(array(
"write"));
152 $this->
ctrl->forwardCommand($perm_gui);
155 case 'ilobjecttranslationgui':
158 $ilTabs->activateTab(
"settings");
161 $transgui->setTitleDescrOnlyMode(
false);
162 $this->
ctrl->forwardCommand($transgui);
165 case 'ilwikipagegui':
168 if ($this->edit_request->getWikiPageId() > 0) {
169 $requested_page = $this->pm->getTitle(
170 $this->edit_request->getWikiPageId(),
171 $this->edit_request->getTranslation()
174 $wpage_gui = $this->content_gui->getCurrentPageGUI();
175 $wpage_gui->setStyleId($this->content_style_domain->getEffectiveStyleId());
177 if (!$ilAccess->checkAccess(
"write",
"", $this->object->getRefId()) &&
179 !$ilAccess->checkAccess(
"edit_content",
"", $this->object->getRefId()) ||
180 $wpage_gui->getPageObject()->getBlocked()
182 $wpage_gui->setEnableEditing(
false);
188 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
189 $wpage_gui->activateMetaDataEditor($this->
object,
"wpg", $wpage_gui->getId());
192 $ret = $this->
ctrl->forwardCommand($wpage_gui);
198 case 'ilobjectcopygui':
200 $cp->setType(
'wiki');
201 $this->
ctrl->forwardCommand($cp);
204 case 'ilpublicuserprofilegui':
206 $this->edit_request->getUserId()
208 $ret = $this->
ctrl->forwardCommand($profile_gui);
212 case "ilobjectcontentstylesettingsgui":
215 $ilTabs->activateTab(
"settings");
218 $settings_gui = $this->content_style_gui
219 ->objectSettingsGUIForRefId(
223 $this->
ctrl->forwardCommand($settings_gui);
228 $ilTabs->activateTab(
"export");
230 $exp_gui->addFormat(
"xml");
231 $exp_gui->addFormat(
"html",
"", $this,
"exportHTML");
232 if ($this->
object->isCommentsExportPossible()) {
233 $exp_gui->addFormat(
"html_comments",
"HTML (" . $this->
lng->txt(
"wiki_incl_comments") .
")", $this,
"exportHTML");
235 $this->
ctrl->forwardCommand($exp_gui);
238 case "ilcommonactiondispatchergui":
240 $this->
ctrl->forwardCommand($gui);
247 $ilTabs->activateTab(
"settings");
250 $gui->setObject($this->
object->getId(), $this->
object->getType());
251 $gui->setExportCallback(array($this,
"getSubObjectTitle"), $this->
lng->txt(
"page"));
252 $this->
ctrl->forwardCommand($gui);
255 case "ilwikistatgui":
259 $ilTabs->activateTab(
"statistics");
261 $this->
ctrl->forwardCommand($gui);
264 case "ilwikipagetemplategui":
267 $ilTabs->activateTab(
"settings");
270 $this->
ctrl->forwardCommand($wptgui);
273 case 'ilobjectmetadatagui':
276 $ilTabs->activateTab(
"advmd");
278 $this->
ctrl->forwardCommand($md_gui);
281 case 'ilrepositoryobjectsearchgui':
284 $ilTabs->setTabActive(
"wiki_search_results");
285 $ilCtrl->setReturn($this,
'view');
286 $ilCtrl->setParameterByClass(ilWikiPageGUI::class,
"wpg_id", null);
287 $ilCtrl->setParameterByClass(ilObjWikiGUI::class,
"wpg_id", null);
289 $this->
object->getRefId(),
293 $ilCtrl->forwardCommand($search_gui);
296 case 'ilobjnotificationsettingsgui':
298 $ilTabs->activateTab(
"settings");
301 $this->
ctrl->forwardCommand($gui);
304 case 'illtiproviderobjectsettinggui':
306 $ilTabs->activateTab(
"settings");
310 $lti_gui->offerLTIRolesForSelection(
false);
311 $this->
ctrl->forwardCommand($lti_gui);
320 if ($cmd !==
"cancelObject") {
321 if ($cmd !==
"infoScreenObject") {
322 if (!in_array($cmd, array(
"createObject",
"saveObject",
"importFileObject"))) {
345 $forms = array(self::CFORM_NEW => $this->form_gui,
361 if ($this->form_gui->checkInput()) {
363 $short_item = $this->form_gui->getItemByPostVar(
"shorttitle");
364 $short_item->setAlert(
$lng->
txt(
"wiki_short_title_already_in_use"));
366 parent::saveObject();
371 $this->form_gui->setValuesByPost();
379 $new_object->
setTitle($this->form_gui->getInput(
"title"));
380 $new_object->
setDescription($this->form_gui->getInput(
"description"));
381 $new_object->setIntroduction($this->form_gui->getInput(
"intro"));
382 $new_object->setStartPage($this->form_gui->getInput(
"startpage"));
383 $new_object->setShortTitle((
string) $this->form_gui->getInput(
"shorttitle"));
384 $new_object->setRating($this->form_gui->getInput(
"rating"));
386 $new_object->setRatingForNewPages($this->form_gui->getInput(
"rating_new"));
387 $new_object->setRatingCategories($this->form_gui->getInput(
"rating_ext"));
389 $new_object->setRatingOverall($this->form_gui->getInput(
"rating_overall"));
390 $new_object->setPageToc($this->form_gui->getInput(
"page_toc"));
395 $new_object->setPublicNotes($this->form_gui->getInput(
"public_notes"));
397 $new_object->setOnline($this->form_gui->getInput(
"online"));
401 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"object_added"),
true);
413 $this->
ctrl->setCmd(
"showSummary");
414 $this->
ctrl->setCmdClass(
"ilinfoscreengui");
425 $ilTabs->activateTab(
"info_short");
427 if (!$ilAccess->checkAccess(
"visible",
"", $this->object->getRefId())) {
432 $info->enablePrivateNotes();
433 if (trim($this->
object->getIntroduction()) !==
"") {
434 $info->addSection(
$lng->
txt(
"wiki_introduction"));
435 $info->addProperty(
"", nl2br($this->
object->getIntroduction()));
443 $info->addSection($this->
lng->txt(
"wiki_feedback_from_tutor"));
444 if ($lpcomment !==
"") {
446 $this->
lng->txt(
"wiki_comment"),
452 $this->
lng->txt(
"wiki_mark"),
459 $this->
lng->txt(
"status"),
460 $this->
lng->txt(
"wiki_passed")
465 $this->
lng->txt(
"status"),
466 $this->
lng->txt(
"wiki_failed")
471 if ($ilAccess->checkAccess(
"read",
"", $this->object->getRefId())) {
472 $info->addButton(
$lng->
txt(
"wiki_start_page"), self::getGotoLink($this->
object->getRefId()));
476 $this->
lng->loadLanguageModule(
"meta");
477 $this->
lng->loadLanguageModule(
"wiki");
480 $this->
ctrl->forwardCommand($info);
500 "wiki_what_links_here",
501 $this->
ctrl->getLinkTargetByClass(
509 $this->
ctrl->getLinkTargetByClass(
522 $ilTabs->activateTab(
"wiki_pages");
533 $ilTabs->addSubTabTarget(
535 $this->
ctrl->getLinkTarget($this,
"allPages"),
538 $ilTabs->addSubTabTarget(
539 "wiki_recent_changes",
540 $this->
ctrl->getLinkTarget($this,
"recentChanges"),
543 $ilTabs->addSubTabTarget(
545 $this->
ctrl->getLinkTarget($this,
"newPages"),
548 $ilTabs->addSubTabTarget(
549 "wiki_popular_pages",
550 $this->
ctrl->getLinkTarget($this,
"popularPages"),
553 $ilTabs->addSubTabTarget(
554 "wiki_orphaned_pages",
555 $this->
ctrl->getLinkTarget($this,
"orphanedPages"),
570 if (in_array(strtolower($ilCtrl->getCmdClass()), array(
"",
"ilobjectcontentstylesettingsgui",
"ilobjwikigui",
571 "ilinfoscreengui",
"ilpermissiongui",
"ilexportgui",
"ilratingcategorygui",
"ilobjnotificationsettingsgui",
"iltaxmdgui",
572 "ilwikistatgui",
"ilwikipagetemplategui",
"iladvancedmdsettingsgui",
"ilsettingspermissiongui",
'ilrepositoryobjectsearchgui',
573 'ilobjecttranslationgui' 574 ),
true) || $ilCtrl->getNextClass() ===
"ilpermissiongui") {
575 if ($this->requested_page !==
"") {
576 $page_id = ($this->edit_request->getWikiPageId() > 0)
577 ? $this->edit_request->getWikiPageId()
578 : $this->pm->getPageIdForTitle(
579 $this->requested_page,
580 $this->edit_request->getTranslation()
582 if (is_null($page_id) && $this->edit_request->getFromPage() !==
"") {
583 $page_id = $this->pm->getPageIdForTitle(
584 $this->edit_request->getFromPage(),
585 $this->edit_request->getTranslation()
588 if (!is_null($page_id)) {
589 $this->tabs_gui->setBackTarget(
590 $lng->
txt(
"wiki_last_visited_page"),
591 $this->pm->getPermaLink(
593 $this->edit_request->getTranslation()
600 if ($ilAccess->checkAccess(
'read',
"", $this->object->getRefId())) {
601 $this->tabs_gui->addTab(
604 $this->
ctrl->getLinkTarget($this,
"allPages")
609 if ($ilAccess->checkAccess(
'visible',
"", $this->object->getRefId())) {
610 $this->tabs_gui->addTab(
613 $this->
ctrl->getLinkTargetByClass(
"ilinfoscreengui",
"showSummary")
618 if ($ilAccess->checkAccess(
'write',
"", $this->object->getRefId())) {
619 $this->tabs_gui->addTab(
622 $this->
ctrl->getLinkTarget($this,
"editSettings")
627 $mdtab = $mdgui->getTab();
629 $this->tabs_gui->addTab(
631 $this->
lng->txt(
"meta_data"),
638 if ($ilAccess->checkAccess(
'write',
"", $this->object->getRefId())) {
639 $this->tabs_gui->addTab(
641 $lng->
txt(
"wiki_contributors"),
642 $this->
ctrl->getLinkTarget($this,
"listContributors")
647 if ($ilAccess->checkAccess(
'statistics_read',
"", $this->object->getRefId())) {
648 $this->tabs_gui->addTab(
651 $this->
ctrl->getLinkTargetByClass(
"ilWikiStatGUI",
"initial")
655 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
656 $this->tabs_gui->addTab(
659 $this->
ctrl->getLinkTargetByClass(
"ilexportgui",
"")
664 if ($ilAccess->checkAccess(
'edit_permission',
"", $this->object->getRefId())) {
665 $this->tabs_gui->addTab(
668 $this->
ctrl->getLinkTargetByClass(
"ilpermissiongui",
"perm")
682 array(
"general_settings",
"style",
"imp_pages",
"rating_categories",
"obj_multilinguality",
683 "page_templates",
"advmd",
"permission_settings",
"notifications",
"lti_provider")
685 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
689 $lng->
txt(
"wiki_general_settings"),
690 $ilCtrl->getLinkTarget($this,
'editSettings')
695 "permission_settings",
696 $lng->
txt(
"obj_permission_settings"),
697 $this->
ctrl->getLinkTargetByClass(
"ilsettingspermissiongui",
"")
704 $ilCtrl->getLinkTargetByClass(
"ilObjectContentStyleSettingsGUI",
"")
708 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
713 $ilCtrl->getLinkTarget($this,
'editImportantPages')
717 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
721 $lng->
txt(
"wiki_page_templates"),
722 $ilCtrl->getLinkTargetByClass(
"ilwikipagetemplategui",
"")
726 if ($this->
object->getRating() && $this->
object->getRatingCategories()) {
730 $lng->
txt(
"rating_categories"),
731 $ilCtrl->getLinkTargetByClass(array(
'ilratinggui',
'ilratingcategorygui'),
'')
738 $ilCtrl->getLinkTargetByClass(
"ilobjnotificationsettingsgui",
'')
742 'obj_multilinguality',
743 $lng->
txt(
"obj_multilinguality"),
744 $this->
ctrl->getLinkTargetByClass(
"ilobjecttranslationgui",
"")
750 if ($lti_settings->hasSettingsAccess()) {
751 $ilTabs->addSubTabTarget(
753 $this->
ctrl->getLinkTargetByClass(ilLTIProviderObjectSettingGUI::class)
757 $ilTabs->activateSubTab($a_active);
774 $ecs->addSettingsToForm($this->form_gui,
'wiki');
789 $ilTabs->activateTab(
"settings");
795 $tit->setRequired(
true);
796 $this->form_gui->addItem($tit);
800 $this->form_gui->addItem($des);
806 $this->form_gui->addItem($intro);
810 if ($a_mode ===
"edit") {
811 foreach ($this->pm->getWikiPages() as $page) {
816 $this->form_gui->addItem($si);
819 if ($a_mode ===
"edit") {
820 $sp->setInfo(
$lng->
txt(
"wiki_start_page_info"));
822 $sp->setMaxLength(200);
823 $sp->setRequired(
true);
824 $this->form_gui->addItem($sp);
829 $this->form_gui->addItem($online);
836 $rate->setInfo(
$lng->
txt(
'rating_activate_rating_info'));
837 $this->form_gui->addItem($rate);
840 $this->form_gui->addItem($rating);
848 $rating->addSubItem($new);
851 $rating->addSubItem($extended);
866 $page_toc->setInfo(
$lng->
txt(
"wiki_page_toc_info"));
867 $this->form_gui->addItem($page_toc);
869 if ($a_mode ===
"edit") {
873 $link_md->setInfo(
$lng->
txt(
"wiki_link_md_values_info"));
874 $this->form_gui->addItem($link_md);
879 $section->setTitle($this->
lng->txt(
'obj_presentation'));
880 $this->form_gui->addItem($section);
883 $obj_service->commonSettings()->legacyForm($this->form_gui, $this->
object)->addTileImage();
888 $feat->setTitle($this->
lng->txt(
'obj_features'));
889 $this->form_gui->addItem($feat);
904 if ($a_mode !==
"create") {
905 $this->form_gui->setTitle(
$lng->
txt(
"wiki_settings"));
906 $this->form_gui->addCommandButton(
"saveSettings",
$lng->
txt(
"save"));
908 $this->form_gui->setTitle(
$lng->
txt(
"wiki_new"));
909 $this->form_gui->addCommandButton(
"save",
$lng->
txt(
"wiki_add"));
910 $this->form_gui->addCommandButton(
"cancel",
$lng->
txt(
"cancel"));
914 if ($a_mode ===
"create") {
915 $ilCtrl->setParameter($this,
"new_type",
"wiki");
918 $this->form_gui->setFormAction($ilCtrl->getFormAction($this,
"saveSettings"));
924 if ($a_mode ===
"create") {
925 $values[
"rating_new"] =
true;
928 $values[
"rating_overall"] = $parent->selfOrParentWithRatingEnabled();
930 $values[
"online"] = $this->
object->getOnline();
931 $values[
"title"] = $this->
object->getTitle();
934 $values[
"shorttitle"] = $this->
object->getShortTitle();
935 $values[
"description"] = $this->
object->getLongDescription();
936 $values[
"rating_overall"] = $this->
object->getRatingOverall();
937 $values[
"rating"] = $this->
object->getRating();
938 $values[
"rating_new"] = $this->
object->getRatingForNewPages();
939 $values[
"rating_ext"] = $this->
object->getRatingCategories();
940 $values[
"public_notes"] = $this->
object->getPublicNotes();
941 $values[
"intro"] = $this->
object->getIntroduction();
942 $values[
"page_toc"] = $this->
object->getPageToc();
943 $values[
"link_md_values"] = $this->
object->getLinkMetadataValues();
947 $this->form_gui->setValuesByArray($values,
true);
962 if ($this->form_gui->checkInput()) {
964 $this->form_gui->getInput(
"shorttitle") !== $this->
object->getShortTitle()) {
965 $short_item = $this->form_gui->getItemByPostVar(
"shorttitle");
966 $short_item->setAlert(
$lng->
txt(
"wiki_short_title_already_in_use"));
968 $this->
object->setTitle($this->form_gui->getInput(
"title"));
969 $this->
object->setDescription($this->form_gui->getInput(
"description"));
970 $this->
object->setOnline($this->form_gui->getInput(
"online"));
972 $this->
object->setShortTitle((
string) $this->form_gui->getInput(
"shorttitle"));
973 $this->
object->setRatingOverall($this->form_gui->getInput(
"rating_overall"));
974 $this->
object->setRating($this->form_gui->getInput(
"rating"));
976 $this->
object->setRatingForNewPages($this->form_gui->getInput(
"rating_new"));
977 $this->
object->setRatingCategories($this->form_gui->getInput(
"rating_ext"));
980 $this->
object->setPublicNotes($this->form_gui->getInput(
"public_notes"));
982 $this->
object->setIntroduction($this->form_gui->getInput(
"intro"));
983 $this->
object->setPageToc($this->form_gui->getInput(
"page_toc"));
984 $this->
object->setLinkMetadataValues($this->form_gui->getInput(
"link_md_values"));
985 $this->
object->update();
988 $obj_service->commonSettings()->legacyForm($this->form_gui, $this->
object)->saveTileImage();
1000 if ($ecs->handleSettingsUpdate($this->form_gui)) {
1001 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"msg_obj_modified"),
true);
1002 $ilCtrl->redirect($this,
"editSettings");
1007 $this->form_gui->setValuesByPost();
1008 $this->tpl->setContent($this->form_gui->getHTML());
1017 $ilTabs->activateTab(
"wiki_contributors");
1037 $users = $this->edit_request->getUserIds();
1038 $marks = $this->edit_request->getMarks();
1039 $comments = $this->edit_request->getComments();
1040 $status = $this->edit_request->getStatus();
1043 foreach ($users as $user_id) {
1044 if ($user_id !=
"") {
1050 if ($marks_obj->getMark() !== $new_mark ||
1054 $marks_obj->setMark($new_mark);
1055 $marks_obj->setComment($new_comment);
1056 $marks_obj->update();
1062 $this->tpl->setOnScreenMessage(
'success',
$lng->
txt(
"msg_obj_modified"),
true);
1065 $ilCtrl->redirect($this,
"listContributors");
1073 if (is_object($this->
object)) {
1075 $this->
object->getTitle(),
1076 self::getGotoLink($this->
object->getRefId()),
1078 $this->requested_ref_id
1083 public static function _goto(
string $a_target): void
1086 $main_tpl = $DIC->ui()->mainTemplate();
1090 $ilAccess = $DIC->access();
1091 $lng = $DIC->language();
1092 $ctrl = $DIC->ctrl();
1093 $transl = $DIC->wiki()->internal()->gui()->request()->getTranslation();
1097 $i = strpos($a_target,
"_");
1100 $a_page = substr($a_target, $i + 1);
1101 $a_target = substr($a_target, 0, $i);
1104 if ($a_target ===
"wpage") {
1105 $a_page_arr = explode(
"_", $a_page);
1106 $wpg_id = (
int) $a_page_arr[0];
1108 $lang = ($a_page_arr[2] ??
"");
1115 foreach ($refs as
$r) {
1116 if ($ilAccess->checkAccess(
"read",
"", $r)) {
1123 if ($ilAccess->checkAccess(
"read",
"", $a_target)) {
1149 if ($a_page !=
"") {
1151 [
"ilwikihandlergui",
"ilobjwikigui"],
1156 [
"ilwikihandlergui"],
1160 } elseif ($ilAccess->checkAccess(
"visible",
"", $a_target)) {
1163 $main_tpl->setOnScreenMessage(
'failure', sprintf(
1164 $lng->
txt(
"msg_no_perm_read_item"),
1175 string $a_page =
"",
1178 if ($a_page ===
"") {
1182 $append = (!in_array(
$lang, [
"",
"-"]))
1183 ?
"&transl=" .
$lang 1185 $goto =
"goto.php?target=wiki_" . $a_ref_id .
"_" .
1200 $ilTabs->clearTargets();
1203 $wpage_gui = $this->gui->content()->getCurrentPageGUI();
1206 $ilCtrl->setParameter(
1212 $wpage_gui->setStyleId($this->content_style_domain->getEffectiveStyleId());
1217 $ilCtrl->setCmdClass(
"ilwikipagegui");
1218 $ilCtrl->setCmd(
"preview");
1219 if (!$ilAccess->checkAccess(
"write",
"", $this->object->getRefId()) &&
1221 !$ilAccess->checkAccess(
"edit_content",
"", $this->object->getRefId()) ||
1222 $wpage_gui->getPageObject()->getBlocked()
1224 $wpage_gui->setEnableEditing(
false);
1228 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
1229 $wpage_gui->activateMetaDataEditor($this->
object,
"wpg", $wpage_gui->getId());
1232 $html = $ilCtrl->forwardCommand($wpage_gui);
1308 if ($a_page ===
"") {
1312 if ($this->pm->existsByTitle(
1314 $this->edit_request->getTranslation()
1317 ilUtil::redirect(self::getGotoLink($this->
object->getRefId(), $a_page, $this->edit_request->getTranslation()));
1319 if (!$this->
access->checkAccess(
"add_pages",
"", $this->object->getRefId())) {
1320 $this->tpl->setOnScreenMessage(
"failure", $this->
lng->txt(
"no_permission"),
true);
1321 $from_page_id = $this->pm->getPageIdForTitle($this->edit_request->getFromPage(), $this->edit_request->getTranslation());
1322 ilUtil::redirect($this->pm->getPermaLink($from_page_id, $this->edit_request->getTranslation()));
1327 if (!$this->
object->getTemplateSelectionOnCreation()) {
1330 $this->tpl->setOnScreenMessage(
1332 $this->
lng->txt(
"wiki_page_title_too_long") .
" (" . $a_page .
")",
1335 $ilCtrl->setParameterByClass(
1340 $ilCtrl->redirectByClass(
"ilwikipagegui",
"preview");
1343 $this->pm->createWikiPage(
1346 $this->edit_request->getTranslation()
1351 $ilCtrl->redirectByClass(
"ilwikipagegui",
"edit");
1354 $ilCtrl->setParameter(
1359 $ilCtrl->redirect($this,
"showTemplateSelection");
1366 if (in_array($this->edit_request->getTranslation(), [
"-",
""])) {
1373 $this->edit_request->getTranslation()
1375 $this->tabs_gui->clearTargets();
1376 $this->tabs_gui->setBackTarget(
1377 $this->
lng->txt(
"back"),
1378 $this->pm->getPermaLink(
1379 $this->pm->getPageIdForTitle(
1380 $this->edit_request->getFromPage(),
1381 $this->edit_request->getTranslation()
1383 $this->edit_request->getTranslation()
1395 $mess = $this->gui->ui()->factory()->messageBox()->info(
1396 $this->
lng->txt(
"wiki_translate_page_master_info")
1398 return $this->gui->ui()->renderer()->render($mess);
1403 $pm = $this->domain->page()->page($this->
object->getRefId());
1405 foreach ($pm->getMasterPagesWithoutTranslation($this->edit_request->getTranslation()) as $page) {
1406 $options[$page->getId()] = $page->getTitle();
1408 $append =
" '" . $this->edit_request->getPage() .
"'";
1409 $append .=
" (" . $this->
lng->txt(
"meta_l_" . $this->edit_request->getTranslation()) .
")";
1410 $append2 =
" (" . $this->
lng->txt(
"meta_l_" . $this->ot->getMasterLanguage()) .
")";
1411 $form = $this->gui->form([self::class],
"createNewTranslatedPage")
1412 ->section(
"sec", $this->
lng->txt(
"wiki_translation_page") . $append)
1413 ->
switch(
"type", $this->
lng->txt(
"wiki_page_in_master_language") . $append2,
"",
"existing")
1414 ->group(
"existing", $this->
lng->txt(
"wiki_master_existing"))
1415 ->select(
"master_id", $this->
lng->txt(
"wiki_master_title"), $options)
1417 ->group(
"new", $this->
lng->txt(
"wiki_no_master"))
1418 ->text(
"master_title", $this->
lng->txt(
"wiki_master_title"))
1421 if ($this->
object->getTemplateSelectionOnCreation($this->edit_request->getTranslation())) {
1422 $form = $form->radio(
"page_templ", $this->
lng->txt(
"wiki_page_template"),
"",
"0")->required();
1423 if ($this->
object->getEmptyPageTemplate()) {
1424 $form = $form->radioOption(
"0", $this->
lng->txt(
"wiki_empty_page"));
1428 foreach ($ts as $t) {
1429 $form = $form->radioOption($t[
"wpage_id"], $t[
"title"]);
1439 if ($form->isValid()) {
1440 $page_template_id = 0;
1441 if ($this->
object->getTemplateSelectionOnCreation($this->edit_request->getTranslation())) {
1442 $page_template_id = (
int) $form->getData(
"page_templ");
1444 if ($form->getData(
"type") ===
"new") {
1445 $wpg_id = $this->pm->createWikiPage(
1446 $form->getData(
"master_title")
1449 $wpg_id = $form->getData(
"master_id");
1451 $wpg_id = $this->pm->createWikiPage(
1452 $this->edit_request->getPage(),
1454 $this->edit_request->getTranslation(),
1458 $this->
ctrl->setParameterByClass(ilWikiPageGUI::class,
"wpg_id", $wpg_id);
1459 $this->
ctrl->redirectByClass(ilWikiPageGUI::class,
"preview");
1490 self::renderSideBlock($a_wpg_id, $this->
object->getRefId());
1501 $lng = $DIC->language();
1502 $ilAccess = $DIC->access();
1503 $ilCtrl = $DIC->ctrl();
1509 $tpl->
addOnLoadCode(
"il.Wiki.Pres.init('" . $ilCtrl->getLinkTargetByClass(
"ilobjwikigui",
"",
"",
false,
false) .
"');");
1511 if ($a_wpg_id > 0 && !$a_wp) {
1520 if ($a_wpg_id > 0) {
1525 $a_wp->getRating()) {
1527 $rgui->setObject($wiki_id,
"wiki", $a_wpg_id,
"wpg");
1529 $rgui->setYourRatingText(
"#");
1530 $rcontent .= $rgui->getBlockHTML(
$lng->
txt(
"wiki_rate_page"));
1536 if ($ilAccess->checkAccess(
"write",
"", $a_wiki_ref_id) ||
1537 $ilAccess->checkAccess(
"edit_page_meta",
"", $a_wiki_ref_id)) {
1539 "edit" => $ilCtrl->getLinkTargetByClass(
"ilwikipagegui",
"editAdvancedMetaData"),
1540 "hide" => $ilCtrl->getLinkTargetByClass(
"ilwikipagegui",
"hideAdvancedMetaData")
1544 $callback = $wiki->getLinkMetadataValues()
1545 ? array($wiki,
"decorateAdvMDValue")
1548 $rcontent .= $mdgui->getBlockHTML($cmd, $callback);
1554 $rcontent .= $imp_pages_block->getHTML();
1557 if ($a_wpg_id > 0) {
1559 $wiki_functions_block->setPageObject($a_wp);
1560 $rcontent .= $wiki_functions_block->getHTML();
1588 $ordering = $this->edit_request->getPrintOrdering();
1591 if (count($ordering) > 0) {
1593 $page_ids = array_keys($ordering);
1596 elseif ($this->edit_request->getWikiPageId()) {
1597 $page_ids = array($this->edit_request->getWikiPageId());
1607 $provider = new \ILIAS\Wiki\WikiPrintViewProviderGUI(
1610 $this->
object->getRefId(),
1614 return new \ILIAS\Export\PrintProcessGUI(
1625 $print_view->sendPrintView();
1637 $ilTabs->setTabActive(
"wiki_search_results");
1639 if ($this->edit_request->getSearchTerm() ===
"") {
1640 $this->tpl->setOnScreenMessage(
'failure',
$lng->
txt(
"wiki_please_enter_search_term"),
true);
1641 $ilCtrl->redirectByClass(
"ilwikipagegui",
"preview");
1646 $this->edit_request->getSearchTerm()
1653 $this->edit_request->getSearchTerm()
1687 $this->tpl->setOnScreenMessage(
'info',
$lng->
txt(
"wiki_navigation_info"));
1689 $ipages_ids = $this->imp_pages->getImportantPageIds();
1692 $pages = $this->pm->getAllPagesInfo();
1693 $options = array(
"" =>
$lng->
txt(
"please_select"));
1694 foreach ($pages as $p) {
1695 if (!in_array($p->getId(), $ipages_ids)) {
1699 if (count($options) > 0) {
1703 $ilToolbar->addInputItem($si);
1704 $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
1705 $ilToolbar->addFormButton(
$lng->
txt(
"add"),
"addImportantPage");
1709 $ilTabs->activateTab(
"settings");
1724 $imp_page_id = $this->edit_request->getImportantPageId();
1725 if ($imp_page_id > 0) {
1726 $this->imp_pages->add($imp_page_id);
1727 $this->tpl->setOnScreenMessage(
'success',
$lng->
txt(
"wiki_imp_page_added"),
true);
1729 $ilCtrl->redirect($this,
"editImportantPages");
1738 $imp_page_ids = $this->edit_request->getImportantPageIds();
1739 if (count($imp_page_ids) === 0) {
1740 $this->tpl->setOnScreenMessage(
'info',
$lng->
txt(
"no_checkbox"),
true);
1741 $ilCtrl->redirect($this,
"editImportantPages");
1744 $cgui->setFormAction($ilCtrl->getFormAction($this));
1745 $cgui->setHeaderText(
$lng->
txt(
"wiki_sure_remove_imp_pages"));
1746 $cgui->setCancel(
$lng->
txt(
"cancel"),
"editImportantPages");
1747 $cgui->setConfirm(
$lng->
txt(
"remove"),
"removeImportantPages");
1749 foreach ($imp_page_ids as $i) {
1764 $imp_page_ids = $this->edit_request->getImportantPageIds();
1765 foreach ($imp_page_ids as $i) {
1766 $this->imp_pages->removeImportantPage($i);
1768 $this->tpl->setOnScreenMessage(
'success',
$lng->
txt(
"wiki_removed_imp_pages"),
true);
1769 $ilCtrl->redirect($this,
"editImportantPages");
1779 $ordering = $this->edit_request->getImportantPageOrdering();
1780 $indentation = $this->edit_request->getImportantPageIndentation();
1781 $this->imp_pages->saveOrderingAndIndentation($ordering, $indentation);
1782 $this->tpl->setOnScreenMessage(
'success',
$lng->
txt(
"wiki_ordering_and_indent_saved"),
true);
1783 $ilCtrl->redirect($this,
"editImportantPages");
1793 $imp_page_ids = $this->edit_request->getImportantPageIds();
1794 if (count($imp_page_ids) !== 1) {
1795 $this->tpl->setOnScreenMessage(
'info',
$lng->
txt(
"wiki_select_one_item"),
true);
1797 $this->imp_pages->removeImportantPage($imp_page_ids[0]);
1799 $this->
object->update();
1800 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"msg_obj_modified"),
true);
1802 $ilCtrl->redirect($this,
"editImportantPages");
1811 public function exportHTML():
void 1815 $cont_exp =
new Export\WikiHtmlExport($wiki);
1817 $format = explode(
"_", $this->edit_request->getFormat());
1818 if (($format[1] ??
"") ===
"comments") {
1819 $cont_exp->setMode(Export\WikiHtmlExport::MODE_COMMENTS);
1822 $cont_exp->buildExportFile();
1833 if ($page->getWikiId() === $a_wiki_id) {
1834 return $page->getTitle();
1861 $ilTabs->clearTargets();
1862 $this->tpl->setOnScreenMessage(
'info',
$lng->
txt(
"wiki_page_not_exist_select_templ"));
1877 $hi->setValue($this->requested_page);
1878 $form->addItem($hi);
1884 if ($this->
object->getEmptyPageTemplate()) {
1886 $radg->addOption($op1);
1891 foreach ($ts as $t) {
1893 $radg->addOption($op);
1896 $form->addItem($radg);
1899 $form->addCommandButton(
"createPageUsingTemplate",
$lng->
txt(
"wiki_create_page"));
1900 $form->addCommandButton(
"cancelCreationPageUsingTemplate",
$lng->
txt(
"cancel"));
1903 $form->setFormAction($ilCtrl->getFormAction($this));
1915 if ($form->checkInput()) {
1916 $a_page = $this->edit_request->getPage();
1917 $this->pm->createWikiPage(
1920 $this->edit_request->getTranslation(),
1921 $this->edit_request->getPageTemplateId()
1926 $ilCtrl->redirectByClass(
"ilwikipagegui",
"edit");
1928 $this->tpl->setOnScreenMessage(
'success',
$lng->
txt(
"msg_obj_modified"),
true);
1929 $ilCtrl->redirect($this,
"");
1931 $form->setValuesByPost();
1946 $ilCtrl->redirectByClass(
"ilwikipagegui",
"preview");
1951 if ($perm ===
"create") {
1952 return parent::checkPermissionBool($perm, $cmd,
$type,
$ref_id);
1955 $ref_id = $this->
object->getRefId();
1983 $this->log->debug(
"init: " . $this->req_with_comments);
1985 $this->
object->initUserHTMLExport($this->req_with_comments);
1993 $this->log->debug(
"start: " . $this->req_with_comments);
1995 $this->
object->startUserHTMLExport($this->req_with_comments);
2003 $this->log->debug(
"get progress: " . $this->req_with_comments);
2005 $p = $this->
object->getUserHTMLExportProgress($this->req_with_comments);
2008 $pb->setCurrent($p[
"progress"]);
2011 $r->progressBar = $pb->render();
2012 $r->status = $p[
"status"];
2013 $this->log->debug(
"status: " .
$r->status);
2014 echo(json_encode(
$r, JSON_THROW_ON_ERROR));
2020 $this->log->debug(
"download");
2022 $this->
object->deliverUserHTMLExport();
2027 $this->log->debug(
"download");
2029 $this->
object->deliverUserHTMLExport(
true);
2034 if (!is_object($this->
object)) {
2038 $this->
object->getRefId(),
2039 $this->
user->getId()
2041 if (count($ass_info) > 0) {
2042 $ass_ids = array_map(
static function ($i):
int {
2047 $this->tool_context->current()->addAdditionalData(
2064 $this->
object->getRefId(),
2065 $this->
user->getId()
2068 foreach ($ass_info as $i) {
2074 $ilCtrl->setParameterByClass(
"ilwikipagegui",
"ass", $ass->getId());
2075 $submit_link = $ilCtrl->getLinkTargetByClass(
"ilwikipagegui",
"finalizeAssignment");
2076 $ilCtrl->setParameterByClass(
"ilwikipagegui",
"ass",
"");
2078 $buttons[$i->getId()][] = $ui->factory()->button()->primary(
$lng->
txt(
"wiki_finalize_wiki"), $submit_link);
2083 if ($submission->hasSubmitted()) {
2085 if ($submitted[
"ts"] !=
"") {
2086 $ilCtrl->setParameterByClass(
"ilwikipagegui",
"ass", $ass->getId());
2088 $dl_link = $ilCtrl->getLinkTargetByClass(
"ilwikipagegui",
"downloadExcSubFile");
2089 $ilCtrl->setParameterByClass(
"ilwikipagegui",
"ass",
"");
2090 $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)
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)
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
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 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)
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.
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)
Export User Interface Class.
ContextServices $tool_context
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...
GUI class for public user profile presentation.
static checkShortTitleAvailability(string $a_short_title)
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)
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...
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()
Current process:
createPageUsingTemplateObject()
getAssignmentButtons()
Get assignment buttons.
ILIAS Wiki Navigation ImportantPageManager $imp_pages
static getRandomPage(int $a_wiki_id)
ilObjectService $object_service
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
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
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="-")
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
ILIAS Wiki InternalDomainService $domain
addItem(string $a_title, string $a_link, string $a_frame="", int $a_ref_id=0, ?string $type=null)
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)
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.
createNewTranslatedPageObject()
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
setDescription(string $description)
initSettingsForm(string $a_mode="edit")
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)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...