49 $this->tree =
new ilTree($a_tree_id);
50 $this->tree->setTableNames(
'bookmark_tree',
'bookmark_data');
51 $this->
id = $a_bmf_id;
66 $q =
"SELECT * FROM bookmark_data WHERE obj_id = ".
67 $ilDB->quote($this->
getId(),
"integer");
68 $bmf_set = $ilDB->query($q);
69 if ($ilDB->numRows($bmf_set) == 0)
71 $message =
"ilBookmarkFolder::read(): Bookmark Folder with id ".$this->getId().
" not found!";
72 $ilias->raiseError($message,$ilias->error_obj->WARNING);
76 $bmf = $ilDB->fetchAssoc($bmf_set);
78 $this->
setParent($this->tree->getParentId($this->getId()));
89 $q =
"DELETE FROM bookmark_data WHERE obj_id = ".$ilDB->quote($this->
getId(),
"integer");
105 $this->tree->addTree($this->tree->getTreeId(), 1);
117 $this->
setId($ilDB->nextId(
"bookmark_data"));
119 "INSERT INTO bookmark_data (obj_id, user_id, title, type) ".
120 "VALUES (%s,%s,%s,%s)",
121 $ilDB->quote($this->getId(),
"integer"),
122 $ilDB->quote(
$_SESSION[
"AccountId"],
"integer"),
123 $ilDB->quote($this->
getTitle(),
"text"),
124 $ilDB->quote(
'bmf',
"text")
127 $ilDB->manipulate($q);
139 "UPDATE bookmark_data SET title=%s ".
141 $ilDB->quote($this->getTitle(),
"text"),
142 $ilDB->quote($this->getId(),
"integer")
144 $ilDB->manipulate($q);
165 $this->title = $a_title;
175 $this->parent = $a_parent_id;
185 $q =
"SELECT * FROM bookmark_data WHERE obj_id = ".
186 $ilDB->quote($a_bmf_id,
"integer");
187 $bmf_set = $ilDB->query($q);
188 $bmf = $ilDB->fetchAssoc($bmf_set);
190 return $bmf[
"title"];
200 $tree->setTableNames(
'bookmark_tree',
'bookmark_data');
204 $a_id =
$tree->getRootId();
207 $childs =
$tree->getChilds($a_id,
"title");
210 $bookmarks = array();
212 foreach ($childs as $key => $child)
214 switch ($child[
"type"])
221 $bookmarks[] = $child;
225 foreach ($bookmarks as $key => $bookmark)
227 $objects[] = $bookmark;
239 $tree->setTableNames(
'bookmark_tree',
'bookmark_data');
241 $root_node =
$tree->getNodeData(
$tree->getRootId());
243 if ($root_node[
"lft"] !=
"")
245 $bmf =
$tree->getSubTree($root_node,
false,
"bmf");
246 $bm =
$tree->getSubTree($root_node,
false,
"bm");
250 $bmf = array(
"dummy");
254 return array(
"folders" => (
int) count($bmf) - 1,
"bookmarks" => (
int) count($bm));
265 $tree->setTableNames(
'bookmark_tree',
'bookmark_data');
269 $a_id =
$tree->getRootId();
272 $object =
$tree->getNodeData($a_id);
280 $tree->setTableNames(
'bookmark_tree',
'bookmark_data');
282 if ($a_id ==
$tree->getRootId())
296 $tree->setTableNames(
'bookmark_tree',
'bookmark_data');
298 return $tree->getRootId();
305 $tree->setTableNames(
'bookmark_tree',
'bookmark_data');
306 return $tree->getParentId($a_id);