4 include_once(
"./Services/DataSet/classes/class.ilDataSet.php");
23 parent::__construct();
24 $this->db = $DIC->database();
35 return array(
"4.3.0");
46 return "http://www.ilias.de/xml/Services/Bookmarks/" . $a_entity;
55 protected function getTypes($a_entity, $a_version)
58 if ($a_entity ==
"bookmarks") {
68 if ($a_entity ==
"bookmark_tree") {
72 "UserId" =>
"integer",
74 "Parent" =>
"integer",
78 "Description" =>
"text",
91 public function readData($a_entity, $a_version, $a_ids, $a_field =
"")
95 if (!is_array($a_ids)) {
96 $a_ids =
array($a_ids);
100 if ($a_entity ==
"bookmarks") {
101 switch ($a_version) {
104 foreach ($a_ids as
$id) {
112 if ($a_entity ==
"bookmark_tree") {
113 switch ($a_version) {
116 " ,parent,depth,type,title,description,target " .
117 " FROM bookmark_tree JOIN bookmark_data ON (child = obj_id) " .
119 $ilDB->in(
"tree", $a_ids,
false,
"integer") .
120 " ORDER BY tree, depth");
134 "bookmark_tree" =>
array(
"ids" => $a_rec[
"UserId"])
151 public function importRecord($a_entity, $a_types, $a_rec, $a_mapping, $a_schema_version)
157 case "bookmark_tree":
158 $usr_id = $a_mapping->getMapping(
"Services/User",
"usr", $a_rec[
"UserId"]);
162 switch ($a_rec[
"Type"]) {
164 if ($a_rec[
"Parent"] > 0) {
165 $parent = (int) $a_mapping->getMapping(
"Services/Bookmarks",
"bookmark_tree", $a_rec[
"Parent"]);
166 include_once(
"./Services/Bookmarks/classes/class.ilBookmarkFolder.php");
168 $bmf->setTitle($a_rec[
"Title"]);
169 $bmf->setParent($parent);
171 $fold_id = $bmf->getId();
173 $tree =
new ilTree($usr_id);
174 $tree->setTableNames(
'bookmark_tree',
'bookmark_data');
175 $fold_id = $tree->readRootId();
177 $a_mapping->addMapping(
178 "Services/Bookmarks",
187 if (((
int) $a_rec[
"Parent"]) > 0) {
188 $parent = (int) $a_mapping->getMapping(
"Services/Bookmarks",
"bookmark_tree", $a_rec[
"Parent"]);
194 $tree =
new ilTree($usr_id);
195 $tree->setTableNames(
'bookmark_tree',
'bookmark_data');
196 $parent = $tree->readRootId();
199 include_once(
"./Services/Bookmarks/classes/class.ilBookmark.php");
201 $bm->setTitle($a_rec[
"Title"]);
202 $bm->setDescription($a_rec[
"Description"]);
203 $bm->setTarget($a_rec[
"Target"]);
204 $bm->setParent($parent);
getSupportedVersions()
Get supported versions.
Class Bookmarks Bookmark management.
importRecord($a_entity, $a_types, $a_rec, $a_mapping, $a_schema_version)
Import record.
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 ...
Bookmarks Data set class.
readData($a_entity, $a_version, $a_ids, $a_field="")
Read data.
if(!array_key_exists('StateId', $_REQUEST)) $id
getDependencies($a_entity, $a_version, $a_rec, $a_ids)
Determine the dependent sets of data.
getXmlNamespace($a_entity, $a_schema_version)
Get xml namespace.
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
Create styles array
The data for the language used.
static _lookupType($a_id, $a_reference=false)
lookup object type
bookmark folder (note: this class handles personal bookmarks folders only)
A dataset contains in data in a common structure that can be shared and transformed for different pur...
getTypes($a_entity, $a_version)
Get field types for entity.
__construct()
Constructor.