ILIAS  release_4-4 Revision
ilHtmlBlock Class Reference

A HTML block allows to present simple HTML within a block. More...

+ Inheritance diagram for ilHtmlBlock:
+ Collaboration diagram for ilHtmlBlock:

Public Member Functions

 __construct ($a_id=0)
 Constructor. More...
 
 setContent ($a_content)
 Set Content. More...
 
 getContent ()
 Get Content. More...
 
 create ()
 Create new item. More...
 
 read ()
 Read item from database. More...
 
 update ()
 Update item in database. More...
 
 delete ()
 Delete item from database. More...
 
- Public Member Functions inherited from ilCustomBlock
 __construct ($a_id=0)
 Constructor. More...
 
 setId ($a_id)
 Set Id. More...
 
 getId ()
 Get Id. More...
 
 setContextObjId ($a_context_obj_id)
 Set ContextObjId. More...
 
 getContextObjId ()
 Get ContextObjId. More...
 
 setContextObjType ($a_context_obj_type)
 Set ContextObjType. More...
 
 getContextObjType ()
 Get ContextObjType. More...
 
 setContextSubObjId ($a_context_sub_obj_id)
 Set ContextSubObjId. More...
 
 getContextSubObjId ()
 Get ContextSubObjId. More...
 
 setContextSubObjType ($a_context_sub_obj_type)
 Set ContextSubObjType. More...
 
 getContextSubObjType ()
 Get ContextSubObjType. More...
 
 setType ($a_type)
 Set Type. More...
 
 getType ()
 Get Type. More...
 
 setTitle ($a_title)
 Set Title. More...
 
 getTitle ()
 Get Title. More...
 
 create ()
 Create new item. More...
 
 read ()
 Read item from database. More...
 
 update ()
 Update item in database. More...
 
 delete ()
 Delete item from database. More...
 
 querygetBlocksForContext ()
 Query getBlocksForContext. More...
 
 queryBlocksForContext ()
 Query BlocksForContext. More...
 
 queryTitleForId ()
 Query TitleForId. More...
 
 queryCntBlockForContext ()
 Query CntBlockForContext. More...
 

Protected Attributes

 $content
 
- Protected Attributes inherited from ilCustomBlock
 $id
 
 $context_obj_id
 
 $context_obj_type
 
 $context_sub_obj_id
 
 $context_sub_obj_type
 
 $type
 
 $title
 

Detailed Description

A HTML block allows to present simple HTML within a block.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 12 of file class.ilHtmlBlock.php.

Constructor & Destructor Documentation

◆ __construct()

ilHtmlBlock::__construct (   $a_id = 0)

Constructor.

Parameters
int$a_id

Definition at line 22 of file class.ilHtmlBlock.php.

References read(), and ilCustomBlock\setId().

23  {
24  if ($a_id > 0)
25  {
26  $this->setId($a_id);
27  $this->read();
28  }
29 
30  }
setId($a_id)
Set Id.
read()
Read item from database.
+ Here is the call graph for this function:

Member Function Documentation

◆ create()

ilHtmlBlock::create ( )

Create new item.

Definition at line 56 of file class.ilHtmlBlock.php.

References $query, getContent(), and ilCustomBlock\getId().

57  {
58  global $ilDB;
59 
60  parent::create();
61 
62  $query = "INSERT INTO il_html_block (".
63  " id".
64  ", content".
65  " ) VALUES (".
66  $ilDB->quote($this->getId(), "integer")
67  .",".$ilDB->quote($this->getContent(), "text").")";
68  $ilDB->manipulate($query);
69 
70 
71  }
getContent()
Get Content.
+ Here is the call graph for this function:

◆ delete()

ilHtmlBlock::delete ( )

Delete item from database.

Definition at line 114 of file class.ilHtmlBlock.php.

References $query, and ilCustomBlock\getId().

115  {
116  global $ilDB;
117 
118  parent::delete();
119 
120  $query = "DELETE FROM il_html_block".
121  " WHERE id = ".$ilDB->quote($this->getId(), "integer");
122 
123  $ilDB->manipulate($query);
124 
125  }
+ Here is the call graph for this function:

◆ getContent()

ilHtmlBlock::getContent ( )

Get Content.

Returns
string HTML content of the block.

Definition at line 47 of file class.ilHtmlBlock.php.

References $content.

Referenced by create(), and update().

48  {
49  return $this->content;
50  }
+ Here is the caller graph for this function:

◆ read()

ilHtmlBlock::read ( )

Read item from database.

Definition at line 77 of file class.ilHtmlBlock.php.

References $query, ilCustomBlock\getId(), and setContent().

Referenced by __construct().

78  {
79  global $ilDB;
80 
81  parent::read();
82 
83  $query = "SELECT * FROM il_html_block WHERE id = ".
84  $ilDB->quote($this->getId(), "integer");
85  $set = $ilDB->query($query);
86  $rec = $ilDB->fetchAssoc($set);
87 
88  $this->setContent($rec["content"]);
89 
90  }
setContent($a_content)
Set Content.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setContent()

ilHtmlBlock::setContent (   $a_content)

Set Content.

Parameters
string$a_contentHTML content of the block.

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

Referenced by read().

38  {
39  $this->content = $a_content;
40  }
+ Here is the caller graph for this function:

◆ update()

ilHtmlBlock::update ( )

Update item in database.

Definition at line 96 of file class.ilHtmlBlock.php.

References $query, getContent(), and ilCustomBlock\getId().

97  {
98  global $ilDB;
99 
100  parent::update();
101 
102  $query = "UPDATE il_html_block SET ".
103  " content = ".$ilDB->quote($this->getContent(), "text").
104  " WHERE id = ".$ilDB->quote($this->getId(), "integer");
105 
106  $ilDB->manipulate($query);
107 
108  }
getContent()
Get Content.
+ Here is the call graph for this function:

Field Documentation

◆ $content

ilHtmlBlock::$content
protected

Definition at line 15 of file class.ilHtmlBlock.php.

Referenced by getContent().


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