diff options
author | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2009-02-05 16:52:50 +0000 |
---|---|---|
committer | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2009-02-05 16:52:50 +0000 |
commit | 697a81f7d240e47e261421a462f3e28a92841a1c (patch) | |
tree | 1a189cd5fe5299905c8f8f0a9306658e2874f42b /mod/notifications/actions | |
parent | e721c3391124c1fdabf834551112a17cb199e415 (diff) | |
download | elgg-697a81f7d240e47e261421a462f3e28a92841a1c.tar.gz elgg-697a81f7d240e47e261421a462f3e28a92841a1c.tar.bz2 |
Fitter, happier, more productive notifications plugin.
git-svn-id: https://code.elgg.org/elgg/trunk@2657 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/notifications/actions')
-rw-r--r-- | mod/notifications/actions/save.php | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/mod/notifications/actions/save.php b/mod/notifications/actions/save.php index faee22ef6..3e50ffc11 100644 --- a/mod/notifications/actions/save.php +++ b/mod/notifications/actions/save.php @@ -1,9 +1,9 @@ <?php
/**
- * Elgg notifications plugin save action
+ * Elgg SMS Client
*
- * @package ElggNotifications
+ * @package ElggSMS
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
* @author Curverider Ltd
* @copyright Curverider Ltd 2008-2009
@@ -13,17 +13,20 @@ // Restrict to logged in users
gatekeeper();
- // Get people
- $subscriptions = get_input('subscriptions');
-
- // Clear existing subscriptions
global $SESSION;
- remove_entity_relationships($SESSION['user']->guid,'notify',false);
+
+ global $NOTIFICATION_HANDLERS;
+ foreach($NOTIFICATION_HANDLERS as $method => $foo) {
+ $subscriptions[$method] = get_input($method.'subscriptions');
+ remove_entity_relationships($SESSION['user']->guid,'notify' , $method, false);
+ }
// Add new ones
- if (is_array($subscriptions) && !empty($subscriptions)) {
- foreach($subscriptions as $subscription) {
- register_notification_interest($SESSION['user']->guid, $subscription);
+ foreach($subscriptions as $key => $subscription)
+ if (is_array($subscription) && !empty($subscription)) {
+ foreach($subscription as $subscriptionperson) {
+ // register_notification_interest($SESSION['user']->guid, $subscription);
+ add_entity_relationship($_SESSION['user']->guid, 'notify' . $key, $subscriptionperson);
}
}
|