27 $this->message = $a_message;
41 foreach ($this->context->getPlaceholders() as
$key => $ph_definition) {
42 $result = $this->context->resolvePlaceholder($key, $a_context_params,
$user);
43 if (!$replace_empty && strlen(
$result) == 0) {
47 $startTag =
'\[IF_' . strtoupper($key) .
'\]';
48 $endTag =
'\[\/IF_' . strtoupper($key) .
'\]';
53 if (array_key_exists(
'supportsCondition', $ph_definition) && $ph_definition[
'supportsCondition']) {
54 $message = preg_replace(
'/' . $startTag .
'(.*?)' . $endTag .
'/imsU',
'$1',
$message);
57 $message = preg_replace(
'/[[:space:]]{1,1}\[' . $ph_definition[
'placeholder'] .
'\][[:space:]]{1,1}/ims',
' ',
$message);
58 $message = preg_replace(
'/\[' . $ph_definition[
'placeholder'] .
'\]/ims',
'',
$message);
60 if (array_key_exists(
'supportsCondition', $ph_definition) && $ph_definition[
'supportsCondition']) {
61 $message = preg_replace(
'/' . $startTag .
'.*?' . $endTag .
'/imsU',
'',
$message);
resolve(ilObjUser $user=null, $a_context_params=array(), $replace_empty=true)
__construct(ilMailTemplateContext $context, $a_message)
ilMailTemplateProcessor constructor.
Class ilMailTemplateContext.
Class ilMailTemplaceProcessor.