4 include_once(
"./Services/DataSet/classes/class.ilDataSet.php");
28 return array(
"4.3.0",
"5.0.0");
36 return "http://www.ilias.de/xml/Modules/Blog/".$a_entity;
42 protected function getTypes($a_entity, $a_version)
44 if ($a_entity ==
"blog")
52 "Description" =>
"text",
55 "FontColor" =>
"text",
58 "RssActive" =>
"integer",
59 "Approval" =>
"integer",
67 "Description" =>
"text",
70 "FontColor" =>
"text",
73 "RssActive" =>
"integer",
74 "Approval" =>
"integer",
76 "AbsShorten" =>
"integer",
77 "AbsShortenLen" =>
"integer",
78 "AbsImage" =>
"integer",
79 "AbsImgWidth" =>
"integer",
80 "AbsImgHeight" =>
"integer",
81 "NavMode" =>
"integer",
82 "NavListPost" =>
"integer",
83 "NavListMon" =>
"integer",
84 "Keywords" =>
"integer",
85 "Authors" =>
"integer",
87 "OvPost" =>
"integer",
93 if ($a_entity ==
"blog_posting")
101 "BlogId" =>
"integer",
102 "Title" =>
"integer",
105 "Approved" =>
"integer"
117 function readData($a_entity, $a_version, $a_ids, $a_field =
"")
121 if (!is_array($a_ids))
123 $a_ids = array($a_ids);
126 if ($a_entity ==
"blog")
132 "bl.notes,bl.bg_color,bl.font_color,bl.img,bl.ppic,bl.rss_active,bl.approval".
134 " JOIN object_data od ON (od.obj_id = bl.id)".
135 " WHERE ".$ilDB->in(
"bl.id", $a_ids,
false,
"integer").
136 " AND od.type = ".$ilDB->quote(
"blog",
"text"));
141 "bl.bg_color,bl.font_color,bl.img,bl.ppic,bl.rss_active,bl.approval,".
142 "bl.abs_shorten,bl.abs_shorten_len,bl.abs_image,bl.abs_img_width,bl.abs_img_height,".
143 "bl.nav_mode,bl.nav_list_post,bl.nav_list_mon,bl.keywords,bl.authors,bl.nav_order,".
146 " JOIN object_data od ON (od.obj_id = bl.id)".
147 " WHERE ".$ilDB->in(
"bl.id", $a_ids,
false,
"integer").
148 " AND od.type = ".$ilDB->quote(
"blog",
"text"));
153 if ($a_entity ==
"blog_posting")
160 " FROM il_blog_posting WHERE ".
161 $ilDB->in(
"blog_id", $a_ids,
false,
"integer"));
162 foreach($this->data as $idx => $item)
171 include_once(
"./Modules/Blog/classes/class.ilBlogPosting.php");
172 include_once(
"./Services/MetaData/classes/class.ilMDKeyword.php");
173 foreach($this->data as $idx => $item)
179 foreach($keywords as $kidx => $keyword)
181 $this->data[$idx][
"Keyword".$kidx] = $keyword;
197 "blog_posting" => array(
"ids" => $a_rec[
"Id"])
211 if ($a_entity ==
"blog")
213 include_once(
"./Modules/Blog/classes/class.ilObjBlog.php");
215 $a_set[
"Dir"] = $dir;
217 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
221 include_once(
"./Services/Notes/classes/class.ilNote.php");
234 function importRecord($a_entity, $a_types, $a_rec, $a_mapping, $a_schema_version)
239 include_once(
"./Modules/Blog/classes/class.ilObjBlog.php");
242 if($new_id = $a_mapping->getMapping(
"Services/Container",
"objs", $a_rec[
"Id"]))
252 $newObj->setTitle($a_rec[
"Title"]);
253 $newObj->setDescription($a_rec[
"Description"]);
254 $newObj->setNotesStatus($a_rec[
"Notes"]);
255 $newObj->setBackgroundColor($a_rec[
"BgColor"]);
256 $newObj->setFontColor($a_rec[
"FontColor"]);
257 $newObj->setProfilePicture($a_rec[
"Ppic"]);
258 $newObj->setRSS($a_rec[
"RssActive"]);
259 $newObj->setApproval($a_rec[
"Approval"]);
260 $newObj->setImage($a_rec[
"Img"]);
262 $newObj->setAbstractShorten($a_rec[
"AbsShorten"]);
263 $newObj->setAbstractShortenLength($a_rec[
"AbsShortenLen"]);
264 $newObj->setAbstractImage($a_rec[
"AbsImage"]);
265 $newObj->setAbstractImageWidth($a_rec[
"AbsImgWidth"]);
266 $newObj->setAbstractImageHeight($a_rec[
"AbsImgHeight"]);
267 $newObj->setNavMode($a_rec[
"NavMode"]);
268 $newObj->setNavModeListPostings($a_rec[
"NavListPost"]);
269 $newObj->setNavModeListMonths($a_rec[
"NavListMon"]);
270 $newObj->setKeywords($a_rec[
"Keywords"]);
271 $newObj->setAuthors($a_rec[
"Authors"]);
272 $newObj->setOrder(trim($a_rec[
"NavOrder"])
273 ? explode(
";", $a_rec[
"NavOrder"])
275 $newObj->setOverviewPostings($a_rec[
"OvPost"]);
282 $dir = str_replace(
"..",
"", $a_rec[
"Dir"]);
293 self::$style_map[$a_rec[
"Style"]][] = $newObj->getId();
295 $a_mapping->addMapping(
"Modules/Blog",
"blog", $a_rec[
"Id"], $newObj->getId());
299 $blog_id = (int) $a_mapping->getMapping(
"Modules/Blog",
"blog", $a_rec[
"BlogId"]);
302 include_once(
"./Modules/Blog/classes/class.ilBlogPosting.php");
304 $newObj->setBlogId($blog_id);
305 $newObj->setTitle($a_rec[
"Title"]);
307 $newObj->setApproved($a_rec[
"Approved"]);
311 $newObj->setAuthor($author[
"id"]);
313 $newObj->create(
true);
317 for($loop = 0; $loop < 1000; $loop++)
319 if(isset($a_rec[
"Keyword".$loop]))
321 $keyword = trim($a_rec[
"Keyword".$loop]);
324 $keywords[] = $keyword;
328 if(
sizeof($keywords))
330 $newObj->updateKeywords($keywords);
333 $a_mapping->addMapping(
"Services/COPage",
"pg",
"blp:".$a_rec[
"Id"],
"blp:".$newObj->getId());