ILIAS  Release_4_2_x_branch Revision 61807
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilObjWikiGUI.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 require_once "./classes/class.ilObjectGUI.php";
5 require_once "./Modules/Wiki/classes/class.ilObjWiki.php";
6 
7 
20 {
25  function ilObjWikiGUI($a_data, $a_id, $a_call_by_reference, $a_prepare_output = true)
26  {
27  global $ilCtrl, $lng;
28 
29  $this->type = "wiki";
30 
31  $this->ilObjectGUI($a_data,$a_id,$a_call_by_reference,$a_prepare_output);
32  $lng->loadLanguageModule("wiki");
33 
34  if ($_GET["page"] != "")
35  {
36  $ilCtrl->setParameter($this, "page", ilWikiUtil::makeUrlTitle($_GET["page"]));
37  }
38  }
39 
40  function executeCommand()
41  {
42  global $ilUser, $ilCtrl, $tpl, $ilTabs, $ilAccess;
43 
44  $next_class = $this->ctrl->getNextClass($this);
45  $cmd = $this->ctrl->getCmd();
46 
47  $this->prepareOutput();
48 
49  switch($next_class)
50  {
51  case "ilinfoscreengui":
52  $this->checkPermission("visible");
53  $this->addHeaderAction();
54  $this->infoScreen(); // forwards command
55  break;
56 
57  case 'ilpermissiongui':
58  $this->addHeaderAction();
59  $ilTabs->activateTab("perm_settings");
60  include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
61  $perm_gui =& new ilPermissionGUI($this);
62  $ret =& $this->ctrl->forwardCommand($perm_gui);
63  break;
64 
65  case 'ilwikipagegui':
66  $this->checkPermission("read");
67  include_once("./Modules/Wiki/classes/class.ilWikiPageGUI.php");
68  $wpage_gui = ilWikiPageGUI::getGUIForTitle($this->object->getId(),
69  ilWikiUtil::makeDbTitle($_GET["page"]), $_GET["old_nr"], $this->object->getRefId());
70  include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
71  $wpage_gui->setStyleId(ilObjStyleSheet::getEffectiveContentStyleId(
72  $this->object->getStyleSheetId(), "wiki"));
73  $this->setContentStyleSheet();
74  if (!$ilAccess->checkAccess("write", "", $this->object->getRefId()) &&
75  (!$ilAccess->checkAccess("edit_content", "", $this->object->getRefId()) ||
76  $wpage_gui->getPageObject()->getBlocked()
77  ))
78  {
79  $wpage_gui->setEnableEditing(false);
80  }
81 
82  // alter title and description
83 // $tpl->setTitle($wpage_gui->getPageObject()->getTitle());
84 // $tpl->setDescription($this->object->getTitle());
85 
86  $ret = $this->ctrl->forwardCommand($wpage_gui);
87  if ($ret != "")
88  {
89  $tpl->setContent($ret);
90  }
91  break;
92 
93  case 'ilpublicuserprofilegui':
94  require_once './Services/User/classes/class.ilPublicUserProfileGUI.php';
95  $profile_gui = new ilPublicUserProfileGUI($_GET["user"]);
96  $ret = $this->ctrl->forwardCommand($profile_gui);
97  $tpl->setContent($ret);
98  break;
99 
100  case "ilobjstylesheetgui":
101  include_once ("./Services/Style/classes/class.ilObjStyleSheetGUI.php");
102  $this->ctrl->setReturn($this, "editStyleProperties");
103  $style_gui = new ilObjStyleSheetGUI("", $this->object->getStyleSheetId(), false, false);
104  $style_gui->omitLocator();
105  if ($cmd == "create" || $_GET["new_type"]=="sty")
106  {
107  $style_gui->setCreationMode(true);
108  }
109 
110  if ($cmd == "confirmedDelete")
111  {
112  $this->object->setStyleSheetId(0);
113  $this->object->update();
114  }
115 
116  $ret = $this->ctrl->forwardCommand($style_gui);
117 
118  if ($cmd == "save" || $cmd == "copyStyle" || $cmd == "importStyle")
119  {
120  $style_id = $ret;
121  $this->object->setStyleSheetId($style_id);
122  $this->object->update();
123  $this->ctrl->redirectByClass("ilobjstylesheetgui", "edit");
124  }
125  break;
126 
127  case "ilexportgui":
128 // $this->prepareOutput();
129  $this->addHeaderAction();
130  $ilTabs->activateTab("export");
131  include_once("./Services/Export/classes/class.ilExportGUI.php");
132  $exp_gui = new ilExportGUI($this);
133  $exp_gui->addFormat("xml");
134  $exp_gui->addFormat("html", "", $this, "exportHTML");
135  $ret = $this->ctrl->forwardCommand($exp_gui);
136 // $this->tpl->show();
137  break;
138 
139  case "ilcommonactiondispatchergui":
140  include_once("Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
142  $this->ctrl->forwardCommand($gui);
143  break;
144 
145  default:
146  $this->addHeaderAction();
147  if(!$cmd)
148  {
149  $cmd = "infoScreen";
150  }
151  $cmd .= "Object";
152  if ($cmd != "infoScreenObject")
153  {
154  $this->checkPermission("read");
155  }
156  else
157  {
158  $this->checkPermission("visible");
159  }
160  $this->$cmd();
161  break;
162  }
163 
164  return $ret;
165  }
166 
170  function viewObject()
171  {
172  $this->checkPermission("read");
173  $this->gotoStartPageObject();
174  }
175 
176  protected function initCreationForms($a_new_type)
177  {
178  $this->initSettingsForm("create");
179  $this->getSettingsFormValues("create");
180 
181  $forms = array(self::CFORM_NEW => $this->form_gui,
182  self::CFORM_IMPORT => $this->initImportForm($a_new_type));
183 
184  return $forms;
185  }
186 
191  function saveObject()
192  {
193  global $tpl, $lng, $rbacsystem;
194 
195  if (!$this->checkPermissionBool("create", "", "wiki", $_GET["ref_id"]))
196  {
197  $this->ilias->raiseError($this->lng->txt("permission_denied"),$this->ilias->error_obj->MESSAGE);
198  }
199 
200  $this->initSettingsForm("create");
201  if ($this->form_gui->checkInput())
202  {
203  if (!ilObjWiki::checkShortTitleAvailability($this->form_gui->getInput("shorttitle")))
204  {
205  $short_item = $this->form_gui->getItemByPostVar("shorttitle");
206  $short_item->setAlert($lng->txt("wiki_short_title_already_in_use"));
207  }
208  else
209  {
210  // create and insert forum in objecttree
211  $_POST["title"] = $this->form_gui->getInput("title");
212  $_POST["desc"] = $this->form_gui->getInput("description");
213  return parent::saveObject();
214  }
215  }
216 
217  $this->form_gui->setValuesByPost();
218  $tpl->setContent($this->form_gui->getHtml());
219  }
220 
225  function afterSave($newObj)
226  {
227  global $ilSetting;
228 
229  $newObj->setTitle($this->form_gui->getInput("title"));
230  $newObj->setDescription($this->form_gui->getInput("description"));
231  $newObj->setIntroduction($this->form_gui->getInput("intro"));
232  $newObj->setStartPage($this->form_gui->getInput("startpage"));
233  $newObj->setShortTitle($this->form_gui->getInput("shorttitle"));
234  $newObj->setRating($this->form_gui->getInput("rating"));
235  if (!$ilSetting->get("disable_comments"))
236  {
237  $newObj->setPublicNotes($this->form_gui->getInput("public_notes"));
238  }
239  $newObj->setOnline($this->form_gui->getInput("online"));
240  $newObj->update();
241 
242  // always send a message
243  ilUtil::sendSuccess($this->lng->txt("object_added"),true);
244  ilUtil::redirect(ilObjWikiGUI::getGotoLink($newObj->getRefId()));
245  }
246 
252  function infoScreenObject()
253  {
254  $this->checkPermission("visible");
255  $this->ctrl->setCmd("showSummary");
256  $this->ctrl->setCmdClass("ilinfoscreengui");
257  $this->infoScreen();
258  }
259 
263  function infoScreen()
264  {
265  global $ilAccess, $ilUser, $ilTabs, $lng;
266 
267  $ilTabs->activateTab("info_short");
268 
269  if (!$ilAccess->checkAccess("visible", "", $this->object->getRefId()))
270  {
271  $this->ilias->raiseError($this->lng->txt("msg_no_perm_read"),$this->ilias->error_obj->MESSAGE);
272  }
273 
274  include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
275  $info = new ilInfoScreenGUI($this);
276  $info->enablePrivateNotes();
277  if (trim($this->object->getIntroduction()) != "")
278  {
279  $info->addSection($lng->txt("wiki_introduction"));
280  $info->addProperty("", nl2br($this->object->getIntroduction()));
281  }
282 
283  // feedback from tutor; mark, status, comment
284  include_once("./Modules/Wiki/classes/class.ilWikiContributor.php");
285  include_once("./Services/Tracking/classes/class.ilLPMarks.php");
286  $lpcomment = ilLPMarks::_lookupComment($ilUser->getId(), $this->object->getId());
287  $mark = ilLPMarks::_lookupMark($ilUser->getId(), $this->object->getId());
288  $status = ilWikiContributor::_lookupStatus($this->object->getId(), $ilUser->getId());
289  if ($lpcomment != "" || $mark != "" || $status != ilWikiContributor::STATUS_NOT_GRADED)
290  {
291  $info->addSection($this->lng->txt("wiki_feedback_from_tutor"));
292  if ($lpcomment != "")
293  {
294  $info->addProperty($this->lng->txt("wiki_comment"),
295  $lpcomment);
296  }
297  if ($mark != "")
298  {
299  $info->addProperty($this->lng->txt("wiki_mark"),
300  $mark);
301  }
302 
303  if ($status == ilWikiContributor::STATUS_PASSED)
304  {
305  $info->addProperty($this->lng->txt("status"),
306  $this->lng->txt("wiki_passed"));
307  }
308  if ($status == ilWikiContributor::STATUS_FAILED)
309  {
310  $info->addProperty($this->lng->txt("status"),
311  $this->lng->txt("wiki_failed"));
312  }
313  }
314 
315  /*
316  $info->enableNews();
317  if ($ilAccess->checkAccess("write", "", $_GET["ref_id"]))
318  {
319  //$info->enableNewsEditing();
320  $info->setBlockProperty("news", "settings", true);
321  }*/
322 
323  if ($ilAccess->checkAccess("read", "", $this->object->getRefId()))
324  {
325  $info->addButton($lng->txt("wiki_start_page"), ilObjWikiGUI::getGotoLink($this->object->getRefId()));
326  }
327 
328  // general information
329  $this->lng->loadLanguageModule("meta");
330  $this->lng->loadLanguageModule("wiki");
331 
332  //$info->addSection($this->lng->txt("meta_general"));
333  //$info->addProperty($this->lng->txt("mcst_nr_items"),
334  // (int) count($med_items));
335 
336  // forward the command
337  $this->ctrl->forwardCommand($info);
338 
339  if ($ilAccess->checkAccess("read", "", $this->object->getRefId()))
340  {
341 // $this->setSideBlock();
342  }
343  }
344 
349  {
350  global $ilCtrl;
351 
352  ilUtil::redirect(ilObjWikiGUI::getGotoLink($this->object->getRefId()));
353  }
354 
358  function addPageTabs()
359  {
360  global $ilTabs, $ilCtrl;
361 
362  include_once("./Modules/Wiki/classes/class.ilWikiPage.php");
363  $ilCtrl->setParameter($this, "wpg_id",
364  ilWikiPage::getPageIdForTitle($this->object->getId(), ilWikiUtil::makeDbTitle($_GET["page"])));
365  $ilCtrl->setParameter($this, "page", ilWikiUtil::makeUrlTitle($_GET["page"]));
366  $ilTabs->addTarget("wiki_what_links_here",
367  $this->ctrl->getLinkTargetByClass("ilwikipagegui",
368  "whatLinksHere"), "whatLinksHere");
369  //$ilTabs->addTarget("wiki_print_view",
370  // $this->ctrl->getLinkTarget($this,
371  // "printViewSelection"), "printViewSelection");
372  $ilTabs->addTarget("wiki_print_view",
373  $this->ctrl->getLinkTargetByClass("ilwikipagegui",
374  "printViewSelection"), "printViewSelection");
375  }
376 
380  function addPagesSubTabs()
381  {
382  global $ilTabs, $ilCtrl;
383 
384  $ilTabs->activateTab("wiki_pages");
385 
386  include_once("./Modules/Wiki/classes/class.ilWikiPage.php");
387  $ilCtrl->setParameter($this, "wpg_id",
388  ilWikiPage::getPageIdForTitle($this->object->getId(),
389  ilWikiUtil::makeDbTitle($_GET["page"])));
390  $ilCtrl->setParameter($this, "page", ilWikiUtil::makeUrlTitle($_GET["page"]));
391  $ilTabs->addSubTabTarget("wiki_all_pages",
392  $this->ctrl->getLinkTarget($this, "allPages"), "allPages");
393  $ilTabs->addSubTabTarget("wiki_recent_changes",
394  $this->ctrl->getLinkTarget($this, "recentChanges"), "recentChanges");
395  $ilTabs->addSubTabTarget("wiki_new_pages",
396  $this->ctrl->getLinkTarget($this, "newPages"), "newPages");
397  $ilTabs->addSubTabTarget("wiki_popular_pages",
398  $this->ctrl->getLinkTarget($this, "popularPages"), "popularPages");
399  $ilTabs->addSubTabTarget("wiki_orphaned_pages",
400  $this->ctrl->getLinkTarget($this, "orphanedPages"), "orphanedPages");
401  }
402 
408  function getTabs($tabs_gui)
409  {
410  global $ilCtrl, $ilAccess, $ilTabs, $lng;
411 
412  // wiki tabs
413  if (in_array($ilCtrl->getCmdClass(), array("", "ilobjwikigui",
414  "ilinfoscreengui", "ilpermissiongui", "ilexportgui")))
415  {
416  if ($_GET["page"] != "")
417  {
418  $tabs_gui->setBackTarget($lng->txt("wiki_last_visited_page"),
419  $this->getGotoLink($_GET["ref_id"],
420  ilWikiUtil::makeDbTitle($_GET["page"])));
421  }
422 
423  // pages
424  if ($ilAccess->checkAccess('read', "", $this->object->getRefId()))
425  {
426  $ilTabs->addTab("wiki_pages",
427  $lng->txt("wiki_pages"),
428  $this->ctrl->getLinkTarget($this, "allPages"));
429  }
430 
431  // info screen
432  if ($ilAccess->checkAccess('visible', "", $this->object->getRefId()))
433  {
434  $ilTabs->addTab("info_short",
435  $lng->txt("info_short"),
436  $this->ctrl->getLinkTargetByClass("ilinfoscreengui", "showSummary"));
437  }
438 
439  // settings
440  if ($ilAccess->checkAccess('write', "", $this->object->getRefId()))
441  {
442  $ilTabs->addTab("settings",
443  $lng->txt("settings"),
444  $this->ctrl->getLinkTarget($this, "editSettings"));
445  }
446 
447  // contributors
448  if ($ilAccess->checkAccess('write', "", $this->object->getRefId()))
449  {
450  $ilTabs->addTab("wiki_contributors",
451  $lng->txt("wiki_contributors"),
452  $this->ctrl->getLinkTarget($this, "listContributors"));
453  }
454 
455  if ($ilAccess->checkAccess("write", "", $this->object->getRefId()))
456  {
457  $ilTabs->addTab("export",
458  $lng->txt("export"),
459  $this->ctrl->getLinkTargetByClass("ilexportgui", ""));
460  }
461 
462 
463  // edit permissions
464  if ($ilAccess->checkAccess('edit_permission', "", $this->object->getRefId()))
465  {
466  $ilTabs->addTab("perm_settings",
467  $lng->txt("perm_settings"),
468  $this->ctrl->getLinkTargetByClass("ilpermissiongui", "perm"));
469  }
470  }
471  }
472 
476  function setSettingsSubTabs($a_active)
477  {
478  global $ilTabs, $ilCtrl, $lng;
479 
480  if (in_array($a_active,
481  array("general_settings", "style", "imp_pages")))
482  {
483  // general properties
484  $ilTabs->addSubTab("general_settings",
485  $lng->txt("wiki_general_settings"),
486  $ilCtrl->getLinkTarget($this, 'editSettings'));
487 
488  // style properties
489  $ilTabs->addSubTab("style",
490  $lng->txt("wiki_style"),
491  $ilCtrl->getLinkTarget($this, 'editStyleProperties'));
492 
493  // important pages
494  $ilTabs->addSubTab("imp_pages",
495  $lng->txt("wiki_navigation"),
496  $ilCtrl->getLinkTarget($this, 'editImportantPages'));
497 
498  $ilTabs->activateSubTab($a_active);
499  }
500  }
501 
506  {
507  global $tpl;
508 
509  $this->checkPermission("write");
510 
511  $this->setSettingsSubTabs("general_settings");
512 
513  $this->initSettingsForm();
514  $this->getSettingsFormValues();
515 
516  $tpl->setContent($this->form_gui->getHtml());
517  $this->setSideBlock();
518  }
519 
523  function initSettingsForm($a_mode = "edit")
524  {
525  global $tpl, $lng, $ilCtrl, $ilTabs, $ilSetting;
526 
527  $lng->loadLanguageModule("wiki");
528  $ilTabs->activateTab("settings");
529 
530  include("Services/Form/classes/class.ilPropertyFormGUI.php");
531  $this->form_gui = new ilPropertyFormGUI();
532 
533  // Title
534  $tit = new ilTextInputGUI($lng->txt("title"), "title");
535  $tit->setRequired(true);
536  $this->form_gui->addItem($tit);
537 
538  // Short Title
539  // The problem with the short title is, that it is per object
540  // and can't be a substitute for a ref id in the permanent link
541 /*
542  $stit = new ilRegExpInputGUI($lng->txt("wiki_short_title"), "shorttitle");
543  $stit->setPattern("/^[^0-9][^ _\&]+$/");
544  $stit->setRequired(false);
545  $stit->setNoMatchMessage($lng->txt("wiki_msg_short_name_regexp")." &amp; _");
546  $stit->setSize(20);
547  $stit->setMaxLength(20);
548  $stit->setInfo($lng->txt("wiki_short_title_desc2"));
549  $this->form_gui->addItem($stit);
550 */
551 
552  // Description
553  $des = new ilTextAreaInputGUI($lng->txt("description"), "description");
554  $this->form_gui->addItem($des);
555 
556  // Introduction
557  $intro = new ilTextAreaInputGUI($lng->txt("wiki_introduction"), "intro");
558  $intro->setCols(40);
559  $intro->setRows(4);
560  $this->form_gui->addItem($intro);
561 
562  // Start Page
563  $sp = new ilTextInputGUI($lng->txt("wiki_start_page"), "startpage");
564  $sp->setMaxLength(200);
565  $sp->setRequired(true);
566  $this->form_gui->addItem($sp);
567 
568  // Online
569  $online = new ilCheckboxInputGUI($lng->txt("online"), "online");
570  $this->form_gui->addItem($online);
571 
572  // rating
573  $rating = new ilCheckboxInputGUI($lng->txt("wiki_activate_rating"), "rating");
574  $this->form_gui->addItem($rating);
575 
576  // public comments
577  if (!$ilSetting->get("disable_comments"))
578  {
579  $comments = new ilCheckboxInputGUI($lng->txt("wiki_public_comments"), "public_notes");
580  $this->form_gui->addItem($comments);
581  }
582 
583  // important pages
584 // $imp_pages = new ilCheckboxInputGUI($lng->txt("wiki_important_pages"), "imp_pages");
585 // $this->form_gui->addItem($imp_pages);
586 
587  // page toc
588  $page_toc = new ilCheckboxInputGUI($lng->txt("wiki_page_toc"), "page_toc");
589  $page_toc->setInfo($lng->txt("wiki_page_toc_info"));
590  $this->form_gui->addItem($page_toc);
591 
592  // Form action and save button
593  $this->form_gui->setTitleIcon(ilUtil::getImagePath("icon_wiki.gif"));
594  if ($a_mode != "create")
595  {
596  $this->form_gui->setTitle($lng->txt("wiki_settings"));
597  $this->form_gui->addCommandButton("saveSettings", $lng->txt("save"));
598  }
599  else
600  {
601  $this->form_gui->setTitle($lng->txt("wiki_new"));
602  $this->form_gui->addCommandButton("save", $lng->txt("wiki_add"));
603  $this->form_gui->addCommandButton("cancel", $lng->txt("cancel"));
604  }
605 
606  // set values
607  if ($a_mode == "create")
608  {
609  $ilCtrl->setParameter($this, "new_type", "wiki");
610  }
611 
612  $this->form_gui->setFormAction($ilCtrl->getFormAction($this, "saveSettings"));
613  }
614 
615  function getSettingsFormValues($a_mode = "edit")
616  {
617  global $lng, $ilUser;
618 
619  // set values
620  if ($a_mode == "create")
621  {
622  $values["startpage"] = $lng->txt("wiki_main_page");
623  $this->form_gui->setValuesByArray($values);
624  }
625  else
626  {
627  $values["online"] = $this->object->getOnline();
628  $values["title"] = $this->object->getTitle();
629  $values["startpage"] = $this->object->getStartPage();
630  $values["shorttitle"] = $this->object->getShortTitle();
631  $values["description"] = $this->object->getDescription();
632  $values["rating"] = $this->object->getRating();
633  $values["public_notes"] = $this->object->getPublicNotes();
634  $values["intro"] = $this->object->getIntroduction();
635 // $values["imp_pages"] = $this->object->getImportantPages();
636  $values["page_toc"] = $this->object->getPageToc();
637 
638  $this->form_gui->setValuesByArray($values);
639  }
640  }
641 
642 
647  {
648  global $ilCtrl, $lng, $ilUser, $ilSetting;
649 
650  $this->checkPermission("write");
651 
652  $this->initSettingsForm();
653 
654  if ($this->form_gui->checkInput())
655  {
656  if (!ilObjWiki::checkShortTitleAvailability($this->form_gui->getInput("shorttitle")) &&
657  $this->form_gui->getInput("shorttitle") != $this->object->getShortTitle())
658  {
659  $short_item = $this->form_gui->getItemByPostVar("shorttitle");
660  $short_item->setAlert($lng->txt("wiki_short_title_already_in_use"));
661  }
662  else
663  {
664  $this->object->setTitle($this->form_gui->getInput("title"));
665  $this->object->setDescription($this->form_gui->getInput("description"));
666  $this->object->setOnline($this->form_gui->getInput("online"));
667  $this->object->setStartPage($this->form_gui->getInput("startpage"));
668  $this->object->setShortTitle($this->form_gui->getInput("shorttitle"));
669  $this->object->setRating($this->form_gui->getInput("rating"));
670  if (!$ilSetting->get("disable_comments"))
671  {
672  $this->object->setPublicNotes($this->form_gui->getInput("public_notes"));
673  }
674  $this->object->setIntroduction($this->form_gui->getInput("intro"));
675 // $this->object->setImportantPages($this->form_gui->getInput("imp_pages"));
676  $this->object->setPageToc($this->form_gui->getInput("page_toc"));
677  $this->object->update();
678 
679  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"),true);
680  $ilCtrl->redirect($this, "editSettings");
681  }
682  }
683 
684  $this->form_gui->setValuesByPost();
685  $this->tpl->setContent($this->form_gui->getHTML());
686  }
687 
692  {
693  global $tpl, $ilTabs;
694 
695  $this->checkPermission("write");
696  $ilTabs->activateTab("wiki_contributors");
697 
698  include_once("./Modules/Wiki/classes/class.ilWikiContributorsTableGUI.php");
699 
700  $table_gui = new ilWikiContributorsTableGUI($this, "listContributors",
701  $this->object->getId());
702 
703  $tpl->setContent($table_gui->getHTML());
704 
705  $this->setSideBlock();
706  }
707 
711  function saveGradingObject()
712  {
713  global $ilCtrl, $lng;
714 
715  $this->checkPermission("write");
716 
717  $users = (is_array($_POST["sel_user_id"]))
718  ? $_POST["sel_user_id"]
719  : (is_array($_POST["user_id"])
720  ? $_POST["user_id"]
721  : array());
722 
723  include_once("./Modules/Wiki/classes/class.ilWikiContributor.php");
724  include_once("./Services/Tracking/classes/class.ilLPMarks.php");
725  $saved = false;
726  foreach($users as $user_id)
727  {
728  if ($user_id != "")
729  {
730  ilWikiContributor::_writeStatus($this->object->getId(), $user_id,
731  ilUtil::stripSlashes($_POST["status"][$user_id]));
732  $marks_obj = new ilLPMarks($this->object->getId(),$user_id);
733  $marks_obj->setMark(ilUtil::stripSlashes($_POST['mark'][$user_id]));
734  $marks_obj->setComment(ilUtil::stripSlashes($_POST['lcomment'][$user_id]));
735  $marks_obj->update();
736  $saved = true;
737  }
738  }
739  if ($saved)
740  {
741  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
742  }
743 
744  $ilCtrl->redirect($this, "listContributors");
745  }
746 
747  // add wiki to locator
748  function addLocatorItems()
749  {
750  global $ilLocator;
751 
752  if (is_object($this->object))
753  {
754  $ilLocator->addItem($this->object->getTitle(),
755  $this->getGotoLink($this->object->getRefId()), "", $_GET["ref_id"]);
756  }
757  }
758 
759  function _goto($a_target)
760  {
761  global $ilAccess, $ilErr, $lng, $ilNavigationHistory;
762 
763  $i = strpos($a_target, "_");
764  if ($i > 0)
765  {
766  $a_page = substr($a_target, $i+1);
767  $a_target = substr($a_target, 0, $i);
768  }
769 
770  if ($ilAccess->checkAccess("read", "", $a_target))
771  {
772  $_GET["cmd"] = "viewPage";
773  $_GET["ref_id"] = $a_target;
774  $_GET["page"] = $a_page;
775  $_GET["baseClass"] = "ilwikihandlergui";
776  $_GET["cmdClass"] = "ilobjwikigui";
777 /* if ($a_page != "")
778  {
779  $add = "&amp;page=".rawurlencode($_GET["page"]);
780  $ilNavigationHistory->addItem($_GET["ref_id"],
781  "./goto.php?target=wiki_".$_GET["ref_id"].$add, "wiki");
782  }*/
783  include("ilias.php");
784  exit;
785  }
786  else if ($ilAccess->checkAccess("visible", "", $a_target))
787  {
788  $_GET["cmd"] = "infoScreen";
789  $_GET["ref_id"] = $tarr[0];
790  include("repository.php");
791  exit;
792  }
793  else if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID))
794  {
795  $_GET["cmd"] = "frameset";
796  $_GET["target"] = "";
797  $_GET["ref_id"] = ROOT_FOLDER_ID;
798  ilUtil::sendFailure(sprintf($lng->txt("msg_no_perm_read_item"),
800  include("repository.php");
801  exit;
802  }
803 
804  $ilErr->raiseError($lng->txt("msg_no_perm_read"), $ilErr->FATAL);
805  }
806 
810  static function getGotoLink($a_ref_id, $a_page = "")
811  {
812  if ($a_page == "")
813  {
815  }
816 
817  $goto = "goto.php?target=wiki_".$a_ref_id."_".
818  ilWikiUtil::makeUrlTitle($a_page);
819 
820  return $goto;
821  }
822 
826  function viewPageObject()
827  {
828  global $lng, $ilCtrl, $tpl, $ilTabs, $ilAccess;
829 
830  $this->checkPermission("read");
831 
832  $ilTabs->clearTargets();
833  $tpl->setHeaderActionMenu(null);
834 
835  $page = ($_GET["page"] != "")
836  ? $_GET["page"]
837  : $this->object->getStartPage();
838  $_GET["page"] = $page;
839 
840  include_once("./Modules/Wiki/classes/class.ilWikiPage.php");
841  if (!ilWikiPage::exists($this->object->getId(), $page))
842  {
843  $page = $this->object->getStartPage();
844  }
845 
846  if (!ilWikiPage::exists($this->object->getId(), $page))
847  {
848  ilUtil::sendInfo($lng->txt("wiki_no_start_page"), true);
849  $ilCtrl->redirect($this, "infoScreen");
850  return;
851  }
852 
853  // page exists, show it !
854  $ilCtrl->setParameter($this, "page", ilWikiUtil::makeUrlTitle($page));
855 
856  include_once("./Modules/Wiki/classes/class.ilWikiPageGUI.php");
857  $wpage_gui = ilWikiPageGUI::getGUIForTitle($this->object->getId(),
858  ilWikiUtil::makeDbTitle($page), 0, $this->object->getRefId());
859  include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
860  $wpage_gui->setStyleId(ilObjStyleSheet::getEffectiveContentStyleId(
861  $this->object->getStyleSheetId(), "wiki"));
862 
863  $this->setContentStyleSheet();
864  //$wpage_gui->setOutputMode(IL_PAGE_PREVIEW);
865 
866  //$wpage_gui->setSideBlock();
867  $ilCtrl->setCmdClass("ilwikipagegui");
868  $ilCtrl->setCmd("preview");
869  if (!$ilAccess->checkAccess("write", "", $this->object->getRefId()) &&
870  (!$ilAccess->checkAccess("edit_content", "", $this->object->getRefId()) ||
871  $wpage_gui->getPageObject()->getBlocked()
872  ))
873  {
874  $wpage_gui->setEnableEditing(false);
875  }
876 
877  // alter title and description
878  //$tpl->setTitle($wpage_gui->getPageObject()->getTitle());
879  //$tpl->setDescription($this->object->getTitle());
880 
881 
882  $html = $ilCtrl->forwardCommand($wpage_gui);
883  //$this->addPageTabs();
884 
885  $tpl->setContent($html);
886  }
887 
891  function allPagesObject()
892  {
893  global $tpl;
894 
895  $this->checkPermission("read");
896 
897  include_once("./Modules/Wiki/classes/class.ilWikiPagesTableGUI.php");
898 
899  $this->addPagesSubTabs();
900 
901  $table_gui = new ilWikiPagesTableGUI($this, "allPages",
902  $this->object->getId(), IL_WIKI_ALL_PAGES);
903 
904  $this->setSideBlock();
905  $tpl->setContent($table_gui->getHTML());
906  }
907 
912  {
913  global $tpl;
914 
915  $this->checkPermission("read");
916 
917  include_once("./Modules/Wiki/classes/class.ilWikiPagesTableGUI.php");
918 
919  $this->addPagesSubTabs();
920 
921  $table_gui = new ilWikiPagesTableGUI($this, "popularPages",
922  $this->object->getId(), IL_WIKI_POPULAR_PAGES);
923 
924  $this->setSideBlock();
925  $tpl->setContent($table_gui->getHTML());
926  }
927 
932  {
933  global $tpl;
934 
935  $this->checkPermission("read");
936 
937  include_once("./Modules/Wiki/classes/class.ilWikiPagesTableGUI.php");
938 
939  $this->addPagesSubTabs();
940 
941  $table_gui = new ilWikiPagesTableGUI($this, "orphanedPages",
942  $this->object->getId(), IL_WIKI_ORPHANED_PAGES);
943 
944  $this->setSideBlock();
945  $tpl->setContent($table_gui->getHTML());
946  }
947 
953  function gotoPageObject($a_page = "")
954  {
955  global $ilCtrl;
956 
957  if ($a_page == "")
958  {
959  $a_page = $_GET["page"];
960  }
961 
962  include_once("./Modules/Wiki/classes/class.ilWikiPage.php");
963  if (ilWikiPage::_wikiPageExists($this->object->getId(),
964  ilWikiUtil::makeDbTitle($a_page)))
965  {
966  // to do: get rid of this redirect
967  ilUtil::redirect(ilObjWikiGUI::getGotoLink($this->object->getRefId(), $a_page));
968  }
969  else
970  {
971  // create the page
972  $page = new ilWikiPage();
973  $page->setWikiId($this->object->getId());
974  $page->setTitle(ilWikiUtil::makeDbTitle($_GET["page"]));
975  $page->create();
976 
977  // redirect to newly created page
978  $ilCtrl->setParameterByClass("ilwikipagegui", "page", ilWikiUtil::makeUrlTitle(($a_page)));
979  $ilCtrl->redirectByClass("ilwikipagegui", "edit");
980  }
981  }
982 
988  function randomPageObject()
989  {
990  $this->checkPermission("read");
991 
992  include_once("./Modules/Wiki/classes/class.ilWikiPage.php");
993  $page = ilWikiPage::getRandomPage($this->object->getId());
994  $this->gotoPageObject($page);
995  }
996 
1001  {
1002  global $tpl;
1003 
1004  $this->checkPermission("read");
1005 
1006  include_once("./Modules/Wiki/classes/class.ilWikiRecentChangesTableGUI.php");
1007 
1008  $this->addPagesSubTabs();
1009 
1010  $table_gui = new ilWikiRecentChangesTableGUI($this, "recentChanges",
1011  $this->object->getId());
1012 
1013  $this->setSideBlock();
1014  $tpl->setContent($table_gui->getHTML());
1015  }
1016 
1020  function setSideBlock($a_wpg_id = 0)
1021  {
1022  ilObjWikiGUI::renderSideBlock($a_wpg_id, $this->object->getRefId());
1023  }
1024 
1025 
1029  static function renderSideBlock($a_wpg_id, $a_wiki_ref_id, $a_wp = null)
1030  {
1031  global $tpl;
1032 
1033  if ($a_wpg_id > 0 && !$a_wp)
1034  {
1035  include_once("./Modules/Wiki/classes/class.ilWikiPage.php");
1036  $a_wp = ilWikiPage($a_wpg_id);
1037  }
1038 
1039  // search block
1040  include_once("./Modules/Wiki/classes/class.ilWikiSearchBlockGUI.php");
1041  $wiki_search_block = new ilWikiSearchBlockGUI();
1042  $rcontent = $wiki_search_block->getHTML();
1043 
1044  // quick navigation
1045  if ($a_wpg_id > 0)
1046  {
1047 // include_once("./Modules/Wiki/classes/class.ilWikiSideBlockGUI.php");
1048 // $wiki_side_block = new ilWikiSideBlockGUI();
1049 // $wiki_side_block->setPageObject($a_wp);
1050 // $rcontent.= $wiki_side_block->getHTML();
1051  }
1052 
1053  // important pages
1054 // if (ilObjWiki::_lookupImportantPages(ilObject::_lookupObjId($a_wiki_ref_id)))
1055 // {
1056  include_once("./Modules/Wiki/classes/class.ilWikiImportantPagesBlockGUI.php");
1057  $imp_pages_block = new ilWikiImportantPagesBlockGUI();
1058  $rcontent.= $imp_pages_block->getHTML();
1059 // }
1060 
1061  // wiki functions block
1062  if ($a_wpg_id > 0)
1063  {
1064  include_once("./Modules/Wiki/classes/class.ilWikiFunctionsBlockGUI.php");
1065  $wiki_functions_block = new ilWikiFunctionsBlockGUI();
1066  $wiki_functions_block->setPageObject($a_wp);
1067  $rcontent.= $wiki_functions_block->getHTML();
1068  }
1069 
1070  $tpl->setRightContent($rcontent);
1071  }
1072 
1076  function newPagesObject()
1077  {
1078  global $tpl;
1079 
1080  $this->checkPermission("read");
1081 
1082  include_once("./Modules/Wiki/classes/class.ilWikiPagesTableGUI.php");
1083 
1084  $this->addPagesSubTabs();
1085 
1086  $table_gui = new ilWikiPagesTableGUI($this, "newPages",
1087  $this->object->getId(), IL_WIKI_NEW_PAGES);
1088 
1089  $this->setSideBlock();
1090  $tpl->setContent($table_gui->getHTML());
1091  }
1092 
1093 
1097  function printViewObject()
1098  {
1099  $this->checkPermission("read");
1100 
1101  switch ($_POST["sel_type"])
1102  {
1103  case "wiki":
1104  include_once("./Modules/Wiki/classes/class.ilWikiPage.php");
1105  $pages = ilWikiPage::getAllPages($this->object->getId());
1106  foreach ($pages as $p)
1107  {
1108  $pg_ids[] = $p["id"];
1109  }
1110  break;
1111 
1112  case "selection":
1113  if (is_array($_POST["obj_id"]))
1114  {
1115  $pg_ids = $_POST["obj_id"];
1116  }
1117  else
1118  {
1119  $pg_ids[] = $_GET["wpg_id"];
1120  }
1121  break;
1122 
1123  default:
1124  $pg_ids[] = $_GET["wpg_id"];
1125  break;
1126  }
1127 
1128  include_once("./Modules/Wiki/classes/class.ilWikiPageGUI.php");
1129 
1130  // #8850: ilUtil::insertLatexImages() will add jsMath if needed to the GLOBAL tpl
1131  global $tpl;
1132 
1133  $tpl = new ilTemplate("tpl.main.html", true, true);
1134  $tpl->setVariable("LOCATION_STYLESHEET", ilObjStyleSheet::getContentPrintStyle());
1135  $this->setContentStyleSheet($tpl);
1136 
1137  // syntax style
1138  $tpl->setCurrentBlock("SyntaxStyle");
1139  $tpl->setVariable("LOCATION_SYNTAX_STYLESHEET",
1141  $tpl->parseCurrentBlock();
1142 
1143 
1144  // determine target frames for internal links
1145 
1146  foreach ($pg_ids as $p_id)
1147  {
1148  $page_gui = new ilWikiPageGUI($p_id);
1149  $page_gui->setOutputMode("print");
1150  $page_content.= $page_gui->showPage();
1151  }
1152  $tpl->setVariable("CONTENT", '<div class="ilInvisibleBorder">'.$page_content.'</div>'.
1153  '<script type="text/javascript" language="javascript1.2">
1154  <!--
1155  // Do print the page
1156  if (typeof(window.print) != \'undefined\')
1157  {
1158  window.print();
1159  }
1160  //-->
1161  </script>');
1162  $tpl->show(false);
1163  exit;
1164  }
1165 
1170  {
1171  global $tpl, $ilTabs, $ilCtrl, $lng;
1172 
1173  $this->checkPermission("read");
1174 
1175  include_once("./Modules/Wiki/classes/class.ilWikiSearchResultsTableGUI.php");
1176 
1177  $ilTabs->setTabActive("wiki_search_results");
1178 
1179  if (trim($_POST["search_term"]) == "")
1180  {
1181  ilUtil::sendFailure($lng->txt("wiki_please_enter_search_term"), true);
1182  $ilCtrl->redirectByClass("ilwikipagegui", "preview");
1183  }
1184 
1185  $search_results = ilObjWiki::_performSearch($this->object->getId(),
1186  ilUtil::stripSlashes($_POST["search_term"]));
1187  $table_gui = new ilWikiSearchResultsTableGUI($this, "performSearch",
1188  $this->object->getId(), $search_results);
1189 
1190  $this->setSideBlock();
1191  $tpl->setContent($table_gui->getHTML());
1192  }
1193 
1197  function setContentStyleSheet($a_tpl = null)
1198  {
1199  global $tpl;
1200 
1201  if ($a_tpl != null)
1202  {
1203  $ctpl = $a_tpl;
1204  }
1205  else
1206  {
1207  $ctpl = $tpl;
1208  }
1209 
1210  $ctpl->setCurrentBlock("ContentStyle");
1211  $ctpl->setVariable("LOCATION_CONTENT_STYLESHEET",
1212  ilObjStyleSheet::getContentStylePath($this->object->getStyleSheetId()));
1213  $ctpl->parseCurrentBlock();
1214 
1215  }
1216 
1217 
1222  {
1223  global $ilTabs, $tpl;
1224 
1225  $this->checkPermission("write");
1226 
1227  $this->initStylePropertiesForm();
1228  $tpl->setContent($this->form->getHTML());
1229 
1230  $ilTabs->activateTab("settings");
1231  $this->setSettingsSubTabs("style");
1232 
1233  $this->setSideBlock();
1234  }
1235 
1240  {
1241  global $ilCtrl, $lng, $ilTabs, $ilSetting;
1242 
1243  include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
1244  $lng->loadLanguageModule("style");
1245 
1246  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
1247  $this->form = new ilPropertyFormGUI();
1248 
1249  $fixed_style = $ilSetting->get("fixed_content_style_id");
1250  $style_id = $this->object->getStyleSheetId();
1251 
1252  if ($fixed_style > 0)
1253  {
1254  $st = new ilNonEditableValueGUI($lng->txt("style_current_style"));
1255  $st->setValue(ilObject::_lookupTitle($fixed_style)." (".
1256  $this->lng->txt("global_fixed").")");
1257  $this->form->addItem($st);
1258  }
1259  else
1260  {
1261  $st_styles = ilObjStyleSheet::_getStandardStyles(true, false,
1262  $_GET["ref_id"]);
1263 
1264  $st_styles[0] = $this->lng->txt("default");
1265  ksort($st_styles);
1266 
1267  if ($style_id > 0)
1268  {
1269  // individual style
1270  if (!ilObjStyleSheet::_lookupStandard($style_id))
1271  {
1272  $st = new ilNonEditableValueGUI($lng->txt("style_current_style"));
1273  $st->setValue(ilObject::_lookupTitle($style_id));
1274  $this->form->addItem($st);
1275 
1276 //$this->ctrl->getLinkTargetByClass("ilObjStyleSheetGUI", "edit"));
1277 
1278  // delete command
1279  $this->form->addCommandButton("editStyle",
1280  $lng->txt("style_edit_style"));
1281  $this->form->addCommandButton("deleteStyle",
1282  $lng->txt("style_delete_style"));
1283 //$this->ctrl->getLinkTargetByClass("ilObjStyleSheetGUI", "delete"));
1284  }
1285  }
1286 
1287  if ($style_id <= 0 || ilObjStyleSheet::_lookupStandard($style_id))
1288  {
1289  $style_sel = ilUtil::formSelect ($style_id, "style_id",
1290  $st_styles, false, true);
1291  $style_sel = new ilSelectInputGUI($lng->txt("style_current_style"), "style_id");
1292  $style_sel->setOptions($st_styles);
1293  $style_sel->setValue($style_id);
1294  $this->form->addItem($style_sel);
1295 //$this->ctrl->getLinkTargetByClass("ilObjStyleSheetGUI", "create"));
1296  $this->form->addCommandButton("saveStyleSettings",
1297  $lng->txt("save"));
1298  $this->form->addCommandButton("createStyle",
1299  $lng->txt("sty_create_ind_style"));
1300  }
1301  }
1302  $this->form->setTitle($lng->txt("wiki_style"));
1303  $this->form->setFormAction($ilCtrl->getFormAction($this));
1304  }
1305 
1310  {
1311  global $ilCtrl;
1312 
1313  $ilCtrl->redirectByClass("ilobjstylesheetgui", "create");
1314  }
1315 
1319  function editStyleObject()
1320  {
1321  global $ilCtrl;
1322 
1323  $ilCtrl->redirectByClass("ilobjstylesheetgui", "edit");
1324  }
1325 
1330  {
1331  global $ilCtrl;
1332 
1333  $ilCtrl->redirectByClass("ilobjstylesheetgui", "delete");
1334  }
1335 
1340  {
1341  global $ilSetting;
1342 
1343  include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
1344  if ($ilSetting->get("fixed_content_style_id") <= 0 &&
1345  (ilObjStyleSheet::_lookupStandard($this->object->getStyleSheetId())
1346  || $this->object->getStyleSheetId() == 0))
1347  {
1348  $this->object->setStyleSheetId(ilUtil::stripSlashes($_POST["style_id"]));
1349  $this->object->update();
1350  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
1351  }
1352  $this->ctrl->redirect($this, "editStyleProperties");
1353  }
1354 
1355  //
1356  // Important pages
1357  //
1358 
1363  {
1364  global $tpl, $ilToolbar, $ilTabs, $lng, $ilCtrl;
1365 
1366  $this->checkPermission("write");
1367 
1368  ilUtil::sendInfo($lng->txt("wiki_navigation_info"));
1369 
1370  $ipages = ilObjWiki::_lookupImportantPagesList($this->object->getId());
1371  $ipages_ids = array();
1372  foreach ($ipages as $i)
1373  {
1374  $ipages_ids[] = $i["page_id"];
1375  }
1376 
1377  // list pages
1378  include_once("./Modules/Wiki/classes/class.ilWikiPage.php");
1379  $pages = ilWikiPage::getAllPages($this->object->getId());
1380  $options = array("" => $lng->txt("please_select"));
1381  foreach ($pages as $p)
1382  {
1383  if (!in_array($p["id"], $ipages_ids))
1384  {
1385  $options[$p["id"]] = ilUtil::shortenText($p["title"], 60, true);
1386  }
1387  }
1388  if (count($options) > 0)
1389  {
1390  include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
1391  $si = new ilSelectInputGUI($lng->txt("wiki_pages"), "imp_page_id");
1392  $si->setOptions($options);
1393  $si->setInfo($lng->txt(""));
1394  $ilToolbar->addInputItem($si);
1395  $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
1396  $ilToolbar->addFormButton($lng->txt("add"), "addImportantPage");
1397  }
1398 
1399 
1400  $ilTabs->activateTab("settings");
1401  $this->setSettingsSubTabs("imp_pages");
1402 
1403  include_once("./Modules/Wiki/classes/class.ilImportantPagesTableGUI.php");
1404  $imp_table = new ilImportantPagesTableGUI($this, "editImportantPages");
1405 
1406  $tpl->setContent($imp_table->getHTML());
1407  }
1408 
1416  {
1417  global $ilCtrl, $lng;
1418 
1419  $this->checkPermission("write");
1420 
1421  if ($_POST["imp_page_id"] > 0)
1422  {
1423  $this->object->addImportantPage((int) $_POST["imp_page_id"]);
1424  ilUtil::sendSuccess($lng->txt("wiki_imp_page_added"), true);
1425  }
1426  $ilCtrl->redirect($this, "editImportantPages");
1427  }
1428 
1433  {
1434  global $ilCtrl, $tpl, $lng;
1435 
1436  if (!is_array($_POST["imp_page_id"]) || count($_POST["imp_page_id"]) == 0)
1437  {
1438  ilUtil::sendInfo($lng->txt("no_checkbox"), true);
1439  $ilCtrl->redirect($this, "editImportantPages");
1440  }
1441  else
1442  {
1443  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
1444  $cgui = new ilConfirmationGUI();
1445  $cgui->setFormAction($ilCtrl->getFormAction($this));
1446  $cgui->setHeaderText($lng->txt("wiki_sure_remove_imp_pages"));
1447  $cgui->setCancel($lng->txt("cancel"), "editImportantPages");
1448  $cgui->setConfirm($lng->txt("remove"), "removeImportantPages");
1449 
1450  foreach ($_POST["imp_page_id"] as $i)
1451  {
1452  $cgui->addItem("imp_page_id[]", $i, ilWikiPage::lookupTitle((int) $i));
1453  }
1454 
1455  $tpl->setContent($cgui->getHTML());
1456  }
1457  }
1458 
1466  {
1467  global $ilCtrl, $lng;
1468 
1469  $this->checkPermission("write");
1470 
1471  if (is_array($_POST["imp_page_id"]))
1472  {
1473  foreach ($_POST["imp_page_id"] as $i)
1474  {
1475  $this->object->removeImportantPage((int) $i);
1476  }
1477  }
1478  ilUtil::sendSuccess($lng->txt("wiki_removed_imp_pages"), true);
1479  $ilCtrl->redirect($this, "editImportantPages");
1480  }
1481 
1489  {
1490  global $ilCtrl, $lng;
1491 
1492  $this->checkPermission("write");
1493 
1494  $this->object->saveOrderingAndIndentation($_POST["ord"], $_POST["indent"]);
1495  ilUtil::sendSuccess($lng->txt("wiki_ordering_and_indent_saved"), true);
1496  $ilCtrl->redirect($this, "editImportantPages");
1497  }
1498 
1502  function exportHTML()
1503  {
1504  require_once("./Modules/Wiki/classes/class.ilWikiHTMLExport.php");
1505  $cont_exp = new ilWikiHTMLExport($this);
1506  $cont_exp->buildExportFile();
1507  }
1508 
1516  static function lookupSubObjectTitle($a_wiki_id, $a_page_id)
1517  {
1518  include_once "Modules/Wiki/classes/class.ilWikiPage.php";
1519  $page = new ilWikiPage($a_page_id);
1520  if($page->getWikiId() == $a_wiki_id)
1521  {
1522  return $page->getTitle();
1523  }
1524  }
1525 
1526 }
1527 ?>