diff options
author | Tim Almdal <tnalmdal@shaw.ca> | 2010-01-24 20:14:01 -0800 |
---|---|---|
committer | Tim Almdal <tnalmdal@shaw.ca> | 2010-01-24 20:14:01 -0800 |
commit | 865995305cbd709db4f8587d73e7178a277a8d8b (patch) | |
tree | 1e607d0184f29bee7665df42df99b3a32cf2c2ff /modules/notification/helpers/notification_event.php | |
parent | 26eb000637fb83c04919e1e18c67b1441db76da6 (diff) |
Add the active notifications and rest api key to user profile page.
Diffstat (limited to 'modules/notification/helpers/notification_event.php')
-rw-r--r-- | modules/notification/helpers/notification_event.php | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/modules/notification/helpers/notification_event.php b/modules/notification/helpers/notification_event.php index edbf6e39..c8628ae4 100644 --- a/modules/notification/helpers/notification_event.php +++ b/modules/notification/helpers/notification_event.php @@ -126,4 +126,25 @@ class notification_event_Core { } } } + + static function show_user_profile($data) { + if ($data->display_all) { + $view = new View("user_profile_notification.html"); + $view->subscriptions = array(); + foreach(ORM::factory("subscription") + ->where("user_id", "=", $data->user->id) + ->find_all() as $subscription) { + $item = ORM::factory("item") + ->where("id", "=", $subscription->item_id) + ->find(); + if ($item->loaded()) { + $view->subscriptions[] = (object)array("id" => $subscription->id, "title" => $item->title, + "url" => $item->url()); + } + } + if (count($view->subscriptions) > 0) { + $data->content[] = (object)array("title" => t("Watching"), "view" => $view); + } + } + } }
\ No newline at end of file |