From de7e17b7321feebbefb5249febbbfe173e275ada Mon Sep 17 00:00:00 2001 From: Nathan Guse Date: Sat, 20 Oct 2012 21:22:06 -0500 Subject: [PATCH] [ticket/11103] Notifications for subscriptions/bookmarks must obey ACP options If bookmarks/subscriptions are disabled, they should not be listed in the UCP PHPBB3-11103 --- phpBB/includes/notification/type/bookmark.php | 8 ++++++++ phpBB/includes/notification/type/post.php | 8 ++++++++ phpBB/includes/notification/type/quote.php | 8 ++++++++ phpBB/includes/notification/type/topic.php | 8 ++++++++ 4 files changed, 32 insertions(+) diff --git a/phpBB/includes/notification/type/bookmark.php b/phpBB/includes/notification/type/bookmark.php index 4d5a1fd299..4bbe9bbbf4 100644 --- a/phpBB/includes/notification/type/bookmark.php +++ b/phpBB/includes/notification/type/bookmark.php @@ -41,6 +41,14 @@ class phpbb_notification_type_bookmark extends phpbb_notification_type_post 'group' => 'NOTIFICATION_GROUP_POSTING', ); + /** + * Is available + */ + public function is_available() + { + return $this->config['allow_bookmarks']; + } + /** * Find the users who want to receive notifications * diff --git a/phpBB/includes/notification/type/post.php b/phpBB/includes/notification/type/post.php index 9317669e57..11202ee6e9 100644 --- a/phpBB/includes/notification/type/post.php +++ b/phpBB/includes/notification/type/post.php @@ -41,6 +41,14 @@ class phpbb_notification_type_post extends phpbb_notification_type_base 'group' => 'NOTIFICATION_GROUP_POSTING', ); + /** + * Is available + */ + public function is_available() + { + return $this->config['allow_topic_notify']; + } + /** * Get the id of the item * diff --git a/phpBB/includes/notification/type/quote.php b/phpBB/includes/notification/type/quote.php index e4b40e0aec..47337b1cda 100644 --- a/phpBB/includes/notification/type/quote.php +++ b/phpBB/includes/notification/type/quote.php @@ -48,6 +48,14 @@ class phpbb_notification_type_quote extends phpbb_notification_type_post 'group' => 'NOTIFICATION_GROUP_POSTING', ); + /** + * Is available + */ + public function is_available() + { + return true; + } + /** * Find the users who want to receive notifications * diff --git a/phpBB/includes/notification/type/topic.php b/phpBB/includes/notification/type/topic.php index db1d4028f0..99f7b5bee4 100644 --- a/phpBB/includes/notification/type/topic.php +++ b/phpBB/includes/notification/type/topic.php @@ -41,6 +41,14 @@ class phpbb_notification_type_topic extends phpbb_notification_type_base 'group' => 'NOTIFICATION_GROUP_POSTING', ); + /** + * Is available + */ + public function is_available() + { + return $this->config['allow_forum_notify']; + } + /** * Get the id of the item *