ILIAS
release_8 Revision v8.19
◀ ilDoc Overview
Main Page
Related Pages
Modules
+
Namespaces
Namespace List
+
Namespace Members
+
All
$
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
u
v
w
x
+
Functions
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
+
Variables
$
a
b
c
d
e
f
g
h
j
l
m
p
s
t
u
+
Data Structures
Data Structures
Data Structure Index
Class Hierarchy
+
Data Fields
+
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Ö
+
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Variables
$
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Ö
+
Files
File List
+
Globals
+
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
z
+
Functions
_
a
b
c
d
e
g
h
i
m
n
p
r
s
t
u
v
x
+
Variables
$
a
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
z
Examples
•
All
Data Structures
Namespaces
Files
Functions
Variables
Modules
Pages
class.ilContentStyleSettings.php
Go to the documentation of this file.
1
<?php
2
3
declare(strict_types=1);
4
25
class
ilContentStyleSettings
26
{
27
protected
ilDBInterface
$db
;
28
public
array
$styles
= array();
29
30
public
function
__construct
()
31
{
32
global
$DIC
;
33
34
$this->db = $DIC->database();
35
$this->
read
();
36
}
37
41
public
function
addStyle
(
int
$a_style_id): void
42
{
43
$this->styles[$a_style_id] =
44
array(
"id"
=> $a_style_id,
45
"title"
=>
ilObject::_lookupTitle
($a_style_id));
46
}
47
51
public
function
removeStyle
(
int
$a_id): void
52
{
53
unset($this->styles[$a_id]);
54
}
55
56
public
function
update
(): bool
57
{
58
$ilDB
=
$this->db
;
59
60
// save styles of style folder
61
// note: there are no different style folders in ILIAS, only the one in the settings
62
$q =
"DELETE FROM style_folder_styles"
;
63
$ilDB
->manipulate($q);
64
foreach
($this->styles as $style) {
65
$q =
"INSERT INTO style_folder_styles (folder_id, style_id) VALUES"
.
66
"("
.
$ilDB
->quote(0,
"integer"
) .
", "
.
67
$ilDB
->quote((
int
) $style[
"id"
],
"integer"
) .
")"
;
68
$ilDB
->manipulate($q);
69
}
70
71
return
true
;
72
}
73
74
public
function
read
(): void
75
{
76
$ilDB
=
$this->db
;
77
78
// get styles of style folder
79
$q =
"SELECT * FROM style_folder_styles JOIN style_data ON (style_id = style_data.id)"
;
80
81
$style_set =
$ilDB
->query($q);
82
$this->styles = array();
83
while
($style_rec =
$ilDB
->fetchAssoc($style_set)) {
84
$this->styles[$style_rec[
"style_id"
]] =
85
array(
"id"
=> $style_rec[
"style_id"
],
86
"title"
=>
ilObject::_lookupTitle
((
int
) $style_rec[
"style_id"
]),
87
"category"
=> $style_rec[
"category"
]);
88
}
89
90
$this->styles =
91
ilArrayUtil::sortArray
($this->styles,
"title"
,
"asc"
,
false
,
true
);
92
}
93
94
public
function
getStyles
(): array
95
{
96
return
$this->styles
;
97
}
98
}
ilContentStyleSettings\update
update()
Definition:
class.ilContentStyleSettings.php:56
ilContentStyleSettings\$db
ilDBInterface $db
Definition:
class.ilContentStyleSettings.php:27
ilContentStyleSettings\addStyle
addStyle(int $a_style_id)
Add style to style folder.
Definition:
class.ilContentStyleSettings.php:41
ilContentStyleSettings\__construct
__construct()
Definition:
class.ilContentStyleSettings.php:30
ilContentStyleSettings\read
read()
Definition:
class.ilContentStyleSettings.php:74
$DIC
global $DIC
Definition:
feed.php:28
$ilDB
$ilDB
Definition:
storeScorm2004.php:26
ilObject\_lookupTitle
static _lookupTitle(int $obj_id)
Definition:
class.ilObject.php:837
ilContentStyleSettings
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition:
class.ilContentStyleSettings.php:25
ilContentStyleSettings\removeStyle
removeStyle(int $a_id)
remove Style from style list
Definition:
class.ilContentStyleSettings.php:51
ilDBInterface
ilContentStyleSettings\$styles
array $styles
Definition:
class.ilContentStyleSettings.php:28
ilContentStyleSettings\getStyles
getStyles()
Definition:
class.ilContentStyleSettings.php:94
ilArrayUtil\sortArray
static sortArray(array $array, string $a_array_sortby_key, string $a_array_sortorder="asc", bool $a_numeric=false, bool $a_keep_keys=false)
Definition:
class.ilArrayUtil.php:94
Services
Style
Content
classes
class.ilContentStyleSettings.php
Generated on Tue Apr 1 2025 22:02:34 for ILIAS by
1.8.13 (using
Doxyfile
)