ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilObjWiki.php
Go to the documentation of this file.
1 <?php
2 
3 /* Copyright (c) 1998-2011 ILIAS open source, Extended GPL, see docs/LICENSE */
4 
8 include_once "./Services/Object/classes/class.ilObject.php";
9 include_once "./Modules/Wiki/classes/class.ilWikiUtil.php";
10 include_once "./Services/AdvancedMetaData/interfaces/interface.ilAdvancedMetaDataSubItems.php";
11 
21 {
22  protected $online = false;
23  protected $public_notes = true;
24  protected $empty_page_templ = true;
25 
32  function ilObjWiki($a_id = 0,$a_call_by_reference = true)
33  {
34  $this->type = "wiki";
35  $this->ilObject($a_id,$a_call_by_reference);
36  }
37 
43  function setOnline($a_online)
44  {
45  $this->online = $a_online;
46  }
47 
53  function getOnline()
54  {
55  return $this->online;
56  }
57 
63  function setRatingOverall($a_rating)
64  {
65  $this->rating_overall = (bool)$a_rating;
66  }
67 
73  function getRatingOverall()
74  {
75  return $this->rating_overall;
76  }
77 
83  function setRating($a_rating)
84  {
85  $this->rating = (bool)$a_rating;
86  }
87 
93  function getRating()
94  {
95  return $this->rating;
96  }
97 
103  function setRatingAsBlock($a_rating)
104  {
105  $this->rating_block = (bool)$a_rating;
106  }
107 
113  function getRatingAsBlock()
114  {
115  return $this->rating_block;
116  }
117 
123  function setRatingForNewPages($a_rating)
124  {
125  $this->rating_new_pages = (bool)$a_rating;
126  }
127 
134  {
135  return $this->rating_new_pages;
136  }
137 
143  function setRatingCategories($a_rating)
144  {
145  $this->rating_categories = (bool)$a_rating;
146  }
147 
154  {
155  return $this->rating_categories;
156  }
157 
161  public function setPublicNotes($a_val)
162  {
163  $this->public_notes = $a_val;
164  }
165 
169  public function getPublicNotes()
170  {
171  return $this->public_notes;
172  }
173 
179  public function setImportantPages($a_val)
180  {
181  $this->imp_pages = $a_val;
182  }
183 
189  public function getImportantPages()
190  {
191  return $this->imp_pages;
192  }
193 
199  function setStartPage($a_startpage)
200  {
201  $this->startpage = ilWikiUtil::makeDbTitle($a_startpage);
202  }
203 
209  function getStartPage()
210  {
211  return $this->startpage;
212  }
213 
219  function setShortTitle($a_shorttitle)
220  {
221  $this->shorttitle = $a_shorttitle;
222  }
223 
229  function getShortTitle()
230  {
231  return $this->shorttitle;
232  }
233 
239  function setIntroduction($a_introduction)
240  {
241  $this->introduction = $a_introduction;
242  }
243 
249  function getIntroduction()
250  {
251  return $this->introduction;
252  }
253 
257  function getStyleSheetId()
258  {
259  return $this->style_id;
260  }
261 
265  function setStyleSheetId($a_style_id)
266  {
267  $this->style_id = $a_style_id;
268  }
269 
275  public function setPageToc($a_val)
276  {
277  $this->page_toc = $a_val;
278  }
279 
285  public function getPageToc()
286  {
287  return $this->page_toc;
288  }
289 
295  function setEmptyPageTemplate($a_val)
296  {
297  $this->empty_page_templ = $a_val;
298  }
299 
306  {
308  }
309 
315  static function isOnlineHelpWiki($a_ref_id)
316  {
317  if ($a_ref_id > 0 && $a_ref_id == OH_REF_ID)
318  {
319 // return true;
320  }
321  return false;
322  }
323 
327  function create($a_prevent_start_page_creation = false)
328  {
329  global $ilDB;
330 
331  parent::create();
332 
333  $ilDB->insert("il_wiki_data", array(
334  "id" => array("integer", $this->getId()),
335  "is_online" => array("integer", (int) $this->getOnline()),
336  "startpage" => array("text", $this->getStartPage()),
337  "short" => array("text", $this->getShortTitle()),
338  "rating" => array("integer", (int) $this->getRating()),
339  "public_notes" => array("integer", (int) $this->getPublicNotes()),
340  "introduction" => array("clob", $this->getIntroduction()),
341  "empty_page_templ" => array("integer", (int) $this->getEmptyPageTemplate()),
342  ));
343 
344  // create start page
345  if ($this->getStartPage() != "" && !$a_prevent_start_page_creation)
346  {
347  include_once("./Modules/Wiki/classes/class.ilWikiPage.php");
348  $start_page = new ilWikiPage();
349  $start_page->setWikiId($this->getId());
350  $start_page->setTitle($this->getStartPage());
351  $start_page->create();
352  }
353 
354  if (((int) $this->getStyleSheetId()) > 0)
355  {
356  include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
358  }
359  }
360 
367  function update($a_prevent_start_page_creation = false)
368  {
369  global $ilDB;
370 
371  if (!parent::update())
372  {
373  return false;
374  }
375 
376  $ilDB->update("il_wiki_data", array(
377  "is_online" => array("integer", $this->getOnline()),
378  "startpage" => array("text", $this->getStartPage()),
379  "short" => array("text", $this->getShortTitle()),
380  "rating_overall" => array("integer", $this->getRatingOverall()),
381  "rating" => array("integer", $this->getRating()),
382  "rating_side" => array("integer", (bool)$this->getRatingAsBlock()), // #13455
383  "rating_new" => array("integer", $this->getRatingForNewPages()),
384  "rating_ext" => array("integer", $this->getRatingCategories()),
385  "public_notes" => array("integer", $this->getPublicNotes()),
386  "introduction" => array("clob", $this->getIntroduction()),
387  "imp_pages" => array("integer", $this->getImportantPages()),
388  "page_toc" => array("integer", $this->getPageToc()),
389  "empty_page_templ" => array("integer", $this->getEmptyPageTemplate())
390  ), array(
391  "id" => array("integer", $this->getId())
392  ));
393 
394  // check whether start page exists
395  include_once("./Modules/Wiki/classes/class.ilWikiPage.php");
396  if (!ilWikiPage::exists($this->getId(), $this->getStartPage())
397  && !$a_prevent_start_page_creation)
398  {
399  $start_page = new ilWikiPage();
400  $start_page->setWikiId($this->getId());
401  $start_page->setTitle($this->getStartPage());
402  $start_page->create();
403  }
404 
405  include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
407 
408  return true;
409  }
410 
414  function read()
415  {
416  global $ilDB;
417 
418  parent::read();
419 
420  $query = "SELECT * FROM il_wiki_data WHERE id = ".
421  $ilDB->quote($this->getId(), "integer");
422  $set = $ilDB->query($query);
423  $rec = $ilDB->fetchAssoc($set);
424 
425  $this->setOnline($rec["is_online"]);
426  $this->setStartPage($rec["startpage"]);
427  $this->setShortTitle($rec["short"]);
428  $this->setRatingOverall($rec["rating_overall"]);
429  $this->setRating($rec["rating"]);
430  $this->setRatingAsBlock($rec["rating_side"]);
431  $this->setRatingForNewPages($rec["rating_new"]);
432  $this->setRatingCategories($rec["rating_ext"]);
433  $this->setPublicNotes($rec["public_notes"]);
434  $this->setIntroduction($rec["introduction"]);
435  $this->setImportantPages($rec["imp_pages"]);
436  $this->setPageToc($rec["page_toc"]);
437  $this->setEmptyPageTemplate($rec["empty_page_templ"]);
438 
439  include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
441 
442  }
443 
444 
451  function delete()
452  {
453  global $ilDB;
454 
455  // always call parent delete function first!!
456  if (!parent::delete())
457  {
458  return false;
459  }
460 
461  // delete record of table il_wiki_data
462  $query = "DELETE FROM il_wiki_data".
463  " WHERE id = ".$ilDB->quote($this->getId(), "integer");
464  $ilDB->manipulate($query);
465 
466  // remove all notifications
467  include_once "./Services/Notification/classes/class.ilNotification.php";
469 
470  include_once("./Modules/Wiki/classes/class.ilWikiPage.php");
472 
473  return true;
474  }
475 
479  static function checkShortTitleAvailability($a_short_title)
480  {
481  global $ilDB;
482 
483  $res = $ilDB->queryF("SELECT id FROM il_wiki_data WHERE short = %s",
484  array("text"), array($a_short_title));
485  if ($ilDB->fetchAssoc($res))
486  {
487  return false;
488  }
489 
490  return true;
491  }
492 
493 
507  function notify($a_event,$a_ref_id,$a_parent_non_rbac_id,$a_node_id,$a_params = 0)
508  {
509  global $tree;
510 
511  switch ($a_event)
512  {
513  case "link":
514 
515  //var_dump("<pre>",$a_params,"</pre>");
516  //echo "Module name ".$this->getRefId()." triggered by link event. Objects linked into target object ref_id: ".$a_ref_id;
517  //exit;
518  break;
519 
520  case "cut":
521 
522  //echo "Module name ".$this->getRefId()." triggered by cut event. Objects are removed from target object ref_id: ".$a_ref_id;
523  //exit;
524  break;
525 
526  case "copy":
527 
528  //var_dump("<pre>",$a_params,"</pre>");
529  //echo "Module name ".$this->getRefId()." triggered by copy event. Objects are copied into target object ref_id: ".$a_ref_id;
530  //exit;
531  break;
532 
533  case "paste":
534 
535  //echo "Module name ".$this->getRefId()." triggered by paste (cut) event. Objects are pasted into target object ref_id: ".$a_ref_id;
536  //exit;
537  break;
538 
539  case "new":
540 
541  //echo "Module name ".$this->getRefId()." triggered by paste (new) event. Objects are applied to target object ref_id: ".$a_ref_id;
542  //exit;
543  break;
544  }
545 
546  // At the beginning of the recursive process it avoids second call of the notify function with the same parameter
547  if ($a_node_id==$_GET["ref_id"])
548  {
549  $parent_obj =& $this->ilias->obj_factory->getInstanceByRefId($a_node_id);
550  $parent_type = $parent_obj->getType();
551  if($parent_type == $this->getType())
552  {
553  $a_node_id = (int) $tree->getParentId($a_node_id);
554  }
555  }
556 
557  parent::notify($a_event,$a_ref_id,$a_parent_non_rbac_id,$a_node_id,$a_params);
558  }
559 
567  static function _lookupRatingOverall($a_wiki_id)
568  {
569  return ilObjWiki::_lookup($a_wiki_id, "rating_overall");
570  }
571 
579  static function _lookupRating($a_wiki_id)
580  {
581  return ilObjWiki::_lookup($a_wiki_id, "rating");
582  }
583 
591  static function _lookupRatingCategories($a_wiki_id)
592  {
593  return ilObjWiki::_lookup($a_wiki_id, "rating_ext");
594  }
595 
603  static function _lookupRatingAsBlock($a_wiki_id)
604  {
605  return ilObjWiki::_lookup($a_wiki_id, "rating_side");
606  }
607 
615  static function _lookupPublicNotes($a_wiki_id)
616  {
617  return ilObjWiki::_lookup($a_wiki_id, "public_notes");
618  }
619 
628  private static function _lookup($a_wiki_id, $a_field)
629  {
630  global $ilDB;
631 
632  $query = "SELECT $a_field FROM il_wiki_data WHERE id = ".
633  $ilDB->quote($a_wiki_id, "integer");
634  $set = $ilDB->query($query);
635  $rec = $ilDB->fetchAssoc($set);
636  return $rec[$a_field];
637  }
638 
646  static function _lookupStartPage($a_wiki_id)
647  {
648  return ilObjWiki::_lookup($a_wiki_id, "startpage");
649  }
650 
654  static function writeStartPage($a_id, $a_name)
655  {
656  global $ilDB;
657 
658  include_once("./Modules/Wiki/classes/class.ilWikiUtil.php");
659  $ilDB->manipulate("UPDATE il_wiki_data SET ".
660  " startpage = ".$ilDB->quote(ilWikiUtil::makeDbTitle($a_name), "text").
661  " WHERE id = ".$ilDB->quote($a_id, "integer")
662  );
663  }
664 
668  static function _performSearch($a_wiki_id, $a_searchterm)
669  {
670  // query parser
671  include_once 'Services/Search/classes/class.ilQueryParser.php';
672 
673  $query_parser = new ilQueryParser($a_searchterm);
674  $query_parser->setCombination("or");
675  $query_parser->parse();
676 
677  include_once 'Services/Search/classes/class.ilSearchResult.php';
678  $search_result = new ilSearchResult();
679  if($query_parser->validate())
680  {
681 
682  include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
683  $wiki_search =& ilObjectSearchFactory::_getWikiContentSearchInstance($query_parser);
684  $wiki_search->setFilter(array('wpg'));
685  $search_result->mergeEntries($wiki_search->performSearch());
686  }
687 
688  $entries = $search_result->getEntries();
689 
690  $found_pages = array();
691  foreach($entries as $entry)
692  {
693  if ($entry["obj_id"] == $a_wiki_id && is_array($entry["child"]))
694  {
695  foreach($entry["child"] as $child)
696  {
697  $found_pages[] = array("page_id" => $child);
698  }
699  }
700  }
701 
702  return $found_pages;
703  }
704 
705  //
706  // Important pages
707  //
708 
716  static function _lookupImportantPages($a_wiki_id)
717  {
718  return ilObjWiki::_lookup($a_wiki_id, "imp_pages");
719  }
720 
727  static function _lookupImportantPagesList($a_wiki_id)
728  {
729  global $ilDB;
730 
731  $set = $ilDB->query("SELECT * FROM il_wiki_imp_pages WHERE ".
732  " wiki_id = ".$ilDB->quote($a_wiki_id, "integer")." ORDER BY ord ASC "
733  );
734 
735  $imp_pages = array();
736 
737  while ($rec = $ilDB->fetchAssoc($set))
738  {
739  $imp_pages[] = $rec;
740  }
741  return $imp_pages;
742  }
743 
750  static function _lookupMaxOrdNrImportantPages($a_wiki_id)
751  {
752  global $ilDB;
753 
754  $set = $ilDB->query("SELECT MAX(ord) as m FROM il_wiki_imp_pages WHERE ".
755  " wiki_id = ".$ilDB->quote($a_wiki_id, "integer")
756  );
757 
758  $rec = $ilDB->fetchAssoc($set);
759  return (int) $rec["m"];
760  }
761 
762 
768  function addImportantPage($a_page_id, $a_nr = 0, $a_indent = 0)
769  {
770  global $ilDB;
771 
772  if (!$this->isImportantPage($a_page_id))
773  {
774  if ($a_nr == 0)
775  {
776  $a_nr = ilObjWiki::_lookupMaxOrdNrImportantPages($this->getId()) + 10;
777  }
778 
779  $ilDB->manipulate("INSERT INTO il_wiki_imp_pages ".
780  "(wiki_id, ord, indent, page_id) VALUES (".
781  $ilDB->quote($this->getId(), "integer").",".
782  $ilDB->quote($a_nr, "integer").",".
783  $ilDB->quote($a_indent, "integer").",".
784  $ilDB->quote($a_page_id, "integer").
785  ")");
786  }
787  }
788 
795  function isImportantPage($a_page_id)
796  {
797  global $ilDB;
798 
799  $set = $ilDB->query("SELECT * FROM il_wiki_imp_pages WHERE ".
800  " wiki_id = ".$ilDB->quote($this->getId(), "integer")." AND ".
801  " page_id = ".$ilDB->quote($a_page_id, "integer")
802  );
803  if ($rec = $ilDB->fetchAssoc($set))
804  {
805  return true;
806  }
807  return false;
808  }
809 
815  function removeImportantPage($a_id)
816  {
817  global $ilDB;
818 
819  $ilDB->manipulate("DELETE FROM il_wiki_imp_pages WHERE "
820  ." wiki_id = ".$ilDB->quote($this->getId(), "integer")
821  ." AND page_id = ".$ilDB->quote($a_id, "integer")
822  );
823 
825  }
826 
833  function saveOrderingAndIndentation($a_ord, $a_indent)
834  {
835  global $ilDB;
836 
837  $ipages = ilObjWiki::_lookupImportantPagesList($this->getId());
838 
839  foreach ($ipages as $k => $v)
840  {
841  if (isset($a_ord[$v["page_id"]]))
842  {
843  $ipages[$k]["ord"] = (int) $a_ord[$v["page_id"]];
844  }
845  if (isset($a_indent[$v["page_id"]]))
846  {
847  $ipages[$k]["indent"] = (int) $a_indent[$v["page_id"]];
848  }
849  }
850  $ipages = ilUtil::sortArray($ipages, "ord", "asc", true);
851 
852  // fix indentation: no 2 is allowed after a 0
853  $c_indent = 0;
854  $fixed = false;
855  foreach ($ipages as $k => $v)
856  {
857  if ($ipages[$k]["indent"] == 2 && $c_indent == 0)
858  {
859  $ipages[$k]["indent"] = 1;
860  $fixed = true;
861  }
862  $c_indent = $ipages[$k]["indent"];
863  }
864 
865  $ord = 10;
866  reset($ipages);
867  foreach ($ipages as $k => $v)
868  {
869  $ilDB->manipulate($q = "UPDATE il_wiki_imp_pages SET ".
870  " ord = ".$ilDB->quote($ord, "integer").",".
871  " indent = ".$ilDB->quote($v["indent"], "integer").
872  " WHERE wiki_id = ".$ilDB->quote($v["wiki_id"], "integer").
873  " AND page_id = ".$ilDB->quote($v["page_id"], "integer")
874  );
875  $ord+=10;
876  }
877 
878  return $fixed;
879  }
880 
885  {
886  global $ilDB;
887 
888  $ipages = ilObjWiki::_lookupImportantPagesList($this->getId());
889 
890  // fix indentation: no 2 is allowed after a 0
891  $c_indent = 0;
892  $fixed = false;
893  foreach ($ipages as $k => $v)
894  {
895  if ($ipages[$k]["indent"] == 2 && $c_indent == 0)
896  {
897  $ipages[$k]["indent"] = 1;
898  $fixed = true;
899  }
900  $c_indent = $ipages[$k]["indent"];
901  }
902 
903  $ord = 10;
904  foreach ($ipages as $k => $v)
905  {
906  $ilDB->manipulate($q = "UPDATE il_wiki_imp_pages SET ".
907  " ord = ".$ilDB->quote($ord, "integer").
908  ", indent = ".$ilDB->quote($v["indent"], "integer").
909  " WHERE wiki_id = ".$ilDB->quote($v["wiki_id"], "integer").
910  " AND page_id = ".$ilDB->quote($v["page_id"], "integer")
911  );
912  $ord+=10;
913  }
914 
915  }
916 
917  //
918  // Page TOC
919  //
920 
928  static function _lookupPageToc($a_wiki_id)
929  {
930  return ilObjWiki::_lookup($a_wiki_id, "page_toc");
931  }
932 
939  public function cloneObject($a_target_id,$a_copy_id = 0)
940  {
941  global $ilDB, $ilUser, $ilias;
942 
943  $new_obj = parent::cloneObject($a_target_id,$a_copy_id);
944 
945  //copy online status if object is not the root copy object
946  $cp_options = ilCopyWizardOptions::_getInstance($a_copy_id);
947 
948  if(!$cp_options->isRootNode($this->getRefId()))
949  {
950  $new_obj->setOnline($this->getOnline());
951  }
952 
953  $new_obj->setTitle($this->getTitle());
954  $new_obj->setStartPage($this->getStartPage());
955  $new_obj->setShortTitle($this->getShortTitle());
956  $new_obj->setRatingOverall($this->getRatingOverall());
957  $new_obj->setRating($this->getRating());
958  $new_obj->setRatingAsBlock($this->getRatingAsBlock());
959  $new_obj->setRatingForNewPages($this->getRatingForNewPages());
960  $new_obj->setRatingCategories($this->getRatingCategories());
961  $new_obj->setPublicNotes($this->getPublicNotes());
962  $new_obj->setIntroduction($this->getIntroduction());
963  $new_obj->setImportantPages($this->getImportantPages());
964  $new_obj->setPageToc($this->getPageToc());
965  $new_obj->update();
966 
967  // set/copy stylesheet
968  include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
969  $style_id = $this->getStyleSheetId();
970  if ($style_id > 0 && !ilObjStyleSheet::_lookupStandard($style_id))
971  {
972  $style_obj = $ilias->obj_factory->getInstanceByObjId($style_id);
973  $new_id = $style_obj->ilClone();
974  $new_obj->setStyleSheetId($new_id);
975  $new_obj->update();
976  }
977 
978  // copy content
979  include_once("./Modules/Wiki/classes/class.ilWikiPage.php");
980  $pages = ilWikiPage::getAllPages($this->getId());
981  if (count($pages) > 0)
982  {
983  // if we have any pages, delete the start page first
984  $pg_id = ilWikiPage::getPageIdForTitle($new_obj->getId(), $new_obj->getStartPage());
985  $start_page = new ilWikiPage($pg_id);
986  $start_page->delete();
987  }
988  $map = array();
989  foreach ($pages as $p)
990  {
991  $page = new ilWikiPage($p["id"]);
992  $new_page = new ilWikiPage();
993  $new_page->setTitle($page->getTitle());
994  $new_page->setWikiId($new_obj->getId());
995  $new_page->setTitle($page->getTitle());
996  $new_page->setBlocked($page->getBlocked());
997  $new_page->setRating($page->getRating());
998  $new_page->hideAdvancedMetadata($page->isAdvancedMetadataHidden());
999  $new_page->create();
1000 
1001  $page->copy($new_page->getId(), "", 0, true);
1002  //$new_page->setXMLContent($page->copyXMLContent(true));
1003  //$new_page->buildDom(true);
1004  //$new_page->update();
1005  $map[$p["id"]] = $new_page->getId();
1006  }
1007 
1008  // copy important pages
1009  foreach (ilObjWiki::_lookupImportantPagesList($this->getId()) as $ip)
1010  {
1011  $new_obj->addImportantPage($map[$ip["page_id"]], $ip["ord"], $ip["indent"]);
1012  }
1013 
1014  // copy rating categories
1015  include_once("./Services/Rating/classes/class.ilRatingCategory.php");
1016  foreach (ilRatingCategory::getAllForObject($this->getId()) as $rc)
1017  {
1018  $new_rc = new ilRatingCategory();
1019  $new_rc->setParentId($new_obj->getId());
1020  $new_rc->setTitle($rc["title"]);
1021  $new_rc->setDescription($rc["description"]);
1022  $new_rc->save();
1023  }
1024 
1025  return $new_obj;
1026  }
1027 
1035  {
1036  $num = (int) $this->getEmptyPageTemplate();
1037  include_once("./Modules/Wiki/classes/class.ilWikiPageTemplate.php");
1038  $wt = new ilWikiPageTemplate($this->getId());
1039  $ts = $wt->getAllInfo(ilWikiPageTemplate::TYPE_NEW_PAGES);
1040  $num += count($ts);
1041  if ($num > 1)
1042  {
1043  return true;
1044  }
1045  return false;
1046  }
1047 
1055  function createWikiPage($a_page_title, $a_template_page = 0)
1056  {
1057  // check if template has to be used
1058  if ($a_template_page == 0)
1059  {
1060  if (!$this->getEmptyPageTemplate())
1061  {
1062  include_once("./Modules/Wiki/classes/class.ilWikiPageTemplate.php");
1063  $wt = new ilWikiPageTemplate($this->getId());
1064  $ts = $wt->getAllInfo(ilWikiPageTemplate::TYPE_NEW_PAGES);
1065  if (count($ts) == 1)
1066  {
1067  $t = current($ts);
1068  $a_template_page = $t["wpage_id"];
1069  }
1070  }
1071  }
1072 
1073  // create the page
1074  $page = new ilWikiPage();
1075  $page->setWikiId($this->getId());
1076  $page->setTitle(ilWikiUtil::makeDbTitle($a_page_title));
1077  if($this->getRating() && $this->getRatingForNewPages())
1078  {
1079  $page->setRating(true);
1080  }
1081 
1082  // needed for notification
1083  $page->setWikiRefId($this->getRefId());
1084  $page->create();
1085 
1086  // copy template into new page
1087  if ($a_template_page > 0)
1088  {
1089  $orig = new ilWikiPage($a_template_page);
1090  $orig->copy($page->getId());
1091 
1092  // #15718
1093  include_once "Services/AdvancedMetaData/classes/class.ilAdvancedMDValues.php";
1095  $this->getId(),
1096  $this->getId(),
1097  "wpg",
1098  $a_template_page,
1099  $page->getId()
1100  );
1101  }
1102 
1103  return $page;
1104  }
1105 
1106  public static function getAdvMDSubItemTitle($a_obj_id, $a_sub_type, $a_sub_id)
1107  {
1108  global $lng;
1109 
1110  if($a_sub_type == "wpg")
1111  {
1112  $lng->loadLanguageModule("wiki");
1113  include_once "./Modules/Wiki/classes/class.ilWikiPage.php";
1114  return $lng->txt("wiki_wpg").' "'.ilWikiPage::lookupTitle($a_sub_id).'"';
1115  }
1116  }
1117 }
1118 ?>