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");
69 $ilHelp->setScreenIdComponent(
"copgwpg");
81 $this->wiki_ref_id = $a_ref_id;
86 return $this->wiki_ref_id;
96 $next_class = $this->ctrl->getNextClass($this);
97 $cmd = $this->ctrl->getCmd();
103 $ilTabs->setTabActive(
"pg");
108 include_once(
"./Services/Rating/classes/class.ilRatingGUI.php");
110 $rating_gui->setObject($this->
getPageObject()->getParentId(),
"wiki",
112 $this->ctrl->forwardCommand($rating_gui);
113 $ilCtrl->redirect($this,
"preview");
116 case "ilpageobjectgui":
119 $page_gui->setPresentationTitle($this->
getWikiPage()->getTitle());
120 return $ilCtrl->forwardCommand($page_gui);
122 case "ilcommonactiondispatchergui":
123 include_once(
"Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
125 $gui->enableCommentsSettings(
false);
126 $this->ctrl->forwardCommand($gui);
133 include_once
"./Services/Notification/classes/class.ilNotification.php";
153 $ilCtrl->redirect($this,
"preview");
184 static function getGUIForTitle($a_wiki_id, $a_title, $a_old_nr = 0, $a_wiki_ref_id = 0)
188 include_once(
"./Modules/Wiki/classes/class.ilWikiPage.php");
190 $page_gui =
new ilWikiPageGUI($id, $a_old_nr, $a_wiki_ref_id);
205 include_once
"Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
208 $dispatcher->setSubObject(
"wpg", $this->
getPageObject()->getId());
210 include_once
"Services/Object/classes/class.ilObjectListGUI.php";
211 ilObjectListGUI::prepareJSLinks($this->ctrl->getLinkTarget($this,
"redrawHeaderAction",
"",
true),
212 $this->ctrl->getLinkTargetByClass(array(
"ilcommonactiondispatchergui",
"ilnotegui"),
"",
"",
true,
false),
213 $this->ctrl->getLinkTargetByClass(array(
"ilcommonactiondispatchergui",
"iltagginggui"),
"",
"",
true,
false));
215 $lg = $dispatcher->initHeaderAction();
216 $lg->enableNotes(
true);
220 if ($ilUser->getId() != ANONYMOUS_USER_ID)
222 include_once
"./Services/Notification/classes/class.ilNotification.php";
225 $this->ctrl->setParameter($this,
"ntf", 1);
226 $lg->addCustomCommand($this->ctrl->getLinkTarget($this),
"wiki_notification_deactivate_wiki");
228 $lg->addHeaderIcon(
"not_icon",
230 $this->lng->txt(
"wiki_notification_activated"));
234 $this->ctrl->setParameter($this,
"ntf", 2);
235 $lg->addCustomCommand($this->ctrl->getLinkTarget($this),
"wiki_notification_activate_wiki");
239 $this->ctrl->setParameter($this,
"ntf", 3);
240 $lg->addCustomCommand($this->ctrl->getLinkTarget($this),
"wiki_notification_deactivate_page");
242 $lg->addHeaderIcon(
"not_icon",
244 $this->lng->txt(
"wiki_page_notification_activated"));
248 $this->ctrl->setParameter($this,
"ntf", 4);
249 $lg->addCustomCommand($this->ctrl->getLinkTarget($this),
"wiki_notification_activate_page");
251 $lg->addHeaderIcon(
"not_icon",
253 $this->lng->txt(
"wiki_notification_deactivated"));
256 $this->ctrl->setParameter($this,
"ntf",
"");
265 include_once(
"./Services/Rating/classes/class.ilRatingGUI.php");
267 $rating_gui->setObject($this->
getPageObject()->getParentId(),
"wiki",
269 $rating_gui->setYourRatingText($this->lng->txt(
"wiki_rate_page"));
271 $lg->addHeaderIconHTML(
"rating", $this->ctrl->getHtml($rating_gui));
276 $this->tpl->setHeaderActionMenu($lg->getHeaderAction());
280 return $lg->getHeaderAction();
310 $wtpl =
new ilTemplate(
"tpl.wiki_page_view_main_column.html",
311 true,
true,
"Modules/Wiki");
313 $callback = array($this,
"observeNoteAction");
316 if (!$ilSetting->get(
"disable_comments") &&
321 $ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"]), $callback));
325 $append = (
$_GET[
"page"] !=
"")
328 include_once(
"./Services/PermanentLink/classes/class.ilPermanentLinkGUI.php");
330 $wtpl->setVariable(
"PERMA_LINK", $perma_link->getHTML());
333 $wtpl->setVariable(
"PAGE", parent::preview());
335 $tpl->setLoginTargetPar(
"wiki_".
$_GET[
"ref_id"].$append);
338 $wtpl->setVariable(
"LAST_EDITED_INFO",
339 $lng->txt(
"wiki_last_edited").
": ".
343 false,
true, $ilCtrl->getLinkTarget($this,
"preview")));
345 $tpl->setLoginTargetPar(
"wiki_".
$_GET[
"ref_id"].$append);
348 if (
$_GET[
"srcstring"] !=
"")
350 include_once
'./Services/Search/classes/class.ilUserSearchCache.php';
353 $search_string = $cache->getQuery();
355 include_once(
"./Services/UIComponent/TextHighlighter/classes/class.ilTextHighlighterGUI.php");
356 include_once(
"./Services/Search/classes/class.ilQueryParser.php");
360 $words = $p->getQuotedWords();
361 if (is_array($words))
363 foreach ($words as $w)
368 $this->fill_on_load_code =
true;
400 require_once(
'Services/Tracking/classes/class.ilChangeEvent.php');
402 $this->
getWikiPage()->getWikiId(), $ilUser->getId());
411 include_once(
"./Modules/Wiki/classes/class.ilWikiUtil.php");
425 include_once(
"./Modules/Wiki/classes/class.ilWikiPagesTableGUI.php");
431 $tpl->setContent($table_gui->getHTML());
440 $ilCtrl->setParameterByClass(
"ilobjwikigui",
"wpg_id",
445 $ilTabs->addTarget(
"wiki_what_links_here",
446 $this->ctrl->getLinkTargetByClass(
"ilwikipagegui",
447 "whatLinksHere"),
"whatLinksHere");
451 $ilTabs->addTarget(
"wiki_print_view",
452 $this->ctrl->getLinkTargetByClass(
"ilwikipagegui",
453 "printViewSelection"),
"printViewSelection");
464 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"]))
466 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
468 $confirmation_gui->setFormAction($ilCtrl->getFormAction($this));
469 $confirmation_gui->setHeaderText($lng->txt(
"wiki_page_deletion_confirmation"));
470 $confirmation_gui->setCancel($lng->txt(
"cancel"),
"cancelWikiPageDeletion");
471 $confirmation_gui->setConfirm($lng->txt(
"delete"),
"confirmWikiPageDeletion");
473 $dtpl =
new ilTemplate(
"tpl.wiki_page_deletion_confirmation.html",
true,
474 true,
"Modules/Wiki");
476 $dtpl->setVariable(
"PAGE_TITLE", $this->
getWikiPage()->getTitle());
479 $dtpl->setVariable(
"TXT_OTHER_PAGES", $lng->txt(
"wiki_other_pages_linking"));
482 if (count($pages) > 0)
484 foreach($pages as $page)
486 $dtpl->setCurrentBlock(
"lpage");
487 $dtpl->setVariable(
"TXT_LINKING_PAGE", $page[
"title"]);
488 $dtpl->parseCurrentBlock();
493 $dtpl->setCurrentBlock(
"lpage");
494 $dtpl->setVariable(
"TXT_LINKING_PAGE",
"-");
495 $dtpl->parseCurrentBlock();
499 $dtpl->setVariable(
"TXT_CONTRIBUTORS", $lng->txt(
"wiki_contributors"));
501 foreach($contributors as $contributor)
503 $dtpl->setCurrentBlock(
"contributor");
504 $dtpl->setVariable(
"TXT_CONTRIBUTOR",
505 $contributor[
"lastname"].
", ".$contributor[
"firstname"]);
506 $dtpl->parseCurrentBlock();
510 include_once(
"./Services/Notes/classes/class.ilNote.php");
513 $dtpl->setVariable(
"TXT_NUMBER_USERS_NOTES_OR_COMMENTS",
514 $lng->txt(
"wiki_number_users_notes_or_comments"));
515 $dtpl->setVariable(
"TXT_NR_NOTES_COMMENTS", $cnt_note_users);
517 $confirmation_gui->addItem(
"",
"", $dtpl->get());
519 $tpl->setContent($confirmation_gui->getHTML());
530 $ilCtrl->redirect($this,
"preview");
541 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"]))
548 $ilCtrl->redirectByClass(
"ilobjwikigui",
"allPages");
572 $tpl->setContent($this->form->getHTML());
584 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
590 $op1 =
new ilRadioOption($lng->txt(
"cont_current_page"),
"page");
591 $radg->addOption($op1);
593 .
" (".$lng->txt(
"wiki_pages").
": ".count($pages).
")",
"wiki");
594 $radg->addOption($op2);
595 $op3=
new ilRadioOption($lng->txt(
"wiki_selected_pages"),
"selection");
596 $radg->addOption($op3);
598 include_once(
"./Services/Form/classes/class.ilNestedListInputGUI.php");
600 $op3->addSubItem($nl);
602 foreach ($pages as $p)
604 $nl->addListNode($p[
"id"], $p[
"title"], 0,
false,
false,
608 $this->form->addItem($radg);
610 $this->form->addCommandButton(
"printView", $lng->txt(
"cont_show_print_view"));
614 $this->form->setTitle($lng->txt(
"cont_print_selection"));
615 $this->form->setFormAction($ilCtrl->getFormActionByClass(
"ilobjwikigui",
"printView"),
616 false,
"print_view");
630 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"]))
638 $ilCtrl->redirect($this,
"preview");
648 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"]))
656 $ilCtrl->redirect($this,
"preview");
670 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"]))
673 $tpl->setContent($this->form->getHTML());
686 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
690 $ti =
new ilTextInputGUI($lng->txt(
"wiki_new_page_name"),
"new_page_name");
694 $ti->setRequired(
true);
695 $this->form->addItem($ti);
697 $this->form->addCommandButton(
"renamePage", $lng->txt(
"wiki_rename"));
698 $this->form->addCommandButton(
"preview", $lng->txt(
"cancel"));
700 $this->form->setTitle($lng->txt(
"wiki_rename_page"));
701 $this->form->setFormAction($ilCtrl->getFormAction($this));
712 if ($this->form->checkInput())
714 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"]))
716 $new_name = $this->form->getInput(
"new_page_name");
733 $ilCtrl->redirect($this,
"preview");
738 $this->form->setValuesByPost();
739 $tpl->setContent($this->form->getHtml());
754 $ilCtrl->redirect($this,
"preview");
765 $ilCtrl->redirect($this,
"preview");
772 include_once
"Services/Notes/classes/class.ilNote.php";
773 $note =
new ilNote($a_note_id);
774 $note = $note->getText();
776 include_once
"./Services/Notification/classes/class.ilNotification.php";