Elgg  Version 3.0
notifications.php
Go to the documentation of this file.
1 <?php
10 if (!$page_owner instanceof ElggUser) {
11  return;
12 }
13 
14 $NOTIFICATION_HANDLERS = _elgg_services()->notifications->getMethodsAsDeprecatedGlobal();
15 $notification_settings = $page_owner->getNotificationSettings();
16 
17 $title = elgg_echo('notifications:usersettings');
18 
19 $rows = '';
20 
21 // Loop through options
22 foreach ($NOTIFICATION_HANDLERS as $k => $v) {
23  if ($notification_settings[$k]) {
24  $val = "yes";
25  } else {
26  $val = "no";
27  }
28 
29  $radio = elgg_view('input/radio', [
30  'name' => "method[$k]",
31  'value' => $val,
32  'options' => [
33  elgg_echo('option:yes') => 'yes',
34  elgg_echo('option:no') => 'no'
35  ],
36  ]);
37 
38  $cells = '<td class="prm pbl">' . elgg_echo("notification:method:$k") . ': </td>';
39  $cells .= "<td>$radio</td>";
40 
41  $rows .= "<tr>$cells</tr>";
42 }
43 
44 $content = "<table>$rows</table>";
45 
elgg_echo($message_key, array $args=[], $language="")
Given a message key, returns an appropriately translated full-text string.
Definition: languages.php:21
if(!$page_owner instanceof ElggUser) $NOTIFICATION_HANDLERS
$title
elgg_view_module($type, $title, $body, array $vars=[])
Wrapper function for the module display pattern.
Definition: views.php:1198
foreach($NOTIFICATION_HANDLERS as $k=> $v) $content
elgg echo
Translates a string.
Definition: languages.js:43
elgg_get_page_owner_entity()
Gets the owner entity for the current page.
Definition: pageowner.php:65
_elgg_services()
Get the global service provider.
Definition: elgglib.php:1292
$rows
$notification_settings
$page_owner
elgg_view($view, $vars=[], $viewtype= '')
Return a parsed view.
Definition: views.php:246