4 include_once(
"./Services/DataSet/classes/class.ilDataSet.php");
26 return array(
"4.3.0");
34 return "http://www.ilias.de/xml/Modules/Blog/".$a_entity;
40 protected function getTypes($a_entity, $a_version)
42 if ($a_entity ==
"blog")
50 "Description" =>
"text",
53 "FontColor" =>
"text",
56 "RssActive" =>
"integer",
57 "Approval" =>
"integer",
63 if ($a_entity ==
"blog_posting")
70 "BlogId" =>
"integer",
74 "Approved" =>
"integer"
86 function readData($a_entity, $a_version, $a_ids, $a_field =
"")
90 if (!is_array($a_ids))
92 $a_ids = array($a_ids);
95 if ($a_entity ==
"blog")
101 "bl.notes,bl.bg_color,bl.font_color,bl.img,bl.ppic,bl.rss_active,bl.approval".
103 " JOIN object_data od ON (od.obj_id = bl.id)".
104 " WHERE ".$ilDB->in(
"bl.id", $a_ids,
false,
"integer").
105 " AND od.type = ".$ilDB->quote(
"blog",
"text"));
110 if ($a_entity ==
"blog_posting")
116 " FROM il_blog_posting WHERE ".
117 $ilDB->in(
"blog_id", $a_ids,
false,
"integer"));
118 foreach($this->data as $idx => $item)
137 "blog_posting" => array(
"ids" => $a_rec[
"Id"])
151 if ($a_entity ==
"blog")
153 include_once(
"./Modules/Blog/classes/class.ilObjBlog.php");
155 $a_set[
"Dir"] = $dir;
167 function importRecord($a_entity, $a_types, $a_rec, $a_mapping, $a_schema_version)
172 include_once(
"./Modules/Blog/classes/class.ilObjBlog.php");
175 if($new_id = $a_mapping->getMapping(
"Services/Container",
"objs", $a_rec[
"Id"]))
185 $newObj->setTitle($a_rec[
"Title"]);
186 $newObj->setDescription($a_rec[
"Description"]);
187 $newObj->setNotesStatus($a_rec[
"Notes"]);
188 $newObj->setBackgroundColor($a_rec[
"BgColor"]);
189 $newObj->setFontColor($a_rec[
"FontColor"]);
190 $newObj->setProfilePicture($a_rec[
"Ppic"]);
191 $newObj->setRSS($a_rec[
"RssActive"]);
192 $newObj->setApproval($a_rec[
"Approval"]);
193 $newObj->setImage($a_rec[
"Img"]);
199 $dir = str_replace(
"..",
"", $a_rec[
"Dir"]);
208 $a_mapping->addMapping(
"Modules/Blog",
"blog", $a_rec[
"Id"], $newObj->getId());
212 $blog_id = (int) $a_mapping->getMapping(
"Modules/Blog",
"blog", $a_rec[
"BlogId"]);
215 include_once(
"./Modules/Blog/classes/class.ilBlogPosting.php");
217 $newObj->setBlogId($blog_id);
218 $newObj->setTitle($a_rec[
"Title"]);
220 $newObj->setApproved($a_rec[
"Approved"]);
224 $newObj->setAuthor($author[
"id"]);
226 $newObj->create(
true);
228 $a_mapping->addMapping(
"Services/COPage",
"pg",
"blp:".$a_rec[
"Id"],
"blp:".$newObj->getId());