ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
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 
4 include_once("./Services/COPage/classes/class.ilPageObjectGUI.php");
5 include_once("./Modules/Wiki/classes/class.ilWikiPage.php");
6 
20 {
24  function __construct($a_id = 0, $a_old_nr = 0, $a_wiki_ref_id = 0)
25  {
26  global $tpl;
27 
28  // needed for notifications
29  $this->setWikiRefId($a_wiki_ref_id);
30 
32  ilObject::_lookupObjId($a_wiki_ref_id)));
33 
34  parent::__construct("wpg", $a_id, $a_old_nr);
35 
36  // content style
37  include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
38 
39  $tpl->setCurrentBlock("SyntaxStyle");
40  $tpl->setVariable("LOCATION_SYNTAX_STYLESHEET",
42  $tpl->parseCurrentBlock();
43 
44  $this->setEnabledMaps(true);
45  $this->setPreventHTMLUnmasking(true);
46  $this->setEnabledInternalLinks(true);
47  $this->setEnableAnchors(true);
48  $this->setEnabledWikiLinks(true);
49  $this->setEnabledPCTabs(true);
50 
51  $cfg = new ilPageConfig();
52  $cfg->setIntLinkFilterWhiteList(true);
53  $cfg->addIntLinkFilter("RepositoryItem");
54  $this->setPageConfig($cfg);
55  $this->setIntLinkHelpDefault("RepositoryItem", 0);
56 
57  }
58 
66  {
67  global $ilHelp;
68 
69  $ilHelp->setScreenIdComponent("copgwpg");
70  }
71 
72  function initPageObject($a_parent_type, $a_id, $a_old_nr)
73  {
74  $page = new ilWikiPage($a_id, $a_old_nr);
75  $page->setWikiRefId($this->getWikiRefId());
76  $this->setPageObject($page);
77  }
78 
79  function setWikiRefId($a_ref_id)
80  {
81  $this->wiki_ref_id = $a_ref_id;
82  }
83 
84  function getWikiRefId()
85  {
86  return $this->wiki_ref_id;
87  }
88 
92  function &executeCommand()
93  {
94  global $ilCtrl, $ilTabs, $ilUser;
95 
96  $next_class = $this->ctrl->getNextClass($this);
97  $cmd = $this->ctrl->getCmd();
98 
99  switch($next_class)
100  {
101  case "ilnotegui":
102  $this->getTabs();
103  $ilTabs->setTabActive("pg");
104  return $this->preview();
105  break;
106 
107  case "ilratinggui":
108  include_once("./Services/Rating/classes/class.ilRatingGUI.php");
109  $rating_gui = new ilRatingGUI();
110  $rating_gui->setObject($this->getPageObject()->getParentId(), "wiki",
111  $this->getPageObject()->getId(), "wpg");
112  $this->ctrl->forwardCommand($rating_gui);
113  $ilCtrl->redirect($this, "preview");
114  break;
115 
116  case "ilpageobjectgui":
117  $page_gui = new ilPageObjectGUI("wpg",
118  $this->getPageObject()->getId(), $this->getPageObject()->old_nr);
119  $page_gui->setPresentationTitle($this->getWikiPage()->getTitle());
120  return $ilCtrl->forwardCommand($page_gui);
121 
122  case "ilcommonactiondispatchergui":
123  include_once("Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
125  $gui->enableCommentsSettings(false);
126  $this->ctrl->forwardCommand($gui);
127  break;
128 
129  default:
130 
131  if($_GET["ntf"])
132  {
133  include_once "./Services/Notification/classes/class.ilNotification.php";
134  switch($_GET["ntf"])
135  {
136  case 1:
137  ilNotification::setNotification(ilNotification::TYPE_WIKI, $ilUser->getId(), $this->getPageObject()->getParentId(), false);
138  break;
139 
140  case 2:
141  // remove all page notifications here?
142  ilNotification::setNotification(ilNotification::TYPE_WIKI, $ilUser->getId(), $this->getPageObject()->getParentId(), true);
143  break;
144 
145  case 3:
146  ilNotification::setNotification(ilNotification::TYPE_WIKI_PAGE, $ilUser->getId(), $this->getPageObject()->getId(), false);
147  break;
148 
149  case 4:
150  ilNotification::setNotification(ilNotification::TYPE_WIKI_PAGE, $ilUser->getId(), $this->getPageObject()->getId(), true);
151  break;
152  }
153  $ilCtrl->redirect($this, "preview");
154  }
155 
156  $this->setPresentationTitle($this->getWikiPage()->getTitle());
157  return parent::executeCommand();
158  }
159  }
160 
166  function setWikiPage($a_wikipage)
167  {
168  $this->setPageObject($a_wikipage);
169  }
170 
176  function getWikiPage()
177  {
178  return $this->getPageObject();
179  }
180 
184  static function getGUIForTitle($a_wiki_id, $a_title, $a_old_nr = 0, $a_wiki_ref_id = 0)
185  {
186  global $ilDB;
187 
188  include_once("./Modules/Wiki/classes/class.ilWikiPage.php");
189  $id = ilWikiPage::getPageIdForTitle($a_wiki_id, $a_title);
190  $page_gui = new ilWikiPageGUI($id, $a_old_nr, $a_wiki_ref_id);
191 
192  return $page_gui;
193  }
194 
195  function setSideBlock()
196  {
197  ilObjWikiGUI::renderSideBlock($this->getWikiPage()->getId(),
198  $this->wiki_ref_id, $this->getWikiPage());
199  }
200 
201  function addHeaderAction($a_redraw = false)
202  {
203  global $ilUser, $ilAccess;
204 
205  include_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
207  $ilAccess, "wiki", $_GET["ref_id"], $this->getPageObject()->getParentId());
208  $dispatcher->setSubObject("wpg", $this->getPageObject()->getId());
209 
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));
214 
215  $lg = $dispatcher->initHeaderAction();
216  $lg->enableNotes(true);
217  $lg->enableComments(ilObjWiki::_lookupPublicNotes($this->getPageObject()->getParentId()), false);
218 
219  // notification
220  if ($ilUser->getId() != ANONYMOUS_USER_ID)
221  {
222  include_once "./Services/Notification/classes/class.ilNotification.php";
223  if(ilNotification::hasNotification(ilNotification::TYPE_WIKI, $ilUser->getId(), $this->getPageObject()->getParentId()))
224  {
225  $this->ctrl->setParameter($this, "ntf", 1);
226  $lg->addCustomCommand($this->ctrl->getLinkTarget($this), "wiki_notification_deactivate_wiki");
227 
228  $lg->addHeaderIcon("not_icon",
229  ilUtil::getImagePath("notification_on.png"),
230  $this->lng->txt("wiki_notification_activated"));
231  }
232  else
233  {
234  $this->ctrl->setParameter($this, "ntf", 2);
235  $lg->addCustomCommand($this->ctrl->getLinkTarget($this), "wiki_notification_activate_wiki");
236 
237  if(ilNotification::hasNotification(ilNotification::TYPE_WIKI_PAGE, $ilUser->getId(), $this->getPageObject()->getId()))
238  {
239  $this->ctrl->setParameter($this, "ntf", 3);
240  $lg->addCustomCommand($this->ctrl->getLinkTarget($this), "wiki_notification_deactivate_page");
241 
242  $lg->addHeaderIcon("not_icon",
243  ilUtil::getImagePath("notification_on.png"),
244  $this->lng->txt("wiki_page_notification_activated"));
245  }
246  else
247  {
248  $this->ctrl->setParameter($this, "ntf", 4);
249  $lg->addCustomCommand($this->ctrl->getLinkTarget($this), "wiki_notification_activate_page");
250 
251  $lg->addHeaderIcon("not_icon",
252  ilUtil::getImagePath("notification_off.png"),
253  $this->lng->txt("wiki_notification_deactivated"));
254  }
255  }
256  $this->ctrl->setParameter($this, "ntf", "");
257  }
258 
259  // rating
260  $wiki_id = $this->getPageObject()->getParentId();
261  if (ilObjWiki::_lookupRating($wiki_id)
262  && $this->getPageObject()->getRating()
263  && $this->getPageObject()->old_nr == 0)
264  {
265  include_once("./Services/Rating/classes/class.ilRatingGUI.php");
266  $rating_gui = new ilRatingGUI();
267  $rating_gui->setObject($this->getPageObject()->getParentId(), "wiki",
268  $this->getPageObject()->getId(), "wpg");
269  $rating_gui->setYourRatingText($this->lng->txt("wiki_rate_page"));
270  $rating_gui->enableCategories(ilObjWiki::_lookupRatingCategories($wiki_id));
271  $lg->addHeaderIconHTML("rating", $this->ctrl->getHtml($rating_gui));
272  }
273 
274  if(!$a_redraw)
275  {
276  $this->tpl->setHeaderActionMenu($lg->getHeaderAction());
277  }
278  else
279  {
280  return $lg->getHeaderAction();
281  }
282  }
283 
285  {
286  echo $this->addHeaderAction(true);
287  exit;
288  }
289 
293  function preview()
294  {
295  global $ilCtrl, $ilAccess, $lng, $tpl, $ilUser, $ilSetting, $ilToolbar;
296 
297  // block/unblock
298  if ($this->getPageObject()->getBlocked())
299  {
300  ilUtil::sendInfo($lng->txt("wiki_page_status_blocked"));
301  }
302 
303  $this->increaseViewCount();
304 
305  $this->addHeaderAction();
306 
307  // content
308  $this->setSideBlock();
309 
310  $wtpl = new ilTemplate("tpl.wiki_page_view_main_column.html",
311  true, true, "Modules/Wiki");
312 
313  $callback = array($this, "observeNoteAction");
314 
315  // notes
316  if (!$ilSetting->get("disable_comments") &&
317  ilObjWiki::_lookupPublicNotes($this->getPageObject()->getParentId()))
318  {
319  $wtpl->setVariable("NOTES", $this->getNotesHTML($this->getPageObject(),
320  true, ilObjWiki::_lookupPublicNotes($this->getPageObject()->getParentId()),
321  $ilAccess->checkAccess("write", "", $_GET["ref_id"]), $callback));
322  }
323 
324  // permanent link
325  $append = ($_GET["page"] != "")
326  ? "_".ilWikiUtil::makeUrlTitle($_GET["page"])
327  : "";
328  include_once("./Services/PermanentLink/classes/class.ilPermanentLinkGUI.php");
329  $perma_link = new ilPermanentLinkGUI("wiki", $_GET["ref_id"], $append);
330  $wtpl->setVariable("PERMA_LINK", $perma_link->getHTML());
331 
332  // page content
333  $wtpl->setVariable("PAGE", parent::preview());
334 
335  $tpl->setLoginTargetPar("wiki_".$_GET["ref_id"].$append);
336 
337  // last edited info
338  $wtpl->setVariable("LAST_EDITED_INFO",
339  $lng->txt("wiki_last_edited").": ".
341  new ilDateTime($this->getPageObject()->getLastChange(),IL_CAL_DATETIME)).", ".
342  ilUserUtil::getNamePresentation($this->getPageObject()->getLastChangeUser(),
343  false, true, $ilCtrl->getLinkTarget($this, "preview")));
344 
345  $tpl->setLoginTargetPar("wiki_".$_GET["ref_id"].$append);
346 
347  //highlighting
348  if ($_GET["srcstring"] != "")
349  {
350  include_once './Services/Search/classes/class.ilUserSearchCache.php';
351  $cache = ilUserSearchCache::_getInstance($ilUser->getId());
352  $cache->switchSearchType(ilUserSearchCache::LAST_QUERY);
353  $search_string = $cache->getQuery();
354 
355  include_once("./Services/UIComponent/TextHighlighter/classes/class.ilTextHighlighterGUI.php");
356  include_once("./Services/Search/classes/class.ilQueryParser.php");
357  $p = new ilQueryParser($search_string);
358  $p->parse();
359 
360  $words = $p->getQuotedWords();
361  if (is_array($words))
362  {
363  foreach ($words as $w)
364  {
365  ilTextHighlighterGUI::highlight("ilCOPageContent", $w, $tpl);
366  }
367  }
368  $this->fill_on_load_code = true;
369  }
370 
371  return $wtpl->get();
372  }
373 
374  function showPage()
375  {
376  global $tpl, $ilCtrl;
377 
378  // content style
379 /* include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
380  $tpl->setCurrentBlock("ContentStyle");
381  $tpl->setVariable("LOCATION_CONTENT_STYLESHEET",
382  ilObjStyleSheet::getContentStylePath(0));
383  $tpl->parseCurrentBlock();
384 */
385  $this->setTemplateOutput(false);
386  $this->setPresentationTitle($this->getWikiPage()->getTitle());
387  $this->increaseViewCount();
388  $output = parent::showPage();
389 
390  return $output;
391  }
392 
393  protected function increaseViewCount()
394  {
395  global $ilUser;
396 
397  $this->getWikiPage()->increaseViewCnt();
398 
399  // enable object statistics
400  require_once('Services/Tracking/classes/class.ilChangeEvent.php');
402  $this->getWikiPage()->getWikiId(), $ilUser->getId());
403  }
404 
408  function postOutputProcessing($a_output)
409  {
410 //echo htmlentities($a_output);
411  include_once("./Modules/Wiki/classes/class.ilWikiUtil.php");
412  $output = ilWikiUtil::replaceInternalLinks($a_output,
413  $this->getWikiPage()->getWikiId(),
414  ($this->getOutputMode() == "offline"));
415  return $output;
416  }
417 
421  function whatLinksHere()
422  {
423  global $tpl;
424 
425  include_once("./Modules/Wiki/classes/class.ilWikiPagesTableGUI.php");
426 
427  $this->setSideBlock($_GET["wpg_id"]);
428  $table_gui = new ilWikiPagesTableGUI($this, "whatLinksHere",
429  $this->getWikiPage()->getWikiId(), IL_WIKI_WHAT_LINKS_HERE, $_GET["wpg_id"]);
430 
431  $tpl->setContent($table_gui->getHTML());
432  }
433 
434  function getTabs($a_activate = "")
435  {
436  global $ilTabs, $ilCtrl;
437 
438  parent::getTabs($a_activate);
439 
440  $ilCtrl->setParameterByClass("ilobjwikigui", "wpg_id",
441  ilWikiPage::getPageIdForTitle($this->getPageObject()->getParentId(),
442  ilWikiUtil::makeDbTitle($_GET["page"])));
443  $ilCtrl->setParameterByClass("ilobjwikigui", "page", ilWikiUtil::makeUrlTitle($_GET["page"]));
444 
445  $ilTabs->addTarget("wiki_what_links_here",
446  $this->ctrl->getLinkTargetByClass("ilwikipagegui",
447  "whatLinksHere"), "whatLinksHere");
448  //$ilTabs->addTarget("wiki_print_view",
449  // $this->ctrl->getLinkTargetByClass("ilobjwikigui",
450  // "printViewSelection"), "printViewSelection");
451  $ilTabs->addTarget("wiki_print_view",
452  $this->ctrl->getLinkTargetByClass("ilwikipagegui",
453  "printViewSelection"), "printViewSelection");
454 
455  }
456 
461  {
462  global $ilAccess, $tpl, $ilCtrl, $lng;
463 
464  if ($ilAccess->checkAccess("write", "", $_GET["ref_id"]))
465  {
466  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
467  $confirmation_gui = new ilConfirmationGUI();
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");
472 
473  $dtpl = new ilTemplate("tpl.wiki_page_deletion_confirmation.html", true,
474  true, "Modules/Wiki");
475 
476  $dtpl->setVariable("PAGE_TITLE", $this->getWikiPage()->getTitle());
477 
478  // other pages that link to this page
479  $dtpl->setVariable("TXT_OTHER_PAGES", $lng->txt("wiki_other_pages_linking"));
480  $pages = ilWikiPage::getLinksToPage($this->getWikiPage()->getWikiId(),
481  $this->getWikiPage()->getId());
482  if (count($pages) > 0)
483  {
484  foreach($pages as $page)
485  {
486  $dtpl->setCurrentBlock("lpage");
487  $dtpl->setVariable("TXT_LINKING_PAGE", $page["title"]);
488  $dtpl->parseCurrentBlock();
489  }
490  }
491  else
492  {
493  $dtpl->setCurrentBlock("lpage");
494  $dtpl->setVariable("TXT_LINKING_PAGE", "-");
495  $dtpl->parseCurrentBlock();
496  }
497 
498  // contributors
499  $dtpl->setVariable("TXT_CONTRIBUTORS", $lng->txt("wiki_contributors"));
500  $contributors = ilWikiPage::getPageContributors($this->getWikiPage()->getId());
501  foreach($contributors as $contributor)
502  {
503  $dtpl->setCurrentBlock("contributor");
504  $dtpl->setVariable("TXT_CONTRIBUTOR",
505  $contributor["lastname"].", ".$contributor["firstname"]);
506  $dtpl->parseCurrentBlock();
507  }
508 
509  // notes/comments
510  include_once("./Services/Notes/classes/class.ilNote.php");
511  $cnt_note_users = ilNote::getUserCount($this->getPageObject()->getParentId(),
512  $this->getPageObject()->getId(), "wpg");
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);
516 
517  $confirmation_gui->addItem("", "", $dtpl->get());
518 
519  $tpl->setContent($confirmation_gui->getHTML());
520  }
521  }
522 
527  {
528  global $lng, $ilCtrl;
529 
530  $ilCtrl->redirect($this, "preview");
531 
532  }
533 
538  {
539  global $ilAccess, $tpl, $ilCtrl, $lng;
540 
541  if ($ilAccess->checkAccess("write", "", $_GET["ref_id"]))
542  {
543  $this->getPageObject()->delete();
544 
545  ilUtil::sendSuccess($lng->txt("wiki_page_deleted"), true);
546  }
547 
548  $ilCtrl->redirectByClass("ilobjwikigui", "allPages");
549  }
550 
554 
562  {
563  global $ilUser, $lng, $ilToolbar, $ilCtrl, $tpl;
564 
565  /*$ilToolbar->setFormAction($ilCtrl->getFormActionByClass("ilobjwikigui", "printView"),
566  false, "print_view");
567  $ilToolbar->addFormButton($lng->txt("cont_show_print_view"), "printView");
568  $ilToolbar->setCloseFormTag(false);*/
569 
571 
572  $tpl->setContent($this->form->getHTML());
573  }
574 
578  public function initPrintViewSelectionForm()
579  {
580  global $lng, $ilCtrl;
581 
583 
584  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
585  $this->form = new ilPropertyFormGUI();
586 //var_dump($pages);
587  // selection type
588  $radg = new ilRadioGroupInputGUI($lng->txt("cont_selection"), "sel_type");
589  $radg->setValue("page");
590  $op1 = new ilRadioOption($lng->txt("cont_current_page"), "page");
591  $radg->addOption($op1);
592  $op2 = new ilRadioOption($lng->txt("wiki_whole_wiki")
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);
597 
598  include_once("./Services/Form/classes/class.ilNestedListInputGUI.php");
599  $nl = new ilNestedListInputGUI("", "obj_id");
600  $op3->addSubItem($nl);
601 
602  foreach ($pages as $p)
603  {
604  $nl->addListNode($p["id"], $p["title"], 0, false, false,
605  ilUtil::getImagePath("icon_pg_s.png"), $lng->txt("wiki_page"));
606  }
607 
608  $this->form->addItem($radg);
609 
610  $this->form->addCommandButton("printView", $lng->txt("cont_show_print_view"));
611  //$this->form->setOpenTag(false);
612  //$this->form->setCloseTag(false);
613 
614  $this->form->setTitle($lng->txt("cont_print_selection"));
615  $this->form->setFormAction($ilCtrl->getFormActionByClass("ilobjwikigui", "printView"),
616  false, "print_view");
617  }
618 
622 
626  function blockWikiPage()
627  {
628  global $ilAccess, $tpl, $ilCtrl, $lng;
629 
630  if ($ilAccess->checkAccess("write", "", $_GET["ref_id"]))
631  {
632  $this->getPageObject()->setBlocked(true);
633  $this->getPageObject()->update();
634 
635  ilUtil::sendSuccess($lng->txt("wiki_page_blocked"), true);
636  }
637 
638  $ilCtrl->redirect($this, "preview");
639  }
640 
644  function unblockWikiPage()
645  {
646  global $ilAccess, $tpl, $ilCtrl, $lng;
647 
648  if ($ilAccess->checkAccess("write", "", $_GET["ref_id"]))
649  {
650  $this->getPageObject()->setBlocked(false);
651  $this->getPageObject()->update();
652 
653  ilUtil::sendSuccess($lng->txt("wiki_page_unblocked"), true);
654  }
655 
656  $ilCtrl->redirect($this, "preview");
657  }
658 
662 
666  function renameWikiPage()
667  {
668  global $ilAccess, $tpl, $ilCtrl, $lng;
669 
670  if ($ilAccess->checkAccess("write", "", $_GET["ref_id"]))
671  {
672  $this->initRenameForm();
673  $tpl->setContent($this->form->getHTML());
674  }
675  }
676 
682  protected function initRenameForm()
683  {
684  global $lng, $ilCtrl;
685 
686  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
687  $this->form = new ilPropertyFormGUI();
688 
689  // new name
690  $ti = new ilTextInputGUI($lng->txt("wiki_new_page_name"), "new_page_name");
691  $ti->setMaxLength(200);
692  $ti->setSize(50);
693  $ti->setValue($this->getPageObject()->getTitle());
694  $ti->setRequired(true);
695  $this->form->addItem($ti);
696 
697  $this->form->addCommandButton("renamePage", $lng->txt("wiki_rename"));
698  $this->form->addCommandButton("preview", $lng->txt("cancel"));
699 
700  $this->form->setTitle($lng->txt("wiki_rename_page"));
701  $this->form->setFormAction($ilCtrl->getFormAction($this));
702  }
703 
707  public function renamePage()
708  {
709  global $tpl, $lng, $ilCtrl, $ilAccess;
710 
711  $this->initRenameForm();
712  if ($this->form->checkInput())
713  {
714  if ($ilAccess->checkAccess("write", "", $_GET["ref_id"]))
715  {
716  $new_name = $this->form->getInput("new_page_name");
717 
718  $page_title = ilWikiUtil::makeDbTitle($new_name);
719  $pg_id = ilWikiPage::_getPageIdForWikiTitle($this->getPageObject()->getWikiId(), $page_title);
720 
721  // we might get the same page id back here, if the page
722  // name only differs in diacritics
723  // see bug http://www.ilias.de/mantis/view.php?id=11226
724  if ($pg_id > 0 && $pg_id != $this->getPageObject()->getId())
725  {
726  ilUtil::sendFailure($lng->txt("wiki_page_already_exists"));
727  }
728  else
729  {
730  $new_name = $this->getPageObject()->rename($new_name);
731  $ilCtrl->setParameterByClass("ilobjwikigui", "page", ilWikiUtil::makeUrlTitle($new_name));
732  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
733  $ilCtrl->redirect($this, "preview");
734  }
735  }
736  }
737 
738  $this->form->setValuesByPost();
739  $tpl->setContent($this->form->getHtml());
740  }
741 
745 
747  {
748  global $lng, $ilCtrl;
749 
750  $this->getPageObject()->setRating(true);
751  $this->getPageObject()->update();
752 
753  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
754  $ilCtrl->redirect($this, "preview");
755  }
756 
758  {
759  global $lng, $ilCtrl;
760 
761  $this->getPageObject()->setRating(false);
762  $this->getPageObject()->update();
763 
764  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
765  $ilCtrl->redirect($this, "preview");
766  }
767 
768 
769  function observeNoteAction($a_wiki_id, $a_page_id, $a_type, $a_action, $a_note_id)
770  {
771  // #10040 - get note text
772  include_once "Services/Notes/classes/class.ilNote.php";
773  $note = new ilNote($a_note_id);
774  $note = $note->getText();
775 
776  include_once "./Services/Notification/classes/class.ilNotification.php";
777  ilWikiUtil::sendNotification("comment", ilNotification::TYPE_WIKI_PAGE, $this->getWikiRefId(), $a_page_id, $note);
778  }
779 }
780 ?>