ILIAS  Release_4_2_x_branch Revision 61807
 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 
59  function initPageObject($a_parent_type, $a_id, $a_old_nr)
60  {
61  $page = new ilWikiPage($a_id, $a_old_nr);
62  $page->setWikiRefId($this->getWikiRefId());
63  $this->setPageObject($page);
64  }
65 
66  function setWikiRefId($a_ref_id)
67  {
68  $this->wiki_ref_id = $a_ref_id;
69  }
70 
71  function getWikiRefId()
72  {
73  return $this->wiki_ref_id;
74  }
75 
79  function &executeCommand()
80  {
81  global $ilCtrl, $ilTabs, $ilUser;
82 
83  $next_class = $this->ctrl->getNextClass($this);
84  $cmd = $this->ctrl->getCmd();
85 
86  switch($next_class)
87  {
88  case "ilnotegui":
89  $this->getTabs();
90  $ilTabs->setTabActive("pg");
91  return $this->preview();
92  break;
93 
94  case "ilratinggui":
95  include_once("./Services/Rating/classes/class.ilRatingGUI.php");
96  $rating_gui = new ilRatingGUI();
97  $rating_gui->setObject($this->getPageObject()->getParentId(), "wiki",
98  $this->getPageObject()->getId(), "wpg");
99  $this->ctrl->forwardCommand($rating_gui);
100  $ilCtrl->redirect($this, "preview");
101  break;
102 
103  case "ilpageobjectgui":
104  $page_gui = new ilPageObjectGUI("wpg",
105  $this->getPageObject()->getId(), $this->getPageObject()->old_nr);
106  $page_gui->setPresentationTitle($this->getWikiPage()->getTitle());
107  return $ilCtrl->forwardCommand($page_gui);
108 
109  case "ilcommonactiondispatchergui":
110  include_once("Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
112  $gui->enableCommentsSettings(false);
113  $this->ctrl->forwardCommand($gui);
114  break;
115 
116  default:
117 
118  if($_GET["ntf"])
119  {
120  include_once "./Services/Notification/classes/class.ilNotification.php";
121  switch($_GET["ntf"])
122  {
123  case 1:
124  ilNotification::setNotification(ilNotification::TYPE_WIKI, $ilUser->getId(), $this->getPageObject()->getParentId(), false);
125  break;
126 
127  case 2:
128  // remove all page notifications here?
129  ilNotification::setNotification(ilNotification::TYPE_WIKI, $ilUser->getId(), $this->getPageObject()->getParentId(), true);
130  break;
131 
132  case 3:
133  ilNotification::setNotification(ilNotification::TYPE_WIKI_PAGE, $ilUser->getId(), $this->getPageObject()->getId(), false);
134  break;
135 
136  case 4:
137  ilNotification::setNotification(ilNotification::TYPE_WIKI_PAGE, $ilUser->getId(), $this->getPageObject()->getId(), true);
138  break;
139  }
140  $ilCtrl->redirect($this, "preview");
141  }
142 
143  $this->setPresentationTitle($this->getWikiPage()->getTitle());
144  return parent::executeCommand();
145  }
146  }
147 
153  function setWikiPage($a_wikipage)
154  {
155  $this->setPageObject($a_wikipage);
156  }
157 
163  function getWikiPage()
164  {
165  return $this->getPageObject();
166  }
167 
171  static function getGUIForTitle($a_wiki_id, $a_title, $a_old_nr = 0, $a_wiki_ref_id = 0)
172  {
173  global $ilDB;
174 
175  include_once("./Modules/Wiki/classes/class.ilWikiPage.php");
176  $id = ilWikiPage::getPageIdForTitle($a_wiki_id, $a_title);
177  $page_gui = new ilWikiPageGUI($id, $a_old_nr, $a_wiki_ref_id);
178 
179  return $page_gui;
180  }
181 
182  function setSideBlock()
183  {
184  ilObjWikiGUI::renderSideBlock($this->getWikiPage()->getId(),
185  $this->wiki_ref_id, $this->getWikiPage());
186  }
187 
188  function addHeaderAction($a_redraw = false)
189  {
190  global $ilUser, $ilAccess;
191 
192  include_once "Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
194  $ilAccess, "wiki", $_GET["ref_id"], $this->getPageObject()->getParentId());
195  $dispatcher->setSubObject("wpg", $this->getPageObject()->getId());
196 
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));
201 
202  $lg = $dispatcher->initHeaderAction();
203  $lg->enableNotes(true);
204  $lg->enableComments(ilObjWiki::_lookupPublicNotes($this->getPageObject()->getParentId()), false);
205 
206  // notification
207  if ($ilUser->getId() != ANONYMOUS_USER_ID)
208  {
209  include_once "./Services/Notification/classes/class.ilNotification.php";
210  if(ilNotification::hasNotification(ilNotification::TYPE_WIKI, $ilUser->getId(), $this->getPageObject()->getParentId()))
211  {
212  $this->ctrl->setParameter($this, "ntf", 1);
213  $lg->addCustomCommand($this->ctrl->getLinkTarget($this), "wiki_notification_deactivate_wiki");
214 
215  $lg->addHeaderIcon("not_icon",
216  ilUtil::getImagePath("notification_on.png"),
217  $this->lng->txt("wiki_notification_activated"));
218  }
219  else
220  {
221  $this->ctrl->setParameter($this, "ntf", 2);
222  $lg->addCustomCommand($this->ctrl->getLinkTarget($this), "wiki_notification_activate_wiki");
223 
224  if(ilNotification::hasNotification(ilNotification::TYPE_WIKI_PAGE, $ilUser->getId(), $this->getPageObject()->getId()))
225  {
226  $this->ctrl->setParameter($this, "ntf", 3);
227  $lg->addCustomCommand($this->ctrl->getLinkTarget($this), "wiki_notification_deactivate_page");
228 
229  $lg->addHeaderIcon("not_icon",
230  ilUtil::getImagePath("notification_on.png"),
231  $this->lng->txt("wiki_page_notification_activated"));
232  }
233  else
234  {
235  $this->ctrl->setParameter($this, "ntf", 4);
236  $lg->addCustomCommand($this->ctrl->getLinkTarget($this), "wiki_notification_activate_page");
237 
238  $lg->addHeaderIcon("not_icon",
239  ilUtil::getImagePath("notification_off.png"),
240  $this->lng->txt("wiki_notification_deactivated"));
241  }
242  }
243  $this->ctrl->setParameter($this, "ntf", "");
244  }
245 
246  // rating
247  if (ilObjWiki::_lookupRating($this->getPageObject()->getParentId())
248  && $this->getPageObject()->old_nr == 0)
249  {
250  include_once("./Services/Rating/classes/class.ilRatingGUI.php");
251  $rating_gui = new ilRatingGUI();
252  $rating_gui->setObject($this->getPageObject()->getParentId(), "wiki",
253  $this->getPageObject()->getId(), "wpg");
254  $rating_gui->setYourRatingText($this->lng->txt("wiki_rate_page"));
255  $lg->addHeaderIconHTML("rating", $this->ctrl->getHtml($rating_gui));
256  }
257 
258  if(!$a_redraw)
259  {
260  $this->tpl->setHeaderActionMenu($lg->getHeaderAction());
261  }
262  else
263  {
264  return $lg->getHeaderAction();
265  }
266  }
267 
269  {
270  echo $this->addHeaderAction(true);
271  exit;
272  }
273 
277  function preview()
278  {
279  global $ilCtrl, $ilAccess, $lng, $tpl, $ilUser, $ilSetting;
280 
281  // block/unblock
282  if ($this->getPageObject()->getBlocked())
283  {
284  ilUtil::sendInfo($lng->txt("wiki_page_status_blocked"));
285  }
286 
287  $this->increaseViewCount();
288 
289  $this->addHeaderAction();
290 
291 
292  // other actions
293  /*
294 if (false) // currently moved to ilWikiFunctionsBlockGUI
295 {
296  // delete
297  $page_commands = false;
298  if ($ilAccess->checkAccess("write", "", $_GET["ref_id"]))
299  {
300  // rename
301  $list->addItem($lng->txt("wiki_rename_page"), "",
302  $ilCtrl->getLinkTarget($this, "renameWikiPage"));
303 
304  // block/unblock
305  if ($this->getPageObject()->getBlocked())
306  {
307  $list->addItem($lng->txt("wiki_unblock_page"), "",
308  $ilCtrl->getLinkTarget($this, "unblockWikiPage"));
309  }
310  else
311  {
312  $list->addItem($lng->txt("wiki_block_page"), "",
313  $ilCtrl->getLinkTarget($this, "blockWikiPage"));
314  }
315 
316  // delete page
317  $st_page = ilObjWiki::_lookupStartPage($this->getPageObject()->getParentId());
318  if ($st_page != $this->getPageObject()->getTitle())
319  {
320  $list->addItem($lng->txt("wiki_delete_page"), "",
321  $ilCtrl->getLinkTarget($this, "deleteWikiPageConfirmationScreen"));
322  }
323  }
324 }
325 */
326 
327  // content
328 
329  $this->setSideBlock();
330 
331  $wtpl = new ilTemplate("tpl.wiki_page_view_main_column.html",
332  true, true, "Modules/Wiki");
333 
334  $callback = array($this, "observeNoteAction");
335 
336  // notes
337  if (!$ilSetting->get("disable_comments") &&
338  ilObjWiki::_lookupPublicNotes($this->getPageObject()->getParentId()))
339  {
340  $wtpl->setVariable("NOTES", $this->getNotesHTML($this->getPageObject(),
341  true, ilObjWiki::_lookupPublicNotes($this->getPageObject()->getParentId()),
342  $ilAccess->checkAccess("write", "", $_GET["ref_id"]), $callback));
343  }
344 
345  // permanent link
346  $append = ($_GET["page"] != "")
347  ? "_".ilWikiUtil::makeUrlTitle($_GET["page"])
348  : "";
349  include_once("./Services/PermanentLink/classes/class.ilPermanentLinkGUI.php");
350  $perma_link = new ilPermanentLinkGUI("wiki", $_GET["ref_id"], $append);
351  $wtpl->setVariable("PERMA_LINK", $perma_link->getHTML());
352 
353  // page content
354  $wtpl->setVariable("PAGE", parent::preview());
355 
356  $tpl->setLoginTargetPar("wiki_".$_GET["ref_id"].$append);
357 
358  // last edited info
359  $wtpl->setVariable("LAST_EDITED_INFO",
360  $lng->txt("wiki_last_edited").": ".
362  new ilDateTime($this->getPageObject()->getLastChange(),IL_CAL_DATETIME)).", ".
363  ilUserUtil::getNamePresentation($this->getPageObject()->getLastChangeUser(),
364  false, true, $ilCtrl->getLinkTarget($this, "preview")));
365 
366  $tpl->setLoginTargetPar("wiki_".$_GET["ref_id"].$append);
367 
368  //highlighting
369  if ($_GET["srcstring"] != "")
370  {
371  include_once './Services/Search/classes/class.ilUserSearchCache.php';
372  $cache = ilUserSearchCache::_getInstance($ilUser->getId());
373  $cache->switchSearchType(ilUserSearchCache::LAST_QUERY);
374  $search_string = $cache->getQuery();
375 
376  include_once("./Services/UIComponent/TextHighlighter/classes/class.ilTextHighlighterGUI.php");
377  include_once("./Services/Search/classes/class.ilQueryParser.php");
378  $p = new ilQueryParser($search_string);
379  $p->parse();
380 
381  $words = $p->getQuotedWords();
382  if (is_array($words))
383  {
384  foreach ($words as $w)
385  {
386  ilTextHighlighterGUI::highlight("ilCOPageContent", $w, $tpl);
387  }
388  }
389  $this->fill_on_load_code = true;
390  }
391 
392  return $wtpl->get();
393  }
394 
395  function showPage()
396  {
397  global $tpl, $ilCtrl;
398 
399  // content style
400 /* include_once("./classes/class.ilObjStyleSheet.php");
401  $tpl->setCurrentBlock("ContentStyle");
402  $tpl->setVariable("LOCATION_CONTENT_STYLESHEET",
403  ilObjStyleSheet::getContentStylePath(0));
404  $tpl->parseCurrentBlock();
405 */
406  $this->setTemplateOutput(false);
407  $this->setPresentationTitle($this->getWikiPage()->getTitle());
408  $this->increaseViewCount();
409  $output = parent::showPage();
410 
411  return $output;
412  }
413 
414  protected function increaseViewCount()
415  {
416  global $ilUser;
417 
418  $this->getWikiPage()->increaseViewCnt();
419 
420  // enable object statistics
421  require_once('Services/Tracking/classes/class.ilChangeEvent.php');
423  $this->getWikiPage()->getWikiId(), $ilUser->getId());
424  }
425 
429  function postOutputProcessing($a_output)
430  {
431 //echo htmlentities($a_output);
432  include_once("./Modules/Wiki/classes/class.ilWikiUtil.php");
433  $output = ilWikiUtil::replaceInternalLinks($a_output,
434  $this->getWikiPage()->getWikiId(),
435  ($this->getOutputMode() == "offline"));
436  return $output;
437  }
438 
442  function whatLinksHere()
443  {
444  global $tpl;
445 
446  include_once("./Modules/Wiki/classes/class.ilWikiPagesTableGUI.php");
447 
448  $this->setSideBlock($_GET["wpg_id"]);
449  $table_gui = new ilWikiPagesTableGUI($this, "whatLinksHere",
450  $this->getWikiPage()->getWikiId(), IL_WIKI_WHAT_LINKS_HERE, $_GET["wpg_id"]);
451 
452  $tpl->setContent($table_gui->getHTML());
453  }
454 
455  function getTabs($a_activate = "")
456  {
457  global $ilTabs, $ilCtrl;
458 
459  parent::getTabs($a_activate);
460 
461  $ilCtrl->setParameterByClass("ilobjwikigui", "wpg_id",
462  ilWikiPage::getPageIdForTitle($this->getPageObject()->getParentId(),
463  ilWikiUtil::makeDbTitle($_GET["page"])));
464  $ilCtrl->setParameterByClass("ilobjwikigui", "page", ilWikiUtil::makeUrlTitle($_GET["page"]));
465 
466  $ilTabs->addTarget("wiki_what_links_here",
467  $this->ctrl->getLinkTargetByClass("ilwikipagegui",
468  "whatLinksHere"), "whatLinksHere");
469  //$ilTabs->addTarget("wiki_print_view",
470  // $this->ctrl->getLinkTargetByClass("ilobjwikigui",
471  // "printViewSelection"), "printViewSelection");
472  $ilTabs->addTarget("wiki_print_view",
473  $this->ctrl->getLinkTargetByClass("ilwikipagegui",
474  "printViewSelection"), "printViewSelection");
475 
476  }
477 
482  {
483  global $ilAccess, $tpl, $ilCtrl, $lng;
484 
485  if ($ilAccess->checkAccess("write", "", $_GET["ref_id"]))
486  {
487  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
488  $confirmation_gui = new ilConfirmationGUI();
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");
493 
494  $dtpl = new ilTemplate("tpl.wiki_page_deletion_confirmation.html", true,
495  true, "Modules/Wiki");
496 
497  $dtpl->setVariable("PAGE_TITLE", $this->getWikiPage()->getTitle());
498 
499  // other pages that link to this page
500  $dtpl->setVariable("TXT_OTHER_PAGES", $lng->txt("wiki_other_pages_linking"));
501  $pages = ilWikiPage::getLinksToPage($this->getWikiPage()->getWikiId(),
502  $this->getWikiPage()->getId());
503  if (count($pages) > 0)
504  {
505  foreach($pages as $page)
506  {
507  $dtpl->setCurrentBlock("lpage");
508  $dtpl->setVariable("TXT_LINKING_PAGE", $page["title"]);
509  $dtpl->parseCurrentBlock();
510  }
511  }
512  else
513  {
514  $dtpl->setCurrentBlock("lpage");
515  $dtpl->setVariable("TXT_LINKING_PAGE", "-");
516  $dtpl->parseCurrentBlock();
517  }
518 
519  // contributors
520  $dtpl->setVariable("TXT_CONTRIBUTORS", $lng->txt("wiki_contributors"));
521  $contributors = ilWikiPage::getPageContributors($this->getWikiPage()->getId());
522  foreach($contributors as $contributor)
523  {
524  $dtpl->setCurrentBlock("contributor");
525  $dtpl->setVariable("TXT_CONTRIBUTOR",
526  $contributor["lastname"].", ".$contributor["firstname"]);
527  $dtpl->parseCurrentBlock();
528  }
529 
530  // notes/comments
531  include_once("./Services/Notes/classes/class.ilNote.php");
532  $cnt_note_users = ilNote::getUserCount($this->getPageObject()->getParentId(),
533  $this->getPageObject()->getId(), "wpg");
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);
537 
538  $confirmation_gui->addItem("", "", $dtpl->get());
539 
540  $tpl->setContent($confirmation_gui->getHTML());
541  }
542  }
543 
548  {
549  global $lng, $ilCtrl;
550 
551  $ilCtrl->redirect($this, "preview");
552 
553  }
554 
559  {
560  global $ilAccess, $tpl, $ilCtrl, $lng;
561 
562  if ($ilAccess->checkAccess("write", "", $_GET["ref_id"]))
563  {
564  $this->getPageObject()->delete();
565 
566  ilUtil::sendSuccess($lng->txt("wiki_page_deleted"), true);
567  }
568 
569  $ilCtrl->redirectByClass("ilobjwikigui", "allPages");
570  }
571 
575 
583  {
584  global $ilUser, $lng, $ilToolbar, $ilCtrl, $tpl;
585 
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);
590 
592 
593  $tpl->setContent($this->form->getHTML());
594  }
595 
599  public function initPrintViewSelectionForm()
600  {
601  global $lng, $ilCtrl;
602 
604 
605  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
606  $this->form = new ilPropertyFormGUI();
607 //var_dump($pages);
608  // selection type
609  $radg = new ilRadioGroupInputGUI($lng->txt("cont_selection"), "sel_type");
610  $radg->setValue("page");
611  $op1 = new ilRadioOption($lng->txt("cont_current_page"), "page");
612  $radg->addOption($op1);
613  $op2 = new ilRadioOption($lng->txt("wiki_whole_wiki")
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);
618 
619  include_once("./Services/Form/classes/class.ilNestedListInputGUI.php");
620  $nl = new ilNestedListInputGUI("", "obj_id");
621  $op3->addSubItem($nl);
622 
623  foreach ($pages as $p)
624  {
625  $nl->addListNode($p["id"], $p["title"], 0, false, false,
626  ilUtil::getImagePath("icon_pg_s.gif"), $lng->txt("wiki_page"));
627  }
628 
629  $this->form->addItem($radg);
630 
631  $this->form->addCommandButton("printView", $lng->txt("cont_show_print_view"));
632  //$this->form->setOpenTag(false);
633  $this->form->setCloseTag(false);
634 
635  $this->form->setTitle($lng->txt("cont_print_selection"));
636  //$this->form->setFormAction($ilCtrl->getFormAction($this));
637  }
638 
642 
646  function blockWikiPage()
647  {
648  global $ilAccess, $tpl, $ilCtrl, $lng;
649 
650  if ($ilAccess->checkAccess("write", "", $_GET["ref_id"]))
651  {
652  $this->getPageObject()->setBlocked(true);
653  $this->getPageObject()->update();
654 
655  ilUtil::sendSuccess($lng->txt("wiki_page_blocked"), true);
656  }
657 
658  $ilCtrl->redirect($this, "preview");
659  }
660 
664  function unblockWikiPage()
665  {
666  global $ilAccess, $tpl, $ilCtrl, $lng;
667 
668  if ($ilAccess->checkAccess("write", "", $_GET["ref_id"]))
669  {
670  $this->getPageObject()->setBlocked(false);
671  $this->getPageObject()->update();
672 
673  ilUtil::sendSuccess($lng->txt("wiki_page_unblocked"), true);
674  }
675 
676  $ilCtrl->redirect($this, "preview");
677  }
678 
682 
686  function renameWikiPage()
687  {
688  global $ilAccess, $tpl, $ilCtrl, $lng;
689 
690  if ($ilAccess->checkAccess("write", "", $_GET["ref_id"]))
691  {
692  $this->initRenameForm();
693  $tpl->setContent($this->form->getHTML());
694  }
695  }
696 
702  protected function initRenameForm()
703  {
704  global $lng, $ilCtrl;
705 
706  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
707  $this->form = new ilPropertyFormGUI();
708 
709  // new name
710  $ti = new ilTextInputGUI($lng->txt("wiki_new_page_name"), "new_page_name");
711  $ti->setMaxLength(200);
712  $ti->setSize(50);
713  $ti->setValue($this->getPageObject()->getTitle());
714  $ti->setRequired(true);
715  $this->form->addItem($ti);
716 
717  $this->form->addCommandButton("renamePage", $lng->txt("wiki_rename"));
718  $this->form->addCommandButton("preview", $lng->txt("cancel"));
719 
720  $this->form->setTitle($lng->txt("wiki_rename_page"));
721  $this->form->setFormAction($ilCtrl->getFormAction($this));
722  }
723 
727  public function renamePage()
728  {
729  global $tpl, $lng, $ilCtrl, $ilAccess;
730 
731  $this->initRenameForm();
732  if ($this->form->checkInput())
733  {
734  if ($ilAccess->checkAccess("write", "", $_GET["ref_id"]))
735  {
736  $new_name = $this->form->getInput("new_page_name");
737 
738  if (ilWikiPage::exists($this->getPageObject()->getWikiId(), $new_name))
739  {
740  ilUtil::sendFailure($lng->txt("wiki_page_already_exists"));
741  }
742  else
743  {
744  $this->getPageObject()->rename($new_name);
745  $ilCtrl->setParameterByClass("ilobjwikigui", "page", ilWikiUtil::makeUrlTitle($new_name));
746  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
747  $ilCtrl->redirect($this, "preview");
748  }
749  }
750  }
751 
752  $this->form->setValuesByPost();
753  $tpl->setContent($this->form->getHtml());
754  }
755 
756  function observeNoteAction($a_wiki_id, $a_page_id, $a_type, $a_action)
757  {
758  include_once "./Services/Notification/classes/class.ilNotification.php";
760  }
761 }
762 ?>