pluginspath . "notifications/groups.php"; break; case 'personal': default: require $CONFIG->pluginspath . "notifications/index.php"; break; } return TRUE; } /** * Notification settings sidebar menu * */ function notifications_plugin_pagesetup() { global $CONFIG; if (get_context() == 'settings') { add_submenu_item(elgg_echo('notifications:subscriptions:changesettings'), $CONFIG->wwwroot . "pg/notifications/personal"); if (is_plugin_enabled('groups')) { add_submenu_item(elgg_echo('notifications:subscriptions:changesettings:groups'), $CONFIG->wwwroot . "pg/notifications/group"); } } } /** * Update notifications when a relationship is deleted * * @param string $event * @param string $object_type * @param object $relationship */ function notifications_relationship_remove($event, $object_type, $relationship) { global $NOTIFICATION_HANDLERS; $user_guid = $relationship->guid_one; $object_guid = $relationship->guid_two; // loop through all notification types foreach($NOTIFICATION_HANDLERS as $method => $foo) { remove_entity_relationship($user_guid, "notify{$method}", $object_guid); } } register_elgg_event_handler('init', 'system', 'notifications_plugin_init', 1000); register_action("notificationsettings/save", FALSE, $CONFIG->pluginspath . "notifications/actions/save.php"); register_action("notificationsettings/groupsave", FALSE, $CONFIG->pluginspath . "notifications/actions/groupsave.php");