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)
35 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
37 $tpl->setCurrentBlock(
"SyntaxStyle");
38 $tpl->setVariable(
"LOCATION_SYNTAX_STYLESHEET",
40 $tpl->parseCurrentBlock();
53 $ilHelp->setScreenIdComponent(
"copgwpg");
58 $this->wiki_ref_id = $a_ref_id;
63 return $this->wiki_ref_id;
73 $next_class = $this->ctrl->getNextClass($this);
74 $cmd = $this->ctrl->getCmd();
80 $ilTabs->setTabActive(
"pg");
86 include_once(
"./Services/Rating/classes/class.ilRatingGUI.php");
88 $rating_gui->setObject($this->
getPageObject()->getParentId(),
"wiki",
90 $this->ctrl->forwardCommand($rating_gui);
91 $ilCtrl->redirect($this,
"preview");
94 case "ilpageobjectgui":
95 die(
"Deprecated. Wikipage gui forwarding to ilpageobject");
98 case "ilcommonactiondispatchergui":
99 include_once(
"Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
101 $gui->enableCommentsSettings(
false);
102 $gui->setRatingCallback($this,
"preview");
103 $this->ctrl->forwardCommand($gui);
110 include_once
"./Services/Notification/classes/class.ilNotification.php";
130 $ilCtrl->redirect($this,
"preview");
161 static function getGUIForTitle($a_wiki_id, $a_title, $a_old_nr = 0, $a_wiki_ref_id = 0)
165 include_once(
"./Modules/Wiki/classes/class.ilWikiPage.php");
167 $page_gui =
new ilWikiPageGUI($id, $a_old_nr, $a_wiki_ref_id);
185 include_once
"Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
187 $ilAccess,
"wiki",
$_GET[
"ref_id"], $wiki_id);
188 $dispatcher->setSubObject(
"wpg", $page_id);
190 include_once
"Services/Object/classes/class.ilObjectListGUI.php";
191 ilObjectListGUI::prepareJSLinks($this->ctrl->getLinkTarget($this,
"redrawHeaderAction",
"",
true),
192 $this->ctrl->getLinkTargetByClass(array(
"ilcommonactiondispatchergui",
"ilnotegui"),
"",
"",
true,
false),
193 $this->ctrl->getLinkTargetByClass(array(
"ilcommonactiondispatchergui",
"iltagginggui"),
"",
"",
true,
false));
195 $lg = $dispatcher->initHeaderAction();
196 $lg->enableNotes(
true);
202 $lg->enableRating(
true, $this->lng->txt(
"wiki_rate_overall"),
205 array(
"ilcommonactiondispatchergui",
"ilratinggui"));
209 if ($ilUser->getId() != ANONYMOUS_USER_ID)
211 include_once
"./Services/Notification/classes/class.ilNotification.php";
214 $this->ctrl->setParameter($this,
"ntf", 1);
215 $lg->addCustomCommand($this->ctrl->getLinkTarget($this),
"wiki_notification_deactivate_wiki");
217 $lg->addHeaderIcon(
"not_icon",
219 $this->lng->txt(
"wiki_notification_activated"));
223 $this->ctrl->setParameter($this,
"ntf", 2);
224 $lg->addCustomCommand($this->ctrl->getLinkTarget($this),
"wiki_notification_activate_wiki");
228 $this->ctrl->setParameter($this,
"ntf", 3);
229 $lg->addCustomCommand($this->ctrl->getLinkTarget($this),
"wiki_notification_deactivate_page");
231 $lg->addHeaderIcon(
"not_icon",
233 $this->lng->txt(
"wiki_page_notification_activated"));
237 $this->ctrl->setParameter($this,
"ntf", 4);
238 $lg->addCustomCommand($this->ctrl->getLinkTarget($this),
"wiki_notification_activate_page");
240 $lg->addHeaderIcon(
"not_icon",
242 $this->lng->txt(
"wiki_notification_deactivated"));
245 $this->ctrl->setParameter($this,
"ntf",
"");
250 $this->tpl->setHeaderActionMenu($lg->getHeaderAction());
255 return $lg->getHeaderAction().
256 $this->tpl->getOnLoadCodeForAsynch();
286 $wtpl =
new ilTemplate(
"tpl.wiki_page_view_main_column.html",
287 true,
true,
"Modules/Wiki");
289 $callback = array($this,
"observeNoteAction");
292 if (!$ilSetting->get(
"disable_comments") &&
297 $ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"]), $callback));
301 $append = (
$_GET[
"page"] !=
"")
304 include_once(
"./Services/PermanentLink/classes/class.ilPermanentLinkGUI.php");
306 $wtpl->setVariable(
"PERMA_LINK", $perma_link->getHTML());
311 $wtpl->setVariable(
"PAGE", $this->
showPage());
313 $tpl->setLoginTargetPar(
"wiki_".
$_GET[
"ref_id"].$append);
316 include_once(
"./Services/User/classes/class.ilUserUtil.php");
317 $wtpl->setVariable(
"LAST_EDITED_INFO",
318 $lng->txt(
"wiki_last_edited").
": ".
322 false,
true, $ilCtrl->getLinkTarget($this,
"preview")));
324 $tpl->setLoginTargetPar(
"wiki_".
$_GET[
"ref_id"].$append);
327 if (
$_GET[
"srcstring"] !=
"")
329 include_once
'./Services/Search/classes/class.ilUserSearchCache.php';
332 $search_string = $cache->getQuery();
334 include_once(
"./Services/UIComponent/TextHighlighter/classes/class.ilTextHighlighterGUI.php");
335 include_once(
"./Services/Search/classes/class.ilQueryParser.php");
339 $words = $p->getQuotedWords();
340 if (is_array($words))
342 foreach ($words as $w)
347 $this->fill_on_load_code =
true;
379 require_once(
'Services/Tracking/classes/class.ilChangeEvent.php');
381 $this->
getWikiPage()->getWikiId(), $ilUser->getId());
390 include_once(
"./Modules/Wiki/classes/class.ilWikiUtil.php");
404 include_once(
"./Modules/Wiki/classes/class.ilWikiPagesTableGUI.php");
410 $tpl->setContent($table_gui->getHTML());
419 $ilCtrl->setParameterByClass(
"ilobjwikigui",
"wpg_id",
424 $ilTabs->addTarget(
"wiki_what_links_here",
425 $this->ctrl->getLinkTargetByClass(
"ilwikipagegui",
426 "whatLinksHere"),
"whatLinksHere");
430 $ilTabs->addTarget(
"wiki_print_view",
431 $this->ctrl->getLinkTargetByClass(
"ilwikipagegui",
432 "printViewSelection"),
"printViewSelection");
443 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"]))
445 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
447 $confirmation_gui->setFormAction($ilCtrl->getFormAction($this));
448 $confirmation_gui->setHeaderText($lng->txt(
"wiki_page_deletion_confirmation"));
449 $confirmation_gui->setCancel($lng->txt(
"cancel"),
"cancelWikiPageDeletion");
450 $confirmation_gui->setConfirm($lng->txt(
"delete"),
"confirmWikiPageDeletion");
452 $dtpl =
new ilTemplate(
"tpl.wiki_page_deletion_confirmation.html",
true,
453 true,
"Modules/Wiki");
455 $dtpl->setVariable(
"PAGE_TITLE", $this->
getWikiPage()->getTitle());
458 $dtpl->setVariable(
"TXT_OTHER_PAGES", $lng->txt(
"wiki_other_pages_linking"));
461 if (count($pages) > 0)
463 foreach($pages as $page)
465 $dtpl->setCurrentBlock(
"lpage");
466 $dtpl->setVariable(
"TXT_LINKING_PAGE", $page[
"title"]);
467 $dtpl->parseCurrentBlock();
472 $dtpl->setCurrentBlock(
"lpage");
473 $dtpl->setVariable(
"TXT_LINKING_PAGE",
"-");
474 $dtpl->parseCurrentBlock();
478 $dtpl->setVariable(
"TXT_CONTRIBUTORS", $lng->txt(
"wiki_contributors"));
480 foreach($contributors as $contributor)
482 $dtpl->setCurrentBlock(
"contributor");
483 $dtpl->setVariable(
"TXT_CONTRIBUTOR",
484 $contributor[
"lastname"].
", ".$contributor[
"firstname"]);
485 $dtpl->parseCurrentBlock();
489 include_once(
"./Services/Notes/classes/class.ilNote.php");
492 $dtpl->setVariable(
"TXT_NUMBER_USERS_NOTES_OR_COMMENTS",
493 $lng->txt(
"wiki_number_users_notes_or_comments"));
494 $dtpl->setVariable(
"TXT_NR_NOTES_COMMENTS", $cnt_note_users);
496 $confirmation_gui->addItem(
"",
"", $dtpl->get());
498 $tpl->setContent($confirmation_gui->getHTML());
509 $ilCtrl->redirect($this,
"preview");
520 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"]))
527 $ilCtrl->redirectByClass(
"ilobjwikigui",
"allPages");
551 $tpl->setContent($this->form->getHTML());
563 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
569 $op1 =
new ilRadioOption($lng->txt(
"cont_current_page"),
"page");
570 $radg->addOption($op1);
572 .
" (".$lng->txt(
"wiki_pages").
": ".count($pages).
")",
"wiki");
573 $radg->addOption($op2);
574 $op3=
new ilRadioOption($lng->txt(
"wiki_selected_pages"),
"selection");
575 $radg->addOption($op3);
577 include_once(
"./Services/Form/classes/class.ilNestedListInputGUI.php");
579 $op3->addSubItem($nl);
581 foreach ($pages as $p)
583 $nl->addListNode($p[
"id"], $p[
"title"], 0,
false,
false,
587 $this->form->addItem($radg);
589 $this->form->addCommandButton(
"printView", $lng->txt(
"cont_show_print_view"));
593 $this->form->setTitle($lng->txt(
"cont_print_selection"));
594 $this->form->setFormAction($ilCtrl->getFormActionByClass(
"ilobjwikigui",
"printView"),
595 false,
"print_view");
609 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"]))
617 $ilCtrl->redirect($this,
"preview");
627 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"]))
635 $ilCtrl->redirect($this,
"preview");
649 if ($ilAccess->checkAccess(
"edit_content",
"",
$_GET[
"ref_id"]))
652 $tpl->setContent($this->form->getHTML());
665 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
669 $ti =
new ilTextInputGUI($lng->txt(
"wiki_new_page_name"),
"new_page_name");
673 $ti->setRequired(
true);
674 $this->form->addItem($ti);
676 $this->form->addCommandButton(
"renamePage", $lng->txt(
"wiki_rename"));
677 $this->form->addCommandButton(
"preview", $lng->txt(
"cancel"));
679 $this->form->setTitle($lng->txt(
"wiki_rename_page"));
680 $this->form->setFormAction($ilCtrl->getFormAction($this));
691 if ($this->form->checkInput())
693 if ($ilAccess->checkAccess(
"edit_content",
"",
$_GET[
"ref_id"]))
695 $new_name = $this->form->getInput(
"new_page_name");
712 $ilCtrl->redirect($this,
"preview");
717 $this->form->setValuesByPost();
718 $tpl->setContent($this->form->getHtml());
733 $ilCtrl->redirect($this,
"preview");
744 $ilCtrl->redirect($this,
"preview");
751 include_once
"Services/Notes/classes/class.ilNote.php";
752 $note =
new ilNote($a_note_id);
753 $note = $note->getText();
755 include_once
"./Services/Notification/classes/class.ilNotification.php";