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);
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");
286 $lti_gui->setCustomRolesForSelection(
$GLOBALS[
'DIC']->
rbac()->review()->getLocalRoles($this->
object->getRefId()));
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);
795 $rate->setInfo(
$lng->
txt(
'rating_activate_rating_info'));
796 $this->form_gui->addItem($rate);
799 $this->form_gui->addItem($rating);
807 $rating->addSubItem($new);
810 $rating->addSubItem($extended);
825 $page_toc->setInfo(
$lng->
txt(
"wiki_page_toc_info"));
826 $this->form_gui->addItem($page_toc);
828 if ($a_mode ===
"edit") {
832 $link_md->setInfo(
$lng->
txt(
"wiki_link_md_values_info"));
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 ||
1010 $marks_obj->getComment() !== $new_comment ||
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();
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 .
"_" .
1128 $ilCtrl = $this->ctrl;
1130 $ilTabs = $this->tabs;
1131 $ilAccess = $this->access;
1133 $this->checkPermission(
"read");
1135 $ilTabs->clearTargets();
1136 $tpl->setHeaderActionMenu(
"");
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());
1163 $this->setContentStyleSheet();
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);
1183 $tpl->setContent($html);
1190 $this->checkPermission(
"read");
1192 $this->addPagesSubTabs();
1201 $this->setSideBlock();
1202 $tpl->setContent($table_gui->getHTML());
1212 $this->checkPermission(
"read");
1214 $this->addPagesSubTabs();
1223 $this->setSideBlock();
1224 $tpl->setContent($table_gui->getHTML());
1234 $this->checkPermission(
"read");
1236 $this->addPagesSubTabs();
1245 $this->setSideBlock();
1246 $tpl->setContent($table_gui->getHTML());
1255 $ilCtrl = $this->
ctrl;
1257 if ($a_page ===
"") {
1258 $a_page = $this->requested_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");
1306 $this->checkPermission(
"read");
1309 $this->gotoPageObject($page);
1316 $this->checkPermission(
"read");
1318 $this->addPagesSubTabs();
1326 $this->setSideBlock();
1327 $tpl->setContent($table_gui->getHTML());
1332 self::renderSideBlock($a_wpg_id, $this->
object->getRefId());
1344 $ilAccess =
$DIC->access();
1345 $ilCtrl =
$DIC->ctrl();
1347 $tpl->addJavaScript(
"./Modules/Wiki/js/WikiPres.js");
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();
1405 $tpl->setRightContent($rcontent);
1412 $this->checkPermission(
"read");
1414 $this->addPagesSubTabs();
1423 $this->setSideBlock();
1424 $tpl->setContent($table_gui->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());
1448 : $this->getPrintPageIds();
1449 $provider = new \ILIAS\Wiki\WikiPrintViewProviderGUI(
1452 $this->
object->getRefId(),
1456 return new \ILIAS\Export\PrintProcessGUI(
1466 $print_view = $this->getPrintView();
1467 $print_view->sendPrintView();
1473 $ilTabs = $this->tabs;
1474 $ilCtrl = $this->ctrl;
1477 $this->checkPermission(
"read");
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()
1498 $this->setSideBlock();
1499 $tpl->setContent($table_gui->getHTML());
1510 $this->content_style_gui->addCss(
$tpl, $this->
object->getRefId());
1522 $ilToolbar = $this->toolbar;
1523 $ilTabs = $this->tabs;
1525 $ilCtrl = $this->ctrl;
1527 $this->checkPermission(
"edit_wiki_navigation");
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);
1548 $si->setInfo(
$lng->txt(
""));
1549 $ilToolbar->addInputItem($si);
1550 $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
1551 $ilToolbar->addFormButton(
$lng->txt(
"add"),
"addImportantPage");
1555 $ilTabs->activateTab(
"settings");
1556 $this->setSettingsSubTabs(
"imp_pages");
1560 $tpl->setContent($imp_table->getHTML());
1565 $ilCtrl = $this->ctrl;
1568 $this->checkPermission(
"edit_wiki_navigation");
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");
1580 $ilCtrl = $this->ctrl;
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) {
1599 $tpl->setContent($cgui->getHTML());
1605 $ilCtrl = $this->ctrl;
1608 $this->checkPermission(
"edit_wiki_navigation");
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");
1620 $ilCtrl = $this->ctrl;
1623 $this->checkPermission(
"edit_wiki_navigation");
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");
1634 $ilCtrl = $this->ctrl;
1637 $this->checkPermission(
"edit_wiki_navigation");
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
1660 $wiki = $this->object;
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) {
1699 $ilTabs = $this->tabs;
1700 $ilCtrl = $this->ctrl;
1702 $ilCtrl->setParameterByClass(
1707 $ilTabs->clearTargets();
1708 $this->tpl->setOnScreenMessage(
'info',
$lng->txt(
"wiki_page_not_exist_select_templ"));
1710 $form = $this->initTemplateSelectionForm();
1711 $tpl->setContent($form->getHTML());
1717 $ilCtrl = $this->ctrl;
1723 $hi->setValue($this->requested_page);
1724 $form->addItem($hi);
1728 $radg->setRequired(
true);
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"));
1748 $form->setTitle(
$lng->txt(
"wiki_new_page") .
": " . $this->requested_page);
1749 $form->setFormAction($ilCtrl->getFormAction($this));
1758 $ilCtrl = $this->ctrl;
1760 $form = $this->initTemplateSelectionForm();
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();
1776 $tpl->setContent($form->getHTML());
1782 $ilCtrl = $this->ctrl;
1785 $ilCtrl->setParameterByClass(
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);
1816 $this->checkPermission(
"wiki_html_export");
1817 $this->
object->initUserHTMLExport($this->req_with_comments);
1825 $this->log->debug(
"start: " . $this->req_with_comments);
1826 $this->checkPermission(
"wiki_html_export");
1827 $this->
object->startUserHTMLExport($this->req_with_comments);
1835 $this->log->debug(
"get progress: " . $this->req_with_comments);
1836 $this->checkPermission(
"wiki_html_export");
1837 $p = $this->
object->getUserHTMLExportProgress($this->req_with_comments);
1840 $pb->setCurrent($p[
"progress"]);
1842 $r =
new stdClass();
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");
1853 $this->checkPermission(
"wiki_html_export");
1854 $this->
object->deliverUserHTMLExport();
1859 $this->log->debug(
"download");
1860 $this->checkPermission(
"wiki_html_export");
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(
1881 $this->getAssignmentButtons()
1891 $ilCtrl = $this->ctrl;
1896 $this->
object->getRefId(),
1897 $this->user->getId()
1900 foreach ($ass_info as
$i) {
1902 $times_up = $ass->afterDeadlineStrict();
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()) {
1916 $submitted = $submission->getSelectedObject();
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);
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.