ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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  protected $link_md_values = false;
26 
33  function __construct($a_id = 0,$a_call_by_reference = true)
34  {
35  $this->type = "wiki";
36  parent::__construct($a_id,$a_call_by_reference);
37  }
38 
44  function setOnline($a_online)
45  {
46  $this->online = $a_online;
47  }
48 
54  function getOnline()
55  {
56  return $this->online;
57  }
58 
64  function setRatingOverall($a_rating)
65  {
66  $this->rating_overall = (bool)$a_rating;
67  }
68 
74  function getRatingOverall()
75  {
76  return $this->rating_overall;
77  }
78 
84  function setRating($a_rating)
85  {
86  $this->rating = (bool)$a_rating;
87  }
88 
94  function getRating()
95  {
96  return $this->rating;
97  }
98 
104  function setRatingAsBlock($a_rating)
105  {
106  $this->rating_block = (bool)$a_rating;
107  }
108 
114  function getRatingAsBlock()
115  {
116  return $this->rating_block;
117  }
118 
124  function setRatingForNewPages($a_rating)
125  {
126  $this->rating_new_pages = (bool)$a_rating;
127  }
128 
135  {
136  return $this->rating_new_pages;
137  }
138 
144  function setRatingCategories($a_rating)
145  {
146  $this->rating_categories = (bool)$a_rating;
147  }
148 
155  {
156  return $this->rating_categories;
157  }
158 
162  public function setPublicNotes($a_val)
163  {
164  $this->public_notes = $a_val;
165  }
166 
170  public function getPublicNotes()
171  {
172  return $this->public_notes;
173  }
174 
180  public function setImportantPages($a_val)
181  {
182  $this->imp_pages = $a_val;
183  }
184 
190  public function getImportantPages()
191  {
192  return $this->imp_pages;
193  }
194 
200  function setStartPage($a_startpage)
201  {
202  $this->startpage = ilWikiUtil::makeDbTitle($a_startpage);
203  }
204 
210  function getStartPage()
211  {
212  return $this->startpage;
213  }
214 
220  function setShortTitle($a_shorttitle)
221  {
222  $this->shorttitle = $a_shorttitle;
223  }
224 
230  function getShortTitle()
231  {
232  return $this->shorttitle;
233  }
234 
240  function setIntroduction($a_introduction)
241  {
242  $this->introduction = $a_introduction;
243  }
244 
250  function getIntroduction()
251  {
252  return $this->introduction;
253  }
254 
258  function getStyleSheetId()
259  {
260  return $this->style_id;
261  }
262 
266  function setStyleSheetId($a_style_id)
267  {
268  $this->style_id = $a_style_id;
269  }
270 
276  public function setPageToc($a_val)
277  {
278  $this->page_toc = $a_val;
279  }
280 
286  public function getPageToc()
287  {
288  return $this->page_toc;
289  }
290 
296  function setEmptyPageTemplate($a_val)
297  {
298  $this->empty_page_templ = $a_val;
299  }
300 
307  {
309  }
310 
316  function setLinkMetadataValues($a_val)
317  {
318  $this->link_md_values = $a_val;
319  }
320 
327  {
328  return $this->link_md_values;
329  }
330 
336  static function isOnlineHelpWiki($a_ref_id)
337  {
338  if ($a_ref_id > 0 && $a_ref_id == OH_REF_ID)
339  {
340 // return true;
341  }
342  return false;
343  }
344 
348  function create($a_prevent_start_page_creation = false)
349  {
350  global $ilDB;
351 
352  parent::create();
353 
354  $ilDB->insert("il_wiki_data", array(
355  "id" => array("integer", $this->getId()),
356  "is_online" => array("integer", (int) $this->getOnline()),
357  "startpage" => array("text", $this->getStartPage()),
358  "short" => array("text", $this->getShortTitle()),
359  "rating" => array("integer", (int) $this->getRating()),
360  "public_notes" => array("integer", (int) $this->getPublicNotes()),
361  "introduction" => array("clob", $this->getIntroduction()),
362  "empty_page_templ" => array("integer", (int) $this->getEmptyPageTemplate()),
363  ));
364 
365  // create start page
366  if ($this->getStartPage() != "" && !$a_prevent_start_page_creation)
367  {
368  include_once("./Modules/Wiki/classes/class.ilWikiPage.php");
369  $start_page = new ilWikiPage();
370  $start_page->setWikiId($this->getId());
371  $start_page->setTitle($this->getStartPage());
372  $start_page->create();
373  }
374 
375  if (((int) $this->getStyleSheetId()) > 0)
376  {
377  include_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
379  }
380  }
381 
388  function update($a_prevent_start_page_creation = false)
389  {
390  global $ilDB;
391 
392  if (!parent::update())
393  {
394  return false;
395  }
396 
397  $ilDB->update("il_wiki_data", array(
398  "is_online" => array("integer", $this->getOnline()),
399  "startpage" => array("text", $this->getStartPage()),
400  "short" => array("text", $this->getShortTitle()),
401  "rating_overall" => array("integer", $this->getRatingOverall()),
402  "rating" => array("integer", $this->getRating()),
403  "rating_side" => array("integer", (bool)$this->getRatingAsBlock()), // #13455
404  "rating_new" => array("integer", $this->getRatingForNewPages()),
405  "rating_ext" => array("integer", $this->getRatingCategories()),
406  "public_notes" => array("integer", $this->getPublicNotes()),
407  "introduction" => array("clob", $this->getIntroduction()),
408  "imp_pages" => array("integer", $this->getImportantPages()),
409  "page_toc" => array("integer", $this->getPageToc()),
410  "link_md_values" => array("integer", $this->getLinkMetadataValues()),
411  "empty_page_templ" => array("integer", $this->getEmptyPageTemplate())
412  ), array(
413  "id" => array("integer", $this->getId())
414  ));
415 
416  // check whether start page exists
417  include_once("./Modules/Wiki/classes/class.ilWikiPage.php");
418  if (!ilWikiPage::exists($this->getId(), $this->getStartPage())
419  && !$a_prevent_start_page_creation)
420  {
421  $start_page = new ilWikiPage();
422  $start_page->setWikiId($this->getId());
423  $start_page->setTitle($this->getStartPage());
424  $start_page->create();
425  }
426 
427  include_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
429 
430  return true;
431  }
432 
436  function read()
437  {
438  global $ilDB;
439 
440  parent::read();
441 
442  $query = "SELECT * FROM il_wiki_data WHERE id = ".
443  $ilDB->quote($this->getId(), "integer");
444  $set = $ilDB->query($query);
445  $rec = $ilDB->fetchAssoc($set);
446 
447  $this->setOnline($rec["is_online"]);
448  $this->setStartPage($rec["startpage"]);
449  $this->setShortTitle($rec["short"]);
450  $this->setRatingOverall($rec["rating_overall"]);
451  $this->setRating($rec["rating"]);
452  $this->setRatingAsBlock($rec["rating_side"]);
453  $this->setRatingForNewPages($rec["rating_new"]);
454  $this->setRatingCategories($rec["rating_ext"]);
455  $this->setPublicNotes($rec["public_notes"]);
456  $this->setIntroduction($rec["introduction"]);
457  $this->setImportantPages($rec["imp_pages"]);
458  $this->setPageToc($rec["page_toc"]);
459  $this->setEmptyPageTemplate($rec["empty_page_templ"]);
460  $this->setLinkMetadataValues($rec["link_md_values"]);
461 
462  include_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
464 
465  }
466 
467 
474  function delete()
475  {
476  global $ilDB;
477 
478  // always call parent delete function first!!
479  if (!parent::delete())
480  {
481  return false;
482  }
483 
484  // delete record of table il_wiki_data
485  $query = "DELETE FROM il_wiki_data".
486  " WHERE id = ".$ilDB->quote($this->getId(), "integer");
487  $ilDB->manipulate($query);
488 
489  // remove all notifications
490  include_once "./Services/Notification/classes/class.ilNotification.php";
492 
493  include_once("./Modules/Wiki/classes/class.ilWikiPage.php");
495 
496  return true;
497  }
498 
502  static function checkShortTitleAvailability($a_short_title)
503  {
504  global $ilDB;
505 
506  $res = $ilDB->queryF("SELECT id FROM il_wiki_data WHERE short = %s",
507  array("text"), array($a_short_title));
508  if ($ilDB->fetchAssoc($res))
509  {
510  return false;
511  }
512 
513  return true;
514  }
515 
523  static function _lookupRatingOverall($a_wiki_id)
524  {
525  return ilObjWiki::_lookup($a_wiki_id, "rating_overall");
526  }
527 
535  static function _lookupRating($a_wiki_id)
536  {
537  return ilObjWiki::_lookup($a_wiki_id, "rating");
538  }
539 
547  static function _lookupRatingCategories($a_wiki_id)
548  {
549  return ilObjWiki::_lookup($a_wiki_id, "rating_ext");
550  }
551 
559  static function _lookupRatingAsBlock($a_wiki_id)
560  {
561  return ilObjWiki::_lookup($a_wiki_id, "rating_side");
562  }
563 
571  static function _lookupPublicNotes($a_wiki_id)
572  {
573  return ilObjWiki::_lookup($a_wiki_id, "public_notes");
574  }
575 
583  static function _lookupLinkMetadataValues($a_wiki_id)
584  {
585  return ilObjWiki::_lookup($a_wiki_id, "link_md_values");
586  }
587 
596  private static function _lookup($a_wiki_id, $a_field)
597  {
598  global $ilDB;
599 
600  $query = "SELECT $a_field FROM il_wiki_data WHERE id = ".
601  $ilDB->quote($a_wiki_id, "integer");
602  $set = $ilDB->query($query);
603  $rec = $ilDB->fetchAssoc($set);
604  return $rec[$a_field];
605  }
606 
614  static function _lookupStartPage($a_wiki_id)
615  {
616  return ilObjWiki::_lookup($a_wiki_id, "startpage");
617  }
618 
622  static function writeStartPage($a_id, $a_name)
623  {
624  global $ilDB;
625 
626  include_once("./Modules/Wiki/classes/class.ilWikiUtil.php");
627  $ilDB->manipulate("UPDATE il_wiki_data SET ".
628  " startpage = ".$ilDB->quote(ilWikiUtil::makeDbTitle($a_name), "text").
629  " WHERE id = ".$ilDB->quote($a_id, "integer")
630  );
631  }
632 
636  static function _performSearch($a_wiki_id, $a_searchterm)
637  {
638  // query parser
639  include_once 'Services/Search/classes/class.ilQueryParser.php';
640 
641  $query_parser = new ilQueryParser($a_searchterm);
642  $query_parser->setCombination("or");
643  $query_parser->parse();
644 
645  include_once 'Services/Search/classes/class.ilSearchResult.php';
646  $search_result = new ilSearchResult();
647  if($query_parser->validate())
648  {
649 
650  include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
651  $wiki_search = ilObjectSearchFactory::_getWikiContentSearchInstance($query_parser);
652  $wiki_search->setFilter(array('wpg'));
653  $search_result->mergeEntries($wiki_search->performSearch());
654  }
655 
656  $entries = $search_result->getEntries();
657 
658  $found_pages = array();
659  foreach($entries as $entry)
660  {
661  if ($entry["obj_id"] == $a_wiki_id && is_array($entry["child"]))
662  {
663  foreach($entry["child"] as $child)
664  {
665  $found_pages[] = array("page_id" => $child);
666  }
667  }
668  }
669 
670  return $found_pages;
671  }
672 
673  //
674  // Important pages
675  //
676 
684  static function _lookupImportantPages($a_wiki_id)
685  {
686  return ilObjWiki::_lookup($a_wiki_id, "imp_pages");
687  }
688 
695  static function _lookupImportantPagesList($a_wiki_id)
696  {
697  global $ilDB;
698 
699  $set = $ilDB->query("SELECT * FROM il_wiki_imp_pages WHERE ".
700  " wiki_id = ".$ilDB->quote($a_wiki_id, "integer")." ORDER BY ord ASC "
701  );
702 
703  $imp_pages = array();
704 
705  while ($rec = $ilDB->fetchAssoc($set))
706  {
707  $imp_pages[] = $rec;
708  }
709  return $imp_pages;
710  }
711 
718  static function _lookupMaxOrdNrImportantPages($a_wiki_id)
719  {
720  global $ilDB;
721 
722  $set = $ilDB->query("SELECT MAX(ord) as m FROM il_wiki_imp_pages WHERE ".
723  " wiki_id = ".$ilDB->quote($a_wiki_id, "integer")
724  );
725 
726  $rec = $ilDB->fetchAssoc($set);
727  return (int) $rec["m"];
728  }
729 
730 
736  function addImportantPage($a_page_id, $a_nr = 0, $a_indent = 0)
737  {
738  global $ilDB;
739 
740  if (!$this->isImportantPage($a_page_id))
741  {
742  if ($a_nr == 0)
743  {
744  $a_nr = ilObjWiki::_lookupMaxOrdNrImportantPages($this->getId()) + 10;
745  }
746 
747  $ilDB->manipulate("INSERT INTO il_wiki_imp_pages ".
748  "(wiki_id, ord, indent, page_id) VALUES (".
749  $ilDB->quote($this->getId(), "integer").",".
750  $ilDB->quote($a_nr, "integer").",".
751  $ilDB->quote($a_indent, "integer").",".
752  $ilDB->quote($a_page_id, "integer").
753  ")");
754  }
755  }
756 
763  function isImportantPage($a_page_id)
764  {
765  global $ilDB;
766 
767  $set = $ilDB->query("SELECT * FROM il_wiki_imp_pages WHERE ".
768  " wiki_id = ".$ilDB->quote($this->getId(), "integer")." AND ".
769  " page_id = ".$ilDB->quote($a_page_id, "integer")
770  );
771  if ($rec = $ilDB->fetchAssoc($set))
772  {
773  return true;
774  }
775  return false;
776  }
777 
783  function removeImportantPage($a_id)
784  {
785  global $ilDB;
786 
787  $ilDB->manipulate("DELETE FROM il_wiki_imp_pages WHERE "
788  ." wiki_id = ".$ilDB->quote($this->getId(), "integer")
789  ." AND page_id = ".$ilDB->quote($a_id, "integer")
790  );
791 
793  }
794 
801  function saveOrderingAndIndentation($a_ord, $a_indent)
802  {
803  global $ilDB;
804 
805  $ipages = ilObjWiki::_lookupImportantPagesList($this->getId());
806 
807  foreach ($ipages as $k => $v)
808  {
809  if (isset($a_ord[$v["page_id"]]))
810  {
811  $ipages[$k]["ord"] = (int) $a_ord[$v["page_id"]];
812  }
813  if (isset($a_indent[$v["page_id"]]))
814  {
815  $ipages[$k]["indent"] = (int) $a_indent[$v["page_id"]];
816  }
817  }
818  $ipages = ilUtil::sortArray($ipages, "ord", "asc", true);
819 
820  // fix indentation: no 2 is allowed after a 0
821  $c_indent = 0;
822  $fixed = false;
823  foreach ($ipages as $k => $v)
824  {
825  if ($ipages[$k]["indent"] == 2 && $c_indent == 0)
826  {
827  $ipages[$k]["indent"] = 1;
828  $fixed = true;
829  }
830  $c_indent = $ipages[$k]["indent"];
831  }
832 
833  $ord = 10;
834  reset($ipages);
835  foreach ($ipages as $k => $v)
836  {
837  $ilDB->manipulate($q = "UPDATE il_wiki_imp_pages SET ".
838  " ord = ".$ilDB->quote($ord, "integer").",".
839  " indent = ".$ilDB->quote($v["indent"], "integer").
840  " WHERE wiki_id = ".$ilDB->quote($v["wiki_id"], "integer").
841  " AND page_id = ".$ilDB->quote($v["page_id"], "integer")
842  );
843  $ord+=10;
844  }
845 
846  return $fixed;
847  }
848 
853  {
854  global $ilDB;
855 
856  $ipages = ilObjWiki::_lookupImportantPagesList($this->getId());
857 
858  // fix indentation: no 2 is allowed after a 0
859  $c_indent = 0;
860  $fixed = false;
861  foreach ($ipages as $k => $v)
862  {
863  if ($ipages[$k]["indent"] == 2 && $c_indent == 0)
864  {
865  $ipages[$k]["indent"] = 1;
866  $fixed = true;
867  }
868  $c_indent = $ipages[$k]["indent"];
869  }
870 
871  $ord = 10;
872  foreach ($ipages as $k => $v)
873  {
874  $ilDB->manipulate($q = "UPDATE il_wiki_imp_pages SET ".
875  " ord = ".$ilDB->quote($ord, "integer").
876  ", indent = ".$ilDB->quote($v["indent"], "integer").
877  " WHERE wiki_id = ".$ilDB->quote($v["wiki_id"], "integer").
878  " AND page_id = ".$ilDB->quote($v["page_id"], "integer")
879  );
880  $ord+=10;
881  }
882 
883  }
884 
885  //
886  // Page TOC
887  //
888 
896  static function _lookupPageToc($a_wiki_id)
897  {
898  return ilObjWiki::_lookup($a_wiki_id, "page_toc");
899  }
900 
907  public function cloneObject($a_target_id,$a_copy_id = 0, $a_omit_tree = false)
908  {
909  global $ilDB, $ilUser, $ilias;
910 
911  $new_obj = parent::cloneObject($a_target_id,$a_copy_id, $a_omit_tree);
912 
913  //copy online status if object is not the root copy object
914  $cp_options = ilCopyWizardOptions::_getInstance($a_copy_id);
915 
916  if(!$cp_options->isRootNode($this->getRefId()))
917  {
918  $new_obj->setOnline($this->getOnline());
919  }
920 
921  //$new_obj->setTitle($this->getTitle()); // see #20074
922  $new_obj->setStartPage($this->getStartPage());
923  $new_obj->setShortTitle($this->getShortTitle());
924  $new_obj->setRatingOverall($this->getRatingOverall());
925  $new_obj->setRating($this->getRating());
926  $new_obj->setRatingAsBlock($this->getRatingAsBlock());
927  $new_obj->setRatingForNewPages($this->getRatingForNewPages());
928  $new_obj->setRatingCategories($this->getRatingCategories());
929  $new_obj->setPublicNotes($this->getPublicNotes());
930  $new_obj->setIntroduction($this->getIntroduction());
931  $new_obj->setImportantPages($this->getImportantPages());
932  $new_obj->setPageToc($this->getPageToc());
933  $new_obj->update();
934 
935  // set/copy stylesheet
936  include_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
937  $style_id = $this->getStyleSheetId();
938  if ($style_id > 0 && !ilObjStyleSheet::_lookupStandard($style_id))
939  {
940  $style_obj = $ilias->obj_factory->getInstanceByObjId($style_id);
941  $new_id = $style_obj->ilClone();
942  $new_obj->setStyleSheetId($new_id);
943  $new_obj->update();
944  }
945 
946  // copy content
947  include_once("./Modules/Wiki/classes/class.ilWikiPage.php");
948  $pages = ilWikiPage::getAllWikiPages($this->getId());
949  if (count($pages) > 0)
950  {
951  // if we have any pages, delete the start page first
952  $pg_id = ilWikiPage::getPageIdForTitle($new_obj->getId(), $new_obj->getStartPage());
953  $start_page = new ilWikiPage($pg_id);
954  $start_page->delete();
955  }
956  $map = array();
957  foreach ($pages as $p)
958  {
959  $page = new ilWikiPage($p["id"]);
960  $new_page = new ilWikiPage();
961  $new_page->setTitle($page->getTitle());
962  $new_page->setWikiId($new_obj->getId());
963  $new_page->setTitle($page->getTitle());
964  $new_page->setBlocked($page->getBlocked());
965  $new_page->setRating($page->getRating());
966  $new_page->hideAdvancedMetadata($page->isAdvancedMetadataHidden());
967  $new_page->create();
968 
969  $page->copy($new_page->getId(), "", 0, true);
970  //$new_page->setXMLContent($page->copyXMLContent(true));
971  //$new_page->buildDom(true);
972  //$new_page->update();
973  $map[$p["id"]] = $new_page->getId();
974  }
975 
976  // copy important pages
977  foreach (ilObjWiki::_lookupImportantPagesList($this->getId()) as $ip)
978  {
979  $new_obj->addImportantPage($map[$ip["page_id"]], $ip["ord"], $ip["indent"]);
980  }
981 
982  // copy rating categories
983  include_once("./Services/Rating/classes/class.ilRatingCategory.php");
984  foreach (ilRatingCategory::getAllForObject($this->getId()) as $rc)
985  {
986  $new_rc = new ilRatingCategory();
987  $new_rc->setParentId($new_obj->getId());
988  $new_rc->setTitle($rc["title"]);
989  $new_rc->setDescription($rc["description"]);
990  $new_rc->save();
991  }
992 
993  return $new_obj;
994  }
995 
1003  {
1004  $num = (int) $this->getEmptyPageTemplate();
1005  include_once("./Modules/Wiki/classes/class.ilWikiPageTemplate.php");
1006  $wt = new ilWikiPageTemplate($this->getId());
1007  $ts = $wt->getAllInfo(ilWikiPageTemplate::TYPE_NEW_PAGES);
1008  $num += count($ts);
1009  if ($num > 1)
1010  {
1011  return true;
1012  }
1013  return false;
1014  }
1015 
1023  function createWikiPage($a_page_title, $a_template_page = 0)
1024  {
1025  // check if template has to be used
1026  if ($a_template_page == 0)
1027  {
1028  if (!$this->getEmptyPageTemplate())
1029  {
1030  include_once("./Modules/Wiki/classes/class.ilWikiPageTemplate.php");
1031  $wt = new ilWikiPageTemplate($this->getId());
1032  $ts = $wt->getAllInfo(ilWikiPageTemplate::TYPE_NEW_PAGES);
1033  if (count($ts) == 1)
1034  {
1035  $t = current($ts);
1036  $a_template_page = $t["wpage_id"];
1037  }
1038  }
1039  }
1040 
1041  // create the page
1042  $page = new ilWikiPage();
1043  $page->setWikiId($this->getId());
1044  $page->setTitle(ilWikiUtil::makeDbTitle($a_page_title));
1045  if($this->getRating() && $this->getRatingForNewPages())
1046  {
1047  $page->setRating(true);
1048  }
1049 
1050  // needed for notification
1051  $page->setWikiRefId($this->getRefId());
1052  $page->create();
1053 
1054  // copy template into new page
1055  if ($a_template_page > 0)
1056  {
1057  $orig = new ilWikiPage($a_template_page);
1058  $orig->copy($page->getId());
1059 
1060  // #15718
1061  include_once "Services/AdvancedMetaData/classes/class.ilAdvancedMDValues.php";
1063  $this->getId(),
1064  $this->getId(),
1065  "wpg",
1066  $a_template_page,
1067  $page->getId()
1068  );
1069  }
1070 
1071  return $page;
1072  }
1073 
1074  public static function getAdvMDSubItemTitle($a_obj_id, $a_sub_type, $a_sub_id)
1075  {
1076  global $lng;
1077 
1078  if($a_sub_type == "wpg")
1079  {
1080  $lng->loadLanguageModule("wiki");
1081  include_once "./Modules/Wiki/classes/class.ilWikiPage.php";
1082  return $lng->txt("wiki_wpg").' "'.ilWikiPage::lookupTitle($a_sub_id).'"';
1083  }
1084  }
1085 
1093  {
1094  global $ilDB, $ilUser;
1095 
1096  include_once("./Modules/Wiki/classes/class.ilWikiUserHTMLExport.php");
1097 
1098  $user_export = new ilWikiUserHTMLExport($this, $ilDB, $ilUser);
1099  $user_export->initUserHTMLExport();
1100  }
1101 
1109  {
1110  global $ilDB, $ilUser;
1111 
1112  include_once("./Modules/Wiki/classes/class.ilWikiUserHTMLExport.php");
1113 
1114  $user_export = new ilWikiUserHTMLExport($this, $ilDB, $ilUser);
1115  $user_export->startUserHTMLExport();
1116  }
1117 
1124  {
1125  global $ilDB, $ilUser;
1126 
1127  include_once("./Modules/Wiki/classes/class.ilWikiUserHTMLExport.php");
1128 
1129  $user_export = new ilWikiUserHTMLExport($this, $ilDB, $ilUser);
1130  return $user_export->getProgress();
1131  }
1132 
1137  {
1138  global $ilDB, $ilUser;
1139 
1140  include_once("./Modules/Wiki/classes/class.ilWikiUserHTMLExport.php");
1141 
1142  $user_export = new ilWikiUserHTMLExport($this, $ilDB, $ilUser);
1143  return $user_export->deliverFile();
1144  }
1145 
1146 
1153  public function decorateAdvMDValue($a_value)
1154  {
1155  include_once("./Modules/Wiki/classes/class.ilWikiPage.php");
1156  if (ilWikiPage::_wikiPageExists($this->getId(), $a_value))
1157  {
1158  $url = ilObjWikiGUI::getGotoLink($this->getRefId(), $a_value);
1159  return "<a href='".$url."'>".$a_value."</a>";
1160  }
1161 
1162  return $a_value;
1163  }
1164 
1165 
1166 
1167 }
1168 ?>
static getGotoLink($a_ref_id, $a_page="")
Get goto link.
static lookupTitle($a_page_id)
Checks whether a page with given title exists.
static _getWikiContentSearchInstance($query_parser)
get reference of ilFulltextWikiContentSearch
static removeForObject($type, $id)
Remove all notifications for given object.
static _lookupRatingOverall($a_wiki_id)
Lookup whether rating is activated for whole object.
saveOrderingAndIndentation($a_ord, $a_indent)
Save ordering and indentation.
static _lookupImportantPagesList($a_wiki_id)
Get important pages list.
setImportantPages($a_val)
Set important pages.
getRatingOverall()
Get Enable Rating For Object.
__construct($a_id=0, $a_call_by_reference=true)
Constructor public.
update($a_prevent_start_page_creation=false)
update object data
setOnline($a_online)
Set Online.
getUserHTMLExportProgress()
Get user html export progress.
initUserHTMLExport()
Init user html export.
getStartPage()
Get Start Page.
setIntroduction($a_introduction)
Set Introduction.
static checkShortTitleAvailability($a_short_title)
Check availability of short title.
getLinkMetadataValues()
Get link md values.
getShortTitle()
Get ShortTitle.
setPublicNotes($a_val)
Set public notes.
Class ilObject Basic functions for all objects.
static _lookupStartPage($a_wiki_id)
Lookup start page.
deliverUserHTMLExport()
Send user html export file.
static _lookupLinkMetadataValues($a_wiki_id)
Lookup whether metadata should be auto linked.
getPublicNotes()
Get public notes.
startUserHTMLExport()
Start user html export.
getRatingForNewPages()
Get Enable Rating For New Pages.
$url
Definition: shib_logout.php:72
static _lookupRatingCategories($a_wiki_id)
Lookup whether rating categories are activated.
static sortArray($array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
getRatingCategories()
Get Enable Rating Categories.
static getAllForObject($a_parent_obj_id)
Get all categories for object.
static lookupObjectStyle($a_obj_id)
Lookup object style.
static getPageIdForTitle($a_wiki_id, $a_title)
Get wiki page object for id and title.
setRatingCategories($a_rating)
Set Enable Rating Categories.
setStyleSheetId($a_style_id)
set ID of assigned style sheet object
isImportantPage($a_page_id)
Is page an important page?
addImportantPage($a_page_id, $a_nr=0, $a_indent=0)
Add important page.
static _lookupStandard($a_id)
Lookup standard flag.
createWikiPage($a_page_title, $a_template_page=0)
Create new wiki page.
Class manages user html export.
static _lookupRating($a_wiki_id)
Lookup whether rating is activated.
static writeStyleUsage($a_obj_id, $a_style_id)
Write style usage.
getPageToc()
Get page toc.
static getAdvMDSubItemTitle($a_obj_id, $a_sub_type, $a_sub_id)
setRatingAsBlock($a_rating)
Set Enable Rating Side Block.
static _performSearch($a_wiki_id, $a_searchterm)
Search in Wiki.
fixImportantPagesNumbering()
Fix important pages numbering.
static _getInstance($a_copy_id)
Get instance of copy wizard options.
Interface for repository objects to use adv md with subitems.
getEmptyPageTemplate()
Get empty page template.
setEmptyPageTemplate($a_val)
Set empty page template.
decorateAdvMDValue($a_value)
Decorate adv md value.
getId()
get object id public
static _cloneValues($a_source_id, $a_target_id, $a_sub_type=null, $a_source_sub_id=null, $a_target_sub_id=null)
Clone Advanced Meta Data.
getTemplateSelectionOnCreation()
Get template selection on creation? If more than one template (including empty page template) is acti...
getRatingAsBlock()
Get Enable Rating Side Block.
Class ilObjWiki.
static _lookupRatingAsBlock($a_wiki_id)
Lookup whether rating side block is activated.
static _lookupMaxOrdNrImportantPages($a_wiki_id)
Get important pages list.
cloneObject($a_target_id, $a_copy_id=0, $a_omit_tree=false)
Clone wiki.
getStyleSheetId()
get ID of assigned style sheet object
$ilUser
Definition: imgupload.php:18
Class ilWikiPage.
setShortTitle($a_shorttitle)
Set ShortTitle.
static _lookupPageToc($a_wiki_id)
Lookup whether important pages are activated.
static getAllWikiPages($a_wiki_id)
Get all pages of wiki.
static makeDbTitle($a_par)
Handle page GET parameter.
Create styles array
The data for the language used.
setStartPage($a_startpage)
Set Start Page.
setLinkMetadataValues($a_val)
Set link md values.
setRating($a_rating)
Set Enable Rating.
static _lookup($a_wiki_id, $a_field)
Lookup a data field.
static _wikiPageExists($a_wiki_id, $a_title)
Check whether page exists for wiki or not.
read()
Read wiki data.
static exists($a_wiki_id, $a_title)
Checks whether a page with given title exists.
getIntroduction()
Get Introduction.
setRatingForNewPages($a_rating)
Set Enable Rating For New Pages.
global $ilDB
static isOnlineHelpWiki($a_ref_id)
Is wiki an online help wiki?
getRefId()
get reference id public
Class ilRatingCategory.
getImportantPages()
Get important pages.
setRatingOverall($a_rating)
Set Enable Rating For Object.
create($a_prevent_start_page_creation=false)
Create new wiki.
getOnline()
Get Online.
static deleteAllPagesOfWiki($a_wiki_id)
delete wiki page and al related data
getRating()
Get Enable Rating.
static _lookupImportantPages($a_wiki_id)
Lookup whether important pages are activated.
static _lookupPublicNotes($a_wiki_id)
Lookup whether public notes are activated.
setPageToc($a_val)
Set page toc.
static writeStartPage($a_id, $a_name)
Write start page.
removeImportantPage($a_id)
Remove important page.