47 $a_tree_id =
$GLOBALS[
'DIC'][
'ilUser']->getId();
50 $this->tree =
new ilTree($a_tree_id);
51 $this->tree->setTableNames(
'bookmark_tree',
'bookmark_data');
52 $this->
id = $a_bmf_id;
67 $q =
"SELECT * FROM bookmark_data WHERE obj_id = ".
68 $ilDB->quote($this->
getId(),
"integer");
69 $bmf_set = $ilDB->query($q);
70 if ($ilDB->numRows($bmf_set) == 0)
72 $message =
"ilBookmarkFolder::read(): Bookmark Folder with id ".$this->getId().
" not found!";
73 $ilias->raiseError($message,$ilias->error_obj->WARNING);
77 $bmf = $ilDB->fetchAssoc($bmf_set);
79 $this->
setParent($this->tree->getParentId($this->getId()));
90 $q =
"DELETE FROM bookmark_data WHERE obj_id = ".$ilDB->quote($this->
getId(),
"integer");
106 $this->tree->addTree($this->tree->getTreeId(), 1);
118 $this->
setId($ilDB->nextId(
"bookmark_data"));
120 "INSERT INTO bookmark_data (obj_id, user_id, title, type) ".
121 "VALUES (%s,%s,%s,%s)",
122 $ilDB->quote($this->getId(),
"integer"),
123 $ilDB->quote(
$GLOBALS[
'DIC'][
'ilUser']->getId(),
"integer"),
124 $ilDB->quote($this->getTitle(),
"text"),
125 $ilDB->quote(
'bmf',
"text")
128 $ilDB->manipulate($q);
140 "UPDATE bookmark_data SET title=%s ".
142 $ilDB->quote($this->getTitle(),
"text"),
143 $ilDB->quote($this->getId(),
"integer")
145 $ilDB->manipulate($q);
166 $this->title = $a_title;
176 $this->
parent = $a_parent_id;
186 $q =
"SELECT * FROM bookmark_data WHERE obj_id = ".
187 $ilDB->quote($a_bmf_id,
"integer");
188 $bmf_set = $ilDB->query($q);
189 $bmf = $ilDB->fetchAssoc($bmf_set);
191 return $bmf[
"title"];
199 $a_tree_id =
$GLOBALS[
'DIC'][
'ilUser']->getId();
200 $tree =
new ilTree($a_tree_id);
201 $tree->setTableNames(
'bookmark_tree',
'bookmark_data');
205 $a_id = $tree->getRootId();
208 $childs = $tree->getChilds($a_id,
"title");
211 $bookmarks =
array();
213 foreach ($childs as $key => $child)
215 switch ($child[
"type"])
222 $bookmarks[] = $child;
226 foreach ($bookmarks as $key => $bookmark)
228 $objects[] = $bookmark;
238 $a_tree_id =
$GLOBALS[
'DIC'][
'ilUser']->getId();
239 $tree =
new ilTree($a_tree_id);
240 $tree->setTableNames(
'bookmark_tree',
'bookmark_data');
242 $root_node = $tree->getNodeData($tree->getRootId());
244 if ($root_node[
"lft"] !=
"")
246 $bmf = $tree->getSubTree($root_node,
false,
"bmf");
247 $bm = $tree->getSubTree($root_node,
false,
"bm");
251 $bmf =
array(
"dummy");
255 return array(
"folders" => (
int) count($bmf) - 1,
"bookmarks" => (
int) count($bm));
264 $a_tree_id =
$GLOBALS[
'DIC'][
'ilUser']->getId();
265 $tree =
new ilTree($a_tree_id);
266 $tree->setTableNames(
'bookmark_tree',
'bookmark_data');
270 $a_id = $tree->getRootId();
273 $object = $tree->getNodeData($a_id);
279 $a_tree_id =
$GLOBALS[
'DIC'][
'ilUser']->getId();
280 $tree =
new ilTree($a_tree_id);
281 $tree->setTableNames(
'bookmark_tree',
'bookmark_data');
283 if ($a_id == $tree->getRootId())
295 $a_tree_id =
$GLOBALS[
'DIC'][
'ilUser']->getId();
296 $tree =
new ilTree($a_tree_id);
297 $tree->setTableNames(
'bookmark_tree',
'bookmark_data');
299 return $tree->getRootId();
304 $a_tree_id =
$GLOBALS[
'DIC'][
'ilUser']->getId();
305 $tree =
new ilTree($a_tree_id);
306 $tree->setTableNames(
'bookmark_tree',
'bookmark_data');
307 return $tree->getParentId($a_id);
static _getParentId($a_id)
static getObject($a_id)
static
static _getNumberOfObjects()
Get number of folders and bookmarks for current user.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
static isRootFolder($a_id)
__construct($a_bmf_id=0, $a_tree_id=0)
Constructor public.
static _lookupTitle($a_bmf_id)
lookup bookmark folder title
read()
read bookmark folder data from db
redirection script todo: (a better solution should control the processing via a xml file) ...
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.
bookmark folder (note: this class handles personal bookmarks folders only)
createNewBookmarkTree()
create personal bookmark tree
static getObjects($a_id)
static
update()
Update bookmark folder item.
create()
creates new bookmark folder in db