ILIAS
release_5-3 Revision v5.3.23-19-g915713cf615
◀ ilDoc Overview
class.ilMailTemplateDataProvider.php
Go to the documentation of this file.
1
<?php
2
/* Copyright (c) 1998-2015 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4
require_once
'Services/Mail/classes/class.ilMailTemplate.php'
;
5
10
class
ilMailTemplateDataProvider
11
{
15
protected
$mail_templates
=
array
();
16
20
protected
$db
;
21
25
public
function
__construct
()
26
{
27
global
$DIC
;
28
29
$this->db = $DIC->database();
30
31
$this->
read
();
32
}
33
37
private
function
read
()
38
{
39
$res
= $this->db->query(
'SELECT * FROM mail_man_tpl'
);
40
while
(
$row
= $this->db->fetchAssoc(
$res
)) {
41
$this->mail_templates[
$row
[
'tpl_id'
]] =
new
ilMailTemplate
($row);
42
}
43
}
44
48
public
function
getTableData
()
49
{
50
$list
=
array
();
51
foreach
($this->mail_templates as $objMailTpl) {
52
$list
[] =
array
(
53
'tpl_id'
=> $objMailTpl->getTplId(),
54
'title'
=> $objMailTpl->getTitle(),
55
'context'
=> $objMailTpl->getContext(),
56
'lang'
=> $objMailTpl->getLang()
57
);
58
}
59
60
return
$list
;
61
}
62
67
public
function
getTemplateById
($tpl_id)
68
{
69
return
$this->mail_templates[$tpl_id];
70
}
71
76
public
function
getTemplateByContextId
($context_id)
77
{
78
return
array_filter($this->mail_templates,
function
(
ilMailTemplate
$template
) use ($context_id) {
79
return
$context_id === $template->
getContext
();
80
});
81
}
82
86
public
function
deleteTemplates
($tpl_ids =
array
())
87
{
88
if
(count($tpl_ids) > 0) {
89
$this->db->manipulate(
90
'
91
DELETE FROM mail_man_tpl WHERE '
.
92
$this->db->in(
'tpl_id'
, $tpl_ids,
false
,
'integer'
)
93
);
94
}
95
}
96
}
$list
if(isset($_REQUEST['delete'])) $list
Definition:
registry.php:41
ilMailTemplateDataProvider\$mail_templates
$mail_templates
Definition:
class.ilMailTemplateDataProvider.php:15
$template
$template
Definition:
consentAdmin.php:207
$DIC
global $DIC
Definition:
saml.php:7
ilMailTemplateDataProvider\__construct
__construct()
ilMailTemplateDataProvider constructor.
Definition:
class.ilMailTemplateDataProvider.php:25
ilMailTemplateDataProvider\getTemplateById
getTemplateById($tpl_id)
Definition:
class.ilMailTemplateDataProvider.php:67
ilMailTemplateDataProvider\$db
$db
Definition:
class.ilMailTemplateDataProvider.php:20
ilMailTemplate
Class ilMailTemplate.
Definition:
class.ilMailTemplate.php:8
ilMailTemplateDataProvider
Class ilMailTemplateDataProvider.
Definition:
class.ilMailTemplateDataProvider.php:10
$res
foreach($_POST as $key=> $value) $res
Definition:
save_question_post_data.php:15
ilMailTemplate\getContext
getContext()
Definition:
class.ilMailTemplate.php:99
ilMailTemplateDataProvider\read
read()
Definition:
class.ilMailTemplateDataProvider.php:37
array
Create styles array
The data for the language used.
Definition:
40duplicateStyle.php:19
ilMailTemplateDataProvider\deleteTemplates
deleteTemplates($tpl_ids=array())
Definition:
class.ilMailTemplateDataProvider.php:86
ilMailTemplateDataProvider\getTemplateByContextId
getTemplateByContextId($context_id)
Definition:
class.ilMailTemplateDataProvider.php:76
$row
$row
Definition:
10autofilter-selection-1.php:74
ilMailTemplateDataProvider\getTableData
getTableData()
Definition:
class.ilMailTemplateDataProvider.php:48
Services
Mail
classes
class.ilMailTemplateDataProvider.php
Generated on Sat Jan 18 2025 19:01:33 for ILIAS by
1.8.13 (using
Doxyfile
)