notifications.php 922 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. /**
  3. * User settings for notifications.
  4. *
  5. * @package Elgg
  6. * @subpackage Core
  7. */
  8. $NOTIFICATION_HANDLERS = _elgg_services()->notifications->getMethodsAsDeprecatedGlobal();
  9. $notification_settings = get_user_notification_settings(elgg_get_page_owner_guid());
  10. $title = elgg_echo('notifications:usersettings');
  11. $rows = '';
  12. // Loop through options
  13. foreach ($NOTIFICATION_HANDLERS as $k => $v) {
  14. if ($notification_settings->$k) {
  15. $val = "yes";
  16. } else {
  17. $val = "no";
  18. }
  19. $radio = elgg_view('input/radio', array(
  20. 'name' => "method[$k]",
  21. 'value' => $val,
  22. 'options' => array(
  23. elgg_echo('option:yes') => 'yes',
  24. elgg_echo('option:no') => 'no'
  25. ),
  26. ));
  27. $cells = '<td class="prm pbl">' . elgg_echo("notification:method:$k") . ': </td>';
  28. $cells .= "<td>$radio</td>";
  29. $rows .= "<tr>$cells</tr>";
  30. }
  31. $content = '';
  32. $content .= "<table>$rows</table>";
  33. echo elgg_view_module('info', $title, $content);