4 require_once
'./Services/Language/classes/class.ilLanguageFactory.php';
25 return $this->language ? $this->language : $DIC->language();
40 abstract public function getId();
62 'mail_salutation' =>
array(
63 'placeholder' =>
'MAIL_SALUTATION',
64 'label' => $DIC->language()->txt(
'mail_nacc_salutation')
66 'first_name' =>
array(
67 'placeholder' =>
'FIRST_NAME',
68 'label' => $DIC->language()->txt(
'firstname')
71 'placeholder' =>
'LAST_NAME',
72 'label' => $DIC->language()->txt(
'lastname')
75 'placeholder' =>
'LOGIN',
76 'label' => $DIC->language()->txt(
'mail_nacc_login')
79 'placeholder' =>
'TITLE',
80 'label' => $DIC->language()->txt(
'mail_nacc_title'),
81 'supportsCondition' => true
84 'placeholder' =>
'ILIAS_URL',
85 'label' => $DIC->language()->txt(
'mail_nacc_ilias_url')
87 'client_name' =>
array(
88 'placeholder' =>
'CLIENT_NAME',
89 'label' => $DIC->language()->txt(
'mail_nacc_client_name')
100 $placeholders = self::getGenericPlaceholders();
103 return $placeholders + $specific;
130 if ($recipient !== null) {
140 case (
'mail_salutation' == $placeholder_id && $recipient !== null):
141 switch ($recipient->getGender()) {
143 $resolved = $this->
getLanguage()->txt(
'mail_salutation_f');
147 $resolved = $this->
getLanguage()->txt(
'mail_salutation_m');
151 $resolved = $this->
getLanguage()->txt(
'mail_salutation_n');
155 $resolved = $this->
getLanguage()->txt(
'mail_salutation_n');
159 case (
'first_name' == $placeholder_id && $recipient !== null):
160 $resolved = $recipient->getFirstname();
163 case (
'last_name' == $placeholder_id && $recipient !== null):
164 $resolved = $recipient->getLastname();
167 case (
'login' == $placeholder_id && $recipient !== null):
168 $resolved = $recipient->getLogin();
171 case (
'title' == $placeholder_id && $recipient !== null):
172 $resolved = $recipient->getUTitle();
175 case 'ilias_url' == $placeholder_id:
176 $resolved = ILIAS_HTTP_PATH .
'/login.php?client_id=' . CLIENT_ID;
179 case 'client_name' == $placeholder_id:
180 $resolved = CLIENT_NAME;
183 case !in_array($placeholder_id, array_keys(self::getGenericPlaceholders())):
208 $this->language->loadLanguageModule(
'mail');
resolveSpecificPlaceholder($placeholder_id, array $context_parameters, ilObjUser $recipient=null, $html_markup=false)
getSpecificPlaceholders()
Return an array of placeholders.
getId()
Returns a unique (in the context of mail template contexts) id.
static setLanguage($a_lng)
set language
resolvePlaceholder($placeholder_id, array $context_parameters, ilObjUser $recipient=null, $html_markup=false)
initLanguage(ilObjUser $user)
static _getLanguage($a_lang_key='')
Get langauge object.
getTitle()
Returns a translated title (depending on the current language) which is displayed in the user interfa...
initLanguageByIso2Code($a_code)
Init language by ISO2 code.
Class ilMailTemplateContext.
Create styles array
The data for the language used.
getPlaceholders()
Return an array of placeholders.
getDescription()
Returns a translated description (depending on the current language) which is displayed in the user i...
static getGenericPlaceholders()
static getLanguage()
set language
getLanguage()
returns a 2char-language-string public