ILIAS
release_5-2 Revision v5.2.25-18-g3f80b828510
◀ ilDoc Overview
class.ilPageEditorSettings.php
Go to the documentation of this file.
1
<?
php
2
/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3
11
class
ilPageEditorSettings
12
{
13
// settings groups. each group contains one or multiple
14
// page parent types
15
protected
static
$option_groups
=
array
(
16
"lm"
=>
array
(
"lm"
),
17
"wiki"
=>
array
(
"wpg"
),
18
"scorm"
=>
array
(
"sahs"
),
19
"glo"
=>
array
(
"gdf"
),
20
"test"
=>
array
(
"qpl"
),
21
"rep"
=>
array
(
"root"
,
"cat"
,
"grp"
,
"crs"
,
"fold"
)
22
);
23
27
static
function
getGroups
()
28
{
29
return
self::$option_groups;
30
}
31
35
static
function
writeSetting
($a_grp, $a_name, $a_value)
36
{
37
global
$ilDB
;
38
39
$ilDB->manipulate(
"DELETE FROM page_editor_settings WHERE "
.
40
"settings_grp = "
.$ilDB->quote($a_grp,
"text"
).
41
" AND name = "
.$ilDB->quote($a_name,
"text"
)
42
);
43
44
$ilDB->manipulate(
"INSERT INTO page_editor_settings "
.
45
"(settings_grp, name, value) VALUES ("
.
46
$ilDB->quote($a_grp,
"text"
).
","
.
47
$ilDB->quote($a_name,
"text"
).
","
.
48
$ilDB->quote($a_value,
"text"
).
49
")"
);
50
}
51
55
static
function
lookupSetting
($a_grp, $a_name, $a_default =
false
)
56
{
57
global
$ilDB
;
58
59
$set = $ilDB->query(
"SELECT value FROM page_editor_settings "
.
60
" WHERE settings_grp = "
.$ilDB->quote($a_grp,
"text"
).
61
" AND name = "
.$ilDB->quote($a_name,
"text"
)
62
);
63
if
($rec = $ilDB->fetchAssoc($set))
64
{
65
return
$rec[
"value"
];
66
}
67
68
return
$a_default;
69
}
70
74
static
function
lookupSettingByParentType
($a_par_type, $a_name, $a_default =
false
)
75
{
76
foreach
(self::$option_groups as $g => $types)
77
{
78
if
(in_array($a_par_type, $types))
79
{
80
$grp = $g;
81
}
82
}
83
84
if
($grp !=
""
)
85
{
86
return
ilPageEditorSettings::lookupSetting
($grp, $a_name, $a_default);
87
}
88
89
return
$a_default;
90
}
91
92
}
93
?>
ilPageEditorSettings\$option_groups
static $option_groups
Definition:
class.ilPageEditorSettings.php:15
ilPageEditorSettings\lookupSetting
static lookupSetting($a_grp, $a_name, $a_default=false)
Lookup setting.
Definition:
class.ilPageEditorSettings.php:55
ilPageEditorSettings\getGroups
static getGroups()
Get all settings groups.
Definition:
class.ilPageEditorSettings.php:27
ilPageEditorSettings\writeSetting
static writeSetting($a_grp, $a_name, $a_value)
Write Setting.
Definition:
class.ilPageEditorSettings.php:35
ilPageEditorSettings
Page editor settings.
Definition:
class.ilPageEditorSettings.php:11
array
Create styles array
The data for the language used.
Definition:
40duplicateStyle.php:19
ilPageEditorSettings\lookupSettingByParentType
static lookupSettingByParentType($a_par_type, $a_name, $a_default=false)
Lookup setting by parent type.
Definition:
class.ilPageEditorSettings.php:74
$ilDB
global $ilDB
Definition:
storeScorm2004.php:16
php
Services
COPage
classes
class.ilPageEditorSettings.php
Generated on Fri Jan 24 2025 19:01:07 for ILIAS by
1.8.13 (using
Doxyfile
)