Public Member Functions | |
ilBookmarkFolder ($a_bmf_id=0, $a_tree_id=0) | |
Constructor public. | |
read () | |
read bookmark folder data from db | |
delete () | |
delete object data | |
createNewBookmarkTree () | |
create personal bookmark tree | |
create () | |
creates new bookmark folder in db | |
update () | |
getId () | |
setId ($a_id) | |
getTitle () | |
setTitle ($a_title) | |
getParent () | |
setParent ($a_parent_id) | |
getObjects ($a_id) | |
static | |
isRootFolder ($a_id) | |
getRootFolder () | |
Data Fields | |
$tree | |
$ilias | |
$id | |
$title | |
$parent |
Definition at line 33 of file class.ilBookmarkFolder.php.
ilBookmarkFolder::create | ( | ) |
creates new bookmark folder in db
note: parent and title must be set
Definition at line 130 of file class.ilBookmarkFolder.php.
References $q, getId(), getParent(), getTitle(), and setId().
{ $q = "INSERT INTO bookmark_data (user_id, title, target, type) ". "VALUES ('".$_SESSION["AccountId"]."','".$this->getTitle()."','','bmf')"; $this->ilias->db->query($q); $this->setId($this->ilias->db->getLastInsertId()); $this->tree->insertNode($this->getId(), $this->getParent()); }
ilBookmarkFolder::createNewBookmarkTree | ( | ) |
create personal bookmark tree
Definition at line 113 of file class.ilBookmarkFolder.php.
{ global $ilDB; /* $q = "INSERT INTO bookmark_data (user_id, title, target, type) ". "VALUES ('".$this->tree->getTreeId()."','dummy_folder','','bmf')"; $ilDB->query($q);*/ //$this->tree->addTree($this->tree->getTreeId(), $ilDB->getLastInsertId()); $this->tree->addTree($this->tree->getTreeId(), 1); }
ilBookmarkFolder::delete | ( | ) |
ilBookmarkFolder::getId | ( | ) |
Definition at line 147 of file class.ilBookmarkFolder.php.
Referenced by create(), and update().
{
return $this->id;
}
ilBookmarkFolder::getObjects | ( | $ | a_id | ) |
static
Definition at line 180 of file class.ilBookmarkFolder.php.
References $_SESSION, and $tree.
Referenced by ilPersonalDesktopGUI::displayBookmarks(), and ilBookmarkAdministrationGUI::view().
{ $a_tree_id = $_SESSION["AccountId"]; $tree = new ilTree($a_tree_id); $tree->setTableNames('bookmark_tree','bookmark_data'); if(empty($a_id)) { $a_id = $tree->getRootId(); } $childs = $tree->getChilds($a_id, "title"); $objects = array(); $bookmarks = array(); foreach ($childs as $key => $child) { switch ($child["type"]) { case "bmf": $objects[] = $child; break; case "bm": $bookmarks[] = $child; break; } } foreach ($bookmarks as $key => $bookmark) { $objects[] = $bookmark; } return $objects; }
ilBookmarkFolder::getParent | ( | ) |
Definition at line 167 of file class.ilBookmarkFolder.php.
Referenced by create().
{
return $this->parent;
}
ilBookmarkFolder::getRootFolder | ( | ) |
Definition at line 232 of file class.ilBookmarkFolder.php.
References $_SESSION, and $tree.
Referenced by ilPersonalDesktopGUI::displayBookmarks().
{ $a_tree_id = $_SESSION["AccountId"]; $tree = new ilTree($a_tree_id); $tree->setTableNames('bookmark_tree','bookmark_data'); return $tree->getRootId(); }
ilBookmarkFolder::getTitle | ( | ) |
Definition at line 157 of file class.ilBookmarkFolder.php.
Referenced by create().
{
return $this->title;
}
ilBookmarkFolder::ilBookmarkFolder | ( | $ | a_bmf_id = 0 , |
|
$ | a_tree_id = 0 | |||
) |
Constructor public.
integer | user_id (optional) |
Definition at line 58 of file class.ilBookmarkFolder.php.
References $_SESSION, $ilias, and read().
{ global $ilias; // Initiate variables $this->ilias =& $ilias; if ($a_tree_id == 0) { $a_tree_id = $_SESSION["AccountId"]; } $this->tree = new ilTree($a_tree_id); $this->tree->setTableNames('bookmark_tree','bookmark_data'); $this->id = $a_bmf_id; if(!empty($this->id)) { $this->read(); } }
ilBookmarkFolder::isRootFolder | ( | $ | a_id | ) |
Definition at line 216 of file class.ilBookmarkFolder.php.
References $_SESSION, and $tree.
Referenced by ilPersonalDesktopGUI::displayBookmarks().
{ $a_tree_id = $_SESSION["AccountId"]; $tree = new ilTree($a_tree_id); $tree->setTableNames('bookmark_tree','bookmark_data'); if ($a_id == $tree->getRootId()) { return true; } else { return false; } }
ilBookmarkFolder::read | ( | ) |
read bookmark folder data from db
Definition at line 82 of file class.ilBookmarkFolder.php.
References $ilias, $q, setParent(), and setTitle().
Referenced by ilBookmarkFolder().
{ global $ilias; $q = "SELECT * FROM bookmark_data WHERE obj_id = '".$this->id."'"; $bmf_set = $this->ilias->db->query($q); if ($bmf_set->numRows() == 0) { $message = "ilBookmarkFolder::read(): Bookmark Folder with id ".$this->id." not found!"; $ilias->raiseError($message,$ilias->error_obj->WARNING); } else { $bmf = $bmf_set->fetchRow(DB_FETCHMODE_ASSOC); $this->setTitle($bmf["title"]); $this->setParent($this->tree->getParentId($this->id)); } }
ilBookmarkFolder::setId | ( | $ | a_id | ) |
Definition at line 152 of file class.ilBookmarkFolder.php.
Referenced by create().
{
$this->id = $a_id;
}
ilBookmarkFolder::setParent | ( | $ | a_parent_id | ) |
Definition at line 172 of file class.ilBookmarkFolder.php.
Referenced by read().
{ $this->parent = $a_parent_id; }
ilBookmarkFolder::setTitle | ( | $ | a_title | ) |
Definition at line 162 of file class.ilBookmarkFolder.php.
Referenced by read().
{ $this->title = $a_title; }
ilBookmarkFolder::update | ( | ) |
ilBookmarkFolder::$id |
Definition at line 49 of file class.ilBookmarkFolder.php.
ilBookmarkFolder::$ilias |
Definition at line 47 of file class.ilBookmarkFolder.php.
Referenced by ilBookmarkFolder(), and read().
ilBookmarkFolder::$parent |
Definition at line 51 of file class.ilBookmarkFolder.php.
ilBookmarkFolder::$title |
Definition at line 50 of file class.ilBookmarkFolder.php.
ilBookmarkFolder::$tree |
Definition at line 40 of file class.ilBookmarkFolder.php.
Referenced by getObjects(), getRootFolder(), and isRootFolder().