ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
class.ilWikiPageGUI.php
Go to the documentation of this file.
1 <?php
2 
20 
32 {
33  protected \ILIAS\Exercise\InternalDomainService $exc_domain;
34  protected \ILIAS\Wiki\InternalDomainService $domain;
35  protected \ILIAS\Wiki\Page\PageManager $wiki_pm;
37  protected \ILIAS\Wiki\InternalGUIService $wiki_gui;
38  protected \ILIAS\Notes\Service $notes;
39  protected \ILIAS\HTTP\Services $http;
40  protected \ILIAS\Wiki\WikiGUIRequest $wiki_request;
42  protected bool $fill_on_load_code = false;
43  protected int $wiki_ref_id = 0;
44  protected ilSetting $settings;
45  protected ilObjWiki $wiki;
46 
47  public function __construct(
48  int $a_id = 0,
49  int $a_old_nr = 0,
50  int $a_wiki_ref_id = 0,
51  string $lang = "-"
52  ) {
53  global $DIC;
54 
55  $service = $DIC->wiki()->internal();
56  $domain = $service->domain();
57  $gui = $service->gui();
58 
59  $this->domain = $domain;
60  $this->settings = $domain->settings();
61  $this->http = $gui->http();
62 
63  // needed for notifications
64  $this->setWikiRefId($a_wiki_ref_id);
65  parent::__construct("wpg", $a_id, $a_old_nr, false, $lang);
66  $this->getPageObject()->setWikiRefId($this->getWikiRefId());
67  $this->ctrl->saveParameterByClass(self::class, "wpg_id");
68 
69  // content style
70  $this->tpl->addCss(ilObjStyleSheet::getSyntaxStylePath());
71  $this->wiki_request = $gui->request();
72  $this->notes = $DIC->notes();
73  $this->wiki_gui = $gui;
74  $this->ot = $gui->wiki()->translation($a_wiki_ref_id);
75  $this->wiki_pm = $this->domain->page()->page($this->getWikiRefId());
76  $this->exc_domain = $DIC->exercise()->internal()->domain();
77  }
78 
79  public function setScreenIdComponent(): void
80  {
81  $ilHelp = $this->help;
82  $ilHelp->setScreenIdComponent("copgwpg");
83  }
84 
85  public function setWikiRefId(int $a_ref_id): void
86  {
87  $this->wiki_ref_id = $a_ref_id;
88  }
89 
90  public function getWikiRefId(): int
91  {
92  return $this->wiki_ref_id;
93  }
94 
95  public function setWiki(ilObjWiki $a_val): void
96  {
97  $this->wiki = $a_val;
98  }
99 
100  public function getWiki(): ilObjWiki
101  {
102  return $this->wiki;
103  }
104 
108  public function executeCommand(): string
109  {
110  $ilCtrl = $this->ctrl;
111  $ilTabs = $this->tabs_gui;
112  $ilUser = $this->user;
113  $ilAccess = $this->access;
114  $lng = $this->lng;
115  $tpl = $this->tpl;
116 
117  $next_class = $this->ctrl->getNextClass($this);
118 
119  $head_title = ilObject::_lookupTitle(ilObject::_lookupObjId($this->requested_ref_id)) .
120  ": " . $this->getWikiPage()->getTitle();
121  $tpl->setHeaderPageTitle($head_title);
122  // see #13804
123  //if ($this->wiki_request->getWikiPageId() > 0) {
124  PageContentProvider::setPermaLink($this->wiki_pm->getPermaLink(
125  $this->getPageObject()->getId(),
126  $this->getPageObject()->getLanguage()
127  ));
128  //} else {
129  // $tpl->setPermanentLink("wiki", $this->requested_ref_id);
130  //}
131 
132 
133  switch ($next_class) {
134  case "ilnotegui":
135  case "ilcommentgui":
136  $this->getTabs();
137  $ilTabs->setTabActive("pg");
138  return $this->preview();
139 
140  case "ilratinggui":
141  // for rating side block
142  $rating_gui = new ilRatingGUI();
143  $rating_gui->setObject(
144  $this->getPageObject()->getParentId(),
145  "wiki",
146  $this->getPageObject()->getId(),
147  "wpg"
148  );
149  $rating_gui->setUpdateCallback(array($this, "updateStatsRating"));
150  $this->ctrl->forwardCommand($rating_gui);
151  $ilCtrl->redirect($this, "preview");
152  break;
153 
154  case "ilcommonactiondispatchergui":
156  if (!is_null($gui)) {
157  $gui->enableCommentsSettings(false);
158  $gui->setRatingCallback(
159  $this,
160  "preview"
161  );
162  $this->ctrl->forwardCommand($gui);
163  }
164  break;
165 
166  case "ilwikistatgui":
167  if ($ilAccess->checkAccess("statistics_read", "", $this->wiki_ref_id)) {
168  $this->tabs_gui->clearTargets(); // see ilObjWikiGUI::getTabs()
169  $this->getTabs("statistics");
170 
171  $gui = new ilWikiStatGUI(
172  $this->getPageObject()->getParentId(),
173  $this->getPageObject()->getId()
174  );
175  $this->ctrl->forwardCommand($gui);
176  }
177  break;
178  case 'ilobjectmetadatagui':
179 
180  if (!$ilAccess->checkAccess("write", "", $this->wiki_ref_id)) {
181  $this->tpl->setOnScreenMessage('failure', $lng->txt("permission_denied"), true);
182  $ilCtrl->redirect($this, "preview");
183  }
184  return parent::executeCommand();
185 
186  case "ilpropertyformgui":
187  // only case is currently adv metadata internal link in info settings, see #24497
188  $form = $this->initAdvancedMetaDataForm();
189  $ilCtrl->forwardCommand($form);
190  break;
191 
192  default:
193 
194  if (strtolower($ilCtrl->getNextClass()) === "ilpageeditorgui") {
195  self::initEditingJS($this->tpl);
196  }
197 
198  if ($this->wiki_request->getNotification() > 0
199  && $ilUser->getId() !== ANONYMOUS_USER_ID) {
200  switch ($this->wiki_request->getNotification()) {
201  case 1:
202  ilNotification::setNotification(ilNotification::TYPE_WIKI, $ilUser->getId(), $this->getPageObject()->getParentId(), false);
203  break;
204 
205  case 2:
206  // remove all page notifications here?
207  ilNotification::setNotification(ilNotification::TYPE_WIKI, $ilUser->getId(), $this->getPageObject()->getParentId(), true);
208  break;
209 
210  case 3:
211  ilNotification::setNotification(ilNotification::TYPE_WIKI_PAGE, $ilUser->getId(), $this->getPageObject()->getId(), false);
212  break;
213 
214  case 4:
215  ilNotification::setNotification(ilNotification::TYPE_WIKI_PAGE, $ilUser->getId(), $this->getPageObject()->getId(), true);
216  break;
217  }
218  $ilCtrl->redirect($this, "preview");
219  }
220 
221  $this->setPresentationTitle($this->getWikiPage()->getTitle());
222  return parent::executeCommand();
223  }
224  return "";
225  }
226 
227  public function setWikiPage(ilWikiPage $a_wikipage): void
228  {
229  $this->setPageObject($a_wikipage);
230  }
231 
232  public function getWikiPage(): ilWikiPage
233  {
236  return $this->getPageObject();
237  }
238 
239  public function setSideBlock(): void
240  {
242  $this->getWikiPage()->getId(),
243  $this->wiki_ref_id,
244  $this->getWikiPage()
245  );
246  }
247 
248  public function addHeaderAction(
249  bool $a_redraw = false
250  ): string {
251  $ilUser = $this->user;
252  $ilAccess = $this->access;
253 
254  $wiki_id = $this->getPageObject()->getParentId();
255  $page_id = $this->getPageObject()->getId();
256 
257  $dispatcher = new ilCommonActionDispatcherGUI(
259  $ilAccess,
260  "wiki",
261  $this->requested_ref_id,
262  $wiki_id
263  );
264 
265  // see #33422
266  $dispatcher->setSubObject("wpg", $page_id);
267 
269  $this->ctrl->getLinkTarget($this, "redrawHeaderAction", "", true),
270  "",
271  $this->ctrl->getLinkTargetByClass(array("ilcommonactiondispatchergui", "iltagginggui"), "", "", true, false)
272  );
273 
274  $lg = $dispatcher->initHeaderAction();
275  $lg->enableNotes(true);
276  $lg->enableComments(ilObjWiki::_lookupPublicNotes($wiki_id), false);
277 
278  // rating
279  if (ilObjWiki::_lookupRatingOverall($wiki_id)) {
280  $lg->enableRating(
281  true,
282  $this->lng->txt("wiki_rate_overall"),
283  false,
284  // so ilCtrl does not use the shortcut via ilWikiGUI
285  array("ilcommonactiondispatchergui", "ilratinggui"),
286  true
287  );
288  }
289 
290  // notification
291  if ($ilUser->getId() !== ANONYMOUS_USER_ID) {
292  if (ilNotification::hasNotification(ilNotification::TYPE_WIKI, $ilUser->getId(), $wiki_id)) {
293  $this->ctrl->setParameter($this, "ntf", 1);
294  if (ilNotification::hasOptOut($wiki_id)) {
295  $lg->addCustomCommand($this->ctrl->getLinkTarget($this), "wiki_notification_deactivate_wiki");
296  }
297 
298  $lg->addHeaderIcon(
299  "not_icon",
300  ilUtil::getImagePath("object/notification_on.svg"),
301  $this->lng->txt("wiki_notification_activated")
302  );
303  } else {
304  $this->ctrl->setParameter($this, "ntf", 2);
305  $lg->addCustomCommand($this->ctrl->getLinkTarget($this), "wiki_notification_activate_wiki");
306 
307  if (ilNotification::hasNotification(ilNotification::TYPE_WIKI_PAGE, $ilUser->getId(), $page_id)) {
308  $this->ctrl->setParameter($this, "ntf", 3);
309  $lg->addCustomCommand($this->ctrl->getLinkTarget($this), "wiki_notification_deactivate_page");
310 
311  $lg->addHeaderIcon(
312  "not_icon",
313  ilUtil::getImagePath("object/notification_on.svg"),
314  $this->lng->txt("wiki_page_notification_activated")
315  );
316  } else {
317  $this->ctrl->setParameter($this, "ntf", 4);
318  $lg->addCustomCommand($this->ctrl->getLinkTarget($this), "wiki_notification_activate_page");
319 
320  $lg->addHeaderIcon(
321  "not_icon",
322  ilUtil::getImagePath("object/notification_off.svg"),
323  $this->lng->txt("wiki_notification_deactivated")
324  );
325  }
326  }
327  $this->ctrl->setParameter($this, "ntf", "");
328  }
329 
330  if (!$a_redraw) {
331  $this->tpl->setHeaderActionMenu($lg->getHeaderAction());
332  } else {
333  // we need to add onload code manually (rating, comments, etc.)
334  return $lg->getHeaderAction() .
335  $this->tpl->getOnLoadCodeForAsynch();
336  }
337  return "";
338  }
339 
340  public function redrawHeaderAction(): void
341  {
342  echo $this->addHeaderAction(true);
343  exit;
344  }
345 
346  public function preview(): string
347  {
348  $ilCtrl = $this->ctrl;
349  $ilAccess = $this->access;
350  $lng = $this->lng;
351  $tpl = $this->tpl;
352  $ilUser = $this->user;
354  $append = "";
355  $message = "";
356 
357 
358  // block/unblock
359  if ($this->getPageObject()->getBlocked()) {
360  $this->tpl->setOnScreenMessage('info', $lng->txt("wiki_page_status_blocked"));
361  }
362 
363  $this->increaseViewCount();
364 
365  $this->addHeaderAction();
366 
367  // content
368  if (!in_array($ilCtrl->getNextClass(), ["ilnotegui", "ilcommentgui"])) {
369  $this->setSideBlock();
370  }
371 
372  $wtpl = new ilTemplate(
373  "tpl.wiki_page_view_main_column.html",
374  true,
375  true,
376  "components/ILIAS/Wiki"
377  );
378  $callback = array($this, "observeNoteAction");
379  // notes
380  if (!$ilSetting->get("disable_comments") &&
381  ilObjWiki::_lookupPublicNotes($this->getPageObject()->getParentId())) {
382  $may_delete = ($ilSetting->get("comments_del_tutor", '1') &&
383  $ilAccess->checkAccess("write", "", $this->requested_ref_id));
384  $wtpl->setVariable("NOTES", $this->getNotesHTML(
385  $this->getPageObject(),
386  true,
387  ilObjWiki::_lookupPublicNotes($this->getPageObject()->getParentId()),
388  $may_delete,
389  $callback
390  ));
391  }
392 
393 
394  // page content
396  $this->showEditToolbar();
397  $this->setRenderPageContainer(true);
398  $wtpl->setVariable("PAGE", $this->showPage());
399 
400  $tpl->setLoginTargetPar("wiki_" . $this->requested_ref_id . $append);
401 
402  // last edited info
403  $wtpl->setVariable(
404  "LAST_EDITED_INFO",
405  $lng->txt("wiki_last_edited") . ": " .
407  new ilDateTime($this->getPageObject()->getLastChange(), IL_CAL_DATETIME)
408  ) . ", " .
410  $this->getPageObject()->getLastChangeUser(),
411  false,
412  true,
413  $ilCtrl->getLinkTarget($this, "preview")
414  )
415  );
416 
417  $tpl->setLoginTargetPar("wiki_" . $this->requested_ref_id . $append);
418 
419  //highlighting
420  if ($this->wiki_request->getSearchString()) {
421  $cache = ilUserSearchCache::_getInstance($ilUser->getId());
422  $cache->switchSearchType(ilUserSearchCache::LAST_QUERY);
423  $search_string = $cache->getQuery();
424 
425  // advanced search?
426  if (is_array($search_string)) {
427  $search_string = $search_string["lom_content"];
428  }
429 
430  $p = new ilQueryParser($search_string);
431  $p->parse();
432 
433  $words = $p->getQuotedWords();
434  if (is_array($words)) {
435  foreach ($words as $w) {
436  ilTextHighlighterGUI::highlight("ilCOPageContent", $w, $tpl);
437  }
438  }
439  $this->fill_on_load_code = true;
440  }
441 
442  return $message . $wtpl->get();
443  }
444 
445  public function showPage(): string
446  {
447  if ($this->getOutputMode() === ilPageObjectGUI::PRESENTATION && !$this->getAbstractOnly()) {
448  $this->initToolbar();
449  }
450  $this->setTemplateOutput(false);
451 
452  if (!$this->getAbstractOnly()) {
453  $this->setPresentationTitle($this->getWikiPage()->getTitle());
454 
455  // wiki stats clean up
456  // $this->increaseViewCount();
457  }
458 
459  return parent::showPage();
460  }
461 
462  protected function initToolbar(): void
463  {
465 
467 
468  $print_view = $this->getPrintView();
469  $modal_elements = $print_view->getModalElements($this->ctrl->getLinkTarget(
470  $this,
471  "printViewSelection"
472  ));
473  $toolbar->addComponent($modal_elements->button);
474  $toolbar->addComponent($modal_elements->modal);
475  }
476 
477  protected function getCurrentLanguage(): string
478  {
479  return $this->getPageObject()->getLanguage();
480  }
481 
482  protected function addLanguageSelectionToToolbar(): void
483  {
485  $f = $this->wiki_gui->ui()->factory();
486 
487  $this->ctrl->setParameterByClass(self::class, "wpg_id", $this->getId());
488  $this->ctrl->setParameterByClass(self::class, "page", null);
489  if ($this->ot->getContentActivated()) {
490  $actions = [];
491  foreach ($this->ot->getLanguages() as $language) {
492  $lang_code = ($language->getLanguageCode() === $this->ot->getMasterLanguage())
493  ? "-"
494  : $language->getLanguageCode();
495  $exists = $this->wiki_pm->exists($this->getId(), $lang_code);
496  $this->ctrl->setParameterByClass(self::class, "transl", $lang_code);
497  $action = ($lang_code !== "-" && !$exists)
498  ? "switchToLanguage"
499  : "preview";
500  if ($action === "switchToLanguage") {
501  $this->ctrl->setParameterByClass(self::class, "transl", null);
502  $this->ctrl->setParameterByClass(self::class, "totransl", $lang_code);
503  }
504  $append = $exists
505  ? ""
506  : " (" . $this->lng->txt("wiki_not_existing") . ")";
507  if ($lang_code === $this->getCurrentLanguage()) {
508  continue;
509  }
510  $actions[] = $f->link()->standard(
511  $this->getLanguageLabelForCode($language->getLanguageCode()) . $append,
512  $this->ctrl->getLinkTargetByClass(self::class, $action)
513  );
514  }
515  $this->ctrl->setParameterByClass(self::class, "transl", $this->requested_transl);
516  $this->ctrl->setParameterByClass(self::class, "totransl", null);
517  if (count($actions) > 0) {
518  $dd = $f->dropdown()->standard($actions)
519  ->withLabel($this->getLanguageLabelForCode($this->getCurrentLanguage()));
520  $toolbar->addComponent($dd);
521  }
522  }
523  }
524 
525  protected function getLanguageLabelForCode(string $code): string
526  {
527  if ($code === "-") {
528  $code = $this->ot->getMasterLanguage();
529  }
530  return $this->lng->txt("language") . ": " . $this->lng->txt("meta_l_" . $code);
531  }
532 
533  protected function getPrintView(): \ILIAS\Export\PrintProcessGUI
534  {
535  $provider = new \ILIAS\Wiki\WikiPrintViewProviderGUI(
536  $this->lng,
537  $this->ctrl,
538  $this->getWikiPage()->getWikiRefId(),
539  []
540  );
541 
542  return new \ILIAS\Export\PrintProcessGUI(
543  $provider,
544  $this->http,
545  $this->ui,
546  $this->lng
547  );
548  }
549 
550  protected function increaseViewCount(): void
551  {
552  $ilUser = $this->user;
553 
554  $this->getWikiPage()->increaseViewCnt();
555 
556  // enable object statistics
558  "wiki",
559  $this->getWikiPage()->getWikiRefId(),
560  $this->getWikiPage()->getWikiId(),
561  $ilUser->getId()
562  );
563 
565  }
566 
567  public function postOutputProcessing(string $a_output): string
568  {
569  $ilCtrl = $this->ctrl;
570 
571  $title = $this->getPageObject()->getTitle();
572  $ilCtrl->setParameterByClass(
573  "ilobjwikigui",
574  "from_page",
576  );
577  if ($this->getEnabledHref() && $this->getOutputMode() !== self::EDIT) {
579  $a_output,
580  $this->getWikiPage()->getWikiId(),
581  ($this->getOutputMode() === "offline"),
582  $this->getCurrentLanguage()
583  );
584  } else {
585  $output = $a_output;
586  }
587  $ilCtrl->setParameterByClass(
588  "ilobjwikigui",
589  "from_page",
590  $this->wiki_request->getFromPage()
591  );
592 
593 
594  // metadata in print view
595  if ($this->getOutputMode() === "print" && $this->wiki instanceof ilObjWiki) {
596  $mdgui = new ilObjectMetaDataGUI($this->wiki, "wpg", $this->getId());
597  $md = $mdgui->getKeyValueList();
598  if ($md !== "") {
599  $output = str_replace("<!--COPage-PageTop-->", "<p>" . $md . "</p>", $output);
600  }
601  }
602 
603 
604  return $output;
605  }
606 
607  public function whatLinksHere(): void
608  {
609  $tpl = $this->tpl;
610 
611  //$this->setSideBlock();
612  $table_gui = new ilWikiPagesTableGUI(
613  $this,
614  "whatLinksHere",
615  $this->getWikiPage()->getWikiId(),
617  $this->getId(),
618  $this->wiki_request->getTranslation()
619  );
620 
621  $tpl->setContent($table_gui->getHTML());
622  }
623 
624  public function getTabs(
625  string $a_activate = ""
626  ): void {
627  $ilTabs = $this->tabs_gui;
628  $ilCtrl = $this->ctrl;
629  $ilAccess = $this->access;
630 
631  parent::getTabs($a_activate);
632 
633  if ($ilAccess->checkAccess("statistics_read", "", $this->requested_ref_id)) {
634  $ilTabs->addTarget(
635  "statistics",
636  $this->ctrl->getLinkTargetByClass(
637  array("ilwikipagegui", "ilwikistatgui"),
638  "initial"
639  ),
640  "",
641  "ilwikistatgui"
642  );
643  }
644 
645  $ilTabs->addTarget(
646  "wiki_what_links_here",
647  $this->ctrl->getLinkTargetByClass(
648  "ilwikipagegui",
649  "whatLinksHere"
650  ),
651  "whatLinksHere"
652  );
653  }
654 
655  public function deleteWikiPageConfirmationScreen(): void
656  {
657  $tpl = $this->tpl;
658  $ilCtrl = $this->ctrl;
659  $lng = $this->lng;
660 
661  if (ilWikiPerm::check("delete_wiki_pages", $this->requested_ref_id)) {
662  $confirmation_gui = new ilConfirmationGUI();
663  $confirmation_gui->setFormAction($ilCtrl->getFormAction($this));
664  $confirmation_gui->setHeaderText($lng->txt("wiki_page_deletion_confirmation"));
665  $confirmation_gui->setCancel($lng->txt("cancel"), "cancelWikiPageDeletion");
666  $confirmation_gui->setConfirm($lng->txt("delete"), "confirmWikiPageDeletion");
667 
668  $dtpl = new ilTemplate(
669  "tpl.wiki_page_deletion_confirmation.html",
670  true,
671  true,
672  "components/ILIAS/Wiki"
673  );
674 
675  $dtpl->setVariable("PAGE_TITLE", $this->getWikiPage()->getTitle());
676 
677  // other pages that link to this page
678  $dtpl->setVariable("TXT_OTHER_PAGES", $lng->txt("wiki_other_pages_linking"));
680  $this->getWikiPage()->getWikiId(),
681  $this->getWikiPage()->getId()
682  );
683  if (count($pages) > 0) {
684  foreach ($pages as $page) {
685  $dtpl->setCurrentBlock("lpage");
686  $dtpl->setVariable("TXT_LINKING_PAGE", $page["title"]);
687  $dtpl->parseCurrentBlock();
688  }
689  } else {
690  $dtpl->setCurrentBlock("lpage");
691  $dtpl->setVariable("TXT_LINKING_PAGE", "-");
692  $dtpl->parseCurrentBlock();
693  }
694 
695  // contributors
696  $dtpl->setVariable("TXT_CONTRIBUTORS", $lng->txt("wiki_contributors"));
697  $contributors = ilWikiPage::getWikiPageContributors($this->getWikiPage()->getId());
698  foreach ($contributors as $contributor) {
699  $dtpl->setCurrentBlock("contributor");
700  $dtpl->setVariable(
701  "TXT_CONTRIBUTOR",
702  $contributor["lastname"] . ", " . $contributor["firstname"]
703  );
704  $dtpl->parseCurrentBlock();
705  }
706 
707  // notes/comments
708  $cnt_note_users = $this->notes->domain()->getUserCount(
709  $this->getPageObject()->getParentId(),
710  $this->getPageObject()->getId(),
711  "wpg"
712  );
713  $dtpl->setVariable(
714  "TXT_NUMBER_USERS_NOTES_OR_COMMENTS",
715  $lng->txt("wiki_number_users_notes_or_comments")
716  );
717  $dtpl->setVariable("TXT_NR_NOTES_COMMENTS", $cnt_note_users);
718 
719  $confirmation_gui->addItem("", "", $dtpl->get());
720 
721  $tpl->setContent($confirmation_gui->getHTML());
722  }
723  }
724 
725  public function cancelWikiPageDeletion(): void
726  {
727  $ilCtrl = $this->ctrl;
728 
729  $ilCtrl->redirect($this, "preview");
730  }
731 
732  public function confirmWikiPageDeletion(): void
733  {
734  $ilCtrl = $this->ctrl;
735  $lng = $this->lng;
736  if (ilWikiPerm::check("delete_wiki_pages", $this->requested_ref_id)) {
737  $this->getPageObject()->delete();
738 
739  $this->tpl->setOnScreenMessage('success', $lng->txt("wiki_page_deleted"), true);
740  }
741 
742  $ilCtrl->redirectByClass("ilobjwikigui", "allPages");
743  }
744 
748 
749  public function printViewSelection(): void
750  {
751  $view = $this->getPrintView();
752  $view->sendForm();
753  }
754 
755  public function printViewOrder(): void
756  {
757  $this->printViewOrderList();
758  }
759 
760  protected function printViewOrderList(
761  ): void {
762  $ilTabs = $this->tabs_gui;
763 
764  $pg_ids = $all_pages = array();
765 
766  // coming from type selection
767  $ordering = $this->wiki_request->getPrintOrdering();
768  if (count($ordering) === 0) {
769  switch ($this->wiki_request->getSelectedPrintType()) {
770  case "wiki":
771  foreach ($this->wiki_pm->getWikiPages($this->getLanguage()) as $p) {
772  $pg_ids[] = $p->getId();
773  }
774  break;
775 
776  case "selection":
777  $pg_ids = $this->wiki_request->getWikiPageIds();
778  if (count($pg_ids) === 0) {
779  $pg_ids = [$this->wiki_request->getWikiPageId()];
780  }
781  if (count($pg_ids) > 1) {
782  break;
783  } else {
784  $wiki_page_id = array_pop($pg_ids);
785  }
786  $this->ctrl->setParameterByClass(
787  "ilObjWikiGUI",
788  "wpg_id",
789  $wiki_page_id
790  );
791  $this->ctrl->redirectByClass("ilObjWikiGUI", "printView");
792  break;
793 
794  default:
795  $this->ctrl->setParameterByClass(
796  "ilObjWikiGUI",
797  "wpg_id",
798  $this->wiki_request->getWikiPageId()
799  );
800  $this->ctrl->redirectByClass("ilObjWikiGUI", "printView");
801  break;
802  }
803  }
804  // refresh sorting
805  else {
806  asort($ordering);
807  $pg_ids = array_keys($ordering);
808  }
809 
810  $ilTabs->clearTargets();
811  $ilTabs->setBackTarget(
812  $this->lng->txt("back"),
813  $this->ctrl->getLinkTarget($this, "preview")
814  );
815 
816  if (!count($all_pages)) {
817  $all_pages = ilWikiPage::getAllWikiPages($this->getPageObject()->getWikiId());
818  }
819 
820  $tbl = new ilWikiExportOrderTableGUI(
821  $this,
822  "printViewOrderList",
823  $all_pages,
824  $pg_ids
825  );
826  $this->tpl->setContent($tbl->getHTML());
827  }
828 
829 
833 
834  public function blockWikiPage(): void
835  {
836  $ilCtrl = $this->ctrl;
837  $lng = $this->lng;
838 
839  if (ilWikiPerm::check("activate_wiki_protection", $this->requested_ref_id)) {
840  $this->getPageObject()->setBlocked(true);
841  $this->getPageObject()->update();
842 
843  $this->tpl->setOnScreenMessage('success', $lng->txt("wiki_page_blocked"), true);
844  }
845 
846  $ilCtrl->redirect($this, "preview");
847  }
848 
849  public function unblockWikiPage(): void
850  {
851  $ilCtrl = $this->ctrl;
852  $lng = $this->lng;
853 
854  if (ilWikiPerm::check("activate_wiki_protection", $this->requested_ref_id)) {
855  $this->getPageObject()->setBlocked(false);
856  $this->getPageObject()->update();
857 
858  $this->tpl->setOnScreenMessage('success', $lng->txt("wiki_page_unblocked"), true);
859  }
860 
861  $ilCtrl->redirect($this, "preview");
862  }
863 
864 
868 
869  public function renameWikiPage(): void
870  {
871  $ilAccess = $this->access;
872  $tpl = $this->tpl;
873 
874  if (($ilAccess->checkAccess(
875  "edit_content",
876  "",
877  $this->requested_ref_id
878  ) && !$this->getPageObject()->getBlocked())
879  || $ilAccess->checkAccess("write", "", $this->requested_ref_id)) {
880  $this->ctrl->setParameterByClass(ilWikiPageGUI::class, "wpg_id", $this->wiki_request->getWikiPageId());
881  $this->initRenameForm();
882  $tpl->setContent($this->form->getHTML());
883  }
884  }
885 
886  protected function initRenameForm(): void
887  {
888  $lng = $this->lng;
889  $ilCtrl = $this->ctrl;
890 
891  $this->form = new ilPropertyFormGUI();
892 
893  // new name
894  $ti = new ilTextInputGUI($lng->txt("wiki_new_page_name"), "new_page_name");
895  $ti->setMaxLength(200);
896  $ti->setSize(50);
897  $ti->setValue($this->getPageObject()->getTitle());
898  $ti->setRequired(true);
899  $this->form->addItem($ti);
900 
901  $this->form->addCommandButton("renamePage", $lng->txt("wiki_rename"));
902  $this->form->addCommandButton("preview", $lng->txt("cancel"));
903 
904  $this->form->setTitle($lng->txt("wiki_rename_page"));
905  $this->form->setFormAction($ilCtrl->getFormAction($this));
906  }
907 
908  public function renamePage(): void
909  {
910  $tpl = $this->tpl;
911  $lng = $this->lng;
912  $ilCtrl = $this->ctrl;
913  $ilAccess = $this->access;
914 
915  $this->initRenameForm();
916  if ($this->form->checkInput()) {
917  if (($ilAccess->checkAccess("edit_content", "", $this->requested_ref_id) && !$this->getPageObject()->getBlocked())
918  || $ilAccess->checkAccess("write", "", $this->requested_ref_id)) {
919  $new_name = $this->form->getInput("new_page_name");
920 
921  $page_title = ilWikiUtil::makeDbTitle($new_name);
923  $this->getPageObject()->getWikiId(),
924  $page_title,
925  $this->getPageObject()->getLanguage()
926  );
927 
928  // we might get the same page id back here, if the page
929  // name only differs in diacritics
930  // see bug http://www.ilias.de/mantis/view.php?id=11226
931  if ($pg_id > 0 && $pg_id != $this->getPageObject()->getId()) {
932  $this->tpl->setOnScreenMessage('failure', $lng->txt("wiki_page_already_exists"));
933  } else {
934  $new_name = $this->getPageObject()->rename($new_name);
935  $ilCtrl->setParameterByClass("ilobjwikigui", "page", ilWikiUtil::makeUrlTitle($new_name));
936  $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
937  $ilCtrl->redirect($this, "preview");
938  }
939  }
940  }
941 
942  $this->form->setValuesByPost();
943  $tpl->setContent($this->form->getHTML());
944  }
945 
949 
950  public function activateWikiPageRating(): void
951  {
952  $lng = $this->lng;
953  $ilCtrl = $this->ctrl;
954 
955  $this->getPageObject()->setRating(true);
956  $this->getPageObject()->update();
957 
958  $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
959  $ilCtrl->redirect($this, "preview");
960  }
961 
962  public function deactivateWikiPageRating(): void
963  {
964  $lng = $this->lng;
965  $ilCtrl = $this->ctrl;
966 
967  $this->getPageObject()->setRating(false);
968  $this->getPageObject()->update();
969 
970  $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
971  $ilCtrl->redirect($this, "preview");
972  }
973 
974 
975  public function observeNoteAction(
976  int $a_wiki_id,
977  int $a_page_id,
978  string $a_type,
979  string $a_action,
980  int $a_note_id
981  ): void {
982  // #10040 - get note text
983  $note = $this->notes->domain()->getById($a_note_id);
984  $text = $note->getText();
985 
986  $noti = $this->wiki_gui->notification();
987  $noti->send("comment", ilNotification::TYPE_WIKI_PAGE, $this->getWikiRefId(), $a_page_id, $text, $this->getLanguage());
988  }
989 
990  public function updateStatsRating(
991  int $a_wiki_id,
992  string $a_wiki_type,
993  int $a_page_id,
994  string $a_page_type
995  ): void {
997  }
998 
999 
1000  //
1001  // advanced meta data
1002  //
1003 
1005  {
1006  $ilCtrl = $this->ctrl;
1007  $lng = $this->lng;
1008 
1009  $page = $this->getWikiPage();
1010 
1011  $form = new ilPropertyFormGUI();
1012  $form->setFormAction($ilCtrl->getFormAction($this, "updateAdvancedMetaData"));
1013 
1014  // :TODO:
1015  $form->setTitle($lng->txt("wiki_advmd_block_title") . ": " . $page->getTitle());
1016 
1017  $this->record_gui = new ilAdvancedMDRecordGUI(
1019  'wiki',
1020  $page->getWikiId(),
1021  'wpg',
1022  $page->getId()
1023  );
1024  $this->record_gui->setPropertyForm($form);
1025  $this->record_gui->parse();
1026 
1027  $form->addCommandButton("updateAdvancedMetaData", $lng->txt("save"));
1028  $form->addCommandButton("preview", $lng->txt("cancel"));
1029 
1030  return $form;
1031  }
1032 
1033  public function editAdvancedMetaData(
1034  ilPropertyFormGUI $a_form = null
1035  ): void {
1036  $ilTabs = $this->tabs_gui;
1037  $lng = $this->lng;
1038  $ilCtrl = $this->ctrl;
1039  $tpl = $this->tpl;
1040  $ilAccess = $this->access;
1041 
1042  if (!$ilAccess->checkAccess("write", "", $this->wiki_ref_id) &&
1043  !$ilAccess->checkAccess("edit_page_meta", "", $this->wiki_ref_id)) {
1044  return;
1045  }
1046 
1047 
1048  $ilTabs->clearTargets();
1049  $ilTabs->setBackTarget(
1050  $lng->txt("back"),
1051  $ilCtrl->getLinkTarget($this, "preview")
1052  );
1053 
1054  if (!$a_form) {
1055  $a_form = $this->initAdvancedMetaDataForm();
1056  }
1057 
1058  $tpl->setContent($a_form->getHTML());
1059  }
1060 
1061  public function updateAdvancedMetaData(): void
1062  {
1063  $ilCtrl = $this->ctrl;
1064  $lng = $this->lng;
1065  $ilAccess = $this->access;
1066 
1067  if (!$ilAccess->checkAccess("write", "", $this->wiki_ref_id) &&
1068  !$ilAccess->checkAccess("edit_page_meta", "", $this->wiki_ref_id)) {
1069  return;
1070  }
1071 
1072  $form = $this->initAdvancedMetaDataForm();
1073 
1074  // needed for proper advanced MD validation
1075  $form->checkInput();
1076  if (!$this->record_gui->importEditFormPostValues()) {
1077  $this->editAdvancedMetaData($form); // #16470
1078  return;
1079  }
1080 
1081  if ($this->record_gui->writeEditForm()) {
1082  $this->tpl->setOnScreenMessage('success', $lng->txt("settings_saved"), true);
1083  }
1084  $ilCtrl->redirect($this, "preview");
1085  }
1086 
1087  public function hideAdvancedMetaData(): void
1088  {
1089  $ilCtrl = $this->ctrl;
1090  $lng = $this->lng;
1091  $ilAccess = $this->access;
1092 
1093  if (!$ilAccess->checkAccess("write", "", $this->wiki_ref_id) &&
1094  !$ilAccess->checkAccess("edit_page_meta", "", $this->wiki_ref_id)) {
1095  return;
1096  }
1097 
1098  $this->getPageObject()->hideAdvancedMetadata(true);
1099  $this->getPageObject()->update();
1100 
1101  $this->tpl->setOnScreenMessage('success', $lng->txt("settings_saved"), true);
1102  $ilCtrl->redirect($this, "preview");
1103  }
1104 
1105  public function unhideAdvancedMetaData(): void
1106  {
1107  $ilCtrl = $this->ctrl;
1108  $lng = $this->lng;
1109  $ilAccess = $this->access;
1110 
1111  if (!$ilAccess->checkAccess("write", "", $this->wiki_ref_id) &&
1112  !$ilAccess->checkAccess("edit_page_meta", "", $this->wiki_ref_id)) {
1113  return;
1114  }
1115 
1116  $this->getPageObject()->hideAdvancedMetadata(false);
1117  $this->getPageObject()->update();
1118 
1119  $this->tpl->setOnScreenMessage('success', $lng->txt("settings_saved"), true);
1120  $ilCtrl->redirect($this, "preview");
1121  }
1122 
1123  public function edit(): string
1124  {
1125  $tpl = $this->tpl;
1126  $lng = $this->lng;
1127  $this->ctrl->setParameterByClass(self::class, "wpg_id", $this->getId());
1128  self::initEditingJS($tpl);
1129 
1130  return parent::edit();
1131  }
1132 
1133  public static function initEditingJS(ilGlobalTemplateInterface $a_tpl): void
1134  {
1135  global $DIC;
1136 
1137  $lng = $DIC->language();
1138 
1139  $a_tpl->addJavaScript("assets/js/WikiEdit.js");
1140  $a_tpl->addOnLoadCode("il.Wiki.Edit.txt.page_exists = '" . $lng->txt("wiki_page_exists") . "';");
1141  $a_tpl->addOnLoadCode("il.Wiki.Edit.txt.new_page = '" . $lng->txt("wiki_new_page") . "';");
1142  }
1143 
1144 
1148  public function insertWikiLink(): void
1149  {
1150  $lng = $this->lng;
1151  $ilCtrl = $this->ctrl;
1152 
1153  $form = new ilPropertyFormGUI();
1154  $form->addCommandButton("addWikiLink", $lng->txt("wiki_add_link"));
1155  $form->addCommandButton("searchWikiLink", $lng->txt("search"));
1156 
1157  // Target page
1158  $tp = new ilTextInputGUI($this->lng->txt("wiki_target_page"), "target_page");
1159  $tp->setSize(18);
1160  $tp->setRequired(true);
1161  $tp->setInfo("...");
1162  $tp->setDataSource($ilCtrl->getLinkTarget($this, "insertWikiLinkAC", "", true));
1163  $form->addItem($tp);
1164 
1165  // Link text
1166  $lt = new ilTextInputGUI($this->lng->txt("wiki_link_text"), "link_text");
1167  $lt->setSize(18);
1168  $form->addItem($lt);
1169 
1170  //$form->setTitle($lng->txt("wiki_link"));
1171 
1172  echo $form->getHTML();
1173  exit;
1174  }
1175 
1179  public function insertWikiLinkAC(): void
1180  {
1181  $result = array();
1182 
1183  $term = $this->wiki_request->getTerm();
1184 
1185  // if page exists, make it first entry
1186  if (ilWikiPage::_wikiPageExists($this->getPageObject()->getParentId(), $term)) {
1187  $entry = new stdClass();
1188  $entry->value = $term;
1189  $entry->label = $term;
1190  $result[] = $entry;
1191  }
1192 
1193  $res = ilWikiPage::getPagesForSearch($this->getPageObject()->getParentId(), $term);
1194 
1195  $cnt = 0;
1196  foreach ($res as $r) {
1197  if ($result[0]->value == $r) {
1198  continue;
1199  }
1200  if ($cnt++ > 19) {
1201  continue;
1202  }
1203  $entry = new stdClass();
1204  $entry->value = $r;
1205  $entry->label = $r;
1206  $result[] = $entry;
1207  }
1208 
1209  echo json_encode($result, JSON_THROW_ON_ERROR);
1210  exit;
1211  }
1212 
1216  public function searchWikiLinkAC(): void
1217  {
1218  $lng = $this->lng;
1219 
1220  $lng->loadLanguageModule("wiki");
1221 
1222  $tpl = new ilTemplate("tpl.wiki_ac_search_result.html", true, true, "components/ILIAS/Wiki");
1223  $term = $this->wiki_request->getTerm();
1224 
1225  $pages = ilObjWiki::_performSearch($this->getPageObject()->getParentId(), $term);
1226 
1227  $found = array();
1228  foreach ($pages as $page) {
1229  $found[] = array("page_id" => $page["page_id"], "title" => ilWikiPage::lookupTitle($page["page_id"]));
1230  }
1231 
1232  // sort if all pages are listed
1233  if ($term === "") {
1234  $found = ilArrayUtil::sortArray($found, "title", "asc");
1235  }
1236 
1237  foreach ($found as $f) {
1238  $tpl->setCurrentBlock("item");
1239  $tpl->setVariable("WIKI_TITLE", $f["title"]);
1241  }
1242 
1243  if (count($pages) === 0) {
1244  $tpl->setVariable("INFOTEXT", str_replace("$1", $term, $lng->txt("wiki_no_page_found")));
1245  } elseif ($term === '') {
1246  $tpl->setVariable("INFOTEXT", $lng->txt("wiki_no_search_term"));
1247  } else {
1248  $tpl->setVariable("INFOTEXT", str_replace("$1", $term, $lng->txt("wiki_pages_found")));
1249  }
1250 
1251  $tpl->setVariable("TXT_BACK", $lng->txt("back"));
1252  echo $tpl->get();
1253  exit;
1254  }
1255 
1256  //
1257  // exercise assignment
1258  //
1259 
1263  protected function finalizeAssignment(): void
1264  {
1265  $ilCtrl = $this->ctrl;
1266  $lng = $this->lng;
1267 
1269 
1270  $ass_id = $this->wiki_request->getAssignmentId();
1271  $wiki_ass->submitWiki($ass_id, $this->user->getId(), $this->getWikiRefId());
1272 
1273  $this->tpl->setOnScreenMessage('success', $lng->txt("wiki_finalized"), true);
1274  $ilCtrl->redirectByClass("ilObjWikiGUI", "gotoStartPage");
1275  }
1276 
1277  protected function downloadExcSubFile(): void
1278  {
1279  $ilUser = $this->user;
1280 
1281  $ass_id = $this->wiki_request->getAssignmentId();
1282  $ass = new ilExAssignment($ass_id);
1283 
1284  $sub_manager = $this->exc_domain->submission($ass_id);
1285  $sub = $sub_manager->getSubmissionsOfUser($ilUser->getId())->current();
1286  $team_id = $this->exc_domain->team()->getTeamForMember(
1287  $ass->getId(),
1288  $ilUser->getId()
1289  );
1290 
1291  if ($sub) {
1292  $user_data = ilObjUser::_lookupName($sub->getUserId());
1293  $title = ilObject::_lookupTitle($ass->getExerciseId()) . " - " .
1294  $ass->getTitle() . " (Team " . $team_id . ").zip";
1295 
1296  $sub_manager->deliverFile(
1297  $ilUser->getId(),
1298  $sub->getRid(),
1299  $title
1300  );
1301  }
1302  }
1303 
1304  public function getCommentsHTMLExport(): string
1305  {
1306  return $this->getNotesHTML(
1307  $this->getPageObject(),
1308  false,
1309  ilObjWiki::_lookupPublicNotes($this->getPageObject()->getParentId()),
1310  false,
1311  null,
1312  true
1313  );
1314  }
1315 
1319  public function confirmPageTranslationCreation(): void
1320  {
1321  $this->tabs_gui->clearTargets();
1322  $this->tabs_gui->setBackTarget(
1323  $this->lng->txt("back"),
1324  $this->ctrl->getLinkTarget($this, "edit")
1325  );
1326 
1327  $l = $this->request->getString("totransl");
1328  $this->ctrl->setParameter($this, "totransl", $l);
1329  $this->lng->loadLanguageModule("meta");
1330 
1331  $r = $this->wiki_gui->ui()->renderer();
1332  $box = $this->wiki_gui->ui()->factory()->messageBox()->confirmation(
1333  $this->lng->txt("cont_page_translation_does_not_exist") . ": " .
1334  $this->lng->txt("meta_l_" . $l)
1335  );
1336 
1338 
1339  $content = $r->render($box) . $form->render();
1340 
1341  /*
1342  $cgui = new ilConfirmationGUI();
1343  $cgui->setFormAction($this->ctrl->getFormAction($this));
1344  $cgui->setHeaderText($this->lng->txt("cont_page_translation_does_not_exist") . ": " .
1345  $this->lng->txt("meta_l_" . $l));
1346  $cgui->setCancel($this->lng->txt("cancel"), "editMasterLanguage");
1347  $cgui->setConfirm($this->lng->txt("confirm"), "createPageTranslation");*/
1348  $this->tpl->setContent($content);
1349  }
1350 
1351  protected function getTranslatePageFormAdapter(): \ILIAS\Repository\Form\FormAdapterGUI
1352  {
1353  $f = $this->wiki_gui->form(self::class, "createPageTranslation")
1354  ->text("title", $this->lng->txt("title"));
1355  //->required();
1356  return $f;
1357  }
1358 
1359  public function createPageTranslation(): void
1360  {
1361  $l = $this->request->getString("totransl");
1362 
1364  //if ($form->isValid()) {
1365 
1366  $p = $this->domain->page()->getWikiPage(
1367  $this->getWikiRefId(),
1368  $this->getPageObject()->getId(),
1369  0,
1370  "-"
1371  );
1372 
1373  $p->copyPageToTranslation($l);
1374 
1376  $this->getPageObject()->getParentType(),
1377  $this->getPageObject()->getId(),
1378  0,
1379  $l
1380  );
1381  $p2->setWikiRefId($this->getWikiRefId());
1382  $p2->setTitle($form->getData("title"));
1383  $p2->update();
1384  $this->ctrl->setParameter($this, "transl", $l);
1385  //}
1386 
1387  $this->ctrl->redirect($this, "edit");
1388  }
1389 
1390  protected function checkLangPageAvailable(int $id, string $lang): bool
1391  {
1392  return $this->wiki_pm->exists($id, $lang);
1393  }
1394 
1395 }
getLanguageLabelForCode(string $code)
finalizeAssignment()
Finalize and submit blog to exercise.
$res
Definition: ltiservices.php:69
Class ilObjectMetaDataGUI.
confirmPageTranslationCreation()
Confirm page translation creation.
setPropertyForm(ilPropertyFormGUI $form)
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ilObjUser $user=null,)
Exercise assignment.
postOutputProcessing(string $a_output)
const IL_CAL_DATETIME
const ANONYMOUS_USER_ID
Definition: constants.php:27
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...
redirect(object $a_gui_obj, string $a_cmd=null, string $a_anchor=null, bool $is_async=false)
setHeaderPageTitle(string $a_title)
Sets the title of the page (for browser window).
static getPagesForSearch(int $a_wiki_id, string $a_term)
observeNoteAction(int $a_wiki_id, int $a_page_id, string $a_type, string $a_action, int $a_note_id)
setOutputMode(string $a_mode=self::PRESENTATION)
Interface Observer Contains several chained tasks and infos about them.
ilAdvancedMDRecordGUI $record_gui
Wiki statistics GUI class.
static prepareJsLinks(string $redraw_url, string $notes_url, string $tags_url, ilGlobalTemplateInterface $tpl=null)
Insert js/ajax links into template.
static _getInstance(int $a_usr_id)
static renderSideBlock(int $a_wpg_id, int $a_wiki_ref_id, ?ilWikiPage $a_wp=null)
addComponent(\ILIAS\UI\Component\Component $a_comp)
static lookupTitle(int $a_page_id, string $lang="-")
Class ilPageObjectGUI.
static getLinksToPage(int $a_wiki_id, int $a_page_id, string $lang="-")
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.
static _lookupName(int $a_user_id)
lookup user name
TableGUI class for wiki pages table.
static _performSearch(int $a_wiki_id, string $a_searchterm)
Search in Wiki.
ILIAS Wiki WikiGUIRequest $wiki_request
ILIAS COPage InternalGUIService $gui
loadLanguageModule(string $a_module)
Load language module.
setVariable(string $variable, $value='')
Sets the given variable to the given value.
showEditToolbar()
Show edit toolbar.
const EVENT_PAGE_READ
setWikiRefId(int $a_ref_id)
setLoginTargetPar(string $a_val)
Set target parameter for login (public sector).
static replaceInternalLinks(string $s, int $a_wiki_id, bool $a_offline=false, string $lang="-")
This one is based on Mediawiki Parser->replaceInternalLinks since we display images in another way...
setTemplateOutput(bool $a_output=true)
static _lookupObjId(int $ref_id)
static getWikiPageContributors(int $a_page_id)
$provider
Definition: ltitoken.php:80
ILIAS HTTP Services $http
static http()
Fetches the global http state from ILIAS.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getNamePresentation( $a_user_id, bool $a_user_image=false, bool $a_profile_link=false, string $a_profile_back_link='', bool $a_force_first_lastname=false, bool $a_omit_login=false, bool $a_sortable=true, bool $a_return_data_array=false, $a_ctrl_path='ilpublicuserprofilegui')
Default behaviour is:
static _lookupTitle(int $obj_id)
setContent(string $a_html)
Sets content for standard template.
ILIAS Exercise InternalDomainService $exc_domain
static setNotification(int $type, int $user_id, int $id, bool $status=true)
Set notification status for object and user.
setFormAction(string $a_formaction)
checkLangPageAvailable(int $id, string $lang)
setRenderPageContainer(bool $a_val)
ilGlobalTemplateInterface $tpl
$text
Definition: xapiexit.php:21
setScreenIdComponent(string $a_comp)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(int $a_id=0, int $a_old_nr=0, int $a_wiki_ref_id=0, string $lang="-")
setPageObject(ilPageObject $a_pg_obj)
static _recordReadEvent(string $a_type, int $a_ref_id, int $obj_id, int $usr_id, bool $isCatchupWriteEvents=true, $a_ext_rc=null, $a_ext_time=null)
ilAccessHandler $access
global $DIC
Definition: shib_login.php:25
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
Class ilWikiPage GUI class.
const EVENT_PAGE_RATING
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
addJavaScript(string $a_js_file, bool $a_add_version_parameter=true, int $a_batch=2)
Add a javascript file that should be included in the header.
setPresentationTitle(string $a_title="")
ILIAS Wiki InternalGUIService $wiki_gui
addOnLoadCode(string $a_code, int $a_batch=2)
Add on load code.
addCommandButton(string $a_cmd, string $a_text, string $a_id="")
insertWikiLink()
Returns form to insert a wiki link per ajax.
activateWikiPageRating()
Rating /.
getTabs(string $a_activate="")
setCurrentBlock(string $part=self::DEFAULT_BLOCK)
Sets the template to the given block.
ILIAS Wiki InternalDomainService $domain
static initEditingJS(ilGlobalTemplateInterface $a_tpl)
const IL_WIKI_WHAT_LINKS_HERE
static makeUrlTitle(string $a_par)
form( $class_path, string $cmd, string $submit_caption="")
insertWikiLinkAC()
Auto complete for insert wiki link.
updateStatsRating(int $a_wiki_id, string $a_wiki_type, int $a_page_id, string $a_page_type)
ILIAS Wiki Page PageManager $wiki_pm
static makeDbTitle(string $a_par)
static getPageIdForTitle(int $a_wiki_id, string $a_title, string $lang="-")
Get wiki page object for id and title.
static _wikiPageExists(int $a_wiki_id, string $a_title, string $lang="-")
global $ilSetting
Definition: privfeed.php:32
editAdvancedMetaData(ilPropertyFormGUI $a_form=null)
$service
Definition: ltiresult.php:36
__construct(Container $dic, ilPlugin $plugin)
static handleEvent(int $a_event, ilWikiPage $a_page_obj, ?int $a_user_id=null, array $a_additional_data=null)
Handle wiki page event.
setWiki(ilObjWiki $a_val)
static hasNotification(int $type, int $user_id, int $id)
Check notification status for object and user.
static _lookupRatingOverall(int $a_wiki_id)
Lookup whether rating is activated for whole object.
getNotesHTML(object $a_content_object=null, bool $a_enable_private_notes=true, bool $a_enable_public_notes=false, bool $a_enable_notes_deletion=false, callable $a_callback=null, bool $export=false)
Get html for public and/or private notes.
static _lookupPublicNotes(int $a_wiki_id)
Lookup whether public notes are activated.
static check(string $a_perm, int $a_ref_id, string $a_cmd="")
ilObjectTranslation $ot
ILIAS Notes Service $notes
parseCurrentBlock(string $block_name=self::DEFAULT_BLOCK)
Parses the given block.
static getAllWikiPages(int $a_wiki_id, string $lang="-")
ilPropertyFormGUI $form
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilCommonActionDispatcherGUI.
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
static getInstance(string $a_parent_type, int $a_id=0, int $a_old_nr=0, string $a_lang="-")
Get page object instance.
searchWikiLinkAC()
Search wiki link list.
addHeaderAction(bool $a_redraw=false)
setWikiPage(ilWikiPage $a_wikipage)
static sortArray(array $array, string $a_array_sortby_key, string $a_array_sortorder="asc", bool $a_numeric=false, bool $a_keep_keys=false)
static hasOptOut(int $obj_id)
Is opt out (disable notification) allowed?
$r