4 include_once(
"./Services/COPage/classes/class.ilPageObjectGUI.php");
5 include_once(
"./Modules/Wiki/classes/class.ilWikiPage.php");
24 function __construct($a_id = 0, $a_old_nr = 0, $a_wiki_ref_id = 0)
37 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
39 $tpl->setCurrentBlock(
"SyntaxStyle");
40 $tpl->setVariable(
"LOCATION_SYNTAX_STYLESHEET",
42 $tpl->parseCurrentBlock();
52 $cfg->setIntLinkFilterWhiteList(
true);
53 $cfg->addIntLinkFilter(
"RepositoryItem");
68 $this->wiki_ref_id = $a_ref_id;
73 return $this->wiki_ref_id;
81 global
$ilCtrl, $ilTabs, $ilUser;
83 $next_class = $this->ctrl->getNextClass($this);
84 $cmd = $this->ctrl->getCmd();
90 $ilTabs->setTabActive(
"pg");
95 include_once(
"./Services/Rating/classes/class.ilRatingGUI.php");
97 $rating_gui->setObject($this->
getPageObject()->getParentId(),
"wiki",
99 $this->ctrl->forwardCommand($rating_gui);
100 $ilCtrl->redirect($this,
"preview");
103 case "ilpageobjectgui":
106 $page_gui->setPresentationTitle($this->
getWikiPage()->getTitle());
107 return $ilCtrl->forwardCommand($page_gui);
109 case "ilcommonactiondispatchergui":
110 include_once(
"Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
112 $gui->enableCommentsSettings(
false);
113 $this->ctrl->forwardCommand($gui);
120 include_once
"./Services/Notification/classes/class.ilNotification.php";
140 $ilCtrl->redirect($this,
"preview");
171 static function getGUIForTitle($a_wiki_id, $a_title, $a_old_nr = 0, $a_wiki_ref_id = 0)
175 include_once(
"./Modules/Wiki/classes/class.ilWikiPage.php");
177 $page_gui =
new ilWikiPageGUI($id, $a_old_nr, $a_wiki_ref_id);
190 global $ilUser, $ilAccess;
192 include_once
"Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
195 $dispatcher->setSubObject(
"wpg", $this->
getPageObject()->getId());
197 include_once
"Services/Object/classes/class.ilObjectListGUI.php";
198 ilObjectListGUI::prepareJSLinks($this->ctrl->getLinkTarget($this,
"redrawHeaderAction",
"",
true),
199 $this->ctrl->getLinkTargetByClass(array(
"ilcommonactiondispatchergui",
"ilnotegui"),
"",
"",
true,
false),
200 $this->ctrl->getLinkTargetByClass(array(
"ilcommonactiondispatchergui",
"iltagginggui"),
"",
"",
true,
false));
202 $lg = $dispatcher->initHeaderAction();
203 $lg->enableNotes(
true);
207 if ($ilUser->getId() != ANONYMOUS_USER_ID)
209 include_once
"./Services/Notification/classes/class.ilNotification.php";
212 $this->ctrl->setParameter($this,
"ntf", 1);
213 $lg->addCustomCommand($this->ctrl->getLinkTarget($this),
"wiki_notification_deactivate_wiki");
215 $lg->addHeaderIcon(
"not_icon",
217 $this->lng->txt(
"wiki_notification_activated"));
221 $this->ctrl->setParameter($this,
"ntf", 2);
222 $lg->addCustomCommand($this->ctrl->getLinkTarget($this),
"wiki_notification_activate_wiki");
226 $this->ctrl->setParameter($this,
"ntf", 3);
227 $lg->addCustomCommand($this->ctrl->getLinkTarget($this),
"wiki_notification_deactivate_page");
229 $lg->addHeaderIcon(
"not_icon",
231 $this->lng->txt(
"wiki_page_notification_activated"));
235 $this->ctrl->setParameter($this,
"ntf", 4);
236 $lg->addCustomCommand($this->ctrl->getLinkTarget($this),
"wiki_notification_activate_page");
238 $lg->addHeaderIcon(
"not_icon",
240 $this->lng->txt(
"wiki_notification_deactivated"));
243 $this->ctrl->setParameter($this,
"ntf",
"");
250 include_once(
"./Services/Rating/classes/class.ilRatingGUI.php");
252 $rating_gui->setObject($this->
getPageObject()->getParentId(),
"wiki",
254 $rating_gui->setYourRatingText($this->lng->txt(
"wiki_rate_page"));
255 $lg->addHeaderIconHTML(
"rating", $this->ctrl->getHtml($rating_gui));
260 $this->tpl->setHeaderActionMenu($lg->getHeaderAction());
264 return $lg->getHeaderAction();
331 $wtpl =
new ilTemplate(
"tpl.wiki_page_view_main_column.html",
332 true,
true,
"Modules/Wiki");
334 $callback = array($this,
"observeNoteAction");
337 if (!$ilSetting->get(
"disable_comments") &&
342 $ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"]), $callback));
346 $append = (
$_GET[
"page"] !=
"")
349 include_once(
"./Services/PermanentLink/classes/class.ilPermanentLinkGUI.php");
351 $wtpl->setVariable(
"PERMA_LINK", $perma_link->getHTML());
354 $wtpl->setVariable(
"PAGE", parent::preview());
356 $tpl->setLoginTargetPar(
"wiki_".
$_GET[
"ref_id"].$append);
359 $wtpl->setVariable(
"LAST_EDITED_INFO",
360 $lng->txt(
"wiki_last_edited").
": ".
364 false,
true, $ilCtrl->getLinkTarget($this,
"preview")));
366 $tpl->setLoginTargetPar(
"wiki_".
$_GET[
"ref_id"].$append);
369 if (
$_GET[
"srcstring"] !=
"")
371 include_once
'./Services/Search/classes/class.ilUserSearchCache.php';
374 $search_string = $cache->getQuery();
376 include_once(
"./Services/UIComponent/TextHighlighter/classes/class.ilTextHighlighterGUI.php");
377 include_once(
"./Services/Search/classes/class.ilQueryParser.php");
381 $words = $p->getQuotedWords();
382 if (is_array($words))
384 foreach ($words as $w)
389 $this->fill_on_load_code =
true;
421 require_once(
'Services/Tracking/classes/class.ilChangeEvent.php');
423 $this->
getWikiPage()->getWikiId(), $ilUser->getId());
432 include_once(
"./Modules/Wiki/classes/class.ilWikiUtil.php");
446 include_once(
"./Modules/Wiki/classes/class.ilWikiPagesTableGUI.php");
452 $tpl->setContent($table_gui->getHTML());
461 $ilCtrl->setParameterByClass(
"ilobjwikigui",
"wpg_id",
466 $ilTabs->addTarget(
"wiki_what_links_here",
467 $this->ctrl->getLinkTargetByClass(
"ilwikipagegui",
468 "whatLinksHere"),
"whatLinksHere");
472 $ilTabs->addTarget(
"wiki_print_view",
473 $this->ctrl->getLinkTargetByClass(
"ilwikipagegui",
474 "printViewSelection"),
"printViewSelection");
485 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"]))
487 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
489 $confirmation_gui->setFormAction($ilCtrl->getFormAction($this));
490 $confirmation_gui->setHeaderText($lng->txt(
"wiki_page_deletion_confirmation"));
491 $confirmation_gui->setCancel($lng->txt(
"cancel"),
"cancelWikiPageDeletion");
492 $confirmation_gui->setConfirm($lng->txt(
"delete"),
"confirmWikiPageDeletion");
494 $dtpl =
new ilTemplate(
"tpl.wiki_page_deletion_confirmation.html",
true,
495 true,
"Modules/Wiki");
497 $dtpl->setVariable(
"PAGE_TITLE", $this->
getWikiPage()->getTitle());
500 $dtpl->setVariable(
"TXT_OTHER_PAGES", $lng->txt(
"wiki_other_pages_linking"));
503 if (count($pages) > 0)
505 foreach($pages as $page)
507 $dtpl->setCurrentBlock(
"lpage");
508 $dtpl->setVariable(
"TXT_LINKING_PAGE", $page[
"title"]);
509 $dtpl->parseCurrentBlock();
514 $dtpl->setCurrentBlock(
"lpage");
515 $dtpl->setVariable(
"TXT_LINKING_PAGE",
"-");
516 $dtpl->parseCurrentBlock();
520 $dtpl->setVariable(
"TXT_CONTRIBUTORS", $lng->txt(
"wiki_contributors"));
522 foreach($contributors as $contributor)
524 $dtpl->setCurrentBlock(
"contributor");
525 $dtpl->setVariable(
"TXT_CONTRIBUTOR",
526 $contributor[
"lastname"].
", ".$contributor[
"firstname"]);
527 $dtpl->parseCurrentBlock();
531 include_once(
"./Services/Notes/classes/class.ilNote.php");
534 $dtpl->setVariable(
"TXT_NUMBER_USERS_NOTES_OR_COMMENTS",
535 $lng->txt(
"wiki_number_users_notes_or_comments"));
536 $dtpl->setVariable(
"TXT_NR_NOTES_COMMENTS", $cnt_note_users);
538 $confirmation_gui->addItem(
"",
"", $dtpl->get());
540 $tpl->setContent($confirmation_gui->getHTML());
551 $ilCtrl->redirect($this,
"preview");
562 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"]))
569 $ilCtrl->redirectByClass(
"ilobjwikigui",
"allPages");
586 $ilToolbar->setFormAction($ilCtrl->getFormActionByClass(
"ilobjwikigui",
"printView"),
587 false,
"print_view");
588 $ilToolbar->addFormButton($lng->txt(
"cont_show_print_view"),
"printView");
589 $ilToolbar->setCloseFormTag(
false);
593 $tpl->setContent($this->form->getHTML());
605 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
611 $op1 =
new ilRadioOption($lng->txt(
"cont_current_page"),
"page");
612 $radg->addOption($op1);
614 .
" (".$lng->txt(
"wiki_pages").
": ".count($pages).
")",
"wiki");
615 $radg->addOption($op2);
616 $op3=
new ilRadioOption($lng->txt(
"wiki_selected_pages"),
"selection");
617 $radg->addOption($op3);
619 include_once(
"./Services/Form/classes/class.ilNestedListInputGUI.php");
621 $op3->addSubItem($nl);
623 foreach ($pages as $p)
625 $nl->addListNode($p[
"id"], $p[
"title"], 0,
false,
false,
629 $this->form->addItem($radg);
631 $this->form->addCommandButton(
"printView", $lng->txt(
"cont_show_print_view"));
633 $this->form->setCloseTag(
false);
635 $this->form->setTitle($lng->txt(
"cont_print_selection"));
650 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"]))
658 $ilCtrl->redirect($this,
"preview");
668 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"]))
676 $ilCtrl->redirect($this,
"preview");
690 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"]))
693 $tpl->setContent($this->form->getHTML());
706 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
710 $ti =
new ilTextInputGUI($lng->txt(
"wiki_new_page_name"),
"new_page_name");
714 $ti->setRequired(
true);
715 $this->form->addItem($ti);
717 $this->form->addCommandButton(
"renamePage", $lng->txt(
"wiki_rename"));
718 $this->form->addCommandButton(
"preview", $lng->txt(
"cancel"));
720 $this->form->setTitle($lng->txt(
"wiki_rename_page"));
721 $this->form->setFormAction($ilCtrl->getFormAction($this));
732 if ($this->form->checkInput())
734 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"]))
736 $new_name = $this->form->getInput(
"new_page_name");
747 $ilCtrl->redirect($this,
"preview");
752 $this->form->setValuesByPost();
753 $tpl->setContent($this->form->getHtml());
758 include_once
"./Services/Notification/classes/class.ilNotification.php";