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