Elgg  Version 2.3
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 $method => $dummy) {
23 
25  $val = "yes";
26  } else {
27  $val = "no";
28  }
29 
30  $radio = elgg_view('input/radio', array(
31  'name' => "method[$method]",
32  'value' => $val,
33  'options' => array(
34  elgg_echo('option:yes') => 'yes',
35  elgg_echo('option:no') => 'no'
36  ),
37  ));
38 
39  $cells = '<td class="prm pbl">' . elgg_echo("notification:method:$method") . ': </td>';
40  $cells .= "<td>$radio</td>";
41 
42  $rows .= "<tr>$cells</tr>";
43 }
44 
45 $content = '';
46 $content .= "<table>$rows</table>";
47 
elgg_echo($message_key, $args=array(), $language="")
Given a message key, returns an appropriately translated full-text string.
Definition: languages.php:21
$method
Definition: form.php:25
if(!$page_owner instanceof ElggUser) $NOTIFICATION_HANDLERS
$title
elgg echo
Translates a string.
Definition: languages.js:48
elgg_view($view, $vars=array(), $ignore1=false, $ignore2=false, $viewtype= '')
Return a parsed view.
Definition: views.php:336
elgg_get_page_owner_entity()
Gets the owner entity for the current page.
Definition: pageowner.php:56
_elgg_services(\Elgg\Di\ServiceProvider $services=null)
Get the global service provider.
Definition: autoloader.php:17
elgg_extract($key, $array, $default=null, $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
Definition: elgglib.php:1375
elgg_view_module($type, $title, $body, array $vars=array())
Wrapper function for the module display pattern.
Definition: views.php:1250
$rows
$notification_settings
$page_owner
foreach($NOTIFICATION_HANDLERS as $method=> $dummy) $content