ILIAS
release_5-2 Revision v5.2.25-18-g3f80b828510
◀ ilDoc Overview
class.ilMailTemplatePlaceholderResolver.php
Go to the documentation of this file.
1
<?
php
2
/* Copyright (c) 1998-2016 ILIAS open source, Extended GPL, see docs/LICENSE */
3
7
class
ilMailTemplatePlaceholderResolver
8
{
12
protected
$context
;
13
17
protected
$message
;
18
24
public
function
__construct
(
ilMailTemplateContext
$context
, $a_message)
25
{
26
$this->context =
$context
;
27
$this->message = $a_message;
28
}
29
37
public
function
resolve
(
ilObjUser
$user = null, $a_context_params =
array
(), $replace_empty =
true
)
38
{
39
$message
=
$this->message
;
40
41
foreach
($this->context->getPlaceholders() as $key => $ph_definition)
42
{
43
$result
= $this->context->resolvePlaceholder($key, $a_context_params, $user);
44
45
if
(!$replace_empty && strlen(
$result
) === 0)
46
{
47
continue
;
48
}
49
50
$message
= str_replace(
'['
. $ph_definition[
'placeholder'
] .
']'
,
$result
,
$message
);
51
}
52
53
return
$message
;
54
}
55
}
ilMailTemplatePlaceholderResolver\resolve
resolve(ilObjUser $user=null, $a_context_params=array(), $replace_empty=true)
Definition:
class.ilMailTemplatePlaceholderResolver.php:37
$result
$result
Definition:
CleanUpTest.php:407
ilMailTemplatePlaceholderResolver\__construct
__construct(ilMailTemplateContext $context, $a_message)
ilMailTemplateProcessor constructor.
Definition:
class.ilMailTemplatePlaceholderResolver.php:24
ilMailTemplatePlaceholderResolver\$context
$context
Definition:
class.ilMailTemplatePlaceholderResolver.php:12
ilMailTemplateContext
Class ilMailTemplateContext.
Definition:
class.ilMailTemplateContext.php:11
ilMailTemplatePlaceholderResolver
Class ilMailTemplaceProcessor.
Definition:
class.ilMailTemplatePlaceholderResolver.php:7
array
Create styles array
The data for the language used.
Definition:
40duplicateStyle.php:19
php
ilObjUser
Definition:
class.ilObjUser.php:25
ilMailTemplatePlaceholderResolver\$message
$message
Definition:
class.ilMailTemplatePlaceholderResolver.php:17
Services
Mail
classes
class.ilMailTemplatePlaceholderResolver.php
Generated on Fri Jan 17 2025 19:01:14 for ILIAS by
1.8.13 (using
Doxyfile
)