Elgg  Version 2.2
 All Classes Namespaces Files Functions Variables Pages
notifications.php
Go to the documentation of this file.
1 <?php
9 $NOTIFICATION_HANDLERS = _elgg_services()->notifications->getMethodsAsDeprecatedGlobal();
11 
12 $title = elgg_echo('notifications:usersettings');
13 
14 $rows = '';
15 
16 // Loop through options
17 foreach ($NOTIFICATION_HANDLERS as $k => $v) {
18 
19  if ($notification_settings->$k) {
20  $val = "yes";
21  } else {
22  $val = "no";
23  }
24 
25  $radio = elgg_view('input/radio', array(
26  'name' => "method[$k]",
27  'value' => $val,
28  'options' => array(
29  elgg_echo('option:yes') => 'yes',
30  elgg_echo('option:no') => 'no'
31  ),
32  ));
33 
34  $cells = '<td class="prm pbl">' . elgg_echo("notification:method:$k") . ': </td>';
35  $cells .= "<td>$radio</td>";
36 
37  $rows .= "<tr>$cells</tr>";
38 }
39 
40 $content = '';
41 $content .= "<table>$rows</table>";
42 
43 echo elgg_view_module('info', $title, $content);
elgg_echo($message_key, $args=array(), $language="")
Given a message key, returns an appropriately translated full-text string.
Definition: languages.php:21
$title
elgg_view($view, $vars=array(), $ignore1=false, $ignore2=false, $viewtype= '')
Return a parsed view.
Definition: views.php:342
_elgg_services(\Elgg\Di\ServiceProvider $services=null)
Get the global service provider.
Definition: autoloader.php:17
elgg_view_module($type, $title, $body, array $vars=array())
Wrapper function for the module display pattern.
Definition: views.php:1207
$NOTIFICATION_HANDLERS
$rows
$notification_settings
get_user_notification_settings($user_guid=0)
Get the notification settings for a given user.
elgg_get_page_owner_guid($guid=0)
Gets the guid of the entity that owns the current page.
Definition: pageowner.php:22
foreach($NOTIFICATION_HANDLERS as $k=> $v) $content