ILIAS
release_5-3 Revision v5.3.23-19-g915713cf615
◀ ilDoc Overview
class.ilContentStyleSettings.php
Go to the documentation of this file.
1
<?php
2
3
/* Copyright (c) 1998-2014 ILIAS open source, Extended GPL, see docs/LICENSE */
4
12
class
ilContentStyleSettings
13
{
17
protected
$db
;
18
19
public
$styles
=
array
();
20
24
public
function
__construct
()
25
{
26
global
$DIC
;
27
28
$this->db = $DIC->database();
29
$this->
read
();
30
}
31
37
public
function
addStyle
($a_style_id)
38
{
39
$this->styles[$a_style_id] =
40
array
(
"id"
=> $a_style_id,
41
"title"
=>
ilObject::_lookupTitle
($a_style_id));
42
}
43
44
48
public
function
removeStyle
($a_id)
49
{
50
unset($this->styles[$a_id]);
51
}
52
53
59
public
function
update
()
60
{
61
$ilDB
=
$this->db
;
62
63
// save styles of style folder
64
// note: there are no different style folders in ILIAS, only the one in the settings
65
$q =
"DELETE FROM style_folder_styles"
;
66
$ilDB
->manipulate($q);
67
foreach
($this->styles as
$style
) {
68
$q =
"INSERT INTO style_folder_styles (folder_id, style_id) VALUES"
.
69
"("
.
$ilDB
->quote((
int
) 0,
"integer"
) .
", "
.
70
$ilDB
->quote((
int
) $style[
"id"
],
"integer"
) .
")"
;
71
$ilDB
->manipulate($q);
72
}
73
74
return
true
;
75
}
76
80
public
function
read
()
81
{
82
$ilDB
=
$this->db
;
83
84
// get styles of style folder
85
$q =
"SELECT * FROM style_folder_styles JOIN style_data ON (style_id = style_data.id)"
;
86
87
$style_set =
$ilDB
->query($q);
88
$this->styles =
array
();
89
while
($style_rec =
$ilDB
->fetchAssoc($style_set)) {
90
$this->styles[$style_rec[
"style_id"
]] =
91
array
(
"id"
=> $style_rec[
"style_id"
],
92
"title"
=>
ilObject::_lookupTitle
($style_rec[
"style_id"
]),
93
"category"
=> $style_rec[
"category"
]);
94
}
95
96
$this->styles =
97
ilUtil::sortArray
($this->styles,
"title"
,
"asc"
,
false
,
true
);
98
}
99
100
106
public
function
getStyles
()
107
{
108
return
$this->styles
;
109
}
110
}
ilUtil\sortArray
static sortArray( $array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
Definition:
class.ilUtil.php:3107
ilContentStyleSettings\addStyle
addStyle($a_style_id)
Add style to style folder.
Definition:
class.ilContentStyleSettings.php:37
$style
$style
Definition:
example_012.php:70
ilContentStyleSettings\update
update()
update object data
Definition:
class.ilContentStyleSettings.php:59
$DIC
global $DIC
Definition:
saml.php:7
ilContentStyleSettings\$db
$db
Definition:
class.ilContentStyleSettings.php:17
ilContentStyleSettings\__construct
__construct()
Constructor.
Definition:
class.ilContentStyleSettings.php:24
ilObject\_lookupTitle
static _lookupTitle($a_id)
lookup object title
Definition:
class.ilObject.php:933
ilContentStyleSettings\read
read()
read style folder data
Definition:
class.ilContentStyleSettings.php:80
ilContentStyleSettings\removeStyle
removeStyle($a_id)
remove Style from style list
Definition:
class.ilContentStyleSettings.php:48
ilContentStyleSettings\$styles
$styles
Definition:
class.ilContentStyleSettings.php:19
ilContentStyleSettings
Content style settings.
Definition:
class.ilContentStyleSettings.php:12
array
Create styles array
The data for the language used.
Definition:
40duplicateStyle.php:19
$ilDB
global $ilDB
Definition:
storeScorm2004.php:16
ilContentStyleSettings\getStyles
getStyles()
get style ids
Definition:
class.ilContentStyleSettings.php:106
Services
Style
Content
classes
class.ilContentStyleSettings.php
Generated on Sat Jan 18 2025 19:01:38 for ILIAS by
1.8.13 (using
Doxyfile
)