Elgg  Version master
records.php
Go to the documentation of this file.
1 <?php
10 $user = elgg_extract('entity', $vars);
11 if (!$user instanceof \ElggUser) {
12  return;
13 }
14 
16 if (empty($methods)) {
17  return;
18 }
19 
20 // generic personal preferences
22 $params['description'] = elgg_echo('usersettings:notifications:default:description');
23 $params['purpose'] = 'default';
24 
25 echo elgg_view('notifications/settings/record', $params);
26 
27 // content creation preferences
28 $params = $vars;
29 $params['description'] = elgg_echo('usersettings:notifications:content_create:description');
30 $params['purpose'] = 'content_create';
31 
32 echo elgg_view('notifications/settings/record', $params);
33 
34 // comment creation preferences
35 $params = $vars;
36 $params['description'] = elgg_echo('usersettings:notifications:create_comment:description');
37 $params['purpose'] = 'create_comment';
38 
39 echo elgg_view('notifications/settings/record', $params);
40 
41 // mention preferences
42 $params = $vars;
43 $params['description'] = elgg_echo('usersettings:notifications:mentions:description');
44 $params['purpose'] = 'mentions';
45 
46 echo elgg_view('notifications/settings/record', $params);
47 
48 if ($user->isAdmin() && (bool) elgg_get_config('require_admin_validation') && (bool) elgg_get_config('admin_validation_notification')) {
49  $params = $vars;
50  $params['description'] = elgg_echo('usersettings:notifications:admin_validation_notification:description');
51  $params['purpose'] = 'admin_validation_notification';
52 
53  echo elgg_view('notifications/settings/record', $params);
54 }
$user
Show the different notification settings / preferences for the given user.
Definition: records.php:10
elgg_get_config(string $name, $default=null)
Get an Elgg configuration value.
if(empty($methods)) $params
Definition: records.php:21
elgg_echo(string $message_key, array $args=[], string $language= '')
Elgg language module Functions to manage language and translations.
Definition: languages.php:17
if(!$user instanceof\ElggUser) $methods
Definition: records.php:15
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
elgg_view(string $view, array $vars=[], string $viewtype= '')
Return a parsed view.
Definition: views.php:156
$vars
Definition: theme.php:5
elgg_get_notification_methods()
Returns registered delivery methods for notifications [ &#39;email&#39; => &#39;email&#39;, &#39;sms&#39; => &#39;sms&#39;...