Elgg  Version master
salutation.php
Go to the documentation of this file.
1 <?php
11 
12 $recipient = elgg_extract('recipient', $vars);
13 $language = elgg_extract('language', $vars);
14 
15 $notification = elgg_extract('notification', $vars);
16 if ($notification instanceof Notification) {
17  $recipient = $notification->getRecipient();
18  $language = $notification->language;
19 }
20 
21 if (!$recipient instanceof ElggEntity) {
22  return;
23 }
24 
25 if (empty($language) && $recipient instanceof ElggUser) {
26  $language = $recipient->getLanguage();
27 }
28 
29 echo elgg_echo('notification:default:salutation', [$recipient->getDisplayName()], $language);
$language
Definition: salutation.php:13
$recipient
Definition: salutation.php:12
elgg_echo(string $message_key, array $args=[], string $language= '')
Elgg language module Functions to manage language and translations.
Definition: languages.php:17
Notification container.
elgg_extract($key, $array, $default=null, bool $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
Definition: elgglib.php:254
$notification
Definition: salutation.php:15
$vars
Definition: theme.php:5