ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
◀ ilDoc Overview
class.ilDidacticTemplateSettings.php
Go to the documentation of this file.
1
<?
php
2
/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4
include_once
'./Services/DidacticTemplate/classes/class.ilDidacticTemplateSetting.php'
;
5
12
class
ilDidacticTemplateSettings
13
{
14
private
static
$instance
= null;
15
private
static
$instances
= null;
16
17
18
private
$templates
= array();
19
private
$obj_type
=
''
;
20
25
private
function
__construct
($a_obj_type =
''
)
26
{
27
$this->obj_type = $a_obj_type;
28
$this->
read
();
29
}
30
35
public
static
function
getInstance
()
36
{
37
if
(self::$instance) {
38
return
self::$instance;
39
}
40
return
self::$instance =
new
ilDidacticTemplateSettings
();
41
}
42
48
public
static
function
getInstanceByObjectType
($a_obj_type)
49
{
50
if
(self::$instances[$a_obj_type]) {
51
return
self::$instances[$a_obj_type];
52
}
53
return
self::$instances[$a_obj_type] =
new
ilDidacticTemplateSettings
($a_obj_type);
54
}
55
60
public
function
getTemplates
()
61
{
62
return
(array)
$this->templates
;
63
}
64
69
public
function
getObjectType
()
70
{
71
return
$this->obj_type
;
72
}
73
77
public
function
readInactive
()
78
{
79
global
$DIC
;
80
81
$ilDB
= $DIC[
'ilDB'
];
82
83
$query
=
'SELECT dtpl.id FROM didactic_tpl_settings dtpl '
;
84
85
if
($this->
getObjectType
()) {
86
$query
.=
'JOIN didactic_tpl_sa tplsa ON dtpl.id = tplsa.id '
;
87
}
88
$query
.=
'WHERE enabled = '
.
$ilDB
->quote(0,
'integer'
) .
' '
;
89
90
if
($this->
getObjectType
()) {
91
$query
.=
'AND obj_type = '
.
$ilDB
->quote($this->
getObjectType
(),
'text'
);
92
}
93
94
$res
=
$ilDB
->query(
$query
);
95
while
(
$row
=
$res
->fetchRow(
ilDBConstants::FETCHMODE_OBJECT
)) {
96
$this->templates[
$row
->id] =
new
ilDidacticTemplateSetting
(
$row
->id);
97
}
98
return
true
;
99
}
100
106
protected
function
read
()
107
{
108
global
$DIC
;
109
110
$ilDB
= $DIC[
'ilDB'
];
111
112
$query
=
'SELECT dtpl.id FROM didactic_tpl_settings dtpl '
;
113
114
if
($this->
getObjectType
()) {
115
$query
.=
'JOIN didactic_tpl_sa tplsa ON dtpl.id = tplsa.id '
;
116
}
117
$query
.=
'WHERE enabled = '
.
$ilDB
->quote(1,
'integer'
) .
' '
;
118
119
if
($this->
getObjectType
()) {
120
$query
.=
'AND obj_type = '
.
$ilDB
->quote($this->
getObjectType
(),
'text'
);
121
}
122
123
$res
=
$ilDB
->query(
$query
);
124
while
(
$row
=
$res
->fetchRow(
ilDBConstants::FETCHMODE_OBJECT
)) {
125
$this->templates[
$row
->id] =
new
ilDidacticTemplateSetting
(
$row
->id);
126
}
127
return
true
;
128
}
129
}
ilDidacticTemplateSettings\$instances
static $instances
Definition:
class.ilDidacticTemplateSettings.php:15
$DIC
global $DIC
Definition:
saml.php:7
ilDidacticTemplateSetting
Definition:
class.ilDidacticTemplateSetting.php:10
ilDidacticTemplateSettings\$instance
static $instance
Definition:
class.ilDidacticTemplateSettings.php:14
ilDidacticTemplateSettings\getInstance
static getInstance()
Get singelton instance.
Definition:
class.ilDidacticTemplateSettings.php:35
ilDidacticTemplateSettings\getTemplates
getTemplates()
Get templates.
Definition:
class.ilDidacticTemplateSettings.php:60
ilDidacticTemplateSettings\getObjectType
getObjectType()
Get object type.
Definition:
class.ilDidacticTemplateSettings.php:69
ilDidacticTemplateSettings\$obj_type
$obj_type
Definition:
class.ilDidacticTemplateSettings.php:19
ilDidacticTemplateSettings\$templates
$templates
Definition:
class.ilDidacticTemplateSettings.php:18
$res
foreach($_POST as $key=> $value) $res
Definition:
save_question_post_data.php:15
ilDidacticTemplateSettings\read
read()
Read active didactic templates ilDB $ilDB.
Definition:
class.ilDidacticTemplateSettings.php:106
ilDidacticTemplateSettings
Definition:
class.ilDidacticTemplateSettings.php:12
$query
$query
Definition:
proxy_ylocal.php:13
$row
$row
Definition:
migrateto20.php:360
ilDidacticTemplateSettings\__construct
__construct($a_obj_type='')
Constructor.
Definition:
class.ilDidacticTemplateSettings.php:25
ilDidacticTemplateSettings\getInstanceByObjectType
static getInstanceByObjectType($a_obj_type)
Get instance by obj type.
Definition:
class.ilDidacticTemplateSettings.php:48
$ilDB
global $ilDB
Definition:
storeScorm2004.php:16
php
ilDBConstants\FETCHMODE_OBJECT
const FETCHMODE_OBJECT
Definition:
class.ilDBConstants.php:13
ilDidacticTemplateSettings\readInactive
readInactive()
Read disabled templates.
Definition:
class.ilDidacticTemplateSettings.php:77
Services
DidacticTemplate
classes
class.ilDidacticTemplateSettings.php
Generated on Thu Jan 30 2025 19:01:57 for ILIAS by
1.8.13 (using
Doxyfile
)