4 include_once(
"./Services/DataSet/classes/class.ilDataSet.php");
27 return array(
"4.1.0",
"4.3.0");
38 return "http://www.ilias.de/xml/Modules/Wiki/".$a_entity;
47 protected function getTypes($a_entity, $a_version)
49 if ($a_entity ==
"wiki")
57 "Description" =>
"text",
58 "StartPage" =>
"text",
60 "Introduction" =>
"text",
61 "Rating" =>
"integer");
67 "Description" =>
"text",
68 "StartPage" =>
"text",
70 "Introduction" =>
"text",
71 "Rating" =>
"integer",
72 "PublicNotes" =>
"integer",
74 "PageToc" =>
"integer",
75 "RatingSide" =>
"integer",
76 "RatingNew" =>
"integer",
77 "RatingExt" =>
"integer");
81 if ($a_entity ==
"wpg")
89 "WikiId" =>
"integer");
95 "WikiId" =>
"integer",
96 "Blocked" =>
"integer",
97 "Rating" =>
"integer");
109 function readData($a_entity, $a_version, $a_ids, $a_field =
"")
113 if (!is_array($a_ids))
115 $a_ids = array($a_ids);
118 if ($a_entity ==
"wiki")
124 " startpage start_page, short, rating, introduction".
125 " FROM il_wiki_data JOIN object_data ON (il_wiki_data.id = object_data.obj_id)".
126 " WHERE ".$ilDB->in(
"id", $a_ids,
false,
"integer"));
131 " startpage start_page, short, rating, introduction,".
132 " public_notes, page_toc, rating_side, rating_new, rating_ext".
133 " FROM il_wiki_data JOIN object_data ON (il_wiki_data.id = object_data.obj_id)".
134 " WHERE ".$ilDB->in(
"id", $a_ids,
false,
"integer"));
139 if ($a_entity ==
"wpg")
145 " FROM il_wiki_page".
146 " WHERE ".$ilDB->in(
"wiki_id", $a_ids,
false,
"integer"));
152 " FROM il_wiki_page".
153 " WHERE ".$ilDB->in(
"wiki_id", $a_ids,
false,
"integer"));
169 "wpg" => array(
"ids" => $a_rec[
"Id"])
183 function importRecord($a_entity, $a_types, $a_rec, $a_mapping, $a_schema_version)
192 include_once(
"./Modules/Wiki/classes/class.ilObjWiki.php");
193 if($new_id = $a_mapping->getMapping(
'Services/Container',
'objs',$a_rec[
'Id']))
200 $newObj->setType(
"wiki");
201 $newObj->create(
true);
204 $newObj->setTitle($a_rec[
"Title"]);
205 $newObj->setDescription($a_rec[
"Description"]);
206 $newObj->setShortTitle($a_rec[
"Short"]);
207 $newObj->setStartPage($a_rec[
"StartPage"]);
208 $newObj->setRating($a_rec[
"Rating"]);
209 $newObj->setIntroduction($a_rec[
"Introduction"]);
210 $newObj->setPublicNotes($a_rec[
"PublicNotes"]);
213 if(isset($a_rec[
"PageToc"]))
216 $newObj->setPageToc($a_rec[
"PageToc"]);
217 $newObj->setRatingAsBlock($a_rec[
"RatingSide"]);
218 $newObj->setRatingForNewPages($a_rec[
"RatingNew"]);
219 $newObj->setRatingCategories($a_rec[
"RatingExt"]);
222 $newObj->update(
true);
223 $this->current_obj = $newObj;
224 $a_mapping->addMapping(
"Modules/Wiki",
"wiki", $a_rec[
"Id"], $newObj->getId());
225 $a_mapping->addMapping(
"Services/Rating",
"rating_category_parent_id", $a_rec[
"Id"], $newObj->getId());
229 $wiki_id = $a_mapping->getMapping(
"Modules/Wiki",
"wiki", $a_rec[
"WikiId"]);
230 include_once(
"./Modules/Wiki/classes/class.ilWikiPage.php");
232 $wpage->setWikiId($wiki_id);
233 $wpage->setTitle($a_rec[
"Title"]);
236 if(isset($a_rec[
"Blocked"]))
238 $wpage->setBlocked($a_rec[
"Blocked"]);
239 $wpage->setRating($a_rec[
"Rating"]);
242 $wpage->create(
true);
244 $a_mapping->addMapping(
"Modules/Wiki",
"wpg", $a_rec[
"Id"], $wpage->getId());
245 $a_mapping->addMapping(
"Services/COPage",
"pg",
"wpg:".$a_rec[
"Id"],
"wpg:".$wpage->getId());