ILIAS  eassessment Revision 61809
 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 24763 2010-07-21 09:01:16Z mwarkus

Definition at line 13 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 222 of file class.ilBookmark.php.

References $ilDB, and $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 109 of file class.ilBookmark.php.

References $_SESSION, $ilDB, 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 93 of file class.ilBookmark.php.

References $ilDB, and 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 187 of file class.ilBookmark.php.

References $description.

Referenced by create().

{
}

+ Here is the caller graph for this function:

ilBookmark::getId ( )

Definition at line 158 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 213 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 203 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 173 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 41 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 68 of file class.ilBookmark.php.

References $ilDB, $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 182 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 153 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 208 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 197 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 168 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 132 of file class.ilBookmark.php.

References $ilDB.

{
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 31 of file class.ilBookmark.php.

Referenced by getDescription().

ilBookmark::$id

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

Referenced by getId().

ilBookmark::$ilias

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

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

ilBookmark::$parent

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

Referenced by getParent().

ilBookmark::$target

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

Referenced by getTarget().

ilBookmark::$title

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

Referenced by getTitle().

ilBookmark::$tree

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

ilBookmark::$user_Id

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


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