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) | |
_lookupTitle ($a_bmf_id) | |
lookup bookmark folder title | |
getObjects ($a_id) | |
static | |
getObject ($a_id) | |
static | |
isRootFolder ($a_id) | |
getRootFolder () | |
_getParentId ($a_id) | |
Data Fields | |
$tree | |
$ilias | |
$id | |
$title | |
$parent |
Definition at line 34 of file class.ilBookmarkFolder.php.
ilBookmarkFolder::_getParentId | ( | $ | a_id | ) |
Definition at line 282 of file class.ilBookmarkFolder.php.
References $_SESSION, and $tree.
Referenced by ilBookmarkAdministrationGUI::getPDBookmarkListHTMLFlat().
{ $a_tree_id = $_SESSION["AccountId"]; $tree = new ilTree($a_tree_id); $tree->setTableNames('bookmark_tree','bookmark_data'); return $tree->getParentId($a_id); }
ilBookmarkFolder::_lookupTitle | ( | $ | a_bmf_id | ) |
lookup bookmark folder title
Definition at line 190 of file class.ilBookmarkFolder.php.
References $q.
ilBookmarkFolder::create | ( | ) |
creates new bookmark folder in db
note: parent and title must be set
Definition at line 131 of file class.ilBookmarkFolder.php.
References $_SESSION, $q, getId(), getParent(), getTitle(), and setId().
{ $q = sprintf( "INSERT INTO bookmark_data (user_id, title, type) ". "VALUES (%s,%s,%s)", $this->ilias->db->quote($_SESSION["AccountId"]), $this->ilias->db->quote($this->getTitle()), $this->ilias->db->quote('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 114 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 157 of file class.ilBookmarkFolder.php.
Referenced by create(), delete(), and read().
{
return $this->id;
}
ilBookmarkFolder::getObject | ( | $ | a_id | ) |
static
Definition at line 242 of file class.ilBookmarkFolder.php.
References $_SESSION, and $tree.
Referenced by ilBookmarkImportExport::_exportBookmark().
{ $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(); } $object = $tree->getNodeData($a_id); return $object; }
ilBookmarkFolder::getObjects | ( | $ | a_id | ) |
static
Definition at line 204 of file class.ilBookmarkFolder.php.
References $_SESSION, $key, and $tree.
Referenced by ilBookmarkImportExport::__parseExport(), ilBookmarkAdministrationGUI::getPDBookmarkListHTMLFlat(), 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 177 of file class.ilBookmarkFolder.php.
Referenced by create().
{
return $this->parent;
}
ilBookmarkFolder::getRootFolder | ( | ) |
ilBookmarkFolder::getTitle | ( | ) |
Definition at line 167 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 59 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 257 of file class.ilBookmarkFolder.php.
References $_SESSION, and $tree.
Referenced by ilBookmarkAdministrationGUI::getPDBookmarkListHTMLFlat().
{ $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 83 of file class.ilBookmarkFolder.php.
References $ilias, $q, getId(), setParent(), and setTitle().
Referenced by ilBookmarkFolder().
{ global $ilias; $q = "SELECT * FROM bookmark_data WHERE obj_id = ".$this->ilias->db->quote($this->getId()); $bmf_set = $this->ilias->db->query($q); if ($bmf_set->numRows() == 0) { $message = "ilBookmarkFolder::read(): Bookmark Folder with id ".$this->getId()." 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->getId())); } }
ilBookmarkFolder::setId | ( | $ | a_id | ) |
Definition at line 162 of file class.ilBookmarkFolder.php.
Referenced by create().
{
$this->id = $a_id;
}
ilBookmarkFolder::setParent | ( | $ | a_parent_id | ) |
Definition at line 182 of file class.ilBookmarkFolder.php.
Referenced by read().
{ $this->parent = $a_parent_id; }
ilBookmarkFolder::setTitle | ( | $ | a_title | ) |
Definition at line 172 of file class.ilBookmarkFolder.php.
Referenced by read().
{ $this->title = $a_title; }
ilBookmarkFolder::update | ( | ) |
Definition at line 145 of file class.ilBookmarkFolder.php.
References $q.
ilBookmarkFolder::$id |
Definition at line 50 of file class.ilBookmarkFolder.php.
ilBookmarkFolder::$ilias |
Definition at line 48 of file class.ilBookmarkFolder.php.
Referenced by ilBookmarkFolder(), and read().
ilBookmarkFolder::$parent |
Definition at line 52 of file class.ilBookmarkFolder.php.
ilBookmarkFolder::$title |
Definition at line 51 of file class.ilBookmarkFolder.php.
ilBookmarkFolder::$tree |
Definition at line 41 of file class.ilBookmarkFolder.php.
Referenced by _getParentId(), getObject(), getObjects(), getRootFolder(), and isRootFolder().