ILIAS  release_8 Revision v8.25-1-g13de6a5eca6
class.ilObjWikiGUI.php
Go to the documentation of this file.
1<?php
2
22
37{
38 protected \ILIAS\HTTP\Services $http;
39 protected string $requested_page;
41 protected ilTabsGUI $tabs;
42 protected ilHelpGUI $help;
43 protected ilLogger $log;
45 protected \ILIAS\DI\UIServices $ui;
46 protected bool $req_with_comments = false;
48 protected \ILIAS\Style\Content\GUIService $content_style_gui;
49 protected \ILIAS\Style\Content\Object\ObjectFacade $content_style_domain;
50
51 public function __construct(
52 $a_data,
53 int $a_id,
54 bool $a_call_by_reference,
55 bool $a_prepare_output = true
56 ) {
57 global $DIC;
58
59 $this->ctrl = $DIC->ctrl();
60 $this->lng = $DIC->language();
61 $this->tabs = $DIC->tabs();
62 $this->help = $DIC->help();
63 $this->locator = $DIC["ilLocator"];
64 $ilCtrl = $DIC->ctrl();
65 $lng = $DIC->language();
66 $this->http = $DIC->http();
67
68 $this->type = "wiki";
69
70 $this->log = ilLoggerFactory::getLogger('wiki');
71
72 $this->tool_context = $DIC->globalScreen()->tool()->context();
73 $this->ui = $DIC->ui();
74
75 $this->edit_request = $DIC
76 ->wiki()
77 ->internal()
78 ->gui()
79 ->editing()
80 ->request();
81
82 parent::__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
84 $lng->loadLanguageModule("wiki");
85
86 $this->requested_page = $this->edit_request->getPage();
87 if ($this->requested_page !== "") {
88 $ilCtrl->setParameter($this, "page", ilWikiUtil::makeUrlTitle($this->requested_page));
89 }
90
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());
96 }
97 }
98
99 public function executeCommand(): void
100 {
101 $ilCtrl = $this->ctrl;
103 $ilTabs = $this->tabs;
104 $ilAccess = $this->access;
105
106 $next_class = $this->ctrl->getNextClass($this);
107 $cmd = $this->ctrl->getCmd();
108
109 $this->triggerAssignmentTool();
110
111 $this->prepareOutput();
112
113 // see ilWikiPageGUI::printViewOrderList()
114 // printView() cannot be in ilWikiPageGUI because of stylesheet confusion
115 if ($cmd === "printView") {
116 $next_class = null;
117 }
118
119 switch ($next_class) {
120 case "ilinfoscreengui":
121 $this->checkPermission("visible");
122 $this->addHeaderAction();
123 $this->infoScreen(); // forwards command
124 break;
125
126 case 'ilpermissiongui':
127 $this->addHeaderAction();
128 $ilTabs->activateTab("perm_settings");
129 $perm_gui = new ilPermissionGUI($this);
130 $this->ctrl->forwardCommand($perm_gui);
131 break;
132
133 case 'ilsettingspermissiongui':
134 $this->checkPermission("write");
135 $this->addHeaderAction();
136 $ilTabs->activateTab("settings");
137 $this->setSettingsSubTabs("permission_settings");
138 $perm_gui = new ilSettingsPermissionGUI($this);
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);
144 break;
145
146 case 'ilwikipagegui':
147 $this->checkPermission("read");
149 $this->object->getId(),
150 ilWikiUtil::makeDbTitle($this->requested_page),
151 $this->edit_request->getOldNr(),
152 $this->object->getRefId()
153 );
154 $wpage_gui->setStyleId($this->content_style_domain->getEffectiveStyleId());
155 $this->setContentStyleSheet();
156 if (!$ilAccess->checkAccess("write", "", $this->object->getRefId()) &&
157 (
158 !$ilAccess->checkAccess("edit_content", "", $this->object->getRefId()) ||
159 $wpage_gui->getPageObject()->getBlocked()
160 )) {
161 $wpage_gui->setEnableEditing(false);
162 }
163
164 // alter title and description
165 if ($ilAccess->checkAccess("write", "", $this->object->getRefId())) {
166 $wpage_gui->activateMetaDataEditor($this->object, "wpg", $wpage_gui->getId());
167 }
168
169 $ret = $this->ctrl->forwardCommand($wpage_gui);
170 if ($ret != "") {
171 $tpl->setContent($ret);
172 }
173 break;
174
175 case 'ilobjectcopygui':
176 $cp = new ilObjectCopyGUI($this);
177 $cp->setType('wiki');
178 $this->ctrl->forwardCommand($cp);
179 break;
180
181 case 'ilpublicuserprofilegui':
182 $profile_gui = new ilPublicUserProfileGUI(
183 $this->edit_request->getUserId()
184 );
185 $ret = $this->ctrl->forwardCommand($profile_gui);
186 $tpl->setContent($ret);
187 break;
188
189 case "ilobjectcontentstylesettingsgui":
190 $this->checkPermission("write");
191 $this->addHeaderAction();
192 $ilTabs->activateTab("settings");
193 $this->setSettingsSubTabs("style");
194
195 $settings_gui = $this->content_style_gui
196 ->objectSettingsGUIForRefId(
197 null,
198 $this->object->getRefId()
199 );
200 $this->ctrl->forwardCommand($settings_gui);
201 break;
202
203 case "ilexportgui":
204 $this->addHeaderAction();
205 $ilTabs->activateTab("export");
206 $exp_gui = new ilExportGUI($this);
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");
211 }
212 $this->ctrl->forwardCommand($exp_gui);
213 break;
214
215 case "ilcommonactiondispatchergui":
217 $this->ctrl->forwardCommand($gui);
218 break;
219
220 case "ilratinggui":
221 // for rating category editing
222 $this->checkPermission("write");
223 $this->addHeaderAction();
224 $ilTabs->activateTab("settings");
225 $this->setSettingsSubTabs("rating_categories");
226 $gui = new ilRatingGUI();
227 $gui->setObject($this->object->getId(), $this->object->getType());
228 $gui->setExportCallback(array($this, "getSubObjectTitle"), $this->lng->txt("page"));
229 $this->ctrl->forwardCommand($gui);
230 break;
231
232 case "ilwikistatgui":
233 $this->checkPermission("statistics_read");
234
235 $this->addHeaderAction();
236 $ilTabs->activateTab("statistics");
237 $gui = new ilWikiStatGUI($this->object->getId());
238 $this->ctrl->forwardCommand($gui);
239 break;
240
241 case "ilwikipagetemplategui":
242 $this->checkPermission("write");
243 $this->addHeaderAction();
244 $ilTabs->activateTab("settings");
245 $this->setSettingsSubTabs("page_templates");
246 $wptgui = new ilWikiPageTemplateGUI($this);
247 $this->ctrl->forwardCommand($wptgui);
248 break;
249
250 case 'ilobjectmetadatagui':
251 $this->checkPermission("write");
252 $this->addHeaderAction();
253 $ilTabs->activateTab("advmd");
254 $md_gui = new ilObjectMetaDataGUI($this->object, "wpg");
255 $this->ctrl->forwardCommand($md_gui);
256 break;
257
258 case 'ilrepositoryobjectsearchgui':
259 $this->checkPermission("read");
260 $this->addHeaderAction();
261 $this->setSideBlock();
262 $ilTabs->setTabActive("wiki_search_results");
263 $ilCtrl->setReturn($this, 'view');
264 $search_gui = new ilRepositoryObjectSearchGUI(
265 $this->object->getRefId(),
266 $this,
267 'view'
268 );
269 $ilCtrl->forwardCommand($search_gui);
270 break;
271
272 case 'ilobjnotificationsettingsgui':
273 $this->checkPermission("write");
274 $this->addHeaderAction();
275 $ilTabs->activateTab("settings");
276 $this->setSettingsSubTabs("notifications");
277 $gui = new ilObjNotificationSettingsGUI($this->object->getRefId());
278 $this->ctrl->forwardCommand($gui);
279 break;
280
281 case 'illtiproviderobjectsettinggui':
282 $this->checkPermission("write");
283 $this->addHeaderAction();
284 $ilTabs->activateTab("settings");
285 $this->setSettingsSubTabs("lti_provider");
286 $lti_gui = new ilLTIProviderObjectSettingGUI($this->object->getRefId());
287 $lti_gui->setCustomRolesForSelection($GLOBALS['DIC']->rbac()->review()->getLocalRoles($this->object->getRefId()));
288 $lti_gui->offerLTIRolesForSelection(false);
289 $this->ctrl->forwardCommand($lti_gui);
290 break;
291
292 default:
293 $this->addHeaderAction();
294 if (!$cmd) {
295 $cmd = "infoScreen";
296 }
297 $cmd .= "Object";
298 if ($cmd !== "cancelObject") {
299 if ($cmd !== "infoScreenObject") {
300 if (!in_array($cmd, array("createObject", "saveObject", "importFileObject"))) {
301 $this->checkPermission("read");
302 }
303 } else {
304 $this->checkPermission("visible");
305 }
306 }
307 $this->$cmd();
308 break;
309 }
310 }
311
312 public function viewObject(): void
313 {
314 $this->checkPermission("read");
315 $this->gotoStartPageObject();
316 }
317
318 protected function initCreationForms(string $new_type): array
319 {
320 $this->initSettingsForm("create");
321 $this->getSettingsFormValues("create");
322
323 $forms = array(self::CFORM_NEW => $this->form_gui,
324 self::CFORM_IMPORT => $this->initImportForm($new_type),
325 self::CFORM_CLONE => $this->fillCloneTemplate(null, $new_type));
326
327 return $forms;
328 }
329
330 public function saveObject(): void
331 {
334
335 if (!$this->checkPermissionBool("create", "", "wiki", $this->requested_ref_id)) {
336 throw new ilPermissionException($this->lng->txt("permission_denied"));
337 }
338
339 $this->initSettingsForm("create");
340 if ($this->form_gui->checkInput()) {
341 if (!ilObjWiki::checkShortTitleAvailability($this->form_gui->getInput("shorttitle"))) {
342 $short_item = $this->form_gui->getItemByPostVar("shorttitle");
343 $short_item->setAlert($lng->txt("wiki_short_title_already_in_use"));
344 } else {
345 parent::saveObject();
346 return;
347 }
348 }
349
350 $this->form_gui->setValuesByPost();
351 $tpl->setContent($this->form_gui->getHTML());
352 }
353
354 protected function afterSave(ilObject $new_object): void
355 {
357
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"));
364 // $new_object->setRatingAsBlock($this->form_gui->getInput("rating_side"));
365 $new_object->setRatingForNewPages($this->form_gui->getInput("rating_new"));
366 $new_object->setRatingCategories($this->form_gui->getInput("rating_ext"));
367
368 $new_object->setRatingOverall($this->form_gui->getInput("rating_overall"));
369 $new_object->setPageToc($this->form_gui->getInput("page_toc"));
370
371
372
373 if (!$ilSetting->get("disable_comments")) {
374 $new_object->setPublicNotes($this->form_gui->getInput("public_notes"));
375 }
376 $new_object->setOnline($this->form_gui->getInput("online"));
377 $new_object->update();
378
379 // always send a message
380 $this->tpl->setOnScreenMessage('success', $this->lng->txt("object_added"), true);
381 ilUtil::redirect(self::getGotoLink($new_object->getRefId()));
382 }
383
389 public function infoScreenObject(): void
390 {
391 $this->checkPermission("visible");
392 $this->ctrl->setCmd("showSummary");
393 $this->ctrl->setCmdClass("ilinfoscreengui");
394 $this->infoScreen();
395 }
396
397 public function infoScreen(): void
398 {
399 $ilAccess = $this->access;
401 $ilTabs = $this->tabs;
403
404 $ilTabs->activateTab("info_short");
405
406 if (!$ilAccess->checkAccess("visible", "", $this->object->getRefId())) {
407 throw new ilPermissionException($this->lng->txt("permission_denied"));
408 }
409
410 $info = new ilInfoScreenGUI($this);
411 $info->enablePrivateNotes();
412 if (trim($this->object->getIntroduction()) !== "") {
413 $info->addSection($lng->txt("wiki_introduction"));
414 $info->addProperty("", nl2br($this->object->getIntroduction()));
415 }
416
417 // feedback from tutor; mark, status, comment
418 $lpcomment = ilLPMarks::_lookupComment($ilUser->getId(), $this->object->getId());
419 $mark = ilLPMarks::_lookupMark($ilUser->getId(), $this->object->getId());
420 $status = ilWikiContributor::_lookupStatus($this->object->getId(), $ilUser->getId());
421 if ($lpcomment !== "" || $mark !== "" || (int) $status !== ilWikiContributor::STATUS_NOT_GRADED) {
422 $info->addSection($this->lng->txt("wiki_feedback_from_tutor"));
423 if ($lpcomment !== "") {
424 $info->addProperty(
425 $this->lng->txt("wiki_comment"),
426 $lpcomment
427 );
428 }
429 if ($mark !== "") {
430 $info->addProperty(
431 $this->lng->txt("wiki_mark"),
432 $mark
433 );
434 }
435
436 if ((int) $status === ilWikiContributor::STATUS_PASSED) {
437 $info->addProperty(
438 $this->lng->txt("status"),
439 $this->lng->txt("wiki_passed")
440 );
441 }
442 if ((int) $status === ilWikiContributor::STATUS_FAILED) {
443 $info->addProperty(
444 $this->lng->txt("status"),
445 $this->lng->txt("wiki_failed")
446 );
447 }
448 }
449
450 if ($ilAccess->checkAccess("read", "", $this->object->getRefId())) {
451 $info->addButton($lng->txt("wiki_start_page"), self::getGotoLink($this->object->getRefId()));
452 }
453
454 // general information
455 $this->lng->loadLanguageModule("meta");
456 $this->lng->loadLanguageModule("wiki");
457
458 // forward the command
459 $this->ctrl->forwardCommand($info);
460 }
461
462 public function gotoStartPageObject(): void
463 {
464 ilUtil::redirect(self::getGotoLink($this->object->getRefId()));
465 }
466
467 public function addPageTabs(): void
468 {
469 $ilTabs = $this->tabs;
470 $ilCtrl = $this->ctrl;
471
472 $ilCtrl->setParameter(
473 $this,
474 "wpg_id",
475 ilWikiPage::getPageIdForTitle($this->object->getId(), ilWikiUtil::makeDbTitle($this->requested_page))
476 );
477 $ilCtrl->setParameter($this, "page", ilWikiUtil::makeUrlTitle($this->requested_page));
478 $ilTabs->addTarget(
479 "wiki_what_links_here",
480 $this->ctrl->getLinkTargetByClass(
481 "ilwikipagegui",
482 "whatLinksHere"
483 ),
484 "whatLinksHere"
485 );
486 $ilTabs->addTarget(
487 "wiki_print_view",
488 $this->ctrl->getLinkTargetByClass(
489 "ilwikipagegui",
490 "printViewSelection"
491 ),
492 "printViewSelection"
493 );
494 }
495
496 public function addPagesSubTabs(): void
497 {
498 $ilTabs = $this->tabs;
499 $ilCtrl = $this->ctrl;
500
501 $ilTabs->activateTab("wiki_pages");
502
503 $ilCtrl->setParameter(
504 $this,
505 "wpg_id",
507 $this->object->getId(),
508 ilWikiUtil::makeDbTitle($this->requested_page)
509 )
510 );
511 $ilCtrl->setParameter($this, "page", ilWikiUtil::makeUrlTitle($this->requested_page));
512 $ilTabs->addSubTabTarget(
513 "wiki_all_pages",
514 $this->ctrl->getLinkTarget($this, "allPages"),
515 "allPages"
516 );
517 $ilTabs->addSubTabTarget(
518 "wiki_recent_changes",
519 $this->ctrl->getLinkTarget($this, "recentChanges"),
520 "recentChanges"
521 );
522 $ilTabs->addSubTabTarget(
523 "wiki_new_pages",
524 $this->ctrl->getLinkTarget($this, "newPages"),
525 "newPages"
526 );
527 $ilTabs->addSubTabTarget(
528 "wiki_popular_pages",
529 $this->ctrl->getLinkTarget($this, "popularPages"),
530 "popularPages"
531 );
532 $ilTabs->addSubTabTarget(
533 "wiki_orphaned_pages",
534 $this->ctrl->getLinkTarget($this, "orphanedPages"),
535 "orphanedPages"
536 );
537 }
538
539 protected function getTabs(): void
540 {
541 $ilCtrl = $this->ctrl;
542 $ilAccess = $this->access;
544 $ilHelp = $this->help;
545
546 $ilHelp->setScreenIdComponent("wiki");
547
548 // wiki tabs
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"),
556 self::getGotoLink(
557 $this->requested_ref_id,
558 ilWikiUtil::makeDbTitle($this->requested_page)
559 )
560 );
561 }
562
563 // pages
564 if ($ilAccess->checkAccess('read', "", $this->object->getRefId())) {
565 $this->tabs_gui->addTab(
566 "wiki_pages",
567 $lng->txt("wiki_pages"),
568 $this->ctrl->getLinkTarget($this, "allPages")
569 );
570 }
571
572 // info screen
573 if ($ilAccess->checkAccess('visible', "", $this->object->getRefId())) {
574 $this->tabs_gui->addTab(
575 "info_short",
576 $lng->txt("info_short"),
577 $this->ctrl->getLinkTargetByClass("ilinfoscreengui", "showSummary")
578 );
579 }
580
581 // settings
582 if ($ilAccess->checkAccess('write', "", $this->object->getRefId())) {
583 $this->tabs_gui->addTab(
584 "settings",
585 $lng->txt("settings"),
586 $this->ctrl->getLinkTarget($this, "editSettings")
587 );
588
589 // metadata
590 $mdgui = new ilObjectMetaDataGUI($this->object, "wpg");
591 $mdtab = $mdgui->getTab();
592 if ($mdtab) {
593 $this->tabs_gui->addTab(
594 "advmd",
595 $this->lng->txt("meta_data"),
596 $mdtab
597 );
598 }
599 }
600
601 // contributors
602 if ($ilAccess->checkAccess('write', "", $this->object->getRefId())) {
603 $this->tabs_gui->addTab(
604 "wiki_contributors",
605 $lng->txt("wiki_contributors"),
606 $this->ctrl->getLinkTarget($this, "listContributors")
607 );
608 }
609
610 // statistics
611 if ($ilAccess->checkAccess('statistics_read', "", $this->object->getRefId())) {
612 $this->tabs_gui->addTab(
613 "statistics",
614 $lng->txt("statistics"),
615 $this->ctrl->getLinkTargetByClass("ilWikiStatGUI", "initial")
616 );
617 }
618
619 if ($ilAccess->checkAccess("write", "", $this->object->getRefId())) {
620 $this->tabs_gui->addTab(
621 "export",
622 $lng->txt("export"),
623 $this->ctrl->getLinkTargetByClass("ilexportgui", "")
624 );
625 }
626
627 // edit permissions
628 if ($ilAccess->checkAccess('edit_permission', "", $this->object->getRefId())) {
629 $this->tabs_gui->addTab(
630 "perm_settings",
631 $lng->txt("perm_settings"),
632 $this->ctrl->getLinkTargetByClass("ilpermissiongui", "perm")
633 );
634 }
635 }
636 }
637
638 public function setSettingsSubTabs(string $a_active): void
639 {
640 $ilTabs = $this->tabs;
641 $ilCtrl = $this->ctrl;
643 $ilAccess = $this->access;
644
645 if (in_array(
646 $a_active,
647 array("general_settings", "style", "imp_pages", "rating_categories",
648 "page_templates", "advmd", "permission_settings", "notifications", "lti_provider")
649 )) {
650 if ($ilAccess->checkAccess("write", "", $this->object->getRefId())) {
651 // general properties
652 $ilTabs->addSubTab(
653 "general_settings",
654 $lng->txt("wiki_general_settings"),
655 $ilCtrl->getLinkTarget($this, 'editSettings')
656 );
657
658 // permission settings
659 $ilTabs->addSubTab(
660 "permission_settings",
661 $lng->txt("obj_permission_settings"),
662 $this->ctrl->getLinkTargetByClass("ilsettingspermissiongui", "")
663 );
664
665 // style properties
666 $ilTabs->addSubTab(
667 "style",
668 $lng->txt("wiki_style"),
669 $ilCtrl->getLinkTargetByClass("ilObjectContentStyleSettingsGUI", "")
670 );
671 }
672
673 if ($ilAccess->checkAccess("write", "", $this->object->getRefId())) {
674 // important pages
675 $ilTabs->addSubTab(
676 "imp_pages",
677 $lng->txt("wiki_navigation"),
678 $ilCtrl->getLinkTarget($this, 'editImportantPages')
679 );
680 }
681
682 if ($ilAccess->checkAccess("write", "", $this->object->getRefId())) {
683 // page templates
684 $ilTabs->addSubTab(
685 "page_templates",
686 $lng->txt("wiki_page_templates"),
687 $ilCtrl->getLinkTargetByClass("ilwikipagetemplategui", "")
688 );
689
690 // rating categories
691 if ($this->object->getRating() && $this->object->getRatingCategories()) {
692 $lng->loadLanguageModule("rating");
693 $ilTabs->addSubTab(
694 "rating_categories",
695 $lng->txt("rating_categories"),
696 $ilCtrl->getLinkTargetByClass(array('ilratinggui', 'ilratingcategorygui'), '')
697 );
698 }
699
700 $ilTabs->addSubTab(
701 'notifications',
702 $lng->txt("notifications"),
703 $ilCtrl->getLinkTargetByClass("ilobjnotificationsettingsgui", '')
704 );
705 }
706
707 // LTI Provider
708 $lti_settings = new ilLTIProviderObjectSettingGUI($this->object->getRefId());
709 if ($lti_settings->hasSettingsAccess()) {
710 $ilTabs->addSubTabTarget(
711 'lti_provider',
712 $this->ctrl->getLinkTargetByClass(ilLTIProviderObjectSettingGUI::class)
713 );
714 }
715
716 $ilTabs->activateSubTab($a_active);
717 }
718 }
719
720 public function editSettingsObject(): void
721 {
723
724 $this->checkPermission("write");
725
726 $this->setSettingsSubTabs("general_settings");
727
728 $this->initSettingsForm();
729 $this->getSettingsFormValues();
730
731 // Edit ecs export settings
732 $ecs = new ilECSWikiSettings($this->object);
733 $ecs->addSettingsToForm($this->form_gui, 'wiki');
734
735 $tpl->setContent($this->form_gui->getHTML());
736 $this->setSideBlock();
737 }
738
739 public function initSettingsForm(string $a_mode = "edit"): void
740 {
742 $ilCtrl = $this->ctrl;
743 $ilTabs = $this->tabs;
745 $obj_service = $this->object_service;
746
747 $lng->loadLanguageModule("wiki");
748 $ilTabs->activateTab("settings");
749
750 $this->form_gui = new ilPropertyFormGUI();
751
752 // Title
753 $tit = new ilTextInputGUI($lng->txt("title"), "title");
754 $tit->setRequired(true);
755 $this->form_gui->addItem($tit);
756
757 // Description
758 $des = new ilTextAreaInputGUI($lng->txt("description"), "description");
759 $this->form_gui->addItem($des);
760
761 // Introduction
762 $intro = new ilTextAreaInputGUI($lng->txt("wiki_introduction"), "intro");
763 $intro->setCols(40);
764 $intro->setRows(4);
765 $this->form_gui->addItem($intro);
766
767 // Start Page
768 $options = [];
769 if ($a_mode === "edit") {
770 $pages = ilWikiPage::getAllWikiPages($this->object->getId());
771 foreach ($pages as $p) {
772 $options[$p["id"]] = ilStr::shortenTextExtended($p["title"], 60, true);
773 }
774 $si = new ilSelectInputGUI($lng->txt("wiki_start_page"), "startpage_id");
775 $si->setOptions($options);
776 $this->form_gui->addItem($si);
777 } else {
778 $sp = new ilTextInputGUI($lng->txt("wiki_start_page"), "startpage");
779 if ($a_mode === "edit") {
780 $sp->setInfo($lng->txt("wiki_start_page_info"));
781 }
782 $sp->setMaxLength(200);
783 $sp->setRequired(true);
784 $this->form_gui->addItem($sp);
785 }
786
787 // Online
788 $online = new ilCheckboxInputGUI($lng->txt("online"), "online");
789 $this->form_gui->addItem($online);
790
791
792 // rating
793
794 $lng->loadLanguageModule('rating');
795 $rate = new ilCheckboxInputGUI($lng->txt('rating_activate_rating'), 'rating_overall');
796 $rate->setInfo($lng->txt('rating_activate_rating_info'));
797 $this->form_gui->addItem($rate);
798
799 $rating = new ilCheckboxInputGUI($lng->txt("wiki_activate_rating"), "rating");
800 $this->form_gui->addItem($rating);
801
802 /* always active
803 $side = new ilCheckboxInputGUI($lng->txt("wiki_activate_sideblock_rating"), "rating_side");
804 $rating->addSubItem($side);
805 */
806
807 $new = new ilCheckboxInputGUI($lng->txt("wiki_activate_new_page_rating"), "rating_new");
808 $rating->addSubItem($new);
809
810 $extended = new ilCheckboxInputGUI($lng->txt("wiki_activate_extended_rating"), "rating_ext");
811 $rating->addSubItem($extended);
812
813
814 // public comments
815 if (!$ilSetting->get("disable_comments")) {
816 $comments = new ilCheckboxInputGUI($lng->txt("wiki_public_comments"), "public_notes");
817 $this->form_gui->addItem($comments);
818 }
819
820 // important pages
821 // $imp_pages = new ilCheckboxInputGUI($lng->txt("wiki_important_pages"), "imp_pages");
822 // $this->form_gui->addItem($imp_pages);
823
824 // page toc
825 $page_toc = new ilCheckboxInputGUI($lng->txt("wiki_page_toc"), "page_toc");
826 $page_toc->setInfo($lng->txt("wiki_page_toc_info"));
827 $this->form_gui->addItem($page_toc);
828
829 if ($a_mode === "edit") {
830 // advanced metadata auto-linking
831 if (count(ilAdvancedMDRecord::_getSelectedRecordsByObject("wiki", $this->object->getRefId(), "wpg")) > 0) {
832 $link_md = new ilCheckboxInputGUI($lng->txt("wiki_link_md_values"), "link_md_values");
833 $link_md->setInfo($lng->txt("wiki_link_md_values_info"));
834 $this->form_gui->addItem($link_md);
835 }
836
837
838 $section = new ilFormSectionHeaderGUI();
839 $section->setTitle($this->lng->txt('obj_presentation'));
840 $this->form_gui->addItem($section);
841
842 // tile image
843 $obj_service->commonSettings()->legacyForm($this->form_gui, $this->object)->addTileImage();
844
845
846 // additional features
847 $feat = new ilFormSectionHeaderGUI();
848 $feat->setTitle($this->lng->txt('obj_features'));
849 $this->form_gui->addItem($feat);
850
852 $this->object->getId(),
853 $this->form_gui,
854 array(
856 )
857 );
858 }
859
860 // :TODO: sorting
861
862 // Form action and save button
863 $this->form_gui->setTitleIcon(ilUtil::getImagePath("icon_wiki.svg"));
864 if ($a_mode !== "create") {
865 $this->form_gui->setTitle($lng->txt("wiki_settings"));
866 $this->form_gui->addCommandButton("saveSettings", $lng->txt("save"));
867 } else {
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"));
871 }
872
873 // set values
874 if ($a_mode === "create") {
875 $ilCtrl->setParameter($this, "new_type", "wiki");
876 }
877
878 $this->form_gui->setFormAction($ilCtrl->getFormAction($this, "saveSettings"));
879 }
880
881 public function getSettingsFormValues(string $a_mode = "edit"): void
882 {
883 // set values
884 if ($a_mode === "create") {
885 $values["rating_new"] = true;
886
887 $parent = ilObjectFactory::getInstanceByRefId($this->requested_ref_id);
888 $values["rating_overall"] = $parent->selfOrParentWithRatingEnabled();
889 } else {
890 $values["online"] = $this->object->getOnline();
891 $values["title"] = $this->object->getTitle();
892 //$values["startpage"] = $this->object->getStartPage();
893 $values["startpage_id"] = ilWikiPage::_getPageIdForWikiTitle($this->object->getId(), $this->object->getStartPage());
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();
904
905 // only set given values (because of adv. metadata)
906 }
907 $this->form_gui->setValuesByArray($values, true);
908 }
909
910
911 public function saveSettingsObject(): void
912 {
913 $ilCtrl = $this->ctrl;
916 $obj_service = $this->object_service;
917
918 $this->checkPermission("write");
919
920 $this->initSettingsForm();
921
922 if ($this->form_gui->checkInput()) {
923 if (!ilObjWiki::checkShortTitleAvailability($this->form_gui->getInput("shorttitle")) &&
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"));
927 } else {
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"));
931 $this->object->setStartPage(ilWikiPage::lookupTitle($this->form_gui->getInput("startpage_id")));
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"));
935 // $this->object->setRatingAsBlock($this->form_gui->getInput("rating_side"));
936 $this->object->setRatingForNewPages($this->form_gui->getInput("rating_new"));
937 $this->object->setRatingCategories($this->form_gui->getInput("rating_ext"));
938
939 if (!$ilSetting->get("disable_comments")) {
940 $this->object->setPublicNotes($this->form_gui->getInput("public_notes"));
941 }
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();
946
947 // tile image
948 $obj_service->commonSettings()->legacyForm($this->form_gui, $this->object)->saveTileImage();
949
951 $this->object->getId(),
952 $this->form_gui,
953 array(
955 )
956 );
957
958 // Update ecs export settings
959 $ecs = new ilECSWikiSettings($this->object);
960 if ($ecs->handleSettingsUpdate()) {
961 $this->tpl->setOnScreenMessage('success', $this->lng->txt("msg_obj_modified"), true);
962 $ilCtrl->redirect($this, "editSettings");
963 }
964 }
965 }
966
967 $this->form_gui->setValuesByPost();
968 $this->tpl->setContent($this->form_gui->getHTML());
969 }
970
971 public function listContributorsObject(): void
972 {
974 $ilTabs = $this->tabs;
975
976 $this->checkPermission("write");
977 $ilTabs->activateTab("wiki_contributors");
978
979 $table_gui = new ilWikiContributorsTableGUI(
980 $this,
981 "listContributors",
982 $this->object->getId()
983 );
984
985 $tpl->setContent($table_gui->getHTML());
986
987 $this->setSideBlock();
988 }
989
990 public function saveGradingObject(): void
991 {
992 $ilCtrl = $this->ctrl;
994
995 $this->checkPermission("write");
996
997 $users = $this->edit_request->getUserIds();
998 $marks = $this->edit_request->getMarks();
999 $comments = $this->edit_request->getComments();
1000 $status = $this->edit_request->getStatus();
1001
1002 $saved = false;
1003 foreach ($users as $user_id) {
1004 if ($user_id != "") {
1005 $marks_obj = new ilLPMarks($this->object->getId(), $user_id);
1006 $new_mark = ilUtil::stripSlashes($marks[$user_id]);
1007 $new_comment = ilUtil::stripSlashes($comments[$user_id] ?? "");
1008 $new_status = ilUtil::stripSlashes($status[$user_id]);
1009
1010 if ($marks_obj->getMark() !== $new_mark ||
1011 $marks_obj->getComment() !== $new_comment ||
1012 (int) ilWikiContributor::_lookupStatus($this->object->getId(), $user_id) !== (int) $new_status) {
1013 ilWikiContributor::_writeStatus($this->object->getId(), $user_id, $new_status);
1014 $marks_obj->setMark($new_mark);
1015 $marks_obj->setComment($new_comment);
1016 $marks_obj->update();
1017 $saved = true;
1018 }
1019 }
1020 }
1021 if ($saved) {
1022 $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
1023 }
1024
1025 $ilCtrl->redirect($this, "listContributors");
1026 }
1027
1028 // add wiki to locator
1029 protected function addLocatorItems(): void
1030 {
1031 $ilLocator = $this->locator;
1032
1033 if (is_object($this->object)) {
1034 $ilLocator->addItem(
1035 $this->object->getTitle(),
1036 self::getGotoLink($this->object->getRefId()),
1037 "",
1038 $this->requested_ref_id
1039 );
1040 }
1041 }
1042
1043 public static function _goto(string $a_target): void
1044 {
1045 global $DIC;
1046 $main_tpl = $DIC->ui()->mainTemplate();
1047
1048 $ilAccess = $DIC->access();
1049 $lng = $DIC->language();
1050 $ctrl = $DIC->ctrl();
1051
1052 $i = strpos($a_target, "_");
1053 $a_page = "";
1054 if ($i > 0) {
1055 $a_page = substr($a_target, $i + 1);
1056 $a_target = substr($a_target, 0, $i);
1057 }
1058
1059 if ($a_target === "wpage") {
1060 $a_page_arr = explode("_", $a_page);
1061 $wpg_id = (int) $a_page_arr[0];
1062 $ref_id = (int) ($a_page_arr[1] ?? 0);
1063 $w_id = ilWikiPage::lookupWikiId($wpg_id);
1064 if ($ref_id > 0) {
1065 $refs = array($ref_id);
1066 } else {
1067 $refs = ilObject::_getAllReferences($w_id);
1068 }
1069 foreach ($refs as $r) {
1070 if ($ilAccess->checkAccess("read", "", $r)) {
1071 $a_target = $r;
1072 $a_page = ilWikiPage::lookupTitle($wpg_id);
1073 }
1074 }
1075 }
1076
1077 if ($ilAccess->checkAccess("read", "", $a_target)) {
1079 "ilobjwikigui",
1080 "page",
1082 );
1084 "ilwikihandlergui",
1085 "ref_id",
1086 $a_target
1087 );
1088 if ($a_page != "") {
1090 ["ilwikihandlergui", "ilobjwikigui"],
1091 "viewPage"
1092 );
1093 } else {
1095 ["ilwikihandlergui"],
1096 "view"
1097 );
1098 }
1099 } elseif ($ilAccess->checkAccess("visible", "", $a_target)) {
1100 ilObjectGUI::_gotoRepositoryNode($a_target, "infoScreen");
1101 } elseif ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID)) {
1102 $main_tpl->setOnScreenMessage('failure', sprintf(
1103 $lng->txt("msg_no_perm_read_item"),
1105 ), true);
1107 }
1108
1109 throw new ilPermissionException($lng->txt("permission_denied"));
1110 }
1111
1112 public static function getGotoLink(
1113 int $a_ref_id,
1114 string $a_page = ""
1115 ): string {
1116 if ($a_page === "") {
1118 }
1119
1120 $goto = "goto.php?target=wiki_" . $a_ref_id . "_" .
1121 ilWikiUtil::makeUrlTitle($a_page);
1122
1123 return $goto;
1124 }
1125
1126 public function viewPageObject(): void
1127 {
1128 $lng = $this->lng;
1129 $ilCtrl = $this->ctrl;
1130 $tpl = $this->tpl;
1131 $ilTabs = $this->tabs;
1132 $ilAccess = $this->access;
1133
1134 $this->checkPermission("read");
1135
1136 $ilTabs->clearTargets();
1137 $tpl->setHeaderActionMenu("");
1138
1139 $page = ($this->requested_page !== "")
1140 ? $this->requested_page
1141 : $this->object->getStartPage();
1142
1143 if (!ilWikiPage::exists($this->object->getId(), $page)) {
1144 $page = $this->object->getStartPage();
1145 }
1146
1147 if (!ilWikiPage::exists($this->object->getId(), $page)) {
1148 $this->tpl->setOnScreenMessage('info', $lng->txt("wiki_no_start_page"), true);
1149 $ilCtrl->redirect($this, "infoScreen");
1150 return;
1151 }
1152
1153 // page exists, show it !
1154 $ilCtrl->setParameter($this, "page", ilWikiUtil::makeUrlTitle($page));
1155
1156 $wpage_gui = ilWikiPageGUI::getGUIForTitle(
1157 $this->object->getId(),
1159 0,
1160 $this->object->getRefId()
1161 );
1162 $wpage_gui->setStyleId($this->content_style_domain->getEffectiveStyleId());
1163
1164 $this->setContentStyleSheet();
1165
1166 //$wpage_gui->setSideBlock();
1167 $ilCtrl->setCmdClass("ilwikipagegui");
1168 $ilCtrl->setCmd("preview");
1169 if (!$ilAccess->checkAccess("write", "", $this->object->getRefId()) &&
1170 (
1171 !$ilAccess->checkAccess("edit_content", "", $this->object->getRefId()) ||
1172 $wpage_gui->getPageObject()->getBlocked()
1173 )) {
1174 $wpage_gui->setEnableEditing(false);
1175 }
1176
1177 // alter title and description
1178 if ($ilAccess->checkAccess("write", "", $this->object->getRefId())) {
1179 $wpage_gui->activateMetaDataEditor($this->object, "wpg", $wpage_gui->getId());
1180 }
1181
1182 $html = $ilCtrl->forwardCommand($wpage_gui);
1183
1184 $tpl->setContent($html);
1185 }
1186
1187 public function allPagesObject(): void
1188 {
1189 $tpl = $this->tpl;
1190
1191 $this->checkPermission("read");
1192
1193 $this->addPagesSubTabs();
1194
1195 $table_gui = new ilWikiPagesTableGUI(
1196 $this,
1197 "allPages",
1198 $this->object->getId(),
1200 );
1201
1202 $this->setSideBlock();
1203 $tpl->setContent($table_gui->getHTML());
1204 }
1205
1209 public function popularPagesObject(): void
1210 {
1211 $tpl = $this->tpl;
1212
1213 $this->checkPermission("read");
1214
1215 $this->addPagesSubTabs();
1216
1217 $table_gui = new ilWikiPagesTableGUI(
1218 $this,
1219 "popularPages",
1220 $this->object->getId(),
1222 );
1223
1224 $this->setSideBlock();
1225 $tpl->setContent($table_gui->getHTML());
1226 }
1227
1231 public function orphanedPagesObject(): void
1232 {
1233 $tpl = $this->tpl;
1234
1235 $this->checkPermission("read");
1236
1237 $this->addPagesSubTabs();
1238
1239 $table_gui = new ilWikiPagesTableGUI(
1240 $this,
1241 "orphanedPages",
1242 $this->object->getId(),
1244 );
1245
1246 $this->setSideBlock();
1247 $tpl->setContent($table_gui->getHTML());
1248 }
1249
1253 public function gotoPageObject(
1254 string $a_page = ""
1255 ): void {
1256 $ilCtrl = $this->ctrl;
1257
1258 if ($a_page === "") {
1259 $a_page = $this->requested_page;
1260 }
1261
1263 $this->object->getId(),
1265 )) {
1266 // to do: get rid of this redirect
1267 ilUtil::redirect(self::getGotoLink($this->object->getRefId(), $a_page));
1268 } else {
1269 if (!$this->access->checkAccess("edit_content", "", $this->object->getRefId())) {
1270 $this->tpl->setOnScreenMessage("failure", $this->lng->txt("no_permission"), true);
1271 ilUtil::redirect(ilObjWikiGUI::getGotoLink($this->object->getRefId(), $this->edit_request->getFromPage()));
1272 }
1273 if (!$this->object->getTemplateSelectionOnCreation()) {
1274 // check length
1275 if (ilStr::strLen(ilWikiUtil::makeDbTitle($a_page)) > 200) {
1276 $this->tpl->setOnScreenMessage(
1277 'failure',
1278 $this->lng->txt("wiki_page_title_too_long") . " (" . $a_page . ")",
1279 true
1280 );
1281 $ilCtrl->setParameterByClass(
1282 "ilwikipagegui",
1283 "page",
1284 ilWikiUtil::makeUrlTitle($this->edit_request->getFromPage())
1285 );
1286 $ilCtrl->redirectByClass("ilwikipagegui", "preview");
1287 }
1288 $this->object->createWikiPage($a_page);
1289
1290 // redirect to newly created page
1291 $ilCtrl->setParameterByClass("ilwikipagegui", "page", ilWikiUtil::makeUrlTitle(($a_page)));
1292 $ilCtrl->redirectByClass("ilwikipagegui", "edit");
1293 } else {
1294 $ilCtrl->setParameter($this, "page", ilWikiUtil::makeUrlTitle($this->requested_page));
1295 $ilCtrl->setParameter(
1296 $this,
1297 "from_page",
1298 ilWikiUtil::makeUrlTitle($this->edit_request->getFromPage())
1299 );
1300 $ilCtrl->redirect($this, "showTemplateSelection");
1301 }
1302 }
1303 }
1304
1305 public function randomPageObject(): void
1306 {
1307 $this->checkPermission("read");
1308
1309 $page = ilWikiPage::getRandomPage($this->object->getId());
1310 $this->gotoPageObject($page);
1311 }
1312
1313 public function recentChangesObject(): void
1314 {
1315 $tpl = $this->tpl;
1316
1317 $this->checkPermission("read");
1318
1319 $this->addPagesSubTabs();
1320
1321 $table_gui = new ilWikiRecentChangesTableGUI(
1322 $this,
1323 "recentChanges",
1324 $this->object->getId()
1325 );
1326
1327 $this->setSideBlock();
1328 $tpl->setContent($table_gui->getHTML());
1329 }
1330
1331 public function setSideBlock(int $a_wpg_id = 0): void
1332 {
1333 self::renderSideBlock($a_wpg_id, $this->object->getRefId());
1334 }
1335
1336 public static function renderSideBlock(
1337 int $a_wpg_id,
1338 int $a_wiki_ref_id,
1339 ?ilWikiPage $a_wp = null
1340 ): void {
1341 global $DIC;
1342
1343 $tpl = $DIC["tpl"];
1344 $lng = $DIC->language();
1345 $ilAccess = $DIC->access();
1346 $ilCtrl = $DIC->ctrl();
1347
1348 $tpl->addJavaScript("./Modules/Wiki/js/WikiPres.js");
1349
1350 // setting asynch to false fixes #0019457, since otherwise ilBlockGUI would act on asynch and output html when side blocks
1351 // being processed during the export. This is a flaw in ilCtrl and/or ilBlockGUI.
1352 $tpl->addOnLoadCode("il.Wiki.Pres.init('" . $ilCtrl->getLinkTargetByClass("ilobjwikigui", "", "", false, false) . "');");
1353
1354 if ($a_wpg_id > 0 && !$a_wp) {
1355 $a_wp = new ilWikiPage($a_wpg_id);
1356 }
1357
1358 // search block
1359 $rcontent = ilRepositoryObjectSearchGUI::getSearchBlockHTML($lng->txt('wiki_search'));
1360
1361
1362 // quick navigation
1363 if ($a_wpg_id > 0) {
1364 // rating
1365 $wiki_id = ilObject::_lookupObjId($a_wiki_ref_id);
1366 if (ilObjWiki::_lookupRating($wiki_id) &&
1367 // ilObjWiki::_lookupRatingAsBlock($wiki_id) &&
1368 $a_wp->getRating()) {
1369 $rgui = new ilRatingGUI();
1370 $rgui->setObject($wiki_id, "wiki", $a_wpg_id, "wpg");
1371 $rgui->enableCategories(ilObjWiki::_lookupRatingCategories($wiki_id));
1372 $rgui->setYourRatingText("#");
1373 $rcontent .= $rgui->getBlockHTML($lng->txt("wiki_rate_page"));
1374 }
1375
1376 // advanced metadata
1378 $cmd = null;
1379 if ($ilAccess->checkAccess("write", "", $a_wiki_ref_id) ||
1380 $ilAccess->checkAccess("edit_page_meta", "", $a_wiki_ref_id)) {
1381 $cmd = array(
1382 "edit" => $ilCtrl->getLinkTargetByClass("ilwikipagegui", "editAdvancedMetaData"),
1383 "hide" => $ilCtrl->getLinkTargetByClass("ilwikipagegui", "hideAdvancedMetaData")
1384 );
1385 }
1386 $wiki = new ilObjWiki($a_wiki_ref_id);
1387 $callback = $wiki->getLinkMetadataValues()
1388 ? array($wiki, "decorateAdvMDValue")
1389 : null;
1390 $mdgui = new ilObjectMetaDataGUI($wiki, "wpg", $a_wpg_id);
1391 $rcontent .= $mdgui->getBlockHTML($cmd, $callback); // #17291
1392 }
1393 }
1394
1395 // important pages
1396 $imp_pages_block = new ilWikiImportantPagesBlockGUI();
1397 $rcontent .= $imp_pages_block->getHTML();
1398
1399 // wiki functions block
1400 if ($a_wpg_id > 0) {
1401 $wiki_functions_block = new ilWikiFunctionsBlockGUI();
1402 $wiki_functions_block->setPageObject($a_wp);
1403 $rcontent .= $wiki_functions_block->getHTML();
1404 }
1405
1406 $tpl->setRightContent($rcontent);
1407 }
1408
1409 public function newPagesObject(): void
1410 {
1411 $tpl = $this->tpl;
1412
1413 $this->checkPermission("read");
1414
1415 $this->addPagesSubTabs();
1416
1417 $table_gui = new ilWikiPagesTableGUI(
1418 $this,
1419 "newPages",
1420 $this->object->getId(),
1422 );
1423
1424 $this->setSideBlock();
1425 $tpl->setContent($table_gui->getHTML());
1426 }
1427
1428 protected function getPrintPageIds(): array
1429 {
1430 $page_ids = [];
1431 $ordering = $this->edit_request->getPrintOrdering();
1432
1433 // multiple ordered page ids
1434 if (count($ordering) > 0) {
1435 asort($ordering);
1436 $page_ids = array_keys($ordering);
1437 }
1438 // single page
1439 elseif ($this->edit_request->getWikiPageId()) {
1440 $page_ids = array($this->edit_request->getWikiPageId());
1441 }
1442 return $page_ids;
1443 }
1444
1445 public function getPrintView(bool $export = false): \ILIAS\Export\PrintProcessGUI
1446 {
1447 $page_ids = $export
1448 ? null
1449 : $this->getPrintPageIds();
1450 $provider = new \ILIAS\Wiki\WikiPrintViewProviderGUI(
1451 $this->lng,
1452 $this->ctrl,
1453 $this->object->getRefId(),
1454 $page_ids
1455 );
1456
1457 return new \ILIAS\Export\PrintProcessGUI(
1458 $provider,
1459 $this->http,
1460 $this->ui,
1461 $this->lng
1462 );
1463 }
1464
1465 public function printViewObject(): void
1466 {
1467 $print_view = $this->getPrintView();
1468 $print_view->sendPrintView();
1469 }
1470
1471 public function performSearchObject(): void
1472 {
1473 $tpl = $this->tpl;
1474 $ilTabs = $this->tabs;
1475 $ilCtrl = $this->ctrl;
1476 $lng = $this->lng;
1477
1478 $this->checkPermission("read");
1479
1480 $ilTabs->setTabActive("wiki_search_results");
1481
1482 if ($this->edit_request->getSearchTerm() === "") {
1483 $this->tpl->setOnScreenMessage('failure', $lng->txt("wiki_please_enter_search_term"), true);
1484 $ilCtrl->redirectByClass("ilwikipagegui", "preview");
1485 }
1486
1487 $search_results = ilObjWiki::_performSearch(
1488 $this->object->getId(),
1489 $this->edit_request->getSearchTerm()
1490 );
1491 $table_gui = new ilWikiSearchResultsTableGUI(
1492 $this,
1493 "performSearch",
1494 $this->object->getId(),
1495 $search_results,
1496 $this->edit_request->getSearchTerm()
1497 );
1498
1499 $this->setSideBlock();
1500 $tpl->setContent($table_gui->getHTML());
1501 }
1502
1503 public function setContentStyleSheet(): void
1504 {
1505 $tpl = $this->tpl;
1506
1507 if ($tpl == null) {
1508 $tpl = $this->tpl;
1509 }
1510
1511 $this->content_style_gui->addCss($tpl, $this->object->getRefId());
1513 }
1514
1515
1516 //
1517 // Important pages
1518 //
1519
1520 public function editImportantPagesObject(): void
1521 {
1522 $tpl = $this->tpl;
1523 $ilToolbar = $this->toolbar;
1524 $ilTabs = $this->tabs;
1525 $lng = $this->lng;
1526 $ilCtrl = $this->ctrl;
1527
1528 $this->checkPermission("edit_wiki_navigation");
1529
1530 $this->tpl->setOnScreenMessage('info', $lng->txt("wiki_navigation_info"));
1531
1532 $ipages = ilObjWiki::_lookupImportantPagesList($this->object->getId());
1533 $ipages_ids = array();
1534 foreach ($ipages as $i) {
1535 $ipages_ids[] = $i["page_id"];
1536 }
1537
1538 // list pages
1539 $pages = ilWikiPage::getAllWikiPages($this->object->getId());
1540 $options = array("" => $lng->txt("please_select"));
1541 foreach ($pages as $p) {
1542 if (!in_array($p["id"], $ipages_ids)) {
1543 $options[$p["id"]] = ilStr::shortenTextExtended($p["title"], 60, true);
1544 }
1545 }
1546 if (count($options) > 0) {
1547 $si = new ilSelectInputGUI($lng->txt("wiki_pages"), "imp_page_id");
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");
1553 }
1554
1555
1556 $ilTabs->activateTab("settings");
1557 $this->setSettingsSubTabs("imp_pages");
1558
1559 $imp_table = new ilImportantPagesTableGUI($this, "editImportantPages");
1560
1561 $tpl->setContent($imp_table->getHTML());
1562 }
1563
1564 public function addImportantPageObject(): void
1565 {
1566 $ilCtrl = $this->ctrl;
1567 $lng = $this->lng;
1568
1569 $this->checkPermission("edit_wiki_navigation");
1570
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);
1575 }
1576 $ilCtrl->redirect($this, "editImportantPages");
1577 }
1578
1580 {
1581 $ilCtrl = $this->ctrl;
1582 $tpl = $this->tpl;
1583 $lng = $this->lng;
1584
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");
1589 } else {
1590 $cgui = new ilConfirmationGUI();
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");
1595
1596 foreach ($imp_page_ids as $i) {
1597 $cgui->addItem("imp_page_id[]", $i, ilWikiPage::lookupTitle((int) $i));
1598 }
1599
1600 $tpl->setContent($cgui->getHTML());
1601 }
1602 }
1603
1604 public function removeImportantPagesObject(): void
1605 {
1606 $ilCtrl = $this->ctrl;
1607 $lng = $this->lng;
1608
1609 $this->checkPermission("edit_wiki_navigation");
1610
1611 $imp_page_ids = $this->edit_request->getImportantPageIds();
1612 foreach ($imp_page_ids as $i) {
1613 $this->object->removeImportantPage((int) $i);
1614 }
1615 $this->tpl->setOnScreenMessage('success', $lng->txt("wiki_removed_imp_pages"), true);
1616 $ilCtrl->redirect($this, "editImportantPages");
1617 }
1618
1619 public function saveOrderingAndIndentObject(): void
1620 {
1621 $ilCtrl = $this->ctrl;
1622 $lng = $this->lng;
1623
1624 $this->checkPermission("edit_wiki_navigation");
1625
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");
1631 }
1632
1633 public function setAsStartPageObject(): void
1634 {
1635 $ilCtrl = $this->ctrl;
1636 $lng = $this->lng;
1637
1638 $this->checkPermission("edit_wiki_navigation");
1639
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);
1643 } else {
1644 $this->object->removeImportantPage($imp_page_ids[0]);
1645 $this->object->setStartPage(ilWikiPage::lookupTitle($imp_page_ids[0]));
1646 $this->object->update();
1647 $this->tpl->setOnScreenMessage('success', $this->lng->txt("msg_obj_modified"), true);
1648 }
1649 $ilCtrl->redirect($this, "editImportantPages");
1650 }
1651
1652
1658 public function exportHTML(): void
1659 {
1661 $wiki = $this->object;
1662 $cont_exp = new Export\WikiHtmlExport($wiki);
1663
1664 $format = explode("_", $this->edit_request->getFormat());
1665 if (($format[1] ?? "") === "comments") {
1666 $cont_exp->setMode(Export\WikiHtmlExport::MODE_COMMENTS);
1667 }
1668
1669 $cont_exp->buildExportFile();
1670 }
1671
1675 public static function lookupSubObjectTitle(
1676 int $a_wiki_id,
1677 string $a_page_id
1678 ): string {
1679 $page = new ilWikiPage($a_page_id);
1680 if ($page->getWikiId() === $a_wiki_id) {
1681 return $page->getTitle();
1682 }
1683 return "";
1684 }
1685
1689 public function getSubObjectTitle(
1690 int $a_id,
1691 string $a_type
1692 ): string {
1693 return ilWikiPage::lookupTitle($a_id);
1694 }
1695
1696 public function showTemplateSelectionObject(): void
1697 {
1698 $lng = $this->lng;
1699 $tpl = $this->tpl;
1700 $ilTabs = $this->tabs;
1701 $ilCtrl = $this->ctrl;
1702
1703 $ilCtrl->setParameterByClass(
1704 "ilobjwikigui",
1705 "from_page",
1706 ilWikiUtil::makeUrlTitle($this->edit_request->getFromPage())
1707 );
1708 $ilTabs->clearTargets();
1709 $this->tpl->setOnScreenMessage('info', $lng->txt("wiki_page_not_exist_select_templ"));
1710
1711 $form = $this->initTemplateSelectionForm();
1712 $tpl->setContent($form->getHTML());
1713 }
1714
1716 {
1717 $lng = $this->lng;
1718 $ilCtrl = $this->ctrl;
1719
1720 $form = new ilPropertyFormGUI();
1721
1722 // page name
1723 $hi = new ilHiddenInputGUI("page");
1724 $hi->setValue($this->requested_page);
1725 $form->addItem($hi);
1726
1727 // page template
1728 $radg = new ilRadioGroupInputGUI($lng->txt("wiki_page_template"), "page_templ");
1729 $radg->setRequired(true);
1730
1731 if ($this->object->getEmptyPageTemplate()) {
1732 $op1 = new ilRadioOption($lng->txt("wiki_empty_page"), 0);
1733 $radg->addOption($op1);
1734 }
1735
1736 $wt = new ilWikiPageTemplate($this->object->getId());
1737 $ts = $wt->getAllInfo(ilWikiPageTemplate::TYPE_NEW_PAGES);
1738 foreach ($ts as $t) {
1739 $op = new ilRadioOption($t["title"], $t["wpage_id"]);
1740 $radg->addOption($op);
1741 }
1742
1743 $form->addItem($radg);
1744
1745 // save and cancel commands
1746 $form->addCommandButton("createPageUsingTemplate", $lng->txt("wiki_create_page"));
1747 $form->addCommandButton("cancelCreationPageUsingTemplate", $lng->txt("cancel"));
1748
1749 $form->setTitle($lng->txt("wiki_new_page") . ": " . $this->requested_page);
1750 $form->setFormAction($ilCtrl->getFormAction($this));
1751
1752 return $form;
1753 }
1754
1755 public function createPageUsingTemplateObject(): void
1756 {
1757 $tpl = $this->tpl;
1758 $lng = $this->lng;
1759 $ilCtrl = $this->ctrl;
1760
1761 $form = $this->initTemplateSelectionForm();
1762 if ($form->checkInput()) {
1763 $a_page = $this->edit_request->getPage();
1764 $this->object->createWikiPage(
1765 $a_page,
1766 $this->edit_request->getPageTemplateId()
1767 );
1768
1769 // redirect to newly created page
1770 $ilCtrl->setParameterByClass("ilwikipagegui", "page", ilWikiUtil::makeUrlTitle(($a_page)));
1771 $ilCtrl->redirectByClass("ilwikipagegui", "edit");
1772
1773 $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
1774 $ilCtrl->redirect($this, "");
1775 } else {
1776 $form->setValuesByPost();
1777 $tpl->setContent($form->getHTML());
1778 }
1779 }
1780
1782 {
1783 $ilCtrl = $this->ctrl;
1784
1785 // redirect to newly created page
1786 $ilCtrl->setParameterByClass(
1787 "ilwikipagegui",
1788 "page",
1789 ilWikiUtil::makeUrlTitle($this->edit_request->getFromPage())
1790 );
1791 $ilCtrl->redirectByClass("ilwikipagegui", "preview");
1792 }
1793
1794 protected function checkPermissionBool(string $perm, string $cmd = "", string $type = "", ?int $ref_id = null): bool
1795 {
1796 if ($perm === "create") {
1797 return parent::checkPermissionBool($perm, $cmd, $type, $ref_id);
1798 } else {
1799 if (!$ref_id) {
1800 $ref_id = $this->object->getRefId();
1801 }
1802 return ilWikiPerm::check($perm, $ref_id, $cmd);
1803 }
1804 }
1805
1806
1807 //
1808 // User HTML Export
1809 //
1810
1814 public function initUserHTMLExportObject(): void
1815 {
1816 $this->log->debug("init: " . $this->req_with_comments);
1817 $this->checkPermission("wiki_html_export");
1818 $this->object->initUserHTMLExport($this->req_with_comments);
1819 }
1820
1824 public function startUserHTMLExportObject(): void
1825 {
1826 $this->log->debug("start: " . $this->req_with_comments);
1827 $this->checkPermission("wiki_html_export");
1828 $this->object->startUserHTMLExport($this->req_with_comments);
1829 }
1830
1834 public function getUserHTMLExportProgressObject(): void
1835 {
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);
1839
1841 $pb->setCurrent($p["progress"]);
1842
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));
1848 exit;
1849 }
1850
1851 public function downloadUserHTMLExportObject(): void
1852 {
1853 $this->log->debug("download");
1854 $this->checkPermission("wiki_html_export");
1855 $this->object->deliverUserHTMLExport();
1856 }
1857
1859 {
1860 $this->log->debug("download");
1861 $this->checkPermission("wiki_html_export");
1862 $this->object->deliverUserHTMLExport(true);
1863 }
1864
1865 protected function triggerAssignmentTool(): void
1866 {
1867 if (!is_object($this->object)) {
1868 return;
1869 }
1870 $ass_info = ilExcRepoObjAssignment::getInstance()->getAssignmentInfoOfObj(
1871 $this->object->getRefId(),
1872 $this->user->getId()
1873 );
1874 if (count($ass_info) > 0) {
1875 $ass_ids = array_map(static function ($i): int {
1876 return $i->getId();
1877 }, $ass_info);
1878 $this->tool_context->current()->addAdditionalData(ilExerciseGSToolProvider::SHOW_EXC_ASSIGNMENT_INFO, true);
1879 $this->tool_context->current()->addAdditionalData(ilExerciseGSToolProvider::EXC_ASS_IDS, $ass_ids);
1880 $this->tool_context->current()->addAdditionalData(
1882 $this->getAssignmentButtons()
1883 );
1884 }
1885 }
1886
1890 protected function getAssignmentButtons(): array
1891 {
1892 $ilCtrl = $this->ctrl;
1893 $ui = $this->ui;
1894 $lng = $this->lng;
1895
1896 $ass_info = ilExcRepoObjAssignment::getInstance()->getAssignmentInfoOfObj(
1897 $this->object->getRefId(),
1898 $this->user->getId()
1899 );
1900 $buttons = [];
1901 foreach ($ass_info as $i) { // should be only one
1902 $ass = new ilExAssignment($i->getId());
1903 $times_up = $ass->afterDeadlineStrict();
1904
1905 // submit button
1906 if (!$times_up) {
1907 $ilCtrl->setParameterByClass("ilwikipagegui", "ass", $ass->getId());
1908 $submit_link = $ilCtrl->getLinkTargetByClass("ilwikipagegui", "finalizeAssignment");
1909 $ilCtrl->setParameterByClass("ilwikipagegui", "ass", "");
1910
1911 $buttons[$i->getId()][] = $ui->factory()->button()->primary($lng->txt("wiki_finalize_wiki"), $submit_link);
1912 }
1913
1914 // submitted files
1915 $submission = new ilExSubmission($ass, $this->user->getId());
1916 if ($submission->hasSubmitted()) {
1917 $submitted = $submission->getSelectedObject();
1918 if ($submitted["ts"] != "") {
1919 $ilCtrl->setParameterByClass("ilwikipagegui", "ass", $ass->getId());
1920 }
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);
1924 }
1925 }
1926 return $buttons;
1927 }
1928}
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
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_NEW_PAGES
const IL_WIKI_ORPHANED_PAGES
static _getSelectedRecordsByObject(string $a_obj_type, int $a_id, string $a_sub_type="", bool $is_ref_id=true)
This class represents a checkbox property in a property form.
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...
Exercise assignment.
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...
Help GUI class.
setScreenIdComponent(string $a_comp)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilInfoScreenGUI.
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 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)
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)
afterSave(ilObject $new_object)
Post (successful) object creation hook.
startUserHTMLExportObject()
Export html (as user)
ILIAS DI UIServices $ui
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
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)
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.
ilAccessHandler $access
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
ilSetting $settings
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="")
ilLocatorGUI $locator
prepareOutput(bool $show_sub_objects=true)
ilLanguage $lng
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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
setTitle(string $title)
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 class represents a property form user interface.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class represents a property in a property form.
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 class represents a selection list property in a property form.
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)
Definition: class.ilStr.php:63
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...
Definition: confirmReg.php:20
const ROOT_FOLDER_ID
Definition: constants.php:32
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']
global $DIC
Definition: feed.php:28
$ilUser
Definition: imgupload.php:34
setContent(string $a_html)
Sets content for standard template.
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
Definition: latex.php:41
exit
Definition: login.php:28
$ref_id
Definition: ltiauth.php:67
$provider
Definition: ltitoken.php:83
$format
Definition: metadata.php:235
$i
Definition: metadata.php:41
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.
global $ilSetting
Definition: privfeed.php:17
$type
$lng
$comments