ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilWikiPageGUI.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4include_once("./Services/COPage/classes/class.ilPageObjectGUI.php");
5include_once("./Modules/Wiki/classes/class.ilWikiPage.php");
6
21{
25 protected $tabs;
26
30 protected $settings;
31
35 protected $toolbar;
36
40 protected $wiki;
41
45 protected $ui;
46
50 public function __construct($a_id = 0, $a_old_nr = 0, $a_wiki_ref_id = 0)
51 {
52 global $DIC;
53
54 $this->tpl = $DIC["tpl"];
55 $this->help = $DIC["ilHelp"];
56 $this->ctrl = $DIC->ctrl();
57 $this->tabs = $DIC->tabs();
58 $this->user = $DIC->user();
59 $this->access = $DIC->access();
60 $this->lng = $DIC->language();
61 $this->settings = $DIC->settings();
62 $this->toolbar = $DIC->toolbar();
63 $tpl = $DIC["tpl"];
64 $this->ui = $DIC->ui();
65
66 // needed for notifications
67 $this->setWikiRefId($a_wiki_ref_id);
68
69 parent::__construct("wpg", $a_id, $a_old_nr);
70 $this->getPageObject()->setWikiRefId($this->getWikiRefId());
71
72 // content style
73 include_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
74
75 $tpl->setCurrentBlock("SyntaxStyle");
76 $tpl->setVariable(
77 "LOCATION_SYNTAX_STYLESHEET",
79 );
80 $tpl->parseCurrentBlock();
81 }
82
89 public function setScreenIdComponent()
90 {
91 $ilHelp = $this->help;
92
93 $ilHelp->setScreenIdComponent("copgwpg");
94 }
95
96 public function setWikiRefId($a_ref_id)
97 {
98 $this->wiki_ref_id = $a_ref_id;
99 }
100
101 public function getWikiRefId()
102 {
103 return $this->wiki_ref_id;
104 }
105
111 public function setWiki($a_val)
112 {
113 $this->wiki = $a_val;
114 }
115
121 public function getWiki()
122 {
123 return $this->wiki;
124 }
125
129 public function executeCommand()
130 {
131 $ilCtrl = $this->ctrl;
132 $ilTabs = $this->tabs;
134 $ilAccess = $this->access;
137
138 $next_class = $this->ctrl->getNextClass($this);
139 $cmd = $this->ctrl->getCmd();
140
141 $head_title = ilObject::_lookupTitle(ilObject::_lookupObjId((int) $_GET["ref_id"])) . ": " . $this->getWikiPage()->getTitle();
142 $tpl->setHeaderPageTitle($head_title);
143 // see #13804
144 if ($_GET["page"] != "") {
145 $tpl->setPermanentLink("wiki", "", "wpage_" . $this->getPageObject()->getId() . "_" . $_GET["ref_id"], "", $head_title);
146 } else {
147 $tpl->setPermanentLink("wiki", $_GET["ref_id"]);
148 }
149
150
151 switch ($next_class) {
152 case "ilnotegui":
153 $this->getTabs();
154 $ilTabs->setTabActive("pg");
155 return $this->preview();
156 break;
157
158 case "ilratinggui":
159 // for rating side block
160 include_once("./Services/Rating/classes/class.ilRatingGUI.php");
161 $rating_gui = new ilRatingGUI();
162 $rating_gui->setObject(
163 $this->getPageObject()->getParentId(),
164 "wiki",
165 $this->getPageObject()->getId(),
166 "wpg"
167 );
168 $rating_gui->setUpdateCallback(array($this, "updateStatsRating"));
169 $this->ctrl->forwardCommand($rating_gui);
170 $ilCtrl->redirect($this, "preview");
171 break;
172
173 case "ilcommonactiondispatchergui":
174 include_once("Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
176 $gui->enableCommentsSettings(false);
177 $gui->setRatingCallback($this, "preview");
178 $this->ctrl->forwardCommand($gui);
179 break;
180
181 case "ilwikistatgui":
182 if ($ilAccess->checkAccess("statistics_read", "", $this->wiki_ref_id)) {
183 $this->tabs_gui->clearTargets(); // see ilObjWikiGUI::getTabs()
184 $this->getTabs("statistics");
185
186 include_once "Modules/Wiki/classes/class.ilWikiStatGUI.php";
187 $gui = new ilWikiStatGUI(
188 $this->getPageObject()->getParentId(),
189 $this->getPageObject()->getId()
190 );
191 $this->ctrl->forwardCommand($gui);
192 }
193 break;
194 case 'ilobjectmetadatagui':
195
196 if (!$ilAccess->checkAccess("write", "", $this->wiki_ref_id)) {
197 ilUtil::sendFailure($lng->txt("permission_denied"), true);
198 $ilCtrl->redirect($this, "preview");
199 }
200 return parent::executeCommand();
201 break;
202
203 case "ilpropertyformgui":
204 // only case is currently adv metadata internal link in info settings, see #24497
205 $form = $this->initAdvancedMetaDataForm();
206 $ilCtrl->forwardCommand($form);
207 break;
208
209 default:
210
211 if (strtolower($ilCtrl->getNextClass()) == "ilpageeditorgui") {
212 self::initEditingJS($this->tpl);
213 }
214
215 if ($_GET["ntf"]) {
216 include_once "./Services/Notification/classes/class.ilNotification.php";
217 switch ($_GET["ntf"]) {
218 case 1:
219 ilNotification::setNotification(ilNotification::TYPE_WIKI, $ilUser->getId(), $this->getPageObject()->getParentId(), false);
220 break;
221
222 case 2:
223 // remove all page notifications here?
224 ilNotification::setNotification(ilNotification::TYPE_WIKI, $ilUser->getId(), $this->getPageObject()->getParentId(), true);
225 break;
226
227 case 3:
228 ilNotification::setNotification(ilNotification::TYPE_WIKI_PAGE, $ilUser->getId(), $this->getPageObject()->getId(), false);
229 break;
230
231 case 4:
232 ilNotification::setNotification(ilNotification::TYPE_WIKI_PAGE, $ilUser->getId(), $this->getPageObject()->getId(), true);
233 break;
234 }
235 $ilCtrl->redirect($this, "preview");
236 }
237
238 $this->setPresentationTitle($this->getWikiPage()->getTitle());
239 return parent::executeCommand();
240 }
241 }
242
248 public function setWikiPage($a_wikipage)
249 {
250 $this->setPageObject($a_wikipage);
251 }
252
258 public function getWikiPage()
259 {
260 return $this->getPageObject();
261 }
262
266 public static function getGUIForTitle($a_wiki_id, $a_title, $a_old_nr = 0, $a_wiki_ref_id = 0)
267 {
268 global $DIC;
269
270 $ilDB = $DIC->database();
271
272 include_once("./Modules/Wiki/classes/class.ilWikiPage.php");
273 $id = ilWikiPage::getPageIdForTitle($a_wiki_id, $a_title);
274 $page_gui = new ilWikiPageGUI($id, $a_old_nr, $a_wiki_ref_id);
275
276 return $page_gui;
277 }
278
279 public function setSideBlock()
280 {
282 $this->getWikiPage()->getId(),
283 $this->wiki_ref_id,
284 $this->getWikiPage()
285 );
286 }
287
288 public function addHeaderAction($a_redraw = false)
289 {
291 $ilAccess = $this->access;
292
293 $wiki_id = $this->getPageObject()->getParentId();
294 $page_id = $this->getPageObject()->getId();
295
296 include_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
297 $dispatcher = new ilCommonActionDispatcherGUI(
299 $ilAccess,
300 "wiki",
301 $_GET["ref_id"],
302 $wiki_id
303 );
304 $dispatcher->setSubObject("wpg", $page_id);
305
306 include_once "Services/Object/classes/class.ilObjectListGUI.php";
307 ilObjectListGUI::prepareJSLinks(
308 $this->ctrl->getLinkTarget($this, "redrawHeaderAction", "", true),
309 $this->ctrl->getLinkTargetByClass(array("ilcommonactiondispatchergui", "ilnotegui"), "", "", true, false),
310 $this->ctrl->getLinkTargetByClass(array("ilcommonactiondispatchergui", "iltagginggui"), "", "", true, false)
311 );
312
313 $lg = $dispatcher->initHeaderAction();
314 $lg->enableNotes(true);
315 $lg->enableComments(ilObjWiki::_lookupPublicNotes($wiki_id), false);
316
317 // rating
318 if (ilObjWiki::_lookupRatingOverall($wiki_id)) {
319 $lg->enableRating(
320 true,
321 $this->lng->txt("wiki_rate_overall"),
322 false,
323 // so ilCtrl does not use the shortcut via ilWikiGUI
324 array("ilcommonactiondispatchergui", "ilratinggui")
325 );
326 }
327
328 // notification
329 if ($ilUser->getId() != ANONYMOUS_USER_ID) {
330 include_once "./Services/Notification/classes/class.ilNotification.php";
332 $this->ctrl->setParameter($this, "ntf", 1);
333 if (ilNotification::hasOptOut($wiki_id)) {
334 $lg->addCustomCommand($this->ctrl->getLinkTarget($this), "wiki_notification_deactivate_wiki");
335 }
336
337 $lg->addHeaderIcon(
338 "not_icon",
339 ilUtil::getImagePath("notification_on.svg"),
340 $this->lng->txt("wiki_notification_activated")
341 );
342 } else {
343 $this->ctrl->setParameter($this, "ntf", 2);
344 $lg->addCustomCommand($this->ctrl->getLinkTarget($this), "wiki_notification_activate_wiki");
345
347 $this->ctrl->setParameter($this, "ntf", 3);
348 $lg->addCustomCommand($this->ctrl->getLinkTarget($this), "wiki_notification_deactivate_page");
349
350 $lg->addHeaderIcon(
351 "not_icon",
352 ilUtil::getImagePath("notification_on.svg"),
353 $this->lng->txt("wiki_page_notification_activated")
354 );
355 } else {
356 $this->ctrl->setParameter($this, "ntf", 4);
357 $lg->addCustomCommand($this->ctrl->getLinkTarget($this), "wiki_notification_activate_page");
358
359 $lg->addHeaderIcon(
360 "not_icon",
361 ilUtil::getImagePath("notification_off.svg"),
362 $this->lng->txt("wiki_notification_deactivated")
363 );
364 }
365 }
366 $this->ctrl->setParameter($this, "ntf", "");
367 }
368
369 if (!$a_redraw) {
370 $this->tpl->setHeaderActionMenu($lg->getHeaderAction());
371 } else {
372 // we need to add onload code manually (rating, comments, etc.)
373 return $lg->getHeaderAction() .
374 $this->tpl->getOnLoadCodeForAsynch();
375 }
376 }
377
378 public function redrawHeaderAction()
379 {
380 echo $this->addHeaderAction(true);
381 exit;
382 }
383
387 public function preview()
388 {
389 $ilCtrl = $this->ctrl;
390 $ilAccess = $this->access;
395 $ui = $this->ui;
396
397
398 // block/unblock
399 if ($this->getPageObject()->getBlocked()) {
400 ilUtil::sendInfo($lng->txt("wiki_page_status_blocked"));
401 }
402
403
404 $this->increaseViewCount();
405
406 $this->addHeaderAction();
407
408 // content
409 if ($ilCtrl->getNextClass() != "ilnotegui") {
410 $this->setSideBlock();
411 }
412
413 $wtpl = new ilTemplate(
414 "tpl.wiki_page_view_main_column.html",
415 true,
416 true,
417 "Modules/Wiki"
418 );
419
420 $callback = array($this, "observeNoteAction");
421
422 // notes
423 if (!$ilSetting->get("disable_comments") &&
424 ilObjWiki::_lookupPublicNotes($this->getPageObject()->getParentId())) {
425 $may_delete = ($ilSetting->get("comments_del_tutor", 1) &&
426 $ilAccess->checkAccess("write", "", $_GET["ref_id"]));
427 $wtpl->setVariable("NOTES", $this->getNotesHTML(
428 $this->getPageObject(),
429 true,
430 ilObjWiki::_lookupPublicNotes($this->getPageObject()->getParentId()),
431 $may_delete,
432 $callback
433 ));
434 }
435
436
437 // page content
439 $this->showEditToolbar();
440 $this->setRenderPageContainer(true);
441 $wtpl->setVariable("PAGE", $this->showPage());
442
443 $tpl->setLoginTargetPar("wiki_" . $_GET["ref_id"] . $append);
444
445 // last edited info
446 include_once("./Services/User/classes/class.ilUserUtil.php");
447 $wtpl->setVariable(
448 "LAST_EDITED_INFO",
449 $lng->txt("wiki_last_edited") . ": " .
451 new ilDateTime($this->getPageObject()->getLastChange(), IL_CAL_DATETIME)
452 ) . ", " .
454 $this->getPageObject()->getLastChangeUser(),
455 false,
456 true,
457 $ilCtrl->getLinkTarget($this, "preview")
458 )
459 );
460
461 $tpl->setLoginTargetPar("wiki_" . $_GET["ref_id"] . $append);
462
463 //highlighting
464 if ($_GET["srcstring"] != "") {
465 include_once './Services/Search/classes/class.ilUserSearchCache.php';
466 $cache = ilUserSearchCache::_getInstance($ilUser->getId());
467 $cache->switchSearchType(ilUserSearchCache::LAST_QUERY);
468 $search_string = $cache->getQuery();
469
470 // advanced search?
471 if (is_array($search_string)) {
472 $search_string = $search_string["lom_content"];
473 }
474
475 include_once("./Services/UIComponent/TextHighlighter/classes/class.ilTextHighlighterGUI.php");
476 include_once("./Services/Search/classes/class.ilQueryParser.php");
477 $p = new ilQueryParser($search_string);
478 $p->parse();
479
480 $words = $p->getQuotedWords();
481 if (is_array($words)) {
482 foreach ($words as $w) {
483 ilTextHighlighterGUI::highlight("ilCOPageContent", $w, $tpl);
484 }
485 }
486 $this->fill_on_load_code = true;
487 }
488
489 return $message . $wtpl->get();
490 }
491
492 public function showPage()
493 {
495 $ilCtrl = $this->ctrl;
496
497 // content style
498 /* include_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
499 $tpl->setCurrentBlock("ContentStyle");
500 $tpl->setVariable("LOCATION_CONTENT_STYLESHEET",
501 ilObjStyleSheet::getContentStylePath(0));
502 $tpl->parseCurrentBlock();
503 */
504 $this->setTemplateOutput(false);
505
506 if (!$this->getAbstractOnly()) {
507 $this->setPresentationTitle($this->getWikiPage()->getTitle());
508
509 // wiki stats clean up
510 // $this->increaseViewCount();
511 }
512
513 return parent::showPage();
514 }
515
516 protected function increaseViewCount()
517 {
519
520 $this->getWikiPage()->increaseViewCnt();
521
522 // enable object statistics
523 require_once('Services/Tracking/classes/class.ilChangeEvent.php');
525 "wiki",
526 $this->getWikiPage()->getWikiRefId(),
527 $this->getWikiPage()->getWikiId(),
528 $ilUser->getId()
529 );
530
531 include_once "./Modules/Wiki/classes/class.ilWikiStat.php";
533 }
534
538 public function postOutputProcessing($a_output)
539 {
540 $ilCtrl = $this->ctrl;
541
542 //echo htmlentities($a_output);
543 include_once("./Modules/Wiki/classes/class.ilWikiUtil.php");
544
545 $ilCtrl->setParameterByClass("ilobjwikigui", "from_page", ilWikiUtil::makeUrlTitle($_GET["page"]));
546 if ($this->getEnabledHref() && $this->getOutputMode() !== self::EDIT) {
548 $a_output,
549 $this->getWikiPage()->getWikiId(),
550 ($this->getOutputMode() == "offline")
551 );
552 } else {
553 $output = $a_output;
554 }
555 $ilCtrl->setParameterByClass("ilobjwikigui", "from_page", $_GET["from_page"]);
556
557
558 // metadata in print view
559 if ($this->getOutputMode() == "print" && $this->wiki instanceof ilObjWiki) {
560 include_once("./Services/Object/classes/class.ilObjectMetaDataGUI.php");
561 $mdgui = new ilObjectMetaDataGUI($this->wiki, "wpg", $this->getId());
562 $md = $mdgui->getKeyValueList();
563 if ($md != "") {
564 $output = str_replace("<!--COPage-PageTop-->", "<p>" . $md . "</p>", $output);
565 }
566 }
567
568
569 return $output;
570 }
571
575 public function whatLinksHere()
576 {
578
579 include_once("./Modules/Wiki/classes/class.ilWikiPagesTableGUI.php");
580
581 $this->setSideBlock($_GET["wpg_id"]);
582 $table_gui = new ilWikiPagesTableGUI(
583 $this,
584 "whatLinksHere",
585 $this->getWikiPage()->getWikiId(),
587 $_GET["wpg_id"]
588 );
589
590 $tpl->setContent($table_gui->getHTML());
591 }
592
593 public function getTabs($a_activate = "")
594 {
595 $ilTabs = $this->tabs;
596 $ilCtrl = $this->ctrl;
597 $ilAccess = $this->access;
598
599 parent::getTabs($a_activate);
600
601 if ($ilAccess->checkAccess("statistics_read", "", $_GET["ref_id"])) {
602 $ilTabs->addTarget(
603 "statistics",
604 $this->ctrl->getLinkTargetByClass(
605 array("ilwikipagegui", "ilwikistatgui"),
606 "initial"
607 ),
608 "",
609 "ilwikistatgui"
610 );
611 }
612
613 $ilCtrl->setParameterByClass(
614 "ilobjwikigui",
615 "wpg_id",
617 $this->getPageObject()->getParentId(),
619 )
620 );
621 $ilCtrl->setParameterByClass("ilobjwikigui", "page", ilWikiUtil::makeUrlTitle($_GET["page"]));
622
623 $ilTabs->addTarget(
624 "wiki_what_links_here",
625 $this->ctrl->getLinkTargetByClass(
626 "ilwikipagegui",
627 "whatLinksHere"
628 ),
629 "whatLinksHere"
630 );
631 //$ilTabs->addTarget("wiki_print_view",
632 // $this->ctrl->getLinkTargetByClass("ilobjwikigui",
633 // "printViewSelection"), "printViewSelection");
634 $ilTabs->addTarget(
635 "wiki_print_view",
636 $this->ctrl->getLinkTargetByClass(
637 "ilwikipagegui",
638 "printViewSelection"
639 ),
640 "printViewSelection"
641 );
642 }
643
648 {
649 $ilAccess = $this->access;
651 $ilCtrl = $this->ctrl;
653
654 include_once("./Modules/Wiki/classes/class.ilWikiPerm.php");
655 if (ilWikiPerm::check("delete_wiki_pages", $_GET["ref_id"])) {
656 include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
657 $confirmation_gui = new ilConfirmationGUI();
658 $confirmation_gui->setFormAction($ilCtrl->getFormAction($this));
659 $confirmation_gui->setHeaderText($lng->txt("wiki_page_deletion_confirmation"));
660 $confirmation_gui->setCancel($lng->txt("cancel"), "cancelWikiPageDeletion");
661 $confirmation_gui->setConfirm($lng->txt("delete"), "confirmWikiPageDeletion");
662
663 $dtpl = new ilTemplate(
664 "tpl.wiki_page_deletion_confirmation.html",
665 true,
666 true,
667 "Modules/Wiki"
668 );
669
670 $dtpl->setVariable("PAGE_TITLE", $this->getWikiPage()->getTitle());
671
672 // other pages that link to this page
673 $dtpl->setVariable("TXT_OTHER_PAGES", $lng->txt("wiki_other_pages_linking"));
675 $this->getWikiPage()->getWikiId(),
676 $this->getWikiPage()->getId()
677 );
678 if (count($pages) > 0) {
679 foreach ($pages as $page) {
680 $dtpl->setCurrentBlock("lpage");
681 $dtpl->setVariable("TXT_LINKING_PAGE", $page["title"]);
682 $dtpl->parseCurrentBlock();
683 }
684 } else {
685 $dtpl->setCurrentBlock("lpage");
686 $dtpl->setVariable("TXT_LINKING_PAGE", "-");
687 $dtpl->parseCurrentBlock();
688 }
689
690 // contributors
691 $dtpl->setVariable("TXT_CONTRIBUTORS", $lng->txt("wiki_contributors"));
692 $contributors = ilWikiPage::getWikiPageContributors($this->getWikiPage()->getId());
693 foreach ($contributors as $contributor) {
694 $dtpl->setCurrentBlock("contributor");
695 $dtpl->setVariable(
696 "TXT_CONTRIBUTOR",
697 $contributor["lastname"] . ", " . $contributor["firstname"]
698 );
699 $dtpl->parseCurrentBlock();
700 }
701
702 // notes/comments
703 include_once("./Services/Notes/classes/class.ilNote.php");
704 $cnt_note_users = ilNote::getUserCount(
705 $this->getPageObject()->getParentId(),
706 $this->getPageObject()->getId(),
707 "wpg"
708 );
709 $dtpl->setVariable(
710 "TXT_NUMBER_USERS_NOTES_OR_COMMENTS",
711 $lng->txt("wiki_number_users_notes_or_comments")
712 );
713 $dtpl->setVariable("TXT_NR_NOTES_COMMENTS", $cnt_note_users);
714
715 $confirmation_gui->addItem("", "", $dtpl->get());
716
717 $tpl->setContent($confirmation_gui->getHTML());
718 }
719 }
720
724 public function cancelWikiPageDeletion()
725 {
727 $ilCtrl = $this->ctrl;
728
729 $ilCtrl->redirect($this, "preview");
730 }
731
735 public function confirmWikiPageDeletion()
736 {
737 $ilAccess = $this->access;
739 $ilCtrl = $this->ctrl;
741
742 include_once("./Modules/Wiki/classes/class.ilWikiPerm.php");
743 if (ilWikiPerm::check("delete_wiki_pages", $_GET["ref_id"])) {
744 $this->getPageObject()->delete();
745
746 ilUtil::sendSuccess($lng->txt("wiki_page_deleted"), true);
747 }
748
749 $ilCtrl->redirectByClass("ilobjwikigui", "allPages");
750 }
751
755
762 public function printViewSelection()
763 {
766 $ilToolbar = $this->toolbar;
767 $ilCtrl = $this->ctrl;
769
770 /*$ilToolbar->setFormAction($ilCtrl->getFormActionByClass("ilobjwikigui", "printView"),
771 false, "print_view");
772 $ilToolbar->addFormButton($lng->txt("cont_show_print_view"), "printView");
773 $ilToolbar->setCloseFormTag(false);*/
774
776
777 $tpl->setContent($this->form->getHTML());
778 }
779
784 {
786 $ilCtrl = $this->ctrl;
787
789
790 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
791 $this->form = new ilPropertyFormGUI();
792
793 // because of PDF export
794 $this->form->setPreventDoubleSubmission(false);
795
796 //var_dump($pages);
797 // selection type
798 $radg = new ilRadioGroupInputGUI($lng->txt("cont_selection"), "sel_type");
799 $radg->setValue("page");
800 $op1 = new ilRadioOption($lng->txt("cont_current_page"), "page");
801 $radg->addOption($op1);
802 $op2 = new ilRadioOption($lng->txt("wiki_whole_wiki")
803 . " (" . $lng->txt("wiki_pages") . ": " . count($pages) . ")", "wiki");
804 $radg->addOption($op2);
805 $op3 = new ilRadioOption($lng->txt("wiki_selected_pages"), "selection");
806 $radg->addOption($op3);
807
808 include_once("./Services/Form/classes/class.ilNestedListInputGUI.php");
809 $nl = new ilNestedListInputGUI("", "obj_id");
810 $op3->addSubItem($nl);
811
812 foreach ($pages as $p) {
813 $nl->addListNode(
814 $p["id"],
815 $p["title"],
816 0,
817 false,
818 false,
819 ilUtil::getImagePath("icon_pg.svg"),
820 $lng->txt("wiki_page")
821 );
822 }
823
824 $this->form->addItem($radg);
825
826 $this->form->addCommandButton("printViewOrder", $lng->txt("wiki_show_print_view"));
827 $this->form->addCommandButton("pdfExportOrder", $lng->txt("wiki_show_pdf_export"));
828 //$this->form->setOpenTag(false);
829 //$this->form->setCloseTag(false);
830
831 $this->form->setTitle($lng->txt("cont_print_selection"));
832 $this->form->setFormAction($ilCtrl->getFormAction($this, "printViewOrder"));
833 }
834
835 public function printViewOrder()
836 {
837 $this->printViewOrderList();
838 }
839
840 public function pdfExportOrder()
841 {
842 $this->printViewOrderList(true);
843 }
844
845 protected function printViewOrderList($a_pdf_export = false)
846 {
847 $ilTabs = $this->tabs;
848
849 $pg_ids = $all_pages = array();
850
851 // coming from type selection
852 if (!is_array($_POST["wordr"])) {
853 switch (trim($_POST["sel_type"])) {
854 case "wiki":
855 include_once("./Modules/Wiki/classes/class.ilWikiPage.php");
856 $all_pages = ilWikiPage::getAllWikiPages($this->getPageObject()->getWikiId());
857 foreach ($all_pages as $p) {
858 $pg_ids[] = $p["id"];
859 }
860 break;
861
862 case "selection":
863 if (is_array($_POST["obj_id"])) {
864 $pg_ids = $_POST["obj_id"];
865 } else {
866 $pg_ids[] = $_GET["wpg_id"];
867 }
868 if (sizeof($pg_ids) > 1) {
869 break;
870 } else {
871 $_GET["wpg_id"] = array_pop($pg_ids);
872 }
873 // fallthrough
874
875 // no order needed for single page
876 // no break
877 default:
878 //case "page":
879 $this->ctrl->setParameterByClass("ilObjWikiGUI", "wpg_id", $_GET["wpg_id"]);
880 if ($a_pdf_export) {
881 $this->ctrl->redirectByClass("ilObjWikiGUI", "pdfExport");
882 } else {
883 $this->ctrl->redirectByClass("ilObjWikiGUI", "printView");
884 }
885 break;
886 }
887
888 if ($a_pdf_export) {
889 $this->ctrl->setParameter($this, "pexp", 1);
890 }
891 }
892 // refresh sorting
893 else {
894 $a_pdf_export = (bool) $_GET["pexp"];
895
896 asort($_POST["wordr"]);
897 $pg_ids = array_keys($_POST["wordr"]);
898 }
899
900 $ilTabs->clearTargets();
901 $ilTabs->setBackTarget(
902 $this->lng->txt("back"),
903 $this->ctrl->getLinkTarget($this, "preview")
904 );
905
906 if (!sizeof($all_pages)) {
907 include_once("./Modules/Wiki/classes/class.ilWikiPage.php");
908 $all_pages = ilWikiPage::getAllWikiPages($this->getPageObject()->getWikiId());
909 }
910
911 include_once "Modules/Wiki/classes/class.ilWikiExportOrderTableGUI.php";
912 $tbl = new ilWikiExportOrderTableGUI($this, "printViewOrderList", $a_pdf_export, $all_pages, $pg_ids);
913 $this->tpl->setContent($tbl->getHTML());
914 }
915
916
920
924 public function blockWikiPage()
925 {
926 $ilAccess = $this->access;
928 $ilCtrl = $this->ctrl;
930
931 include_once("./Modules/Wiki/classes/class.ilWikiPerm.php");
932 if (ilWikiPerm::check("activate_wiki_protection", $_GET["ref_id"])) {
933 $this->getPageObject()->setBlocked(true);
934 $this->getPageObject()->update();
935
936 ilUtil::sendSuccess($lng->txt("wiki_page_blocked"), true);
937 }
938
939 $ilCtrl->redirect($this, "preview");
940 }
941
945 public function unblockWikiPage()
946 {
947 $ilAccess = $this->access;
949 $ilCtrl = $this->ctrl;
951
952 include_once("./Modules/Wiki/classes/class.ilWikiPerm.php");
953 if (ilWikiPerm::check("activate_wiki_protection", $_GET["ref_id"])) {
954 $this->getPageObject()->setBlocked(false);
955 $this->getPageObject()->update();
956
957 ilUtil::sendSuccess($lng->txt("wiki_page_unblocked"), true);
958 }
959
960 $ilCtrl->redirect($this, "preview");
961 }
962
963
967
971 public function renameWikiPage()
972 {
973 $ilAccess = $this->access;
975 $ilCtrl = $this->ctrl;
977
978 if (($ilAccess->checkAccess("edit_content", "", $_GET["ref_id"]) && !$this->getPageObject()->getBlocked())
979 || $ilAccess->checkAccess("write", "", $_GET["ref_id"])) {
980 $this->initRenameForm();
981 $tpl->setContent($this->form->getHTML());
982 }
983 }
984
990 protected function initRenameForm()
991 {
993 $ilCtrl = $this->ctrl;
994
995 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
996 $this->form = new ilPropertyFormGUI();
997
998 // new name
999 $ti = new ilTextInputGUI($lng->txt("wiki_new_page_name"), "new_page_name");
1000 $ti->setMaxLength(200);
1001 $ti->setSize(50);
1002 $ti->setValue($this->getPageObject()->getTitle());
1003 $ti->setRequired(true);
1004 $this->form->addItem($ti);
1005
1006 $this->form->addCommandButton("renamePage", $lng->txt("wiki_rename"));
1007 $this->form->addCommandButton("preview", $lng->txt("cancel"));
1008
1009 $this->form->setTitle($lng->txt("wiki_rename_page"));
1010 $this->form->setFormAction($ilCtrl->getFormAction($this));
1011 }
1012
1016 public function renamePage()
1017 {
1018 $tpl = $this->tpl;
1019 $lng = $this->lng;
1020 $ilCtrl = $this->ctrl;
1021 $ilAccess = $this->access;
1022
1023 $this->initRenameForm();
1024 if ($this->form->checkInput()) {
1025 if (($ilAccess->checkAccess("edit_content", "", $_GET["ref_id"]) && !$this->getPageObject()->getBlocked())
1026 || $ilAccess->checkAccess("write", "", $_GET["ref_id"])) {
1027 $new_name = $this->form->getInput("new_page_name");
1028
1029 $page_title = ilWikiUtil::makeDbTitle($new_name);
1030 $pg_id = ilWikiPage::_getPageIdForWikiTitle($this->getPageObject()->getWikiId(), $page_title);
1031
1032 // we might get the same page id back here, if the page
1033 // name only differs in diacritics
1034 // see bug http://www.ilias.de/mantis/view.php?id=11226
1035 if ($pg_id > 0 && $pg_id != $this->getPageObject()->getId()) {
1036 ilUtil::sendFailure($lng->txt("wiki_page_already_exists"));
1037 } else {
1038 $new_name = $this->getPageObject()->rename($new_name);
1039 $ilCtrl->setParameterByClass("ilobjwikigui", "page", ilWikiUtil::makeUrlTitle($new_name));
1040 ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
1041 $ilCtrl->redirect($this, "preview");
1042 }
1043 }
1044 }
1045
1046 $this->form->setValuesByPost();
1047 $tpl->setContent($this->form->getHtml());
1048 }
1049
1053
1054 public function activateWikiPageRating()
1055 {
1056 $lng = $this->lng;
1057 $ilCtrl = $this->ctrl;
1058
1059 $this->getPageObject()->setRating(true);
1060 $this->getPageObject()->update();
1061
1062 ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
1063 $ilCtrl->redirect($this, "preview");
1064 }
1065
1067 {
1068 $lng = $this->lng;
1069 $ilCtrl = $this->ctrl;
1070
1071 $this->getPageObject()->setRating(false);
1072 $this->getPageObject()->update();
1073
1074 ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
1075 $ilCtrl->redirect($this, "preview");
1076 }
1077
1078
1079 public function observeNoteAction($a_wiki_id, $a_page_id, $a_type, $a_action, $a_note_id)
1080 {
1081 // #10040 - get note text
1082 include_once "Services/Notes/classes/class.ilNote.php";
1083 $note = new ilNote($a_note_id);
1084 $note = $note->getText();
1085
1086 include_once "./Services/Notification/classes/class.ilNotification.php";
1087 ilWikiUtil::sendNotification("comment", ilNotification::TYPE_WIKI_PAGE, $this->getWikiRefId(), $a_page_id, $note);
1088 }
1089
1090 public function updateStatsRating($a_wiki_id, $a_wiki_type, $a_page_id, $a_page_type)
1091 {
1092 include_once "./Modules/Wiki/classes/class.ilWikiStat.php";
1094 }
1095
1096
1097 //
1098 // advanced meta data
1099 //
1100
1101 protected function initAdvancedMetaDataForm()
1102 {
1103 $ilCtrl = $this->ctrl;
1104 $lng = $this->lng;
1105
1106 $page = $this->getWikiPage();
1107
1108 include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
1109 $form = new ilPropertyFormGUI();
1110 $form->setFormAction($ilCtrl->getFormAction($this, "updateAdvancedMetaData"));
1111
1112 // :TODO:
1113 $form->setTitle($lng->txt("wiki_advmd_block_title") . ": " . $page->getTitle());
1114
1115 include_once('Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordGUI.php');
1116 $this->record_gui = new ilAdvancedMDRecordGUI(ilAdvancedMDRecordGUI::MODE_EDITOR, 'wiki', $page->getWikiId(), 'wpg', $page->getId());
1117 $this->record_gui->setPropertyForm($form);
1118 $this->record_gui->parse();
1119
1120 $form->addCommandButton("updateAdvancedMetaData", $lng->txt("save"));
1121 $form->addCommandButton("preview", $lng->txt("cancel"));
1122
1123 return $form;
1124 }
1125
1126 public function editAdvancedMetaData(ilPropertyFormGUI $a_form = null)
1127 {
1128 $ilTabs = $this->tabs;
1129 $lng = $this->lng;
1130 $ilCtrl = $this->ctrl;
1131 $tpl = $this->tpl;
1132 $ilAccess = $this->access;
1133
1134 if (!$ilAccess->checkAccess("write", "", $this->wiki_ref_id) &&
1135 !$ilAccess->checkAccess("edit_page_meta", "", $this->wiki_ref_id)) {
1136 return;
1137 }
1138
1139
1140 $ilTabs->clearTargets();
1141 $ilTabs->setBackTarget(
1142 $lng->txt("back"),
1143 $ilCtrl->getLinkTarget($this, "preview")
1144 );
1145
1146 if (!$a_form) {
1147 $a_form = $this->initAdvancedMetaDataForm();
1148 }
1149
1150 $tpl->setContent($a_form->getHTML());
1151 }
1152
1153 public function updateAdvancedMetaData()
1154 {
1155 $ilCtrl = $this->ctrl;
1156 $lng = $this->lng;
1157 $ilAccess = $this->access;
1158
1159 if (!$ilAccess->checkAccess("write", "", $this->wiki_ref_id) &&
1160 !$ilAccess->checkAccess("edit_page_meta", "", $this->wiki_ref_id)) {
1161 return;
1162 }
1163
1164 $form = $this->initAdvancedMetaDataForm();
1165
1166 // needed for proper advanced MD validation
1167 $form->checkInput();
1168 if (!$this->record_gui->importEditFormPostValues()) {
1169 $this->editAdvancedMetaData($form); // #16470
1170 return false;
1171 }
1172
1173 if ($this->record_gui->writeEditForm()) {
1174 ilUtil::sendSuccess($lng->txt("settings_saved"), true);
1175 }
1176 $ilCtrl->redirect($this, "preview");
1177 }
1178
1179 public function hideAdvancedMetaData()
1180 {
1181 $ilCtrl = $this->ctrl;
1182 $lng = $this->lng;
1183 $ilAccess = $this->access;
1184
1185 if (!$ilAccess->checkAccess("write", "", $this->wiki_ref_id) &&
1186 !$ilAccess->checkAccess("edit_page_meta", "", $this->wiki_ref_id)) {
1187 return;
1188 }
1189
1190 $this->getPageObject()->hideAdvancedMetadata(true);
1191 $this->getPageObject()->update();
1192
1193 ilUtil::sendSuccess($lng->txt("settings_saved"), true);
1194 $ilCtrl->redirect($this, "preview");
1195 }
1196
1197 public function unhideAdvancedMetaData()
1198 {
1199 $ilCtrl = $this->ctrl;
1200 $lng = $this->lng;
1201 $ilAccess = $this->access;
1202
1203 if (!$ilAccess->checkAccess("write", "", $this->wiki_ref_id) &&
1204 !$ilAccess->checkAccess("edit_page_meta", "", $this->wiki_ref_id)) {
1205 return;
1206 }
1207
1208 $this->getPageObject()->hideAdvancedMetadata(false);
1209 $this->getPageObject()->update();
1210
1211 ilUtil::sendSuccess($lng->txt("settings_saved"), true);
1212 $ilCtrl->redirect($this, "preview");
1213 }
1214
1221 public function edit()
1222 {
1223 $tpl = $this->tpl;
1224 $lng = $this->lng;
1225
1227
1228 return parent::edit();
1229 }
1230
1236 public static function initEditingJS(ilGlobalTemplateInterface $a_tpl)
1237 {
1238 global $DIC;
1239
1240 $lng = $DIC->language();
1241
1242 $a_tpl->addJavascript("./Modules/Wiki/js/WikiEdit.js");
1243 $a_tpl->addOnLoadCode("il.Wiki.Edit.txt.page_exists = '" . $lng->txt("wiki_page_exists") . "';");
1244 $a_tpl->addOnLoadCode("il.Wiki.Edit.txt.new_page = '" . $lng->txt("wiki_new_page") . "';");
1245 }
1246
1247
1251 public function insertWikiLink()
1252 {
1253 $lng = $this->lng;
1254 $ilCtrl = $this->ctrl;
1255
1256 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
1257 $form = new ilPropertyFormGUI();
1258 $form->addCommandButton("addWikiLink", $lng->txt("wiki_add_link"));
1259 $form->addCommandButton("searchWikiLink", $lng->txt("search"));
1260
1261 // Target page
1262 $tp = new ilTextInputGUI($this->lng->txt("wiki_target_page"), "target_page");
1263 $tp->setSize(18);
1264 $tp->setRequired(true);
1265 $tp->setInfo("...");
1266 $tp->setDataSource($ilCtrl->getLinkTarget($this, "insertWikiLinkAC", "", true));
1267 $form->addItem($tp);
1268
1269 // Link text
1270 $lt = new ilTextInputGUI($this->lng->txt("wiki_link_text"), "link_text");
1271 $lt->setSize(18);
1272 $form->addItem($lt);
1273
1274 //$form->setTitle($lng->txt("wiki_link"));
1275
1276 echo $form->getHTML();
1277 exit;
1278 }
1279
1283 public function insertWikiLinkAC()
1284 {
1285 $result = array();
1286
1287 $term = $_GET["term"];
1288
1289 // if page exists, make it first entry
1290 if (ilWikiPage::_wikiPageExists($this->getPageObject()->getParentId(), $term)) {
1291 $entry = new stdClass();
1292 $entry->value = $term;
1293 $entry->label = $term;
1294 $result[] = $entry;
1295 }
1296
1297 $res = ilWikiPage::getPagesForSearch($this->getPageObject()->getParentId(), $term);
1298
1299 $cnt = 0;
1300 foreach ($res as $r) {
1301 if ($result[0]->value == $r) {
1302 continue;
1303 }
1304 if ($cnt++ > 19) {
1305 continue;
1306 }
1307 $entry = new stdClass();
1308 $entry->value = $r;
1309 $entry->label = $r;
1310 $result[] = $entry;
1311 }
1312
1313 include_once './Services/JSON/classes/class.ilJsonUtil.php';
1315 exit;
1316 }
1317
1321 public function searchWikiLinkAC()
1322 {
1323 $lng = $this->lng;
1324
1325 $lng->loadLanguageModule("wiki");
1326
1327 $tpl = new ilTemplate("tpl.wiki_ac_search_result.html", true, true, "Modules/Wiki");
1328 $term = trim($_GET["term"]);
1329
1330 $pages = ilObjWiki::_performSearch($this->getPageObject()->getParentId(), $term);
1331
1332 $found = array();
1333 foreach ($pages as $page) {
1334 $found[] = array("page_id" => $page["page_id"], "title" => ilWikiPage::lookupTitle($page["page_id"]));
1335 }
1336
1337 // sort if all pages are listed
1338 if ($term == "") {
1339 $found = ilUtil::sortArray($found, "title", "asc");
1340 }
1341
1342 foreach ($found as $f) {
1343 $tpl->setCurrentBlock("item");
1344 $tpl->setVariable("WIKI_TITLE", $f["title"]);
1345 $tpl->parseCurrentBlock();
1346 }
1347
1348 if (count($pages) == 0) {
1349 $tpl->setVariable("INFOTEXT", str_replace("$1", $term, $lng->txt("wiki_no_page_found")));
1350 } elseif ($term == '') {
1351 $tpl->setVariable("INFOTEXT", $lng->txt("wiki_no_search_term"), $term);
1352 } else {
1353 $tpl->setVariable("INFOTEXT", str_replace("$1", $term, $lng->txt("wiki_pages_found")));
1354 }
1355
1356 $tpl->setVariable("TXT_BACK", $lng->txt("back"));
1357 echo $tpl->get();
1358 exit;
1359 }
1360
1361 //
1362 // exercise assignment
1363 //
1364
1368 protected function finalizeAssignment()
1369 {
1370 $ilCtrl = $this->ctrl;
1371 $lng = $this->lng;
1372
1373 include_once("./Modules/Exercise/AssignmentTypes/classes/class.ilExAssignmentTypes.php");
1374 include_once("./Modules/Exercise/classes/class.ilExAssignment.php");
1376
1377 $ass_id = (int) $_GET["ass"];
1378 $wiki_ass->submitWiki($ass_id, $this->user->getId(), $this->getWikiRefId());
1379
1380 /*
1381 include_once "Modules/Exercise/classes/class.ilExSubmissionBaseGUI.php";
1382 include_once "Modules/Exercise/classes/class.ilExSubmissionObjectGUI.php";
1383 $exc_gui = ilExSubmissionObjectGUI::initGUIForSubmit($this->ass_id);
1384 $exc_gui->submitBlog($this->node_id);*/
1385
1386 ilUtil::sendSuccess($lng->txt("wiki_finalized"), true);
1387 $ilCtrl->redirectByClass("ilObjWikiGUI", "gotoStartPage");
1388 }
1389
1390 protected function downloadExcSubFile()
1391 {
1393
1394 $ass_id = (int) $_GET["ass"];
1395 $ass = new ilExAssignment($ass_id);
1396 $submission = new ilExSubmission($ass, $ilUser->getId());
1397 $submitted = $submission->getFiles();
1398 if (count($submitted) > 0) {
1399 $submitted = array_pop($submitted);
1400
1401 $user_data = ilObjUser::_lookupName($submitted["user_id"]);
1402 $title = ilObject::_lookupTitle($submitted["obj_id"]) . " - " .
1403 $ass->getTitle() . " (Team " . $submission->getTeam()->getId() . ").zip";
1404
1405 ilUtil::deliverFile($submitted["filename"], $title);
1406 }
1407 }
1408
1412 public function getCommentsHTMLExport()
1413 {
1414 return $this->getNotesHTML(
1415 $this->getPageObject(),
1416 false,
1417 ilObjWiki::_lookupPublicNotes($this->getPageObject()->getParentId()),
1418 false,
1419 null,
1420 true
1421 );
1422 }
1423}
$result
user()
Definition: user.php:4
$_GET["client_id"]
$_POST["username"]
An exception for terminatinating execution or to throw for unit testing.
const IL_CAL_DATETIME
const IL_WIKI_WHAT_LINKS_HERE
static _recordReadEvent( $a_type, $a_ref_id, $obj_id, $usr_id, $isCatchupWriteEvents=true, $a_ext_rc=false, $a_ext_time=false)
Records a read event and catches up with write events.
Class ilCommonActionDispatcherGUI.
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
Confirmation screen class.
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date @access public.
@classDescription Date and time handling
static getInstance()
Get instance.
Exercise assignment.
Exercise submission //TODO: This class has to much static methods related to delivered "files".
static encode($mixed, $suppress_native=false)
This class represents a (nested) list of checkboxes (could be extended for radio items,...
Note class.
static getUserCount($a_rep_obj_id, $a_obj_id, $a_type)
How many users have attached a note/comment to a given object?
static setNotification($type, $user_id, $id, $status=true)
Set notification status for object and user.
static hasNotification($type, $user_id, $id)
Check notification status for object and user.
static hasOptOut($obj_id)
Is opt out (disable notification) allowed?
static getSyntaxStylePath()
get syntax style path
static _lookupName($a_user_id)
lookup user name
static renderSideBlock($a_wpg_id, $a_wiki_ref_id, $a_wp=null)
Side column.
Class ilObjWiki.
static _lookupPublicNotes($a_wiki_id)
Lookup whether public notes are activated.
static _lookupRatingOverall($a_wiki_id)
Lookup whether rating is activated for whole object.
static _performSearch($a_wiki_id, $a_searchterm)
Search in Wiki.
Class ilObjectMetaDataGUI.
static _lookupObjId($a_id)
static _lookupTitle($a_id)
lookup object title
Class ilPageObjectGUI.
setPresentationTitle($a_title="")
setOutputMode($a_mode=self::PRESENTATION)
Set Output Mode.
showEditToolbar()
Show edit toolbar.
setRenderPageContainer($a_val)
Set render page container.
getAbstractOnly()
Get abstract only.
getPageObject()
Get Page Object.
setTemplateOutput($a_output=true)
getNotesHTML($a_content_object=null, $a_enable_private_notes=true, $a_enable_public_notes=false, $a_enable_notes_deletion=false, $a_callback=null, $export=false)
Get html for public and/or private notes.
setPageObject(ilPageObject $a_pg_obj)
Set Page Object.
This class represents a property form user interface.
This class represents a property in a property form.
This class represents an option in a radio group.
Class ilRatingGUI.
special template class to simplify handling of ITX/PEAR
static highlight($a_dom_node_id, $a_text, $a_tpl=null)
Searches for all occurences of a text (case-insensitive) and highlights it.
This class represents a text property in a property form.
static _getInstance($a_usr_id)
Get singleton instance.
static getNamePresentation( $a_user_id, $a_user_image=false, $a_profile_link=false, $a_profile_back_link="", $a_force_first_lastname=false, $a_omit_login=false, $a_sortable=true, $a_return_data_array=false, $a_ctrl_path="ilpublicuserprofilegui")
Default behaviour is:
static sortArray( $array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static deliverFile( $a_file, $a_filename, $a_mime='', $isInline=false, $removeAfterDelivery=false, $a_exit_after=true)
deliver file for download via browser.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
TableGUI class for ordering pages to be printed/exported.
Class ilWikiPage GUI class.
postOutputProcessing($a_output)
Finalizing output processing.
setScreenIdComponent()
Set screen id component.
observeNoteAction($a_wiki_id, $a_page_id, $a_type, $a_action, $a_note_id)
static initEditingJS(ilGlobalTemplateInterface $a_tpl)
Init wiki editing js.
confirmWikiPageDeletion()
Delete the wiki page.
activateWikiPageRating()
Rating /.
renamePage()
Rename page.
showPage()
display content of page
preview()
View wiki page.
cancelWikiPageDeletion()
Cancel wiki page deletion.
printViewSelection()
Print view selection.
initPrintViewSelectionForm()
Init print view selection form.
deleteWikiPageConfirmationScreen()
Delete wiki page confirmation screen.
insertWikiLink()
Returns form to insert a wiki link per ajax.
editAdvancedMetaData(ilPropertyFormGUI $a_form=null)
executeCommand()
execute command
static getGUIForTitle($a_wiki_id, $a_title, $a_old_nr=0, $a_wiki_ref_id=0)
Get wiki page gui for id and title.
finalizeAssignment()
Finalize and submit blog to exercise.
updateStatsRating($a_wiki_id, $a_wiki_type, $a_page_id, $a_page_type)
printViewOrderList($a_pdf_export=false)
insertWikiLinkAC()
Auto complete for insert wiki link.
__construct($a_id=0, $a_old_nr=0, $a_wiki_ref_id=0)
Constructor.
initRenameForm()
Init renaming form.
searchWikiLinkAC()
Search wiki link list.
setWikiRefId($a_ref_id)
setWikiPage($a_wikipage)
Set Wiki Page Object.
whatLinksHere()
All links to a specific page.
getWikiPage()
Get Wiki Page Object.
renameWikiPage()
Rename wiki page form.
setWiki($a_val)
Set wiki.
addHeaderAction($a_redraw=false)
getTabs($a_activate="")
adds tabs to tab gui object
static getPagesForSearch($a_wiki_id, $a_term)
Get pages for search.
static getPageIdForTitle($a_wiki_id, $a_title)
Get wiki page object for id and title.
static _wikiPageExists($a_wiki_id, $a_title)
Check whether page exists for wiki or not.
static getAllWikiPages($a_wiki_id)
Get all pages of wiki.
static getWikiPageContributors($a_page_id)
Get all contributors of wiki.
static getLinksToPage($a_wiki_id, $a_page_id)
Get links to a page.
static lookupTitle($a_page_id)
Checks whether a page with given title exists.
static _getPageIdForWikiTitle($a_wiki_id, $a_title)
Checks whether a page with given title exists.
TableGUI class for wiki pages table.
static check($a_perm, $a_ref_id, $a_cmd="")
Check permission.
Wiki statistics GUI class.
const EVENT_PAGE_RATING
const EVENT_PAGE_READ
static handleEvent($a_event, ilWikiPage $a_page_obj, $a_user_id=null, array $a_additional_data=null)
Handle wiki page event.
static sendNotification($a_action, $a_type, $a_wiki_ref_id, $a_page_id, $a_comment=null)
static makeUrlTitle($a_par)
Set page parameter for Url Embedding.
static makeDbTitle($a_par)
Handle page GET parameter.
static replaceInternalLinks($s, $a_wiki_id, $a_offline=false)
This one is based on Mediawiki Parser->replaceInternalLinks since we display images in another way,...
const ANONYMOUS_USER_ID
Definition: constants.php:25
global $DIC
Definition: goto.php:24
help()
Definition: help.php:2
$ilUser
Definition: imgupload.php:18
addOnLoadCode($a_code, $a_batch=2)
Add on load code.
exit
Definition: login.php:29
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $ilSetting
Definition: privfeed.php:17
foreach($_POST as $key=> $value) $res
settings()
Definition: settings.php:2
global $ilDB
ui()
Definition: ui.php:5
$message
Definition: xapiexit.php:14