ILIAS
release_4-4 Revision
◀ ilDoc Overview
class.ilHtmlBlock.php
Go to the documentation of this file.
1
<?php
2
/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4
include_once(
"./Services/Block/classes/class.ilCustomBlock.php"
);
5
12
class
ilHtmlBlock
extends
ilCustomBlock
13
{
14
15
protected
$content
;
16
22
public
function
__construct
($a_id = 0)
23
{
24
if
($a_id > 0)
25
{
26
$this->
setId
($a_id);
27
$this->
read
();
28
}
29
30
}
31
37
public
function
setContent
($a_content)
38
{
39
$this->content = $a_content;
40
}
41
47
public
function
getContent
()
48
{
49
return
$this->content
;
50
}
51
56
public
function
create
()
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
}
72
77
public
function
read
()
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
}
91
96
public
function
update
()
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
}
109
114
public
function
delete
()
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
}
126
127
128
}
129
?>
ilCustomBlock\getId
getId()
Get Id.
Definition:
class.ilCustomBlock.php:52
ilHtmlBlock\create
create()
Create new item.
Definition:
class.ilHtmlBlock.php:56
ilCustomBlock\setId
setId($a_id)
Set Id.
Definition:
class.ilCustomBlock.php:42
$query
$query
Definition:
examplelayouts.sql.php:24
ilHtmlBlock
A HTML block allows to present simple HTML within a block.
Definition:
class.ilHtmlBlock.php:12
ilHtmlBlock\$content
$content
Definition:
class.ilHtmlBlock.php:15
ilHtmlBlock\read
read()
Read item from database.
Definition:
class.ilHtmlBlock.php:77
ilCustomBlock
This is the super class of all custom blocks.
Definition:
class.ilCustomBlock.php:11
ilHtmlBlock\setContent
setContent($a_content)
Set Content.
Definition:
class.ilHtmlBlock.php:37
ilHtmlBlock\update
update()
Update item in database.
Definition:
class.ilHtmlBlock.php:96
ilHtmlBlock\getContent
getContent()
Get Content.
Definition:
class.ilHtmlBlock.php:47
ilHtmlBlock\__construct
__construct($a_id=0)
Constructor.
Definition:
class.ilHtmlBlock.php:22
Services
Block
classes
class.ilHtmlBlock.php
Generated on Mon Dec 21 2020 19:01:10 for ILIAS by
1.8.13 (using
Doxyfile
)