ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f87
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 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 public More...
 
 getTitle ()
 
 setDescription ($a_str)
 set description public More...
 
 getDescription ()
 
 setTarget ($a_target)
 set target 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.

References $ilDB, and $ilias.

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

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
+ Here is the caller graph for this function:

◆ create()

ilBookmark::create ( )

Create new bookmark item.

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

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

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  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
global $ilDB
+ Here is the call graph for this function:

◆ delete()

ilBookmark::delete ( )

Delete bookmark data.

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

References $ilDB, and getId().

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  }
global $ilDB
+ Here is the call graph for this function:

◆ getDescription()

ilBookmark::getDescription ( )

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

References $description.

Referenced by create().

192  {
193  return $this->description;
194  }
+ Here is the caller graph for this function:

◆ getId()

ilBookmark::getId ( )

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

References $id.

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

163  {
164  return $this->id;
165  }
+ Here is the caller graph for this function:

◆ getParent()

ilBookmark::getParent ( )

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

References $parent.

Referenced by create().

218  {
219  return $this->parent;
220  }
+ Here is the caller graph for this function:

◆ getTarget()

ilBookmark::getTarget ( )

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

References $target.

Referenced by create().

208  {
209  return $this->target;
210  }
+ Here is the caller graph for this function:

◆ getTitle()

ilBookmark::getTitle ( )

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

References $title.

Referenced by create().

178  {
179  return $this->title;
180  }
+ Here is the caller graph for this function:

◆ ilBookmark()

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

Constructor public.

Parameters
integeruser_id (optional)

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

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

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  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
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...
+ 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.

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

Referenced by ilBookmark().

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 public
setTitle($a_str)
set title public
setParent($a_parent_id)
setDescription($a_str)
set description public
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setDescription()

ilBookmark::setDescription (   $a_str)

set description public

Parameters
string

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

Referenced by read().

187  {
188  $this->description = $a_str;
189  }
+ Here is the caller graph for this function:

◆ setId()

ilBookmark::setId (   $a_id)

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

Referenced by create().

158  {
159  $this->id = $a_id;
160  }
+ Here is the caller graph for this function:

◆ setParent()

ilBookmark::setParent (   $a_parent_id)

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

Referenced by read().

213  {
214  $this->parent = $a_parent_id;
215  }
+ Here is the caller graph for this function:

◆ setTarget()

ilBookmark::setTarget (   $a_target)

set target public

Parameters
string

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

Referenced by read().

202  {
203  $this->target = $a_target;
204  }
+ Here is the caller graph for this function:

◆ setTitle()

ilBookmark::setTitle (   $a_str)

set title public

Parameters
string

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

Referenced by read().

173  {
174  $this->title = $a_str;
175  }
+ Here is the caller graph for this function:

◆ update()

ilBookmark::update ( )

Update bookmark item.

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

References $ilDB.

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  }
global $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: