ILIAS
release_5-2 Revision v5.2.25-18-g3f80b828510
◀ 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
{
18
var
$id
= 0;
19
var
$content
=
""
;
20
26
function
__construct
($a_id = 0)
27
{
28
if
($a_id > 0)
29
{
30
$this->
setId
($a_id);
31
$this->
read
();
32
}
33
}
34
40
function
getId
()
41
{
42
return
$this->id
;
43
}
44
50
function
setId
($a_id)
51
{
52
$this->
id
= $a_id;
53
}
54
60
function
getContent
()
61
{
62
return
$this->content
;
63
}
64
70
function
setContent
(
$a_content
)
71
{
72
$this->content =
$a_content
;
73
}
74
78
function
read
()
79
{
80
global
$ilDB
;
81
82
$set = $ilDB->query(
"SELECT * FROM xhtml_page WHERE id = "
.
83
$ilDB->quote($this->getId(),
"integer"
));
84
if
($rec = $ilDB->fetchAssoc($set))
85
{
86
$this->
setContent
($rec[
"content"
]);
87
}
88
}
89
93
static
function
_lookupContent
($a_id)
94
{
95
global
$ilDB
;
96
97
$set = $ilDB->query(
"SELECT content FROM xhtml_page WHERE id = "
.
98
$ilDB->quote($a_id,
"integer"
));
99
if
($rec = $ilDB->fetchAssoc($set))
100
{
101
return
$rec[
"content"
];
102
}
103
}
104
108
static
function
_lookupSavedContent
($a_id)
109
{
110
global
$ilDB
;
111
112
$set = $ilDB->query(
"SELECT save_content FROM xhtml_page WHERE id = "
.
113
$ilDB->quote($a_id,
"integer"
));
114
if
($rec = $ilDB->fetchAssoc($set))
115
{
116
return
$rec[
"save_content"
];
117
}
118
}
119
123
function
save
()
124
{
125
global
$ilDB
;
126
127
if
($this->
getId
() > 0)
128
{
129
$old_content =
ilXHTMLPage::_lookupContent
($this->
getId
());
130
$ilDB->update(
"xhtml_page"
,
array
(
131
"content"
=>
array
(
"clob"
, $this->
getContent
()),
132
"save_content"
=>
array
(
"clob"
, $old_content)
133
),
array
(
134
"id"
=>
array
(
"integer"
, $this->
getId
())
135
));
136
}
137
else
138
{
139
$this->
setId
($ilDB->nextId(
"xhtml_page"
));
140
$ilDB->insert(
"xhtml_page"
,
array
(
141
"id"
=>
array
(
"integer"
, $this->
getId
()),
142
"content"
=>
array
(
"clob"
, $this->
getContent
())
143
));
144
}
145
}
146
150
function
undo
()
151
{
152
global
$ilDB
;
153
154
if
($this->
getId
() > 0)
155
{
156
$content =
ilXHTMLPage::_lookupContent
($this->
getId
());
157
$save_content =
ilXHTMLPage::_lookupSavedContent
($this->
getId
());
158
$ilDB->update(
"xhtml_page"
,
array
(
159
"content"
=>
array
(
"clob"
, $save_content),
160
"save_content"
=>
array
(
"clob"
, $content)
161
),
array
(
162
"id"
=>
array
(
"integer"
, $this->
getId
())
163
));
164
}
165
}
166
170
function
clear
()
171
{
172
global
$ilDB
;
173
174
if
($this->
getId
() > 0)
175
{
176
$this->
setContent
(
""
);
177
$this->
save
();
178
}
179
}
180
181
}
182
?>
ilXHTMLPage\getId
getId()
Get page ID.
Definition:
class.ilXHTMLPage.php:40
ilXHTMLPage\_lookupContent
static _lookupContent($a_id)
Lookup Content.
Definition:
class.ilXHTMLPage.php:93
ilXHTMLPage\$id
$id
Definition:
class.ilXHTMLPage.php:18
ilXHTMLPage\read
read()
Read page data from database.
Definition:
class.ilXHTMLPage.php:78
ilXHTMLPage\getContent
getContent()
Get content of page.
Definition:
class.ilXHTMLPage.php:60
ilXHTMLPage\save
save()
Save the page.
Definition:
class.ilXHTMLPage.php:123
ilXHTMLPage\__construct
__construct($a_id=0)
Constructor.
Definition:
class.ilXHTMLPage.php:26
$a_content
$a_content
Definition:
workflow.php:94
ilXHTMLPage\$content
$content
Definition:
class.ilXHTMLPage.php:19
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:150
$ilDB
global $ilDB
Definition:
storeScorm2004.php:16
ilXHTMLPage\setContent
setContent($a_content)
Set content of page.
Definition:
class.ilXHTMLPage.php:70
php
ilXHTMLPage\setId
setId($a_id)
Set page ID.
Definition:
class.ilXHTMLPage.php:50
ilXHTMLPage\_lookupSavedContent
static _lookupSavedContent($a_id)
Lookup Saved Content.
Definition:
class.ilXHTMLPage.php:108
ilXHTMLPage\clear
clear()
Clear page.
Definition:
class.ilXHTMLPage.php:170
Services
XHTMLPage
classes
class.ilXHTMLPage.php
Generated on Fri Jan 17 2025 19:01:20 for ILIAS by
1.8.13 (using
Doxyfile
)