ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
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.
 read ()
 read bookmark folder data from db
 delete ()
 Delete bookmark data.
 create ()
 Create new bookmark item.
 update ()
 Update bookmark item.
 setId ($a_id)
 getId ()
 setTitle ($a_str)
 set title public
 getTitle ()
 setDescription ($a_str)
 set description public
 getDescription ()
 setTarget ($a_target)
 set target public
 getTarget ()
 setParent ($a_parent_id)
 getParent ()

Static Public Member Functions

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

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:
class.ilBookmark.php 35228 2012-06-26 22:27:00Z akill

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

Member Function Documentation

static ilBookmark::_getTypeOfId (   $a_id)
static

get type of a given id

Parameters
numberid

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

References $ilias.

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

{
global $ilias, $ilDB;
$q = "SELECT * FROM bookmark_data WHERE obj_id = ".
$ilDB->quote($a_id, "integer");
$bm_set = $ilDB->query($q);
if ($ilDB->numRows($bm_set) == 0)
{
return null;
}
else
{
$bm = $ilDB->fetchAssoc($bm_set);
return $bm["type"];
}
}

+ Here is the caller graph for this function:

ilBookmark::create ( )

Create new bookmark item.

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

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

{
global $ilDB;
$this->setId($ilDB->nextId("bookmark_data"));
$q = sprintf(
"INSERT INTO bookmark_data (obj_id, user_id, title,description, target, type) ".
"VALUES (%s,%s,%s,%s,%s,%s)",
$ilDB->quote($this->getId(), "integer"),
$ilDB->quote($_SESSION["AccountId"], "integer"),
$ilDB->quote($this->getTitle(), "text"),
$ilDB->quote($this->getDescription(), "text"),
$ilDB->quote($this->getTarget(), "text"),
$ilDB->quote('bm', "text")
);
$ilDB->manipulate($q);
$this->tree->insertNode($this->getId(), $this->getParent());
}

+ Here is the call graph for this function:

ilBookmark::delete ( )

Delete bookmark data.

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

References getId().

{
global $ilDB;
if ($this->getId() != 1)
{
$q = "DELETE FROM bookmark_data WHERE obj_id = ".
$ilDB->quote($this->getId(), "integer");
$ilDB->manipulate($q);
}
}

+ Here is the call graph for this function:

ilBookmark::getDescription ( )

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

References $description.

Referenced by create().

{
}

+ Here is the caller graph for this function:

ilBookmark::getId ( )

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

References $id.

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

{
return $this->id;
}

+ Here is the caller graph for this function:

ilBookmark::getParent ( )

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

References $parent.

Referenced by create().

{
return $this->parent;
}

+ Here is the caller graph for this function:

ilBookmark::getTarget ( )

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

References $target.

Referenced by create().

{
return $this->target;
}

+ Here is the caller graph for this function:

ilBookmark::getTitle ( )

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

References $title.

Referenced by create().

{
return $this->title;
}

+ Here is the caller graph for this function:

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().

{
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_bm_id;
if(!empty($this->id))
{
$this->read();
}
}

+ Here is the call graph for this function:

ilBookmark::read ( )

read bookmark folder data from db

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

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

Referenced by ilBookmark().

{
global $ilias, $ilDB;
$q = "SELECT * FROM bookmark_data WHERE obj_id = ".
$ilDB->quote($this->getId(), "integer");
$bm_set = $ilDB->query($q);
if ($ilDB->numRows($bm_set) == 0)
{
$message = "ilBookmark::read(): Bookmark with id ".$this->id." not found!";
$ilias->raiseError($message,$ilias->error_obj->WARNING);
}
else
{
$bm = $ilDB->fetchAssoc($bm_set);
$this->setTitle($bm["title"]);
$this->setDescription($bm["description"]);
$this->setTarget($bm["target"]);
$this->setParent($this->tree->getParentId($this->id));
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilBookmark::setDescription (   $a_str)

set description public

Parameters
string

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

Referenced by read().

{
$this->description = $a_str;
}

+ Here is the caller graph for this function:

ilBookmark::setId (   $a_id)

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

Referenced by create().

{
$this->id = $a_id;
}

+ Here is the caller graph for this function:

ilBookmark::setParent (   $a_parent_id)

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

Referenced by read().

{
$this->parent = $a_parent_id;
}

+ Here is the caller graph for this function:

ilBookmark::setTarget (   $a_target)

set target public

Parameters
string

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

Referenced by read().

{
$this->target = $a_target;
}

+ Here is the caller graph for this function:

ilBookmark::setTitle (   $a_str)

set title public

Parameters
string

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

Referenced by read().

{
$this->title = $a_str;
}

+ Here is the caller graph for this function:

ilBookmark::update ( )

Update bookmark item.

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

{
global $ilDB;
$q = sprintf(
"UPDATE bookmark_data SET title=%s,description=%s,target=%s ".
"WHERE obj_id=%s",
$ilDB->quote($this->getTitle(), "text"),
$ilDB->quote($this->getDescription(), "text"),
$ilDB->quote($this->getTarget(), "text"),
$ilDB->quote($this->getId(), "integer")
);
$ilDB->manipulate($q);
}

Field Documentation

ilBookmark::$description

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

Referenced by getDescription().

ilBookmark::$id

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

Referenced by getId().

ilBookmark::$ilias

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

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

ilBookmark::$parent

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

Referenced by getParent().

ilBookmark::$target

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

Referenced by getTarget().

ilBookmark::$title

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

Referenced by getTitle().

ilBookmark::$tree

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

ilBookmark::$user_Id

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


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