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)
31 parent::__construct(
"wpg", $a_id, $a_old_nr);
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");
134 return parent::executeCommand();
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;
367 $output = parent::showPage();
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());
417 parent::getTabs($a_activate);
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";
static renderSideBlock($a_wpg_id, $a_wiki_ref_id, $a_wp=null)
Side column.
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
& executeCommand()
execute command
This class represents an option in a radio group.
static hasNotification($type, $user_id, $id)
Check notification status for object and user.
static _lookupRatingOverall($a_wiki_id)
Lookup whether rating is activated for whole object.
getPageObject()
Get Page Object.
addHeaderAction($a_redraw=false)
Class for permanent links.
setTemplateOutput($a_output=true)
setScreenIdComponent()
Set screen id component.
static getGUIForTitle($a_wiki_id, $a_title, $a_old_nr=0, $a_wiki_ref_id=0)
Get wiki page gui for id and title.
TableGUI class for wiki pages table.
unblockWikiPage()
Unblock.
initRenameForm()
Init renaming form.
observeNoteAction($a_wiki_id, $a_page_id, $a_type, $a_action, $a_note_id)
setPageObject($a_pg_obj)
Set Page Object.
static getPageIdForTitle($a_wiki_id, $a_title)
Get wiki page object for id and title.
getSyntaxStylePath()
get syntax style path
postOutputProcessing($a_output)
Finalizing output processing.
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)
Default behaviour is:
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static _getInstance($a_usr_id)
Get singleton instance.
static sendNotification($a_action, $a_type, $a_wiki_ref_id, $a_page_id, $a_comment=null)
static _getPageIdForWikiTitle($a_wiki_id, $a_title)
Checks whether a page with given title exists.
static getUserCount($a_rep_obj_id, $a_obj_id, $a_type)
How many users have attached a note/comment to a given object?
static makeUrlTitle($a_par)
Set page parameter for Url Embedding.
renameWikiPage()
Rename wiki page form.
printViewSelection()
Print view selection.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static _lookupObjId($a_id)
special template class to simplify handling of ITX/PEAR
deleteWikiPageConfirmationScreen()
Delete wiki page confirmation screen.
static setNotification($type, $user_id, $id, $status=true)
Set notification status for object and user.
This class represents a text property in a property form.
static formatDate(ilDateTime $date)
Format a date public.
Class ilWikiPage GUI class.
setPresentationTitle($a_title="")
whatLinksHere()
All links to a specific page.
setMaxLength($a_maxlength)
Set Max Length.
setRenderPageContainer($a_val)
Set render page container.
static getPageContributors($a_page_id)
Get all contributors of wiki.
__construct($a_id=0, $a_old_nr=0, $a_wiki_ref_id=0)
Constructor.
static makeDbTitle($a_par)
Handle page GET parameter.
activateWikiPageRating()
Rating /.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
getWikiPage()
Get Wiki Page Object.
_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.
const IL_WIKI_WHAT_LINKS_HERE
const IL_PAGE_PRESENTATION
initPrintViewSelectionForm()
Init print view selection form.
setWikiPage($a_wikipage)
Set Wiki Page Object.
static highlight($a_dom_node_id, $a_text, $a_tpl=null)
Searches for all occurences of a text (case-insensitive) and highlights it.
deactivateWikiPageRating()
cancelWikiPageDeletion()
Cancel wiki page deletion.
static getLinksToPage($a_wiki_id, $a_page_id)
Get links to a page.
static replaceInternalLinks($s, $a_wiki_id, $a_offline=false)
This one is based on Mediawiki Parser->replaceInternalLinks since we display images in another way...
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.
confirmWikiPageDeletion()
Delete the wiki page.
static getAllPages($a_wiki_id)
Get all pages of wiki.
Class ilCommonActionDispatcherGUI.
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
static _lookupPublicNotes($a_wiki_id)
Lookup whether public notes are activated.
setOutputMode($a_mode=IL_PAGE_PRESENTATION)
Set Output Mode.
Confirmation screen class.