From 7512efed9e440fe7be55c3882c694f2b10ce16eb Mon Sep 17 00:00:00 2001 From: brunoais Date: Wed, 17 Dec 2014 15:17:44 +0000 Subject: [ticket/13154] Allow filtering the list of users to be notified PHPBB3-13154 --- phpBB/phpbb/notification/manager.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/notification/manager.php b/phpBB/phpbb/notification/manager.php index dd611e1dd1..e8cfae9b53 100644 --- a/phpBB/phpbb/notification/manager.php +++ b/phpBB/phpbb/notification/manager.php @@ -350,6 +350,26 @@ class manager // find out which users want to receive this type of notification $notify_users = $this->get_item_type_class($notification_type_name)->find_users_for_notification($data, $options); + /** + * Allow filtering the notify_users array for a notification that is about to be sent. + * Here, $notify_users is already filtered by f_read and the ignored list included in the options variable + * + * @event core.notification_manager_add_notifications + * @var string notification_type_name The forum id from where the topic belongs + * @var array data Data specific for the notification_type_name used will be inserted + * @var array notify_users The array of userid that are going to be notified for this notification. Set to array() to cancel. + * @var array options The options that were used when this method was called (read only) + * + * @since 3.1.3-RC1 + */ + $vars = array( + 'notification_type_name', + 'data', + 'notify_users', + 'options', + ); + extract($phpbb_dispatcher->trigger_event('core.notification_manager_add_notifications', compact($vars))); + $this->add_notifications_for_users($notification_type_name, $data, $notify_users); return $notify_users; -- cgit v1.2.1 From 458f9cade60e145a2657a7080f0e2968d1f0c6cb Mon Sep 17 00:00:00 2001 From: brunoais Date: Wed, 17 Dec 2014 23:10:37 +0000 Subject: [ticket/13154] Adding phpBB dispatcher to notifications manager PHPBB3-13154 --- phpBB/phpbb/notification/manager.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/notification/manager.php b/phpBB/phpbb/notification/manager.php index e8cfae9b53..c3fa04b457 100644 --- a/phpBB/phpbb/notification/manager.php +++ b/phpBB/phpbb/notification/manager.php @@ -38,6 +38,9 @@ class manager /** @var \phpbb\config\config */ protected $config; + /** @var \phpbb\event\dispatcher */ + protected $phpbb_dispatcher; + /** @var \phpbb\db\driver\driver_interface */ protected $db; @@ -70,6 +73,7 @@ class manager * @param ContainerInterface $phpbb_container * @param \phpbb\user_loader $user_loader * @param \phpbb\config\config $config + * @param \phpbb\event\dispatcher $config * @param \phpbb\db\driver\driver_interface $db * @param \phpbb\cache\service $cache * @param \phpbb\user $user @@ -81,7 +85,7 @@ class manager * * @return \phpbb\notification\manager */ - public function __construct($notification_types, $notification_methods, ContainerInterface $phpbb_container, \phpbb\user_loader $user_loader, \phpbb\config\config $config, \phpbb\db\driver\driver_interface $db, \phpbb\cache\service $cache, $user, $phpbb_root_path, $php_ext, $notification_types_table, $notifications_table, $user_notifications_table) + public function __construct($notification_types, $notification_methods, ContainerInterface $phpbb_container, \phpbb\user_loader $user_loader, \phpbb\config\config $config, \phpbb\event\dispatcher $phpbb_dispatcher, \phpbb\db\driver\driver_interface $db, \phpbb\cache\service $cache, $user, $phpbb_root_path, $php_ext, $notification_types_table, $notifications_table, $user_notifications_table) { $this->notification_types = $notification_types; $this->notification_methods = $notification_methods; @@ -89,6 +93,7 @@ class manager $this->user_loader = $user_loader; $this->config = $config; + $this->phpbb_dispatcher = $phpbb_dispatcher; $this->db = $db; $this->cache = $cache; $this->user = $user; -- cgit v1.2.1 From 13320a08ef4f9dddeac5b93d4186f6bf05256466 Mon Sep 17 00:00:00 2001 From: brunoais Date: Wed, 17 Dec 2014 23:17:12 +0000 Subject: [ticket/13154] Forgot the $this-> PHPBB3-13154 --- phpBB/phpbb/notification/manager.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/notification/manager.php b/phpBB/phpbb/notification/manager.php index c3fa04b457..8eda8dc17b 100644 --- a/phpBB/phpbb/notification/manager.php +++ b/phpBB/phpbb/notification/manager.php @@ -373,7 +373,7 @@ class manager 'notify_users', 'options', ); - extract($phpbb_dispatcher->trigger_event('core.notification_manager_add_notifications', compact($vars))); + extract($this->phpbb_dispatcher->trigger_event('core.notification_manager_add_notifications', compact($vars))); $this->add_notifications_for_users($notification_type_name, $data, $notify_users); -- cgit v1.2.1 From dd9c415020935710aa525bd99a592e26e6143165 Mon Sep 17 00:00:00 2001 From: brunoais Date: Fri, 19 Dec 2014 10:03:57 +0000 Subject: [ticket/13154] space before @var Not a tab. PHPBB3-13154 --- phpBB/phpbb/notification/manager.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/notification/manager.php b/phpBB/phpbb/notification/manager.php index 8eda8dc17b..4bf61170b2 100644 --- a/phpBB/phpbb/notification/manager.php +++ b/phpBB/phpbb/notification/manager.php @@ -38,7 +38,7 @@ class manager /** @var \phpbb\config\config */ protected $config; - /** @var \phpbb\event\dispatcher */ + /** @var \phpbb\event\dispatcher */ protected $phpbb_dispatcher; /** @var \phpbb\db\driver\driver_interface */ -- cgit v1.2.1 From 0929267e722c9aa3019a46509950ce3b74ba9c83 Mon Sep 17 00:00:00 2001 From: brunoais Date: Fri, 19 Dec 2014 11:23:23 +0000 Subject: [ticket/13154] Wrong variable name in the comment block PHPBB3-13154 --- phpBB/phpbb/notification/manager.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/phpbb') diff --git a/phpBB/phpbb/notification/manager.php b/phpBB/phpbb/notification/manager.php index 4bf61170b2..aa52eb61d0 100644 --- a/phpBB/phpbb/notification/manager.php +++ b/phpBB/phpbb/notification/manager.php @@ -73,7 +73,7 @@ class manager * @param ContainerInterface $phpbb_container * @param \phpbb\user_loader $user_loader * @param \phpbb\config\config $config - * @param \phpbb\event\dispatcher $config + * @param \phpbb\event\dispatcher $phpbb_dispatcher * @param \phpbb\db\driver\driver_interface $db * @param \phpbb\cache\service $cache * @param \phpbb\user $user -- cgit v1.2.1