ILIAS
release_5-3 Revision v5.3.23-19-g915713cf615
◀ ilDoc Overview
class.ilXHTMLPage.php
Go to the documentation of this file.
1
<?php
2
/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3
16
class
ilXHTMLPage
17
{
21
protected
$db
;
22
23
public
$id
= 0;
24
public
$content
=
""
;
25
31
public
function
__construct
($a_id = 0)
32
{
33
global
$DIC
;
34
35
$this->db = $DIC->database();
36
if
($a_id > 0) {
37
$this->
setId
($a_id);
38
$this->
read
();
39
}
40
}
41
47
public
function
getId
()
48
{
49
return
$this->id
;
50
}
51
57
public
function
setId
($a_id)
58
{
59
$this->
id
= $a_id;
60
}
61
67
public
function
getContent
()
68
{
69
return
$this->content
;
70
}
71
77
public
function
setContent
(
$a_content
)
78
{
79
$this->content =
$a_content
;
80
}
81
85
public
function
read
()
86
{
87
$ilDB
=
$this->db
;
88
89
$set =
$ilDB
->query(
"SELECT * FROM xhtml_page WHERE id = "
.
90
$ilDB
->quote($this->getId(),
"integer"
));
91
if
($rec =
$ilDB
->fetchAssoc($set)) {
92
$this->
setContent
($rec[
"content"
]);
93
}
94
}
95
99
public
static
function
_lookupContent
($a_id)
100
{
101
global
$DIC
;
102
103
$ilDB
= $DIC->database();
104
105
$set =
$ilDB
->query(
"SELECT content FROM xhtml_page WHERE id = "
.
106
$ilDB
->quote($a_id,
"integer"
));
107
if
($rec =
$ilDB
->fetchAssoc($set)) {
108
return
$rec[
"content"
];
109
}
110
}
111
115
public
static
function
_lookupSavedContent
($a_id)
116
{
117
global
$DIC
;
118
119
$ilDB
= $DIC->database();
120
121
$set =
$ilDB
->query(
"SELECT save_content FROM xhtml_page WHERE id = "
.
122
$ilDB
->quote($a_id,
"integer"
));
123
if
($rec =
$ilDB
->fetchAssoc($set)) {
124
return
$rec[
"save_content"
];
125
}
126
}
127
131
public
function
save
()
132
{
133
$ilDB
=
$this->db
;
134
135
if
($this->
getId
() > 0) {
136
$old_content =
ilXHTMLPage::_lookupContent
($this->
getId
());
137
$ilDB
->update(
"xhtml_page"
,
array
(
138
"content"
=>
array
(
"clob"
, $this->
getContent
()),
139
"save_content"
=>
array
(
"clob"
, $old_content)
140
),
array
(
141
"id"
=>
array
(
"integer"
, $this->
getId
())
142
));
143
}
else
{
144
$this->
setId
(
$ilDB
->nextId(
"xhtml_page"
));
145
$ilDB
->insert(
"xhtml_page"
,
array
(
146
"id"
=>
array
(
"integer"
, $this->
getId
()),
147
"content"
=>
array
(
"clob"
, $this->
getContent
())
148
));
149
}
150
}
151
155
public
function
undo
()
156
{
157
$ilDB
=
$this->db
;
158
159
if
($this->
getId
() > 0) {
160
$content
=
ilXHTMLPage::_lookupContent
($this->
getId
());
161
$save_content =
ilXHTMLPage::_lookupSavedContent
($this->
getId
());
162
$ilDB
->update(
"xhtml_page"
,
array
(
163
"content"
=>
array
(
"clob"
, $save_content),
164
"save_content"
=>
array
(
"clob"
,
$content
)
165
),
array
(
166
"id"
=>
array
(
"integer"
, $this->
getId
())
167
));
168
}
169
}
170
174
public
function
clear
()
175
{
176
$ilDB
=
$this->db
;
177
178
if
($this->
getId
() > 0) {
179
$this->
setContent
(
""
);
180
$this->
save
();
181
}
182
}
183
}
ilXHTMLPage\getId
getId()
Get page ID.
Definition:
class.ilXHTMLPage.php:47
$DIC
global $DIC
Definition:
saml.php:7
ilXHTMLPage\_lookupContent
static _lookupContent($a_id)
Lookup Content.
Definition:
class.ilXHTMLPage.php:99
ilXHTMLPage\$id
$id
Definition:
class.ilXHTMLPage.php:23
ilXHTMLPage\read
read()
Read page data from database.
Definition:
class.ilXHTMLPage.php:85
ilXHTMLPage\getContent
getContent()
Get content of page.
Definition:
class.ilXHTMLPage.php:67
ilXHTMLPage\save
save()
Save the page.
Definition:
class.ilXHTMLPage.php:131
ilXHTMLPage\$db
$db
Definition:
class.ilXHTMLPage.php:21
ilXHTMLPage\__construct
__construct($a_id=0)
Constructor.
Definition:
class.ilXHTMLPage.php:31
$a_content
$a_content
Definition:
workflow.php:93
ilXHTMLPage\$content
$content
Definition:
class.ilXHTMLPage.php:24
array
Create styles array
The data for the language used.
Definition:
40duplicateStyle.php:19
ilXHTMLPage
XHTML Page class.
Definition:
class.ilXHTMLPage.php:16
ilXHTMLPage\undo
undo()
Undo last change.
Definition:
class.ilXHTMLPage.php:155
$ilDB
global $ilDB
Definition:
storeScorm2004.php:16
ilXHTMLPage\setContent
setContent($a_content)
Set content of page.
Definition:
class.ilXHTMLPage.php:77
ilXHTMLPage\setId
setId($a_id)
Set page ID.
Definition:
class.ilXHTMLPage.php:57
ilXHTMLPage\_lookupSavedContent
static _lookupSavedContent($a_id)
Lookup Saved Content.
Definition:
class.ilXHTMLPage.php:115
ilXHTMLPage\clear
clear()
Clear page.
Definition:
class.ilXHTMLPage.php:174
Services
XHTMLPage
classes
class.ilXHTMLPage.php
Generated on Sat Jan 18 2025 19:01:42 for ILIAS by
1.8.13 (using
Doxyfile
)