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();
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);
165 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
166 $wpage_gui->activateMetaDataEditor($this->
object,
"wpg", $wpage_gui->getId());
169 $ret = $this->
ctrl->forwardCommand($wpage_gui);
175 case 'ilobjectcopygui':
177 $cp->setType(
'wiki');
178 $this->
ctrl->forwardCommand($cp);
181 case 'ilpublicuserprofilegui':
183 $this->edit_request->getUserId()
185 $ret = $this->
ctrl->forwardCommand($profile_gui);
189 case "ilobjectcontentstylesettingsgui":
192 $ilTabs->activateTab(
"settings");
195 $settings_gui = $this->content_style_gui
196 ->objectSettingsGUIForRefId(
200 $this->
ctrl->forwardCommand($settings_gui);
205 $ilTabs->activateTab(
"export");
207 $exp_gui->addFormat(
"xml");
208 $exp_gui->addFormat(
"html",
"", $this,
"exportHTML");
209 if ($this->
object->isCommentsExportPossible()) {
210 $exp_gui->addFormat(
"html_comments",
"HTML (" . $this->
lng->txt(
"wiki_incl_comments") .
")", $this,
"exportHTML");
212 $this->
ctrl->forwardCommand($exp_gui);
215 case "ilcommonactiondispatchergui":
217 $this->
ctrl->forwardCommand($gui);
224 $ilTabs->activateTab(
"settings");
227 $gui->setObject($this->
object->getId(), $this->object->getType());
228 $gui->setExportCallback(array($this,
"getSubObjectTitle"), $this->
lng->txt(
"page"));
229 $this->
ctrl->forwardCommand($gui);
232 case "ilwikistatgui":
236 $ilTabs->activateTab(
"statistics");
238 $this->
ctrl->forwardCommand($gui);
241 case "ilwikipagetemplategui":
244 $ilTabs->activateTab(
"settings");
247 $this->
ctrl->forwardCommand($wptgui);
250 case 'ilobjectmetadatagui':
253 $ilTabs->activateTab(
"advmd");
255 $this->
ctrl->forwardCommand($md_gui);
258 case 'ilrepositoryobjectsearchgui':
262 $ilTabs->setTabActive(
"wiki_search_results");
263 $ilCtrl->setReturn($this,
'view');
265 $this->
object->getRefId(),
269 $ilCtrl->forwardCommand($search_gui);
272 case 'ilobjnotificationsettingsgui':
275 $ilTabs->activateTab(
"settings");
278 $this->
ctrl->forwardCommand($gui);
281 case 'illtiproviderobjectsettinggui':
284 $ilTabs->activateTab(
"settings");
287 $lti_gui->setCustomRolesForSelection(
$GLOBALS[
'DIC']->
rbac()->review()->getLocalRoles($this->
object->getRefId()));
288 $lti_gui->offerLTIRolesForSelection(
false);
289 $this->
ctrl->forwardCommand($lti_gui);
298 if ($cmd !==
"cancelObject") {
299 if ($cmd !==
"infoScreenObject") {
300 if (!in_array($cmd, array(
"createObject",
"saveObject",
"importFileObject"))) {
323 $forms = array(self::CFORM_NEW => $this->form_gui,
340 if ($this->form_gui->checkInput()) {
342 $short_item = $this->form_gui->getItemByPostVar(
"shorttitle");
343 $short_item->setAlert(
$lng->
txt(
"wiki_short_title_already_in_use"));
345 parent::saveObject();
350 $this->form_gui->setValuesByPost();
358 $new_object->
setTitle($this->form_gui->getInput(
"title"));
359 $new_object->
setDescription($this->form_gui->getInput(
"description"));
360 $new_object->setIntroduction($this->form_gui->getInput(
"intro"));
361 $new_object->setStartPage($this->form_gui->getInput(
"startpage"));
362 $new_object->setShortTitle((
string) $this->form_gui->getInput(
"shorttitle"));
363 $new_object->setRating($this->form_gui->getInput(
"rating"));
365 $new_object->setRatingForNewPages($this->form_gui->getInput(
"rating_new"));
366 $new_object->setRatingCategories($this->form_gui->getInput(
"rating_ext"));
368 $new_object->setRatingOverall($this->form_gui->getInput(
"rating_overall"));
369 $new_object->setPageToc($this->form_gui->getInput(
"page_toc"));
374 $new_object->setPublicNotes($this->form_gui->getInput(
"public_notes"));
376 $new_object->setOnline($this->form_gui->getInput(
"online"));
380 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"object_added"),
true);
392 $this->
ctrl->setCmd(
"showSummary");
393 $this->
ctrl->setCmdClass(
"ilinfoscreengui");
404 $ilTabs->activateTab(
"info_short");
406 if (!$ilAccess->checkAccess(
"visible",
"", $this->object->getRefId())) {
411 $info->enablePrivateNotes();
412 if (trim($this->
object->getIntroduction()) !==
"") {
413 $info->addSection(
$lng->
txt(
"wiki_introduction"));
414 $info->addProperty(
"", nl2br($this->
object->getIntroduction()));
422 $info->addSection($this->
lng->txt(
"wiki_feedback_from_tutor"));
423 if ($lpcomment !==
"") {
425 $this->
lng->txt(
"wiki_comment"),
431 $this->
lng->txt(
"wiki_mark"),
438 $this->
lng->txt(
"status"),
439 $this->lng->txt(
"wiki_passed")
444 $this->
lng->txt(
"status"),
445 $this->lng->txt(
"wiki_failed")
450 if ($ilAccess->checkAccess(
"read",
"", $this->object->getRefId())) {
451 $info->addButton(
$lng->
txt(
"wiki_start_page"), self::getGotoLink($this->object->getRefId()));
455 $this->
lng->loadLanguageModule(
"meta");
456 $this->
lng->loadLanguageModule(
"wiki");
459 $this->
ctrl->forwardCommand($info);
479 "wiki_what_links_here",
480 $this->
ctrl->getLinkTargetByClass(
488 $this->
ctrl->getLinkTargetByClass(
501 $ilTabs->activateTab(
"wiki_pages");
512 $ilTabs->addSubTabTarget(
514 $this->
ctrl->getLinkTarget($this,
"allPages"),
517 $ilTabs->addSubTabTarget(
518 "wiki_recent_changes",
519 $this->
ctrl->getLinkTarget($this,
"recentChanges"),
522 $ilTabs->addSubTabTarget(
524 $this->
ctrl->getLinkTarget($this,
"newPages"),
527 $ilTabs->addSubTabTarget(
528 "wiki_popular_pages",
529 $this->
ctrl->getLinkTarget($this,
"popularPages"),
532 $ilTabs->addSubTabTarget(
533 "wiki_orphaned_pages",
534 $this->
ctrl->getLinkTarget($this,
"orphanedPages"),
549 if (in_array(strtolower($ilCtrl->getCmdClass()), array(
"",
"ilobjectcontentstylesettingsgui",
"ilobjwikigui",
550 "ilinfoscreengui",
"ilpermissiongui",
"ilexportgui",
"ilratingcategorygui",
"ilobjnotificationsettingsgui",
"iltaxmdgui",
551 "ilwikistatgui",
"ilwikipagetemplategui",
"iladvancedmdsettingsgui",
"ilsettingspermissiongui",
'ilrepositoryobjectsearchgui'
552 ),
true) || $ilCtrl->getNextClass() ===
"ilpermissiongui") {
553 if ($this->requested_page !==
"") {
554 $this->tabs_gui->setBackTarget(
555 $lng->
txt(
"wiki_last_visited_page"),
557 $this->requested_ref_id,
564 if ($ilAccess->checkAccess(
'read',
"", $this->object->getRefId())) {
565 $this->tabs_gui->addTab(
568 $this->ctrl->getLinkTarget($this,
"allPages")
573 if ($ilAccess->checkAccess(
'visible',
"", $this->object->getRefId())) {
574 $this->tabs_gui->addTab(
577 $this->ctrl->getLinkTargetByClass(
"ilinfoscreengui",
"showSummary")
582 if ($ilAccess->checkAccess(
'write',
"", $this->object->getRefId())) {
583 $this->tabs_gui->addTab(
586 $this->ctrl->getLinkTarget($this,
"editSettings")
591 $mdtab = $mdgui->getTab();
593 $this->tabs_gui->addTab(
595 $this->
lng->txt(
"meta_data"),
602 if ($ilAccess->checkAccess(
'write',
"", $this->object->getRefId())) {
603 $this->tabs_gui->addTab(
605 $lng->
txt(
"wiki_contributors"),
606 $this->ctrl->getLinkTarget($this,
"listContributors")
611 if ($ilAccess->checkAccess(
'statistics_read',
"", $this->object->getRefId())) {
612 $this->tabs_gui->addTab(
615 $this->ctrl->getLinkTargetByClass(
"ilWikiStatGUI",
"initial")
619 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
620 $this->tabs_gui->addTab(
623 $this->ctrl->getLinkTargetByClass(
"ilexportgui",
"")
628 if ($ilAccess->checkAccess(
'edit_permission',
"", $this->object->getRefId())) {
629 $this->tabs_gui->addTab(
632 $this->ctrl->getLinkTargetByClass(
"ilpermissiongui",
"perm")
647 array(
"general_settings",
"style",
"imp_pages",
"rating_categories",
648 "page_templates",
"advmd",
"permission_settings",
"notifications",
"lti_provider")
650 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
654 $lng->
txt(
"wiki_general_settings"),
655 $ilCtrl->getLinkTarget($this,
'editSettings')
660 "permission_settings",
661 $lng->
txt(
"obj_permission_settings"),
662 $this->ctrl->getLinkTargetByClass(
"ilsettingspermissiongui",
"")
669 $ilCtrl->getLinkTargetByClass(
"ilObjectContentStyleSettingsGUI",
"")
673 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
678 $ilCtrl->getLinkTarget($this,
'editImportantPages')
682 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
686 $lng->
txt(
"wiki_page_templates"),
687 $ilCtrl->getLinkTargetByClass(
"ilwikipagetemplategui",
"")
691 if ($this->
object->getRating() && $this->object->getRatingCategories()) {
695 $lng->
txt(
"rating_categories"),
696 $ilCtrl->getLinkTargetByClass(array(
'ilratinggui',
'ilratingcategorygui'),
'')
703 $ilCtrl->getLinkTargetByClass(
"ilobjnotificationsettingsgui",
'')
709 if ($lti_settings->hasSettingsAccess()) {
710 $ilTabs->addSubTabTarget(
712 $this->
ctrl->getLinkTargetByClass(ilLTIProviderObjectSettingGUI::class)
716 $ilTabs->activateSubTab($a_active);
733 $ecs->addSettingsToForm($this->form_gui,
'wiki');
748 $ilTabs->activateTab(
"settings");
754 $tit->setRequired(
true);
755 $this->form_gui->addItem($tit);
759 $this->form_gui->addItem($des);
765 $this->form_gui->addItem($intro);
769 if ($a_mode ===
"edit") {
771 foreach ($pages as $p) {
775 $si->setOptions($options);
776 $this->form_gui->addItem($si);
779 if ($a_mode ===
"edit") {
780 $sp->setInfo(
$lng->
txt(
"wiki_start_page_info"));
782 $sp->setMaxLength(200);
783 $sp->setRequired(
true);
784 $this->form_gui->addItem($sp);
789 $this->form_gui->addItem($online);
796 $rate->setInfo(
$lng->
txt(
'rating_activate_rating_info'));
797 $this->form_gui->addItem($rate);
800 $this->form_gui->addItem($rating);
808 $rating->addSubItem($new);
811 $rating->addSubItem($extended);
826 $page_toc->setInfo(
$lng->
txt(
"wiki_page_toc_info"));
827 $this->form_gui->addItem($page_toc);
829 if ($a_mode ===
"edit") {
833 $link_md->setInfo(
$lng->
txt(
"wiki_link_md_values_info"));
834 $this->form_gui->addItem($link_md);
839 $section->setTitle($this->
lng->txt(
'obj_presentation'));
840 $this->form_gui->addItem($section);
843 $obj_service->commonSettings()->legacyForm($this->form_gui, $this->
object)->addTileImage();
848 $feat->setTitle($this->
lng->txt(
'obj_features'));
849 $this->form_gui->addItem($feat);
864 if ($a_mode !==
"create") {
865 $this->form_gui->setTitle(
$lng->
txt(
"wiki_settings"));
866 $this->form_gui->addCommandButton(
"saveSettings",
$lng->
txt(
"save"));
868 $this->form_gui->setTitle(
$lng->
txt(
"wiki_new"));
869 $this->form_gui->addCommandButton(
"save",
$lng->
txt(
"wiki_add"));
870 $this->form_gui->addCommandButton(
"cancel",
$lng->
txt(
"cancel"));
874 if ($a_mode ===
"create") {
875 $ilCtrl->setParameter($this,
"new_type",
"wiki");
878 $this->form_gui->setFormAction($ilCtrl->getFormAction($this,
"saveSettings"));
884 if ($a_mode ===
"create") {
885 $values[
"rating_new"] =
true;
888 $values[
"rating_overall"] = $parent->selfOrParentWithRatingEnabled();
890 $values[
"online"] = $this->
object->getOnline();
891 $values[
"title"] = $this->
object->getTitle();
894 $values[
"shorttitle"] = $this->
object->getShortTitle();
895 $values[
"description"] = $this->
object->getLongDescription();
896 $values[
"rating_overall"] = $this->
object->getRatingOverall();
897 $values[
"rating"] = $this->
object->getRating();
898 $values[
"rating_new"] = $this->
object->getRatingForNewPages();
899 $values[
"rating_ext"] = $this->
object->getRatingCategories();
900 $values[
"public_notes"] = $this->
object->getPublicNotes();
901 $values[
"intro"] = $this->
object->getIntroduction();
902 $values[
"page_toc"] = $this->
object->getPageToc();
903 $values[
"link_md_values"] = $this->
object->getLinkMetadataValues();
907 $this->form_gui->setValuesByArray($values,
true);
922 if ($this->form_gui->checkInput()) {
924 $this->form_gui->getInput(
"shorttitle") !== $this->object->getShortTitle()) {
925 $short_item = $this->form_gui->getItemByPostVar(
"shorttitle");
926 $short_item->setAlert(
$lng->
txt(
"wiki_short_title_already_in_use"));
928 $this->
object->setTitle($this->form_gui->getInput(
"title"));
929 $this->
object->setDescription($this->form_gui->getInput(
"description"));
930 $this->
object->setOnline($this->form_gui->getInput(
"online"));
932 $this->
object->setShortTitle((
string) $this->form_gui->getInput(
"shorttitle"));
933 $this->
object->setRatingOverall($this->form_gui->getInput(
"rating_overall"));
934 $this->
object->setRating($this->form_gui->getInput(
"rating"));
936 $this->
object->setRatingForNewPages($this->form_gui->getInput(
"rating_new"));
937 $this->
object->setRatingCategories($this->form_gui->getInput(
"rating_ext"));
940 $this->
object->setPublicNotes($this->form_gui->getInput(
"public_notes"));
942 $this->
object->setIntroduction($this->form_gui->getInput(
"intro"));
943 $this->
object->setPageToc($this->form_gui->getInput(
"page_toc"));
944 $this->
object->setLinkMetadataValues($this->form_gui->getInput(
"link_md_values"));
945 $this->
object->update();
948 $obj_service->commonSettings()->legacyForm($this->form_gui, $this->
object)->saveTileImage();
960 if ($ecs->handleSettingsUpdate()) {
961 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"msg_obj_modified"),
true);
962 $ilCtrl->redirect($this,
"editSettings");
967 $this->form_gui->setValuesByPost();
968 $this->tpl->setContent($this->form_gui->getHTML());
977 $ilTabs->activateTab(
"wiki_contributors");
997 $users = $this->edit_request->getUserIds();
998 $marks = $this->edit_request->getMarks();
999 $comments = $this->edit_request->getComments();
1000 $status = $this->edit_request->getStatus();
1003 foreach ($users as $user_id) {
1004 if ($user_id !=
"") {
1010 if ($marks_obj->getMark() !== $new_mark ||
1011 $marks_obj->getComment() !== $new_comment ||
1014 $marks_obj->setMark($new_mark);
1015 $marks_obj->setComment($new_comment);
1016 $marks_obj->update();
1022 $this->tpl->setOnScreenMessage(
'success',
$lng->
txt(
"msg_obj_modified"),
true);
1025 $ilCtrl->redirect($this,
"listContributors");
1033 if (is_object($this->
object)) {
1035 $this->
object->getTitle(),
1036 self::getGotoLink($this->object->getRefId()),
1038 $this->requested_ref_id
1043 public static function _goto(
string $a_target): void
1046 $main_tpl =
$DIC->ui()->mainTemplate();
1048 $ilAccess =
$DIC->access();
1052 $i = strpos($a_target,
"_");
1055 $a_page = substr($a_target,
$i + 1);
1056 $a_target = substr($a_target, 0,
$i);
1059 if ($a_target ===
"wpage") {
1060 $a_page_arr = explode(
"_", $a_page);
1061 $wpg_id = (
int) $a_page_arr[0];
1069 foreach ($refs as $r) {
1070 if ($ilAccess->checkAccess(
"read",
"", $r)) {
1077 if ($ilAccess->checkAccess(
"read",
"", $a_target)) {
1088 if ($a_page !=
"") {
1090 [
"ilwikihandlergui",
"ilobjwikigui"],
1095 [
"ilwikihandlergui"],
1099 } elseif ($ilAccess->checkAccess(
"visible",
"", $a_target)) {
1102 $main_tpl->setOnScreenMessage(
'failure', sprintf(
1103 $lng->
txt(
"msg_no_perm_read_item"),
1116 if ($a_page ===
"") {
1120 $goto =
"goto.php?target=wiki_" . $a_ref_id .
"_" .
1129 $ilCtrl = $this->ctrl;
1131 $ilTabs = $this->tabs;
1132 $ilAccess = $this->access;
1134 $this->checkPermission(
"read");
1136 $ilTabs->clearTargets();
1137 $tpl->setHeaderActionMenu(
"");
1139 $page = ($this->requested_page !==
"")
1140 ? $this->requested_page
1141 : $this->
object->getStartPage();
1144 $page = $this->
object->getStartPage();
1148 $this->tpl->setOnScreenMessage(
'info',
$lng->txt(
"wiki_no_start_page"),
true);
1149 $ilCtrl->redirect($this,
"infoScreen");
1160 $this->object->getRefId()
1162 $wpage_gui->setStyleId($this->content_style_domain->getEffectiveStyleId());
1164 $this->setContentStyleSheet();
1167 $ilCtrl->setCmdClass(
"ilwikipagegui");
1168 $ilCtrl->setCmd(
"preview");
1169 if (!$ilAccess->checkAccess(
"write",
"", $this->object->getRefId()) &&
1171 !$ilAccess->checkAccess(
"edit_content",
"", $this->object->getRefId()) ||
1172 $wpage_gui->getPageObject()->getBlocked()
1174 $wpage_gui->setEnableEditing(
false);
1178 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
1179 $wpage_gui->activateMetaDataEditor($this->
object,
"wpg", $wpage_gui->getId());
1182 $html = $ilCtrl->forwardCommand($wpage_gui);
1184 $tpl->setContent($html);
1191 $this->checkPermission(
"read");
1193 $this->addPagesSubTabs();
1202 $this->setSideBlock();
1203 $tpl->setContent($table_gui->getHTML());
1213 $this->checkPermission(
"read");
1215 $this->addPagesSubTabs();
1224 $this->setSideBlock();
1225 $tpl->setContent($table_gui->getHTML());
1235 $this->checkPermission(
"read");
1237 $this->addPagesSubTabs();
1246 $this->setSideBlock();
1247 $tpl->setContent($table_gui->getHTML());
1256 $ilCtrl = $this->
ctrl;
1258 if ($a_page ===
"") {
1259 $a_page = $this->requested_page;
1269 if (!$this->
access->checkAccess(
"edit_content",
"", $this->object->getRefId())) {
1270 $this->tpl->setOnScreenMessage(
"failure", $this->
lng->txt(
"no_permission"),
true);
1273 if (!$this->
object->getTemplateSelectionOnCreation()) {
1276 $this->tpl->setOnScreenMessage(
1278 $this->
lng->txt(
"wiki_page_title_too_long") .
" (" . $a_page .
")",
1281 $ilCtrl->setParameterByClass(
1286 $ilCtrl->redirectByClass(
"ilwikipagegui",
"preview");
1288 $this->
object->createWikiPage($a_page);
1292 $ilCtrl->redirectByClass(
"ilwikipagegui",
"edit");
1295 $ilCtrl->setParameter(
1300 $ilCtrl->redirect($this,
"showTemplateSelection");
1307 $this->checkPermission(
"read");
1310 $this->gotoPageObject($page);
1317 $this->checkPermission(
"read");
1319 $this->addPagesSubTabs();
1327 $this->setSideBlock();
1328 $tpl->setContent($table_gui->getHTML());
1333 self::renderSideBlock($a_wpg_id, $this->
object->getRefId());
1345 $ilAccess =
$DIC->access();
1346 $ilCtrl =
$DIC->ctrl();
1348 $tpl->addJavaScript(
"./Modules/Wiki/js/WikiPres.js");
1352 $tpl->addOnLoadCode(
"il.Wiki.Pres.init('" . $ilCtrl->getLinkTargetByClass(
"ilobjwikigui",
"",
"",
false,
false) .
"');");
1354 if ($a_wpg_id > 0 && !$a_wp) {
1363 if ($a_wpg_id > 0) {
1368 $a_wp->getRating()) {
1370 $rgui->setObject($wiki_id,
"wiki", $a_wpg_id,
"wpg");
1372 $rgui->setYourRatingText(
"#");
1373 $rcontent .= $rgui->getBlockHTML(
$lng->txt(
"wiki_rate_page"));
1379 if ($ilAccess->checkAccess(
"write",
"", $a_wiki_ref_id) ||
1380 $ilAccess->checkAccess(
"edit_page_meta",
"", $a_wiki_ref_id)) {
1382 "edit" => $ilCtrl->getLinkTargetByClass(
"ilwikipagegui",
"editAdvancedMetaData"),
1383 "hide" => $ilCtrl->getLinkTargetByClass(
"ilwikipagegui",
"hideAdvancedMetaData")
1387 $callback = $wiki->getLinkMetadataValues()
1388 ? array($wiki,
"decorateAdvMDValue")
1391 $rcontent .= $mdgui->getBlockHTML($cmd, $callback);
1397 $rcontent .= $imp_pages_block->getHTML();
1400 if ($a_wpg_id > 0) {
1402 $wiki_functions_block->setPageObject($a_wp);
1403 $rcontent .= $wiki_functions_block->getHTML();
1406 $tpl->setRightContent($rcontent);
1413 $this->checkPermission(
"read");
1415 $this->addPagesSubTabs();
1424 $this->setSideBlock();
1425 $tpl->setContent($table_gui->getHTML());
1431 $ordering = $this->edit_request->getPrintOrdering();
1434 if (count($ordering) > 0) {
1436 $page_ids = array_keys($ordering);
1439 elseif ($this->edit_request->getWikiPageId()) {
1440 $page_ids = array($this->edit_request->getWikiPageId());
1449 : $this->getPrintPageIds();
1450 $provider = new \ILIAS\Wiki\WikiPrintViewProviderGUI(
1453 $this->
object->getRefId(),
1457 return new \ILIAS\Export\PrintProcessGUI(
1467 $print_view = $this->getPrintView();
1468 $print_view->sendPrintView();
1474 $ilTabs = $this->tabs;
1475 $ilCtrl = $this->ctrl;
1478 $this->checkPermission(
"read");
1480 $ilTabs->setTabActive(
"wiki_search_results");
1482 if ($this->edit_request->getSearchTerm() ===
"") {
1483 $this->tpl->setOnScreenMessage(
'failure',
$lng->txt(
"wiki_please_enter_search_term"),
true);
1484 $ilCtrl->redirectByClass(
"ilwikipagegui",
"preview");
1489 $this->edit_request->getSearchTerm()
1496 $this->edit_request->getSearchTerm()
1499 $this->setSideBlock();
1500 $tpl->setContent($table_gui->getHTML());
1511 $this->content_style_gui->addCss(
$tpl, $this->
object->getRefId());
1523 $ilToolbar = $this->toolbar;
1524 $ilTabs = $this->tabs;
1526 $ilCtrl = $this->ctrl;
1528 $this->checkPermission(
"edit_wiki_navigation");
1530 $this->tpl->setOnScreenMessage(
'info',
$lng->txt(
"wiki_navigation_info"));
1533 $ipages_ids = array();
1534 foreach ($ipages as
$i) {
1535 $ipages_ids[] =
$i[
"page_id"];
1540 $options = array(
"" =>
$lng->txt(
"please_select"));
1541 foreach ($pages as $p) {
1542 if (!in_array($p[
"id"], $ipages_ids)) {
1546 if (count($options) > 0) {
1548 $si->setOptions($options);
1549 $si->setInfo(
$lng->txt(
""));
1550 $ilToolbar->addInputItem($si);
1551 $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
1552 $ilToolbar->addFormButton(
$lng->txt(
"add"),
"addImportantPage");
1556 $ilTabs->activateTab(
"settings");
1557 $this->setSettingsSubTabs(
"imp_pages");
1561 $tpl->setContent($imp_table->getHTML());
1566 $ilCtrl = $this->ctrl;
1569 $this->checkPermission(
"edit_wiki_navigation");
1571 $imp_page_id = $this->edit_request->getImportantPageId();
1572 if ($imp_page_id > 0) {
1573 $this->
object->addImportantPage($imp_page_id);
1574 $this->tpl->setOnScreenMessage(
'success',
$lng->txt(
"wiki_imp_page_added"),
true);
1576 $ilCtrl->redirect($this,
"editImportantPages");
1581 $ilCtrl = $this->ctrl;
1585 $imp_page_ids = $this->edit_request->getImportantPageIds();
1586 if (count($imp_page_ids) === 0) {
1587 $this->tpl->setOnScreenMessage(
'info',
$lng->txt(
"no_checkbox"),
true);
1588 $ilCtrl->redirect($this,
"editImportantPages");
1591 $cgui->setFormAction($ilCtrl->getFormAction($this));
1592 $cgui->setHeaderText(
$lng->txt(
"wiki_sure_remove_imp_pages"));
1593 $cgui->setCancel(
$lng->txt(
"cancel"),
"editImportantPages");
1594 $cgui->setConfirm(
$lng->txt(
"remove"),
"removeImportantPages");
1596 foreach ($imp_page_ids as
$i) {
1600 $tpl->setContent($cgui->getHTML());
1606 $ilCtrl = $this->ctrl;
1609 $this->checkPermission(
"edit_wiki_navigation");
1611 $imp_page_ids = $this->edit_request->getImportantPageIds();
1612 foreach ($imp_page_ids as
$i) {
1613 $this->
object->removeImportantPage((
int) $i);
1615 $this->tpl->setOnScreenMessage(
'success',
$lng->txt(
"wiki_removed_imp_pages"),
true);
1616 $ilCtrl->redirect($this,
"editImportantPages");
1621 $ilCtrl = $this->ctrl;
1624 $this->checkPermission(
"edit_wiki_navigation");
1626 $ordering = $this->edit_request->getImportantPageOrdering();
1627 $indentation = $this->edit_request->getImportantPageIndentation();
1628 $this->
object->saveOrderingAndIndentation($ordering, $indentation);
1629 $this->tpl->setOnScreenMessage(
'success',
$lng->txt(
"wiki_ordering_and_indent_saved"),
true);
1630 $ilCtrl->redirect($this,
"editImportantPages");
1635 $ilCtrl = $this->ctrl;
1638 $this->checkPermission(
"edit_wiki_navigation");
1640 $imp_page_ids = $this->edit_request->getImportantPageIds();
1641 if (count($imp_page_ids) !== 1) {
1642 $this->tpl->setOnScreenMessage(
'info',
$lng->txt(
"wiki_select_one_item"),
true);
1644 $this->
object->removeImportantPage($imp_page_ids[0]);
1646 $this->
object->update();
1647 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"msg_obj_modified"),
true);
1649 $ilCtrl->redirect($this,
"editImportantPages");
1658 public function exportHTML(): void
1661 $wiki = $this->object;
1662 $cont_exp =
new Export\WikiHtmlExport($wiki);
1664 $format = explode(
"_", $this->edit_request->getFormat());
1665 if ((
$format[1] ??
"") ===
"comments") {
1666 $cont_exp->setMode(Export\WikiHtmlExport::MODE_COMMENTS);
1669 $cont_exp->buildExportFile();
1680 if ($page->getWikiId() === $a_wiki_id) {
1700 $ilTabs = $this->tabs;
1701 $ilCtrl = $this->ctrl;
1703 $ilCtrl->setParameterByClass(
1708 $ilTabs->clearTargets();
1709 $this->tpl->setOnScreenMessage(
'info',
$lng->txt(
"wiki_page_not_exist_select_templ"));
1711 $form = $this->initTemplateSelectionForm();
1712 $tpl->setContent($form->getHTML());
1718 $ilCtrl = $this->ctrl;
1724 $hi->setValue($this->requested_page);
1725 $form->addItem($hi);
1729 $radg->setRequired(
true);
1731 if ($this->
object->getEmptyPageTemplate()) {
1733 $radg->addOption($op1);
1738 foreach ($ts as $t) {
1740 $radg->addOption($op);
1743 $form->addItem($radg);
1746 $form->addCommandButton(
"createPageUsingTemplate",
$lng->txt(
"wiki_create_page"));
1747 $form->addCommandButton(
"cancelCreationPageUsingTemplate",
$lng->txt(
"cancel"));
1749 $form->setTitle(
$lng->txt(
"wiki_new_page") .
": " . $this->requested_page);
1750 $form->setFormAction($ilCtrl->getFormAction($this));
1759 $ilCtrl = $this->ctrl;
1761 $form = $this->initTemplateSelectionForm();
1762 if ($form->checkInput()) {
1763 $a_page = $this->edit_request->getPage();
1764 $this->
object->createWikiPage(
1766 $this->edit_request->getPageTemplateId()
1771 $ilCtrl->redirectByClass(
"ilwikipagegui",
"edit");
1773 $this->tpl->setOnScreenMessage(
'success',
$lng->txt(
"msg_obj_modified"),
true);
1774 $ilCtrl->redirect($this,
"");
1776 $form->setValuesByPost();
1777 $tpl->setContent($form->getHTML());
1783 $ilCtrl = $this->ctrl;
1786 $ilCtrl->setParameterByClass(
1791 $ilCtrl->redirectByClass(
"ilwikipagegui",
"preview");
1796 if ($perm ===
"create") {
1797 return parent::checkPermissionBool($perm, $cmd,
$type,
$ref_id);
1800 $ref_id = $this->
object->getRefId();
1816 $this->log->debug(
"init: " . $this->req_with_comments);
1817 $this->checkPermission(
"wiki_html_export");
1818 $this->
object->initUserHTMLExport($this->req_with_comments);
1826 $this->log->debug(
"start: " . $this->req_with_comments);
1827 $this->checkPermission(
"wiki_html_export");
1828 $this->
object->startUserHTMLExport($this->req_with_comments);
1836 $this->log->debug(
"get progress: " . $this->req_with_comments);
1837 $this->checkPermission(
"wiki_html_export");
1838 $p = $this->
object->getUserHTMLExportProgress($this->req_with_comments);
1841 $pb->setCurrent($p[
"progress"]);
1843 $r =
new stdClass();
1844 $r->progressBar = $pb->render();
1845 $r->status = $p[
"status"];
1846 $this->log->debug(
"status: " . $r->status);
1847 echo(json_encode($r, JSON_THROW_ON_ERROR));
1853 $this->log->debug(
"download");
1854 $this->checkPermission(
"wiki_html_export");
1855 $this->
object->deliverUserHTMLExport();
1860 $this->log->debug(
"download");
1861 $this->checkPermission(
"wiki_html_export");
1862 $this->
object->deliverUserHTMLExport(
true);
1867 if (!is_object($this->
object)) {
1871 $this->
object->getRefId(),
1872 $this->user->getId()
1874 if (count($ass_info) > 0) {
1875 $ass_ids = array_map(
static function (
$i):
int {
1880 $this->tool_context->current()->addAdditionalData(
1882 $this->getAssignmentButtons()
1892 $ilCtrl = $this->ctrl;
1897 $this->
object->getRefId(),
1898 $this->user->getId()
1901 foreach ($ass_info as
$i) {
1903 $times_up = $ass->afterDeadlineStrict();
1907 $ilCtrl->setParameterByClass(
"ilwikipagegui",
"ass", $ass->getId());
1908 $submit_link = $ilCtrl->getLinkTargetByClass(
"ilwikipagegui",
"finalizeAssignment");
1909 $ilCtrl->setParameterByClass(
"ilwikipagegui",
"ass",
"");
1911 $buttons[
$i->getId()][] = $ui->factory()->button()->primary(
$lng->txt(
"wiki_finalize_wiki"), $submit_link);
1916 if ($submission->hasSubmitted()) {
1917 $submitted = $submission->getSelectedObject();
1918 if ($submitted[
"ts"] !=
"") {
1919 $ilCtrl->setParameterByClass(
"ilwikipagegui",
"ass", $ass->getId());
1921 $dl_link = $ilCtrl->getLinkTargetByClass(
"ilwikipagegui",
"downloadExcSubFile");
1922 $ilCtrl->setParameterByClass(
"ilwikipagegui",
"ass",
"");
1923 $buttons[
$i->getId()][] = $ui->factory()->button()->standard(
$lng->txt(
"wiki_download_submission"), $dl_link);
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
const IL_WIKI_ALL_PAGES
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const IL_WIKI_POPULAR_PAGES
const IL_WIKI_ORPHANED_PAGES
static _getSelectedRecordsByObject(string $a_obj_type, int $a_id, string $a_sub_type="", bool $is_ref_id=true)
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
redirectByClass( $a_class, string $a_cmd=null, string $a_anchor=null, bool $is_async=false)
@inheritDoc
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
@inheritDoc
setParameterByClass(string $a_class, string $a_parameter, $a_value)
@inheritDoc
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...
setScreenIdComponent(string $a_comp)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupComment(int $a_usr_id, int $a_obj_id)
static _lookupMark(int $a_usr_id, int $a_obj_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
loadLanguageModule(string $a_module)
Load language module.
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
addItem(string $a_title, string $a_link, string $a_frame="", int $a_ref_id=0, ?string $type=null)
static getLogger(string $a_component_id)
Get component logger.
Component logger with individual log levels by component id.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getSyntaxStylePath()
static lookupSubObjectTitle(int $a_wiki_id, string $a_page_id)
Get title for wiki page (used in ilNotesGUI)
getSubObjectTitle(int $a_id, string $a_type)
Used for rating export.
getPrintView(bool $export=false)
setSideBlock(int $a_wpg_id=0)
ILIAS Style Content Object ObjectFacade $content_style_domain
getAssignmentButtons()
Get assignment buttons.
getTabs()
@abstract overwrite in derived GUI class of your object type
EditingGUIRequest $edit_request
addLocatorItems()
should be overwritten to add object specific items (repository items are preloaded)
downloadUserHTMLExportObject()
cancelCreationPageUsingTemplateObject()
static getGotoLink(int $a_ref_id, string $a_page="")
ilPropertyFormGUI $form_gui
downloadUserHTMLExportWithCommentsObject()
initSettingsForm(string $a_mode="edit")
ILIAS HTTP Services $http
gotoPageObject(string $a_page="")
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
__construct( $a_data, int $a_id, bool $a_call_by_reference, bool $a_prepare_output=true)
viewObject()
viewObject container presentation for "administration -> repository, trash, permissions"
setSettingsSubTabs(string $a_active)
initTemplateSelectionForm()
showTemplateSelectionObject()
afterSave(ilObject $new_object)
Post (successful) object creation hook.
startUserHTMLExportObject()
Export html (as user)
createPageUsingTemplateObject()
saveOrderingAndIndentObject()
removeImportantPagesObject()
static renderSideBlock(int $a_wpg_id, int $a_wiki_ref_id, ?ilWikiPage $a_wp=null)
initCreationForms(string $new_type)
Init creation forms.
ContextServices $tool_context
editImportantPagesObject()
getUserHTMLExportProgressObject()
Get user html export progress.
getSettingsFormValues(string $a_mode="edit")
initUserHTMLExportObject()
Export html (as user)
infoScreenObject()
this one is called from the info button in the repository
static _goto(string $a_target)
confirmRemoveImportantPagesObject()
ILIAS Style Content GUIService $content_style_gui
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static checkShortTitleAvailability(string $a_short_title)
static _lookupRating(int $a_wiki_id)
Lookup whether rating is activated.
static _lookupStartPage(int $a_wiki_id)
static _performSearch(int $a_wiki_id, string $a_searchterm)
Search in Wiki.
static _lookupRatingCategories(int $a_wiki_id)
Lookup whether rating categories are activated.
static _lookupImportantPagesList(int $a_wiki_id)
GUI class for the workflow of copying objects.
static getInstanceByRefId(int $ref_id, bool $stop_on_error=true)
get an instance of an Ilias object by reference id
Class ilObjectGUI Basic methods of all Output classes.
initImportForm(string $new_type)
ilGlobalTemplateInterface $tpl
static _gotoRepositoryRoot(bool $raise_error=false)
Goto repository root.
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
ilObjectService $object_service
addHeaderAction()
Add header action menu.
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...
static _gotoRepositoryNode(int $ref_id, string $cmd="")
prepareOutput(bool $show_sub_objects=true)
static updateServiceSettingsForm(int $obj_id, ilPropertyFormGUI $form, array $services)
static initServiceSettingsForm(int $obj_id, ilPropertyFormGUI $form, array $services)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _getAllReferences(int $id)
get all reference ids for object ID
static _lookupObjId(int $ref_id)
static _lookupTitle(int $obj_id)
setDescription(string $desc)
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.
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 getSearchBlockHTML(string $a_title)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static shortenTextExtended(string $a_str, int $a_len, bool $a_dots=false, bool $a_next_blank=false, bool $a_keep_extension=false)
static strLen(string $a_string)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class represents a text area property in a property form.
This class represents a text property in a property form.
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
static redirect(string $a_script)
static _writeStatus(int $a_obj_id, int $a_user_id, int $a_status)
static _lookupStatus(int $a_obj_id, int $a_user_id)
Lookup current success status (STATUS_NOT_GRADED|STATUS_PASSED|STATUS_FAILED)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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.
Wiki page template gui class.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getAllWikiPages(int $a_wiki_id)
static exists(int $a_wiki_id, string $a_title)
Checks whether a page with given title exists.
static lookupWikiId(int $a_page_id)
static lookupAdvancedMetadataHidden(int $a_page_id)
static getPageIdForTitle(int $a_wiki_id, string $a_title)
Get wiki page object for id and title.
static getRandomPage(int $a_wiki_id)
static _wikiPageExists(int $a_wiki_id, string $a_title)
static lookupTitle(int $a_page_id)
static _getPageIdForWikiTitle(int $a_wiki_id, string $a_title)
TableGUI class for wiki pages table.
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...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Wiki statistics GUI class.
static makeUrlTitle(string $a_par)
static makeDbTitle(string $a_par)
if(!file_exists(getcwd() . '/ilias.ini.php'))
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
return['3gp', '7z', 'ai', 'aif', 'aifc', 'aiff', 'au', 'arw', 'avi', 'backup', 'bak', 'bas', 'bpmn', 'bpmn2', 'bmp', 'bib', 'bibtex', 'bz', 'bz2', 'c', 'c++', 'cc', 'cct', 'cdf', 'cer', 'class', 'cls', 'conf', 'cpp', 'crt', 'crs', 'crw', 'cr2', 'css', 'cst', 'csv', 'cur', 'db', 'dcr', 'des', 'dng', 'doc', 'docx', 'dot', 'dotx', 'dtd', 'dvi', 'el', 'eps', 'epub', 'f', 'f77', 'f90', 'flv', 'for', 'g3', 'gif', 'gl', 'gan', 'ggb', 'gsd', 'gsm', 'gtar', 'gz', 'gzip', 'h', 'hpp', 'htm', 'html', 'htmls', 'ibooks', 'ico', 'ics', 'ini', 'ipynb', 'java', 'jbf', 'jpeg', 'jpg', 'js', 'jsf', 'jso', 'json', 'latex', 'lang', 'less', 'log', 'lsp', 'ltx', 'm1v', 'm2a', 'm2v', 'm3u', 'm4a', 'm4v', 'markdown', 'm', 'mat', 'md', 'mdl', 'mdown', 'mid', 'min', 'midi', 'mobi', 'mod', 'mov', 'movie', 'mp2', 'mp3', 'mp4', 'mpa', 'mpeg', 'mpg', 'mph', 'mpga', 'mpp', 'mpt', 'mpv', 'mpx', 'mv', 'mw', 'mv4', 'nb', 'nbp', 'nef', 'nif', 'niff', 'obj', 'obm', 'odt', 'ods', 'odp', 'odg', 'odf', 'oga', 'ogg', 'ogv', 'old', 'p', 'pas', 'pbm', 'pcl', 'pct', 'pcx', 'pdf', 'pgm', 'pic', 'pict', 'png', 'por', 'pov', 'project', 'properties', 'ppa', 'ppm', 'pps', 'ppsx', 'ppt', 'pptx', 'ppz', 'ps', 'psd', 'pwz', 'qt', 'qtc', 'qti', 'qtif', 'r', 'ra', 'ram', 'rar', 'rast', 'rda', 'rev', 'rexx', 'ris', 'rf', 'rgb', 'rm', 'rmd', 'rmi', 'rmm', 'rmp', 'rt', 'rtf', 'rtx', 'rv', 's', 's3m', 'sav', 'sbs', 'sec', 'sdml', 'sgm', 'sgml', 'smi', 'smil', 'srt', 'sps', 'spv', 'stl', 'svg', 'swa', 'swf', 'swz', 'tar', 'tex', 'texi', 'texinfo', 'text', 'tgz', 'tif', 'tiff', 'ttf', 'txt', 'tmp', 'uvproj', 'vdf', 'vimeo', 'viv', 'vivo', 'vrml', 'vsdx', 'wav', 'webm', 'wmv', 'wmx', 'wmz', 'woff', 'wwd', 'xhtml', 'xif', 'xls', 'xlsx', 'xmind', 'xml', 'xsl', 'xsd', 'zip']
setContent(string $a_html)
Sets content for standard template.
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
static http()
Fetches the global http state from ILIAS.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ChatMainBarProvider \MainMenu\Provider.