ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilBookmark Class Reference

Class Bookmarks Bookmark management. More...

+ Collaboration diagram for ilBookmark:

Public Member Functions

 ilBookmark ($a_bm_id=0, $a_tree_id=0)
 Constructor @access public. More...
 
 read ()
 read bookmark folder data from db More...
 
 delete ()
 Delete bookmark data. More...
 
 create ()
 Create new bookmark item. More...
 
 update ()
 Update bookmark item. More...
 
 setId ($a_id)
 
 getId ()
 
 setTitle ($a_str)
 set title @access public More...
 
 getTitle ()
 
 setDescription ($a_str)
 set description @access public More...
 
 getDescription ()
 
 setTarget ($a_target)
 set target @access public More...
 
 getTarget ()
 
 setParent ($a_parent_id)
 
 getParent ()
 

Static Public Member Functions

static _getTypeOfId ($a_id)
 get type of a given id More...
 

Data Fields

 $user_Id
 
 $ilias
 
 $tree
 
 $title
 
 $description
 
 $target
 
 $id
 
 $parent
 

Detailed Description

Class Bookmarks Bookmark management.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Manfred Thaler manfr.nosp@m.ed.t.nosp@m.haler.nosp@m.@end.nosp@m.o7.co.nosp@m.m
Version
$Id$

Definition at line 17 of file class.ilBookmark.php.

Member Function Documentation

◆ _getTypeOfId()

static ilBookmark::_getTypeOfId (   $a_id)
static

get type of a given id

Parameters
numberid

Definition at line 226 of file class.ilBookmark.php.

227 {
228 global $ilias, $ilDB;
229
230 $q = "SELECT * FROM bookmark_data WHERE obj_id = ".
231 $ilDB->quote($a_id, "integer");
232 $bm_set = $ilDB->query($q);
233 if ($ilDB->numRows($bm_set) == 0)
234 {
235 return null;
236 }
237 else
238 {
239 $bm = $ilDB->fetchAssoc($bm_set);
240 return $bm["type"];
241 }
242 }
global $ilDB

References $ilDB, and $ilias.

Referenced by ilBookmarkAdministrationGUI\confirm(), and ilBookmarkAdministrationGUI\delete().

+ Here is the caller graph for this function:

◆ create()

ilBookmark::create ( )

Create new bookmark item.

Definition at line 113 of file class.ilBookmark.php.

114 {
115 global $ilDB;
116
117 $this->setId($ilDB->nextId("bookmark_data"));
118 $q = sprintf(
119 "INSERT INTO bookmark_data (obj_id, user_id, title,description, target, type) ".
120 "VALUES (%s,%s,%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($this->getDescription(), "text"),
125 $ilDB->quote($this->getTarget(), "text"),
126 $ilDB->quote('bm', "text")
127 );
128
129 $ilDB->manipulate($q);
130 $this->tree->insertNode($this->getId(), $this->getParent());
131 }
$_SESSION["AccountId"]

References $_SESSION, $ilDB, getId(), getParent(), and setId().

+ Here is the call graph for this function:

◆ delete()

ilBookmark::delete ( )

Delete bookmark data.

Definition at line 97 of file class.ilBookmark.php.

98 {
99 global $ilDB;
100
101 if ($this->getId() != 1)
102 {
103 $q = "DELETE FROM bookmark_data WHERE obj_id = ".
104 $ilDB->quote($this->getId(), "integer");
105 $ilDB->manipulate($q);
106 }
107 }

References $ilDB, and getId().

+ Here is the call graph for this function:

◆ getDescription()

ilBookmark::getDescription ( )

Definition at line 191 of file class.ilBookmark.php.

192 {
193 return $this->description;
194 }

References $description.

◆ getId()

ilBookmark::getId ( )

Definition at line 162 of file class.ilBookmark.php.

163 {
164 return $this->id;
165 }

References $id.

Referenced by create(), delete(), and read().

+ Here is the caller graph for this function:

◆ getParent()

ilBookmark::getParent ( )

Definition at line 217 of file class.ilBookmark.php.

218 {
219 return $this->parent;
220 }

References $parent.

Referenced by create().

+ Here is the caller graph for this function:

◆ getTarget()

ilBookmark::getTarget ( )

Definition at line 207 of file class.ilBookmark.php.

208 {
209 return $this->target;
210 }

References $target.

◆ getTitle()

ilBookmark::getTitle ( )

Definition at line 177 of file class.ilBookmark.php.

178 {
179 return $this->title;
180 }

References $title.

◆ ilBookmark()

ilBookmark::ilBookmark (   $a_bm_id = 0,
  $a_tree_id = 0 
)

Constructor @access public.

Parameters
integeruser_id (optional)

Definition at line 45 of file class.ilBookmark.php.

46 {
47 global $ilias;
48
49 // Initiate variables
50 $this->ilias =& $ilias;
51 if ($a_tree_id == 0)
52 {
53 $a_tree_id = $_SESSION["AccountId"];
54 }
55
56 $this->tree = new ilTree($a_tree_id);
57 $this->tree->setTableNames('bookmark_tree','bookmark_data');
58
59 $this->id = $a_bm_id;
60
61 if(!empty($this->id))
62 {
63 $this->read();
64 }
65
66 }
read()
read bookmark folder data from db
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
redirection script todo: (a better solution should control the processing via a xml file)

References $_SESSION, $ilias, and read().

+ Here is the call graph for this function:

◆ read()

ilBookmark::read ( )

read bookmark folder data from db

Definition at line 72 of file class.ilBookmark.php.

73 {
74 global $ilias, $ilDB;
75
76 $q = "SELECT * FROM bookmark_data WHERE obj_id = ".
77 $ilDB->quote($this->getId(), "integer");
78 $bm_set = $ilDB->query($q);
79 if ($ilDB->numRows($bm_set) == 0)
80 {
81 $message = "ilBookmark::read(): Bookmark with id ".$this->id." not found!";
82 $ilias->raiseError($message,$ilias->error_obj->WARNING);
83 }
84 else
85 {
86 $bm = $ilDB->fetchAssoc($bm_set);
87 $this->setTitle($bm["title"]);
88 $this->setDescription($bm["description"]);
89 $this->setTarget($bm["target"]);
90 $this->setParent($this->tree->getParentId($this->id));
91 }
92 }
setTarget($a_target)
set target @access public
setParent($a_parent_id)
setTitle($a_str)
set title @access public
setDescription($a_str)
set description @access public

References $ilDB, $ilias, getId(), setDescription(), setParent(), setTarget(), and setTitle().

Referenced by ilBookmark().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setDescription()

ilBookmark::setDescription (   $a_str)

set description @access public

Parameters
string

Definition at line 186 of file class.ilBookmark.php.

187 {
188 $this->description = $a_str;
189 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setId()

ilBookmark::setId (   $a_id)

Definition at line 157 of file class.ilBookmark.php.

158 {
159 $this->id = $a_id;
160 }

Referenced by create().

+ Here is the caller graph for this function:

◆ setParent()

ilBookmark::setParent (   $a_parent_id)

Definition at line 212 of file class.ilBookmark.php.

213 {
214 $this->parent = $a_parent_id;
215 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setTarget()

ilBookmark::setTarget (   $a_target)

set target @access public

Parameters
string

Definition at line 201 of file class.ilBookmark.php.

202 {
203 $this->target = $a_target;
204 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setTitle()

ilBookmark::setTitle (   $a_str)

set title @access public

Parameters
string

Definition at line 172 of file class.ilBookmark.php.

173 {
174 $this->title = $a_str;
175 }

Referenced by read().

+ Here is the caller graph for this function:

◆ update()

ilBookmark::update ( )

Update bookmark item.

Definition at line 136 of file class.ilBookmark.php.

137 {
138 global $ilDB;
139
140 $q = sprintf(
141 "UPDATE bookmark_data SET title=%s,description=%s,target=%s ".
142 "WHERE obj_id=%s",
143 $ilDB->quote($this->getTitle(), "text"),
144 $ilDB->quote($this->getDescription(), "text"),
145 $ilDB->quote($this->getTarget(), "text"),
146 $ilDB->quote($this->getId(), "integer")
147 );
148 $ilDB->manipulate($q);
149 }

References $ilDB.

Field Documentation

◆ $description

ilBookmark::$description

Definition at line 35 of file class.ilBookmark.php.

Referenced by getDescription().

◆ $id

ilBookmark::$id

Definition at line 37 of file class.ilBookmark.php.

Referenced by getId().

◆ $ilias

ilBookmark::$ilias

Definition at line 31 of file class.ilBookmark.php.

Referenced by _getTypeOfId(), ilBookmark(), and read().

◆ $parent

ilBookmark::$parent

Definition at line 38 of file class.ilBookmark.php.

Referenced by getParent().

◆ $target

ilBookmark::$target

Definition at line 36 of file class.ilBookmark.php.

Referenced by getTarget().

◆ $title

ilBookmark::$title

Definition at line 34 of file class.ilBookmark.php.

Referenced by getTitle().

◆ $tree

ilBookmark::$tree

Definition at line 32 of file class.ilBookmark.php.

◆ $user_Id

ilBookmark::$user_Id

Definition at line 24 of file class.ilBookmark.php.


The documentation for this class was generated from the following file: