index.php 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. /**
  3. * Elgg notifications plugin index
  4. *
  5. * @package ElggNotifications
  6. *
  7. * @uses $user ElggUser
  8. */
  9. if (!isset($user) || !($user instanceof ElggUser)) {
  10. $url = 'notifications/personal/' . elgg_get_logged_in_user_entity()->username;
  11. forward($url);
  12. }
  13. elgg_set_page_owner_guid($user->guid);
  14. // Set the context to settings
  15. elgg_set_context('settings');
  16. $title = elgg_echo('notifications:subscriptions:changesettings');
  17. elgg_push_breadcrumb(elgg_echo('settings'), "settings/user/$user->username");
  18. elgg_push_breadcrumb($title);
  19. // Get the form
  20. $people = array();
  21. if ($people_ents = elgg_get_entities_from_relationship(array(
  22. 'relationship' => 'notify',
  23. 'relationship_guid' => $user->guid,
  24. 'type' => 'user',
  25. 'limit' => false,
  26. ))) {
  27. foreach($people_ents as $ent) {
  28. $people[] = $ent->guid;
  29. }
  30. }
  31. $body = elgg_view('notifications/subscriptions/form', array(
  32. 'people' => $people,
  33. 'user' => $user,
  34. ));
  35. $params = array(
  36. 'content' => $body,
  37. 'title' => $title,
  38. );
  39. $body = elgg_view_layout('one_sidebar', $params);
  40. echo elgg_view_page($title, $body);