4 include_once(
"./Services/DataSet/classes/class.ilDataSet.php");
28 return array(
"4.3.0",
"5.0.0",
"5.3.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") {
50 "Description" =>
"text",
53 "FontColor" =>
"text",
56 "RssActive" =>
"integer",
57 "Approval" =>
"integer",
65 "Description" =>
"text",
68 "FontColor" =>
"text",
71 "RssActive" =>
"integer",
72 "Approval" =>
"integer",
74 "AbsShorten" =>
"integer",
75 "AbsShortenLen" =>
"integer",
76 "AbsImage" =>
"integer",
77 "AbsImgWidth" =>
"integer",
78 "AbsImgHeight" =>
"integer",
79 "NavMode" =>
"integer",
80 "NavListPost" =>
"integer",
81 "NavListMon" =>
"integer",
82 "Keywords" =>
"integer",
83 "Authors" =>
"integer",
85 "OvPost" =>
"integer",
93 "Description" =>
"text",
96 "FontColor" =>
"text",
99 "RssActive" =>
"integer",
100 "Approval" =>
"integer",
101 "Dir" =>
"directory",
102 "AbsShorten" =>
"integer",
103 "AbsShortenLen" =>
"integer",
104 "AbsImage" =>
"integer",
105 "AbsImgWidth" =>
"integer",
106 "AbsImgHeight" =>
"integer",
107 "NavMode" =>
"integer",
108 "NavListMonWithPost" =>
"integer",
109 "NavListMon" =>
"integer",
110 "Keywords" =>
"integer",
111 "Authors" =>
"integer",
112 "NavOrder" =>
"text",
113 "OvPost" =>
"integer",
120 if ($a_entity ==
"blog_posting") {
121 switch ($a_version) {
127 "BlogId" =>
"integer",
128 "Title" =>
"integer",
131 "Approved" =>
"integer" 143 public function readData($a_entity, $a_version, $a_ids, $a_field =
"")
147 if (!is_array($a_ids)) {
148 $a_ids =
array($a_ids);
151 if ($a_entity ==
"blog") {
152 switch ($a_version) {
155 "bl.notes,bl.bg_color,bl.font_color,bl.img,bl.ppic,bl.rss_active,bl.approval" .
157 " JOIN object_data od ON (od.obj_id = bl.id)" .
158 " WHERE " .
$ilDB->in(
"bl.id", $a_ids,
false,
"integer") .
159 " AND od.type = " .
$ilDB->quote(
"blog",
"text"));
164 "bl.bg_color,bl.font_color,bl.img,bl.ppic,bl.rss_active,bl.approval," .
165 "bl.abs_shorten,bl.abs_shorten_len,bl.abs_image,bl.abs_img_width,bl.abs_img_height," .
166 "bl.nav_mode,bl.nav_list_post,bl.nav_list_mon,bl.keywords,bl.authors,bl.nav_order," .
169 " JOIN object_data od ON (od.obj_id = bl.id)" .
170 " WHERE " .
$ilDB->in(
"bl.id", $a_ids,
false,
"integer") .
171 " AND od.type = " .
$ilDB->quote(
"blog",
"text"));
176 "bl.bg_color,bl.font_color,bl.img,bl.ppic,bl.rss_active,bl.approval," .
177 "bl.abs_shorten,bl.abs_shorten_len,bl.abs_image,bl.abs_img_width,bl.abs_img_height," .
178 "bl.nav_mode,bl.nav_list_mon_with_post,bl.nav_list_mon,bl.keywords,bl.authors,bl.nav_order," .
181 " JOIN object_data od ON (od.obj_id = bl.id)" .
182 " WHERE " .
$ilDB->in(
"bl.id", $a_ids,
false,
"integer") .
183 " AND od.type = " .
$ilDB->quote(
"blog",
"text"));
188 if ($a_entity ==
"blog_posting") {
189 switch ($a_version) {
194 " FROM il_blog_posting WHERE " .
195 $ilDB->in(
"blog_id", $a_ids,
false,
"integer"));
196 foreach ($this->
data as $idx => $item) {
204 include_once(
"./Modules/Blog/classes/class.ilBlogPosting.php");
205 include_once(
"./Services/MetaData/classes/class.ilMDKeyword.php");
206 foreach ($this->
data as $idx => $item) {
210 foreach ($keywords as $kidx => $keyword) {
211 $this->
data[$idx][
"Keyword" . $kidx] = $keyword;
226 "blog_posting" =>
array(
"ids" => $a_rec[
"Id"])
240 if ($a_entity ==
"blog") {
241 include_once(
"./Modules/Blog/classes/class.ilObjBlog.php");
243 $a_set[
"Dir"] = $dir;
245 include_once(
"./Services/Style/Content/classes/class.ilObjStyleSheet.php");
249 include_once(
"./Services/Notes/classes/class.ilNote.php");
262 public function importRecord($a_entity, $a_types, $a_rec, $a_mapping, $a_schema_version)
266 include_once(
"./Modules/Blog/classes/class.ilObjBlog.php");
269 if ($new_id = $a_mapping->getMapping(
"Services/Container",
"objs", $a_rec[
"Id"])) {
276 $newObj->setTitle($a_rec[
"Title"]);
277 $newObj->setDescription($a_rec[
"Description"]);
278 $newObj->setNotesStatus($a_rec[
"Notes"]);
279 $newObj->setBackgroundColor($a_rec[
"BgColor"]);
280 $newObj->setFontColor($a_rec[
"FontColor"]);
281 $newObj->setProfilePicture($a_rec[
"Ppic"]);
282 $newObj->setRSS($a_rec[
"RssActive"]);
283 $newObj->setApproval($a_rec[
"Approval"]);
284 $newObj->setImage($a_rec[
"Img"]);
286 $newObj->setAbstractShorten($a_rec[
"AbsShorten"]);
287 $newObj->setAbstractShortenLength($a_rec[
"AbsShortenLen"]);
288 $newObj->setAbstractImage($a_rec[
"AbsImage"]);
289 $newObj->setAbstractImageWidth($a_rec[
"AbsImgWidth"]);
290 $newObj->setAbstractImageHeight($a_rec[
"AbsImgHeight"]);
291 $newObj->setNavMode($a_rec[
"NavMode"]);
292 if ($a_rec[
"NavListMonWithPost"] == 0) {
293 $newObj->setNavModeListMonthsWithPostings(3);
295 $newObj->setNavModeListMonthsWithPostings($a_rec[
"NavListMonWithPost"]);
298 $newObj->setNavModeListMonths($a_rec[
"NavListMon"]);
299 $newObj->setKeywords($a_rec[
"Keywords"]);
300 $newObj->setAuthors($a_rec[
"Authors"]);
301 $newObj->setOrder(trim($a_rec[
"NavOrder"])
302 ? explode(
";", $a_rec[
"NavOrder"])
304 $newObj->setOverviewPostings($a_rec[
"OvPost"]);
310 $dir = str_replace(
"..",
"", $a_rec[
"Dir"]);
318 if ($a_rec[
"Style"]) {
319 self::$style_map[$a_rec[
"Style"]][] = $newObj->getId();
321 $a_mapping->addMapping(
"Modules/Blog",
"blog", $a_rec[
"Id"], $newObj->getId());
325 $blog_id = (int) $a_mapping->getMapping(
"Modules/Blog",
"blog", $a_rec[
"BlogId"]);
327 include_once(
"./Modules/Blog/classes/class.ilBlogPosting.php");
329 $newObj->setBlogId($blog_id);
330 $newObj->setTitle($a_rec[
"Title"]);
332 $newObj->setApproved($a_rec[
"Approved"]);
336 $newObj->setAuthor($author[
"id"]);
338 $newObj->create(
true);
342 for ($loop = 0; $loop < 1000; $loop++) {
343 if (isset($a_rec[
"Keyword" . $loop])) {
344 $keyword = trim($a_rec[
"Keyword" . $loop]);
345 if (strlen($keyword)) {
346 $keywords[] = $keyword;
350 if (
sizeof($keywords)) {
351 $newObj->updateKeywords($keywords);
354 $a_mapping->addMapping(
"Services/COPage",
"pg",
"blp:" . $a_rec[
"Id"],
"blp:" . $newObj->getId());
importRecord($a_entity, $a_types, $a_rec, $a_mapping, $a_schema_version)
Import record.
getSupportedVersions()
Get supported versions.
static lookupBlogId($a_posting_id)
Lookup blog id.
getDirectDataFromQuery($a_query, $a_convert_to_leading_upper=true, $a_set=true)
Get data from query.This is a standard procedure, all db field names are directly mapped to abstract ...
static rCopy($a_sdir, $a_tdir, $preserveTimeAttributes=false)
Copies content of a directory $a_sdir recursively to a directory $a_tdir.
readData($a_entity, $a_version, $a_ids, $a_field="")
Read data.
createObjectExportId($a_type, $a_id)
Build ilias export id.
static getKeywords($a_obj_id, $a_posting_id)
getImportDirectory()
Get import directory.
static lookupObjectStyle($a_obj_id)
Lookup object style.
getXmlNamespace($a_entity, $a_schema_version)
Get xml namespace.
getDependencies($a_entity, $a_version, $a_rec, $a_ids)
Determine the dependent sets of data.
getXmlRecord($a_entity, $a_version, $a_set)
Get xml record.
static initStorage($a_id, $a_subdir=null)
Init file system storage.
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
Create styles array
The data for the language used.
static commentsActivated($a_rep_obj_id, $a_obj_id, $a_obj_type)
Are comments activated for object?
getTypes($a_entity, $a_version)
Get field types for entity.
parseObjectExportId($a_id, $a_fallback_id=null)
Parse export id.
A dataset contains in data in a common structure that can be shared and transformed for different pur...