ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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 {
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 {
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 // exercise information
404 /*
405 include_once("./Modules/Exercise/RepoObjectAssignment/classes/class.ilExcRepoObjAssignment.php");
406 $ass_info = ilExcRepoObjAssignment::getInstance()->getAssignmentInfoOfObj($this->getWikiRefId(), $ilUser->getId());
407 $message = "";
408 foreach ($ass_info as $i) // should be only one
409 {
410 $links = $buttons = [];
411 $ass = new ilExAssignment($i->getId());
412 $times_up = $ass->afterDeadlineStrict();
413
414 // info text and link
415 $exc_title = $i->getExerciseTitle();
416 $info = sprintf($lng->txt("wiki_exercise_info"),
417 $i->getTitle(), $exc_title);
418 foreach ($i->getLinks() as $l)
419 {
420 $links[] = $ui->factory()->link()->standard($exc_title, $l);
421 }
422
423 // submit button
424 if(!$times_up)
425 {
426 $ilCtrl->setParameterByClass("ilwikipagegui", "ass", $ass->getId());
427 $submit_link = $ilCtrl->getLinkTargetByClass("ilwikipagegui", "finalizeAssignment");
428 $ilCtrl->setParameterByClass("ilwikipagegui", "ass", "");
429
430 $buttons[] = $ui->factory()->button()->primary($lng->txt("wiki_finalize_wiki"), $submit_link);
431 }
432
433 // submitted files
434 include_once "Modules/Exercise/classes/class.ilExSubmission.php";
435 $submission = new ilExSubmission($ass, $ilUser->getId());
436 if($submission->hasSubmitted())
437 {
438 $submitted = $submission->getSelectedObject();
439
440 $ilCtrl->setParameterByClass("ilwikipagegui", "ass", $ass->getId());
441 $dl_link = $ilCtrl->getLinkTargetByClass("ilwikipagegui", "downloadExcSubFile");
442 $ilCtrl->setParameterByClass("ilwikipagegui", "ass", "");
443
444 $rel = ilDatePresentation::useRelativeDates();
445 ilDatePresentation::setUseRelativeDates(false);
446
447
448 $info .= "<br />".sprintf($lng->txt("wiki_exercise_submitted_info"),
449 ilDatePresentation::formatDate(new ilDateTime($submitted["ts"], IL_CAL_DATETIME)));
450
451 ilDatePresentation::setUseRelativeDates($rel);
452 $buttons[] = $ui->factory()->button()->standard($lng->txt("wiki_download_submission"), $dl_link);
453 }
454
455
456 $mbox = $ui->factory()->messageBox()->info($info)
457 ->withLinks($links)
458 ->withButtons($buttons);
459
460 $message = $ui->renderer()->render($mbox);
461
462 //ilUtil::sendInfo($info);
463 }
464 */
465
466
467 $this->increaseViewCount();
468
469 $this->addHeaderAction();
470
471 // content
472 $this->setSideBlock();
473
474 $wtpl = new ilTemplate(
475 "tpl.wiki_page_view_main_column.html",
476 true,
477 true,
478 "Modules/Wiki"
479 );
480
481 $callback = array($this, "observeNoteAction");
482
483 // notes
484 if (!$ilSetting->get("disable_comments") &&
485 ilObjWiki::_lookupPublicNotes($this->getPageObject()->getParentId())) {
486 $may_delete = ($ilSetting->get("comments_del_tutor", 1) &&
487 $ilAccess->checkAccess("write", "", $_GET["ref_id"]));
488 $wtpl->setVariable("NOTES", $this->getNotesHTML(
489 $this->getPageObject(),
490 true,
491 ilObjWiki::_lookupPublicNotes($this->getPageObject()->getParentId()),
492 $may_delete,
493 $callback
494 ));
495 }
496
497
498 // page content
500 $this->setRenderPageContainer(true);
501 $wtpl->setVariable("PAGE", $this->showPage());
502
503 $tpl->setLoginTargetPar("wiki_" . $_GET["ref_id"] . $append);
504
505 // last edited info
506 include_once("./Services/User/classes/class.ilUserUtil.php");
507 $wtpl->setVariable(
508 "LAST_EDITED_INFO",
509 $lng->txt("wiki_last_edited") . ": " .
511 new ilDateTime($this->getPageObject()->getLastChange(), IL_CAL_DATETIME)
512 ) . ", " .
514 $this->getPageObject()->getLastChangeUser(),
515 false,
516 true,
517 $ilCtrl->getLinkTarget($this, "preview")
518 )
519 );
520
521 $tpl->setLoginTargetPar("wiki_" . $_GET["ref_id"] . $append);
522
523 //highlighting
524 if ($_GET["srcstring"] != "") {
525 include_once './Services/Search/classes/class.ilUserSearchCache.php';
526 $cache = ilUserSearchCache::_getInstance($ilUser->getId());
527 $cache->switchSearchType(ilUserSearchCache::LAST_QUERY);
528 $search_string = $cache->getQuery();
529
530 // advanced search?
531 if (is_array($search_string)) {
532 $search_string = $search_string["lom_content"];
533 }
534
535 include_once("./Services/UIComponent/TextHighlighter/classes/class.ilTextHighlighterGUI.php");
536 include_once("./Services/Search/classes/class.ilQueryParser.php");
537 $p = new ilQueryParser($search_string);
538 $p->parse();
539
540 $words = $p->getQuotedWords();
541 if (is_array($words)) {
542 foreach ($words as $w) {
543 ilTextHighlighterGUI::highlight("ilCOPageContent", $w, $tpl);
544 }
545 }
546 $this->fill_on_load_code = true;
547 }
548
549 return $message . $wtpl->get();
550 }
551
552 public function showPage()
553 {
556
557 // content style
558 /* include_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
559 $tpl->setCurrentBlock("ContentStyle");
560 $tpl->setVariable("LOCATION_CONTENT_STYLESHEET",
561 ilObjStyleSheet::getContentStylePath(0));
562 $tpl->parseCurrentBlock();
563 */
564 $this->setTemplateOutput(false);
565
566 if (!$this->getAbstractOnly()) {
567 $this->setPresentationTitle($this->getWikiPage()->getTitle());
568
569 // wiki stats clean up
570 // $this->increaseViewCount();
571 }
572
573 return parent::showPage();
574 }
575
576 protected function increaseViewCount()
577 {
579
580 $this->getWikiPage()->increaseViewCnt();
581
582 // enable object statistics
583 require_once('Services/Tracking/classes/class.ilChangeEvent.php');
585 "wiki",
586 $this->getWikiPage()->getWikiRefId(),
587 $this->getWikiPage()->getWikiId(),
588 $ilUser->getId()
589 );
590
591 include_once "./Modules/Wiki/classes/class.ilWikiStat.php";
593 }
594
598 public function postOutputProcessing($a_output)
599 {
601
602 //echo htmlentities($a_output);
603 include_once("./Modules/Wiki/classes/class.ilWikiUtil.php");
604
605 $ilCtrl->setParameterByClass("ilobjwikigui", "from_page", ilWikiUtil::makeUrlTitle($_GET["page"]));
607 $a_output,
608 $this->getWikiPage()->getWikiId(),
609 ($this->getOutputMode() == "offline")
610 );
611 $ilCtrl->setParameterByClass("ilobjwikigui", "from_page", $_GET["from_page"]);
612
613
614 // metadata in print view
615 if ($this->getOutputMode() == "print" && $this->wiki instanceof ilObjWiki) {
616 include_once("./Services/Object/classes/class.ilObjectMetaDataGUI.php");
617 $mdgui = new ilObjectMetaDataGUI($this->wiki, "wpg", $this->getId());
618 $md = $mdgui->getKeyValueList();
619 if ($md != "") {
620 $output = str_replace("<!--COPage-PageTop-->", "<p>" . $md . "</p>", $output);
621 }
622 }
623
624
625 return $output;
626 }
627
631 public function whatLinksHere()
632 {
634
635 include_once("./Modules/Wiki/classes/class.ilWikiPagesTableGUI.php");
636
637 $this->setSideBlock($_GET["wpg_id"]);
638 $table_gui = new ilWikiPagesTableGUI(
639 $this,
640 "whatLinksHere",
641 $this->getWikiPage()->getWikiId(),
643 $_GET["wpg_id"]
644 );
645
646 $tpl->setContent($table_gui->getHTML());
647 }
648
649 public function getTabs($a_activate = "")
650 {
651 $ilTabs = $this->tabs;
653 $ilAccess = $this->access;
654
655 parent::getTabs($a_activate);
656
657 if ($ilAccess->checkAccess("statistics_read", "", $_GET["ref_id"])) {
658 $ilTabs->addTarget(
659 "statistics",
660 $this->ctrl->getLinkTargetByClass(
661 array("ilwikipagegui", "ilwikistatgui"),
662 "initial"
663 ),
664 "",
665 "ilwikistatgui"
666 );
667 }
668
669 $ilCtrl->setParameterByClass(
670 "ilobjwikigui",
671 "wpg_id",
673 $this->getPageObject()->getParentId(),
675 )
676 );
677 $ilCtrl->setParameterByClass("ilobjwikigui", "page", ilWikiUtil::makeUrlTitle($_GET["page"]));
678
679 $ilTabs->addTarget(
680 "wiki_what_links_here",
681 $this->ctrl->getLinkTargetByClass(
682 "ilwikipagegui",
683 "whatLinksHere"
684 ),
685 "whatLinksHere"
686 );
687 //$ilTabs->addTarget("wiki_print_view",
688 // $this->ctrl->getLinkTargetByClass("ilobjwikigui",
689 // "printViewSelection"), "printViewSelection");
690 $ilTabs->addTarget(
691 "wiki_print_view",
692 $this->ctrl->getLinkTargetByClass(
693 "ilwikipagegui",
694 "printViewSelection"
695 ),
696 "printViewSelection"
697 );
698 }
699
704 {
705 $ilAccess = $this->access;
709
710 include_once("./Modules/Wiki/classes/class.ilWikiPerm.php");
711 if (ilWikiPerm::check("delete_wiki_pages", $_GET["ref_id"])) {
712 include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
713 $confirmation_gui = new ilConfirmationGUI();
714 $confirmation_gui->setFormAction($ilCtrl->getFormAction($this));
715 $confirmation_gui->setHeaderText($lng->txt("wiki_page_deletion_confirmation"));
716 $confirmation_gui->setCancel($lng->txt("cancel"), "cancelWikiPageDeletion");
717 $confirmation_gui->setConfirm($lng->txt("delete"), "confirmWikiPageDeletion");
718
719 $dtpl = new ilTemplate(
720 "tpl.wiki_page_deletion_confirmation.html",
721 true,
722 true,
723 "Modules/Wiki"
724 );
725
726 $dtpl->setVariable("PAGE_TITLE", $this->getWikiPage()->getTitle());
727
728 // other pages that link to this page
729 $dtpl->setVariable("TXT_OTHER_PAGES", $lng->txt("wiki_other_pages_linking"));
731 $this->getWikiPage()->getWikiId(),
732 $this->getWikiPage()->getId()
733 );
734 if (count($pages) > 0) {
735 foreach ($pages as $page) {
736 $dtpl->setCurrentBlock("lpage");
737 $dtpl->setVariable("TXT_LINKING_PAGE", $page["title"]);
738 $dtpl->parseCurrentBlock();
739 }
740 } else {
741 $dtpl->setCurrentBlock("lpage");
742 $dtpl->setVariable("TXT_LINKING_PAGE", "-");
743 $dtpl->parseCurrentBlock();
744 }
745
746 // contributors
747 $dtpl->setVariable("TXT_CONTRIBUTORS", $lng->txt("wiki_contributors"));
748 $contributors = ilWikiPage::getWikiPageContributors($this->getWikiPage()->getId());
749 foreach ($contributors as $contributor) {
750 $dtpl->setCurrentBlock("contributor");
751 $dtpl->setVariable(
752 "TXT_CONTRIBUTOR",
753 $contributor["lastname"] . ", " . $contributor["firstname"]
754 );
755 $dtpl->parseCurrentBlock();
756 }
757
758 // notes/comments
759 include_once("./Services/Notes/classes/class.ilNote.php");
760 $cnt_note_users = ilNote::getUserCount(
761 $this->getPageObject()->getParentId(),
762 $this->getPageObject()->getId(),
763 "wpg"
764 );
765 $dtpl->setVariable(
766 "TXT_NUMBER_USERS_NOTES_OR_COMMENTS",
767 $lng->txt("wiki_number_users_notes_or_comments")
768 );
769 $dtpl->setVariable("TXT_NR_NOTES_COMMENTS", $cnt_note_users);
770
771 $confirmation_gui->addItem("", "", $dtpl->get());
772
773 $tpl->setContent($confirmation_gui->getHTML());
774 }
775 }
776
780 public function cancelWikiPageDeletion()
781 {
784
785 $ilCtrl->redirect($this, "preview");
786 }
787
791 public function confirmWikiPageDeletion()
792 {
793 $ilAccess = $this->access;
797
798 include_once("./Modules/Wiki/classes/class.ilWikiPerm.php");
799 if (ilWikiPerm::check("delete_wiki_pages", $_GET["ref_id"])) {
800 $this->getPageObject()->delete();
801
802 ilUtil::sendSuccess($lng->txt("wiki_page_deleted"), true);
803 }
804
805 $ilCtrl->redirectByClass("ilobjwikigui", "allPages");
806 }
807
811
818 public function printViewSelection()
819 {
822 $ilToolbar = $this->toolbar;
825
826 /*$ilToolbar->setFormAction($ilCtrl->getFormActionByClass("ilobjwikigui", "printView"),
827 false, "print_view");
828 $ilToolbar->addFormButton($lng->txt("cont_show_print_view"), "printView");
829 $ilToolbar->setCloseFormTag(false);*/
830
832
833 $tpl->setContent($this->form->getHTML());
834 }
835
840 {
843
845
846 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
847 $this->form = new ilPropertyFormGUI();
848
849 // because of PDF export
850 $this->form->setPreventDoubleSubmission(false);
851
852 //var_dump($pages);
853 // selection type
854 $radg = new ilRadioGroupInputGUI($lng->txt("cont_selection"), "sel_type");
855 $radg->setValue("page");
856 $op1 = new ilRadioOption($lng->txt("cont_current_page"), "page");
857 $radg->addOption($op1);
858 $op2 = new ilRadioOption($lng->txt("wiki_whole_wiki")
859 . " (" . $lng->txt("wiki_pages") . ": " . count($pages) . ")", "wiki");
860 $radg->addOption($op2);
861 $op3 = new ilRadioOption($lng->txt("wiki_selected_pages"), "selection");
862 $radg->addOption($op3);
863
864 include_once("./Services/Form/classes/class.ilNestedListInputGUI.php");
865 $nl = new ilNestedListInputGUI("", "obj_id");
866 $op3->addSubItem($nl);
867
868 foreach ($pages as $p) {
869 $nl->addListNode(
870 $p["id"],
871 $p["title"],
872 0,
873 false,
874 false,
875 ilUtil::getImagePath("icon_pg.svg"),
876 $lng->txt("wiki_page")
877 );
878 }
879
880 $this->form->addItem($radg);
881
882 $this->form->addCommandButton("printViewOrder", $lng->txt("wiki_show_print_view"));
883 $this->form->addCommandButton("pdfExportOrder", $lng->txt("wiki_show_pdf_export"));
884 //$this->form->setOpenTag(false);
885 //$this->form->setCloseTag(false);
886
887 $this->form->setTitle($lng->txt("cont_print_selection"));
888 $this->form->setFormAction($ilCtrl->getFormAction($this, "printViewOrder"));
889 }
890
891 public function printViewOrder()
892 {
893 $this->printViewOrderList();
894 }
895
896 public function pdfExportOrder()
897 {
898 $this->printViewOrderList(true);
899 }
900
901 protected function printViewOrderList($a_pdf_export = false)
902 {
903 $ilTabs = $this->tabs;
904
905 $pg_ids = $all_pages = array();
906
907 // coming from type selection
908 if (!is_array($_POST["wordr"])) {
909 switch (trim($_POST["sel_type"])) {
910 case "wiki":
911 include_once("./Modules/Wiki/classes/class.ilWikiPage.php");
912 $all_pages = ilWikiPage::getAllWikiPages($this->getPageObject()->getWikiId());
913 foreach ($all_pages as $p) {
914 $pg_ids[] = $p["id"];
915 }
916 break;
917
918 case "selection":
919 if (is_array($_POST["obj_id"])) {
920 $pg_ids = $_POST["obj_id"];
921 } else {
922 $pg_ids[] = $_GET["wpg_id"];
923 }
924 if (sizeof($pg_ids) > 1) {
925 break;
926 } else {
927 $_GET["wpg_id"] = array_pop($pg_ids);
928 }
929 // fallthrough
930
931 // no order needed for single page
932 // no break
933 default:
934 //case "page":
935 $this->ctrl->setParameterByClass("ilObjWikiGUI", "wpg_id", $_GET["wpg_id"]);
936 if ($a_pdf_export) {
937 $this->ctrl->redirectByClass("ilObjWikiGUI", "pdfExport");
938 } else {
939 $this->ctrl->redirectByClass("ilObjWikiGUI", "printView");
940 }
941 break;
942 }
943
944 if ($a_pdf_export) {
945 $this->ctrl->setParameter($this, "pexp", 1);
946 }
947 }
948 // refresh sorting
949 else {
950 $a_pdf_export = (bool) $_GET["pexp"];
951
952 asort($_POST["wordr"]);
953 $pg_ids = array_keys($_POST["wordr"]);
954 }
955
956 $ilTabs->clearTargets();
957 $ilTabs->setBackTarget(
958 $this->lng->txt("back"),
959 $this->ctrl->getLinkTarget($this, "preview")
960 );
961
962 if (!sizeof($all_pages)) {
963 include_once("./Modules/Wiki/classes/class.ilWikiPage.php");
964 $all_pages = ilWikiPage::getAllWikiPages($this->getPageObject()->getWikiId());
965 }
966
967 include_once "Modules/Wiki/classes/class.ilWikiExportOrderTableGUI.php";
968 $tbl = new ilWikiExportOrderTableGUI($this, "printViewOrderList", $a_pdf_export, $all_pages, $pg_ids);
969 $this->tpl->setContent($tbl->getHTML());
970 }
971
972
976
980 public function blockWikiPage()
981 {
982 $ilAccess = $this->access;
986
987 include_once("./Modules/Wiki/classes/class.ilWikiPerm.php");
988 if (ilWikiPerm::check("activate_wiki_protection", $_GET["ref_id"])) {
989 $this->getPageObject()->setBlocked(true);
990 $this->getPageObject()->update();
991
992 ilUtil::sendSuccess($lng->txt("wiki_page_blocked"), true);
993 }
994
995 $ilCtrl->redirect($this, "preview");
996 }
997
1001 public function unblockWikiPage()
1002 {
1003 $ilAccess = $this->access;
1004 $tpl = $this->tpl;
1006 $lng = $this->lng;
1007
1008 include_once("./Modules/Wiki/classes/class.ilWikiPerm.php");
1009 if (ilWikiPerm::check("activate_wiki_protection", $_GET["ref_id"])) {
1010 $this->getPageObject()->setBlocked(false);
1011 $this->getPageObject()->update();
1012
1013 ilUtil::sendSuccess($lng->txt("wiki_page_unblocked"), true);
1014 }
1015
1016 $ilCtrl->redirect($this, "preview");
1017 }
1018
1019
1023
1027 public function renameWikiPage()
1028 {
1029 $ilAccess = $this->access;
1030 $tpl = $this->tpl;
1032 $lng = $this->lng;
1033
1034 if (($ilAccess->checkAccess("edit_content", "", $_GET["ref_id"]) && !$this->getPageObject()->getBlocked())
1035 || $ilAccess->checkAccess("write", "", $_GET["ref_id"])) {
1036 $this->initRenameForm();
1037 $tpl->setContent($this->form->getHTML());
1038 }
1039 }
1040
1046 protected function initRenameForm()
1047 {
1048 $lng = $this->lng;
1050
1051 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
1052 $this->form = new ilPropertyFormGUI();
1053
1054 // new name
1055 $ti = new ilTextInputGUI($lng->txt("wiki_new_page_name"), "new_page_name");
1056 $ti->setMaxLength(200);
1057 $ti->setSize(50);
1058 $ti->setValue($this->getPageObject()->getTitle());
1059 $ti->setRequired(true);
1060 $this->form->addItem($ti);
1061
1062 $this->form->addCommandButton("renamePage", $lng->txt("wiki_rename"));
1063 $this->form->addCommandButton("preview", $lng->txt("cancel"));
1064
1065 $this->form->setTitle($lng->txt("wiki_rename_page"));
1066 $this->form->setFormAction($ilCtrl->getFormAction($this));
1067 }
1068
1072 public function renamePage()
1073 {
1074 $tpl = $this->tpl;
1075 $lng = $this->lng;
1077 $ilAccess = $this->access;
1078
1079 $this->initRenameForm();
1080 if ($this->form->checkInput()) {
1081 if (($ilAccess->checkAccess("edit_content", "", $_GET["ref_id"]) && !$this->getPageObject()->getBlocked())
1082 || $ilAccess->checkAccess("write", "", $_GET["ref_id"])) {
1083 $new_name = $this->form->getInput("new_page_name");
1084
1085 $page_title = ilWikiUtil::makeDbTitle($new_name);
1086 $pg_id = ilWikiPage::_getPageIdForWikiTitle($this->getPageObject()->getWikiId(), $page_title);
1087
1088 // we might get the same page id back here, if the page
1089 // name only differs in diacritics
1090 // see bug http://www.ilias.de/mantis/view.php?id=11226
1091 if ($pg_id > 0 && $pg_id != $this->getPageObject()->getId()) {
1092 ilUtil::sendFailure($lng->txt("wiki_page_already_exists"));
1093 } else {
1094 $new_name = $this->getPageObject()->rename($new_name);
1095 $ilCtrl->setParameterByClass("ilobjwikigui", "page", ilWikiUtil::makeUrlTitle($new_name));
1096 ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
1097 $ilCtrl->redirect($this, "preview");
1098 }
1099 }
1100 }
1101
1102 $this->form->setValuesByPost();
1103 $tpl->setContent($this->form->getHtml());
1104 }
1105
1109
1110 public function activateWikiPageRating()
1111 {
1112 $lng = $this->lng;
1114
1115 $this->getPageObject()->setRating(true);
1116 $this->getPageObject()->update();
1117
1118 ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
1119 $ilCtrl->redirect($this, "preview");
1120 }
1121
1123 {
1124 $lng = $this->lng;
1126
1127 $this->getPageObject()->setRating(false);
1128 $this->getPageObject()->update();
1129
1130 ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
1131 $ilCtrl->redirect($this, "preview");
1132 }
1133
1134
1135 public function observeNoteAction($a_wiki_id, $a_page_id, $a_type, $a_action, $a_note_id)
1136 {
1137 // #10040 - get note text
1138 include_once "Services/Notes/classes/class.ilNote.php";
1139 $note = new ilNote($a_note_id);
1140 $note = $note->getText();
1141
1142 include_once "./Services/Notification/classes/class.ilNotification.php";
1143 ilWikiUtil::sendNotification("comment", ilNotification::TYPE_WIKI_PAGE, $this->getWikiRefId(), $a_page_id, $note);
1144 }
1145
1146 public function updateStatsRating($a_wiki_id, $a_wiki_type, $a_page_id, $a_page_type)
1147 {
1148 include_once "./Modules/Wiki/classes/class.ilWikiStat.php";
1150 }
1151
1152
1153 //
1154 // advanced meta data
1155 //
1156
1157 protected function initAdvancedMetaDataForm()
1158 {
1160 $lng = $this->lng;
1161
1162 $page = $this->getWikiPage();
1163
1164 include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
1165 $form = new ilPropertyFormGUI();
1166 $form->setFormAction($ilCtrl->getFormAction($this, "updateAdvancedMetaData"));
1167
1168 // :TODO:
1169 $form->setTitle($lng->txt("wiki_advmd_block_title") . ": " . $page->getTitle());
1170
1171 include_once('Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordGUI.php');
1172 $this->record_gui = new ilAdvancedMDRecordGUI(ilAdvancedMDRecordGUI::MODE_EDITOR, 'wiki', $page->getWikiId(), 'wpg', $page->getId());
1173 $this->record_gui->setPropertyForm($form);
1174 $this->record_gui->parse();
1175
1176 $form->addCommandButton("updateAdvancedMetaData", $lng->txt("save"));
1177 $form->addCommandButton("preview", $lng->txt("cancel"));
1178
1179 return $form;
1180 }
1181
1182 public function editAdvancedMetaData(ilPropertyFormGUI $a_form = null)
1183 {
1184 $ilTabs = $this->tabs;
1185 $lng = $this->lng;
1187 $tpl = $this->tpl;
1188 $ilAccess = $this->access;
1189
1190 if (!$ilAccess->checkAccess("write", "", $this->wiki_ref_id) &&
1191 !$ilAccess->checkAccess("edit_page_meta", "", $this->wiki_ref_id)) {
1192 return;
1193 }
1194
1195
1196 $ilTabs->clearTargets();
1197 $ilTabs->setBackTarget(
1198 $lng->txt("back"),
1199 $ilCtrl->getLinkTarget($this, "preview")
1200 );
1201
1202 if (!$a_form) {
1203 $a_form = $this->initAdvancedMetaDataForm();
1204 }
1205
1206 $tpl->setContent($a_form->getHTML());
1207 }
1208
1209 public function updateAdvancedMetaData()
1210 {
1212 $lng = $this->lng;
1213 $ilAccess = $this->access;
1214
1215 if (!$ilAccess->checkAccess("write", "", $this->wiki_ref_id) &&
1216 !$ilAccess->checkAccess("edit_page_meta", "", $this->wiki_ref_id)) {
1217 return;
1218 }
1219
1220 $form = $this->initAdvancedMetaDataForm();
1221
1222 // needed for proper advanced MD validation
1223 $form->checkInput();
1224 if (!$this->record_gui->importEditFormPostValues()) {
1225 $this->editAdvancedMetaData($form); // #16470
1226 return false;
1227 }
1228
1229 if ($this->record_gui->writeEditForm()) {
1230 ilUtil::sendSuccess($lng->txt("settings_saved"), true);
1231 }
1232 $ilCtrl->redirect($this, "preview");
1233 }
1234
1235 public function hideAdvancedMetaData()
1236 {
1238 $lng = $this->lng;
1239 $ilAccess = $this->access;
1240
1241 if (!$ilAccess->checkAccess("write", "", $this->wiki_ref_id) &&
1242 !$ilAccess->checkAccess("edit_page_meta", "", $this->wiki_ref_id)) {
1243 return;
1244 }
1245
1246 $this->getPageObject()->hideAdvancedMetadata(true);
1247 $this->getPageObject()->update();
1248
1249 ilUtil::sendSuccess($lng->txt("settings_saved"), true);
1250 $ilCtrl->redirect($this, "preview");
1251 }
1252
1253 public function unhideAdvancedMetaData()
1254 {
1256 $lng = $this->lng;
1257 $ilAccess = $this->access;
1258
1259 if (!$ilAccess->checkAccess("write", "", $this->wiki_ref_id) &&
1260 !$ilAccess->checkAccess("edit_page_meta", "", $this->wiki_ref_id)) {
1261 return;
1262 }
1263
1264 $this->getPageObject()->hideAdvancedMetadata(false);
1265 $this->getPageObject()->update();
1266
1267 ilUtil::sendSuccess($lng->txt("settings_saved"), true);
1268 $ilCtrl->redirect($this, "preview");
1269 }
1270
1277 public function edit()
1278 {
1279 $tpl = $this->tpl;
1280 $lng = $this->lng;
1281
1283
1284 return parent::edit();
1285 }
1286
1292 public static function initEditingJS(ilGlobalTemplateInterface $a_tpl)
1293 {
1294 global $DIC;
1295
1296 $lng = $DIC->language();
1297
1298 $a_tpl->addJavascript("./Modules/Wiki/js/WikiEdit.js");
1299 $a_tpl->addOnLoadCode("il.Wiki.Edit.txt.page_exists = '" . $lng->txt("wiki_page_exists") . "';");
1300 $a_tpl->addOnLoadCode("il.Wiki.Edit.txt.new_page = '" . $lng->txt("wiki_new_page") . "';");
1301 }
1302
1303
1307 public function insertWikiLink()
1308 {
1309 $lng = $this->lng;
1311
1312 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
1313 $form = new ilPropertyFormGUI();
1314 $form->addCommandButton("addWikiLink", $lng->txt("wiki_add_link"));
1315 $form->addCommandButton("searchWikiLink", $lng->txt("search"));
1316
1317 // Target page
1318 $tp = new ilTextInputGUI($this->lng->txt("wiki_target_page"), "target_page");
1319 $tp->setSize(18);
1320 $tp->setRequired(true);
1321 $tp->setInfo("...");
1322 $tp->setDataSource($ilCtrl->getLinkTarget($this, "insertWikiLinkAC", "", true));
1323 $form->addItem($tp);
1324
1325 // Link text
1326 $lt = new ilTextInputGUI($this->lng->txt("wiki_link_text"), "link_text");
1327 $lt->setSize(18);
1328 $form->addItem($lt);
1329
1330 //$form->setTitle($lng->txt("wiki_link"));
1331
1332 echo $form->getHTML();
1333 exit;
1334 }
1335
1339 public function insertWikiLinkAC()
1340 {
1341 $result = array();
1342
1343 $term = $_GET["term"];
1344
1345 // if page exists, make it first entry
1346 if (ilWikiPage::_wikiPageExists($this->getPageObject()->getParentId(), $term)) {
1347 $entry = new stdClass();
1348 $entry->value = $term;
1349 $entry->label = $term;
1350 $result[] = $entry;
1351 }
1352
1353 $res = ilWikiPage::getPagesForSearch($this->getPageObject()->getParentId(), $term);
1354
1355 $cnt = 0;
1356 foreach ($res as $r) {
1357 if ($result[0]->value == $r) {
1358 continue;
1359 }
1360 if ($cnt++ > 19) {
1361 continue;
1362 }
1363 $entry = new stdClass();
1364 $entry->value = $r;
1365 $entry->label = $r;
1366 $result[] = $entry;
1367 }
1368
1369 include_once './Services/JSON/classes/class.ilJsonUtil.php';
1371 exit;
1372 }
1373
1377 public function searchWikiLinkAC()
1378 {
1379 $lng = $this->lng;
1380
1381 $lng->loadLanguageModule("wiki");
1382
1383 $tpl = new ilTemplate("tpl.wiki_ac_search_result.html", true, true, "Modules/Wiki");
1384 $term = trim($_GET["term"]);
1385
1386 $pages = ilObjWiki::_performSearch($this->getPageObject()->getParentId(), $term);
1387
1388 $found = array();
1389 foreach ($pages as $page) {
1390 $found[] = array("page_id" => $page["page_id"], "title" => ilWikiPage::lookupTitle($page["page_id"]));
1391 }
1392
1393 // sort if all pages are listed
1394 if ($term == "") {
1395 $found = ilUtil::sortArray($found, "title", "asc");
1396 }
1397
1398 foreach ($found as $f) {
1399 $tpl->setCurrentBlock("item");
1400 $tpl->setVariable("WIKI_TITLE", $f["title"]);
1401 $tpl->parseCurrentBlock();
1402 }
1403
1404 if (count($pages) == 0) {
1405 $tpl->setVariable("INFOTEXT", str_replace("$1", $term, $lng->txt("wiki_no_page_found")));
1406 } elseif ($term == '') {
1407 $tpl->setVariable("INFOTEXT", $lng->txt("wiki_no_search_term"), $term);
1408 } else {
1409 $tpl->setVariable("INFOTEXT", str_replace("$1", $term, $lng->txt("wiki_pages_found")));
1410 }
1411
1412 $tpl->setVariable("TXT_BACK", $lng->txt("back"));
1413 echo $tpl->get();
1414 exit;
1415 }
1416
1417 //
1418 // exercise assignment
1419 //
1420
1424 protected function finalizeAssignment()
1425 {
1427 $lng = $this->lng;
1428
1429 include_once("./Modules/Exercise/AssignmentTypes/classes/class.ilExAssignmentTypes.php");
1430 include_once("./Modules/Exercise/classes/class.ilExAssignment.php");
1432
1433 $ass_id = (int) $_GET["ass"];
1434 $wiki_ass->submitWiki($ass_id, $this->user->getId(), $this->getWikiRefId());
1435
1436 /*
1437 include_once "Modules/Exercise/classes/class.ilExSubmissionBaseGUI.php";
1438 include_once "Modules/Exercise/classes/class.ilExSubmissionObjectGUI.php";
1439 $exc_gui = ilExSubmissionObjectGUI::initGUIForSubmit($this->ass_id);
1440 $exc_gui->submitBlog($this->node_id);*/
1441
1442 ilUtil::sendSuccess($lng->txt("wiki_finalized"), true);
1443 $ilCtrl->redirectByClass("ilObjWikiGUI", "gotoStartPage");
1444 }
1445
1446 protected function downloadExcSubFile()
1447 {
1449
1450 $ass_id = (int) $_GET["ass"];
1451 $ass = new ilExAssignment($ass_id);
1452 $submission = new ilExSubmission($ass, $ilUser->getId());
1453 $submitted = $submission->getFiles();
1454 if (count($submitted) > 0) {
1455 $submitted = array_pop($submitted);
1456
1457 $user_data = ilObjUser::_lookupName($submitted["user_id"]);
1458 $title = ilObject::_lookupTitle($submitted["obj_id"]) . " - " .
1459 $ass->getTitle() . " (Team " . $submission->getTeam()->getId() . ").zip";
1460
1461 ilUtil::deliverFile($submitted["filename"], $title);
1462 }
1463 }
1464}
$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.
setRenderPageContainer($a_val)
Set render page container.
getNotesHTML($a_content_object=null, $a_enable_private_notes=true, $a_enable_public_notes=false, $a_enable_notes_deletion=false, $a_callback=null)
Get html for public and/or private notes.
getAbstractOnly()
Get abstract only.
getPageObject()
Get Page Object.
setTemplateOutput($a_output=true)
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,...
help()
Definition: help.php:2
global $ilCtrl
Definition: ilias.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
$ilUser
Definition: imgupload.php:18
ui()
Definition: ui.php:5
$a_type
Definition: workflow.php:92
$message
Definition: xapiexit.php:14
$DIC
Definition: xapitoken.php:46