69 $this->tree =
new ilTree($a_tree_id);
70 $this->tree->setTableNames(
'bookmark_tree',
'bookmark_data');
71 $this->
id = $a_bmf_id;
86 $q =
"SELECT * FROM bookmark_data WHERE obj_id = ".$this->ilias->db->quote($this->
getId());
87 $bmf_set = $this->ilias->db->query($q);
88 if ($bmf_set->numRows() == 0)
90 $message =
"ilBookmarkFolder::read(): Bookmark Folder with id ".$this->getId().
" not found!";
91 $ilias->raiseError($message,$ilias->error_obj->WARNING);
97 $this->
setParent($this->tree->getParentId($this->getId()));
106 $q =
"DELETE FROM bookmark_data WHERE obj_id = ".$this->ilias->db->quote($this->
getId());
107 $this->ilias->db->query($q);
122 $this->tree->addTree($this->tree->getTreeId(), 1);
133 "INSERT INTO bookmark_data (user_id, title, type) ".
135 $this->ilias->db->quote(
$_SESSION[
"AccountId"]),
136 $this->ilias->db->quote($this->
getTitle()),
137 $this->ilias->db->quote(
'bmf')
140 $this->ilias->db->query($q);
141 $this->
setId($this->ilias->db->getLastInsertId());
147 "UPDATE bookmark_data SET title=%s ".
149 $this->ilias->db->quote($this->getTitle()),
150 $this->ilias->db->quote($this->getId())
152 $this->ilias->db->query($q);
173 $this->title = $a_title;
183 $this->parent = $a_parent_id;
193 $q =
"SELECT * FROM bookmark_data WHERE obj_id = ".$ilDB->quote($a_bmf_id);
194 $bmf_set = $ilDB->query($q);
197 return $bmf[
"title"];
207 $tree->setTableNames(
'bookmark_tree',
'bookmark_data');
211 $a_id =
$tree->getRootId();
214 $childs =
$tree->getChilds($a_id,
"title");
217 $bookmarks = array();
219 foreach ($childs as $key => $child)
221 switch ($child[
"type"])
228 $bookmarks[] = $child;
232 foreach ($bookmarks as $key => $bookmark)
234 $objects[] = $bookmark;
246 $tree->setTableNames(
'bookmark_tree',
'bookmark_data');
248 $root_node =
$tree->getNodeData(
$tree->getRootId());
250 if ($root_node[
"lft"] !=
"")
252 $bmf =
$tree->getSubTree($root_node,
false,
"bmf");
253 $bm =
$tree->getSubTree($root_node,
false,
"bm");
257 $bmf = array(
"dummy");
261 return array(
"folders" => (
int) count($bmf) - 1,
"bookmarks" => (
int) count($bm));
272 $tree->setTableNames(
'bookmark_tree',
'bookmark_data');
276 $a_id =
$tree->getRootId();
279 $object =
$tree->getNodeData($a_id);
287 $tree->setTableNames(
'bookmark_tree',
'bookmark_data');
289 if ($a_id ==
$tree->getRootId())
303 $tree->setTableNames(
'bookmark_tree',
'bookmark_data');
305 return $tree->getRootId();
312 $tree->setTableNames(
'bookmark_tree',
'bookmark_data');
313 return $tree->getParentId($a_id);