ILIAS
trunk Revision v11.0_alpha-2662-g519ff7d528f
◀ ilDoc Overview
class.ilMailTemplateContextAdapter.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
30
class
ilMailTemplateContextAdapter
31
{
32
public
function
__construct
(
34
protected
array $contexts,
35
protected
array $context_parameter,
36
protected
readonly Mustache_Engine $mustache_engine,
37
protected
?
ilObjUser
$recipient =
null
38
) {
39
}
40
41
public
function
withContext
(
ilMailTemplateContext
$context
): self
42
{
43
$clone = clone $this;
44
$clone->contexts[] =
$context
;
45
return
$clone;
46
}
47
48
public
function
__isset
(
string
$name): bool
49
{
50
foreach
($this->contexts as
$context
) {
51
$possible_placeholder =
array_map
(
52
static
function
($placeholder):
string
{
53
return
strtoupper($placeholder);
54
},
55
array_keys($context->getPlaceholders())
56
);
57
if
(in_array($name, $possible_placeholder,
true
)) {
58
return
true
;
59
}
60
}
61
62
return
false
;
63
}
64
65
public
function
__get
(
string
$name): string
66
{
67
foreach
($this->contexts as
$context
) {
68
$ret = $context->resolvePlaceholder($name, $this->context_parameter, $this->recipient);
69
if
(in_array($name, $context->getNestedPlaceholders(),
true
)) {
70
$ret = $this->mustache_engine->render($ret, $this);
71
}
72
if
($ret !==
''
) {
73
return
$ret;
74
}
75
}
76
77
return
''
;
78
}
79
}
$context
$context
Definition:
webdav.php:31
array_map
null
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
Definition:
shib_logout.php:144
ilObjUser
ilMailTemplateContextAdapter
This class forms an interface between the existing ILIAS mail contexts and the requirements of Mustac...
Definition:
class.ilMailTemplateContextAdapter.php:30
ilMailTemplateContext
Definition:
class.ilMailTemplateContext.php:24
ilMailTemplateContextAdapter\withContext
withContext(ilMailTemplateContext $context)
Definition:
class.ilMailTemplateContextAdapter.php:41
ilMailTemplateContextAdapter\__isset
__isset(string $name)
Definition:
class.ilMailTemplateContextAdapter.php:48
ILIAS\GlobalScreen\Provider\__construct
__construct(Container $dic, ilPlugin $plugin)
Definition:
PluginProviderHelper.php:38
ilMailTemplateContextAdapter\__get
__get(string $name)
Definition:
class.ilMailTemplateContextAdapter.php:65
components
ILIAS
Mail
classes
Mustache
class.ilMailTemplateContextAdapter.php
Generated on Wed Sep 3 2025 23:03:24 for ILIAS by
1.8.13 (using
Doxyfile
)