diff options
Diffstat (limited to 'phpBB/phpbb')
-rw-r--r-- | phpBB/phpbb/notification/manager.php | 26 | ||||
-rw-r--r-- | phpBB/phpbb/notification/type/admin_activate_user.php | 16 | ||||
-rw-r--r-- | phpBB/phpbb/notification/type/base.php | 25 | ||||
-rw-r--r-- | phpBB/phpbb/notification/type/bookmark.php | 9 | ||||
-rw-r--r-- | phpBB/phpbb/notification/type/group_request.php | 8 | ||||
-rw-r--r-- | phpBB/phpbb/notification/type/pm.php | 16 | ||||
-rw-r--r-- | phpBB/phpbb/notification/type/post.php | 17 | ||||
-rw-r--r-- | phpBB/phpbb/notification/type/report_pm.php | 2 | ||||
-rw-r--r-- | phpBB/phpbb/notification/type/topic.php | 16 |
9 files changed, 102 insertions, 33 deletions
diff --git a/phpBB/phpbb/notification/manager.php b/phpBB/phpbb/notification/manager.php index 9a8b671ef8..04259382ba 100644 --- a/phpBB/phpbb/notification/manager.php +++ b/phpBB/phpbb/notification/manager.php @@ -26,7 +26,7 @@ class manager /** @var array */ protected $subscription_types; - /** @var array */ + /** @var method\method_interface[] */ protected $notification_methods; /** @var ContainerInterface */ @@ -805,8 +805,10 @@ class manager } /** - * Helper to get the list of methods enabled by default - */ + * Helper to get the list of methods enabled by default + * + * @return method\method_interface[] + */ public function get_default_methods() { $default_methods = array(); @@ -823,8 +825,10 @@ class manager } /** - * Helper to get the notifications item type class and set it up - */ + * Helper to get the notifications item type class and set it up + * + * @return type\type_interface + */ public function get_item_type_class($notification_type_name, $data = array()) { $item = $this->load_object($notification_type_name); @@ -835,16 +839,20 @@ class manager } /** - * Helper to get the notifications method class and set it up - */ + * Helper to get the notifications method class and set it up + * + * @return method\method_interface + */ public function get_method_class($method_name) { return $this->load_object($method_name); } /** - * Helper to load objects (notification types/methods) - */ + * Helper to load objects (notification types/methods) + * + * @return method\method_interface|type\type_interface + */ protected function load_object($object_name) { $object = $this->phpbb_container->get($object_name); diff --git a/phpBB/phpbb/notification/type/admin_activate_user.php b/phpBB/phpbb/notification/type/admin_activate_user.php index 5b7e58bd92..b191fa62ae 100644 --- a/phpBB/phpbb/notification/type/admin_activate_user.php +++ b/phpBB/phpbb/notification/type/admin_activate_user.php @@ -41,6 +41,22 @@ class admin_activate_user extends \phpbb\notification\type\base 'group' => 'NOTIFICATION_GROUP_ADMINISTRATION', ); + /** @var \phpbb\user_loader */ + protected $user_loader; + + /** @var \phpbb\config\config */ + protected $config; + + public function set_config(\phpbb\config\config $config) + { + $this->config = $config; + } + + public function set_user_loader(\phpbb\user_loader $user_loader) + { + $this->user_loader = $user_loader; + } + /** * {@inheritdoc} */ diff --git a/phpBB/phpbb/notification/type/base.php b/phpBB/phpbb/notification/type/base.php index 843ab98de8..06f7f9c615 100644 --- a/phpBB/phpbb/notification/type/base.php +++ b/phpBB/phpbb/notification/type/base.php @@ -21,27 +21,15 @@ abstract class base implements \phpbb\notification\type\type_interface /** @var \phpbb\notification\manager */ protected $notification_manager; - /** @var \phpbb\user_loader */ - protected $user_loader; - /** @var \phpbb\db\driver\driver_interface */ protected $db; - /** @var \phpbb\cache\driver\driver_interface */ - protected $cache; - - /** @var \phpbb\template\template */ - protected $template; - /** @var \phpbb\user */ protected $user; /** @var \phpbb\auth\auth */ protected $auth; - /** @var \phpbb\config\config */ - protected $config; - /** @var string */ protected $phpbb_root_path; @@ -49,9 +37,6 @@ abstract class base implements \phpbb\notification\type\type_interface protected $php_ext; /** @var string */ - protected $notification_types_table; - - /** @var string */ protected $user_notifications_table; /** @@ -88,31 +73,23 @@ abstract class base implements \phpbb\notification\type\type_interface /** * Notification Type Base Constructor * - * @param \phpbb\user_loader $user_loader * @param \phpbb\db\driver\driver_interface $db - * @param \phpbb\cache\driver\driver_interface $cache * @param \phpbb\user $user * @param \phpbb\auth\auth $auth - * @param \phpbb\config\config $config * @param string $phpbb_root_path * @param string $php_ext - * @param string $notification_types_table * @param string $user_notifications_table * @return \phpbb\notification\type\base */ - public function __construct(\phpbb\user_loader $user_loader, \phpbb\db\driver\driver_interface $db, \phpbb\cache\driver\driver_interface $cache, $user, \phpbb\auth\auth $auth, \phpbb\config\config $config, $phpbb_root_path, $php_ext, $notification_types_table, $user_notifications_table) + public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\user $user, \phpbb\auth\auth $auth, $phpbb_root_path, $php_ext, $user_notifications_table) { - $this->user_loader = $user_loader; $this->db = $db; - $this->cache = $cache; $this->user = $user; $this->auth = $auth; - $this->config = $config; $this->phpbb_root_path = $phpbb_root_path; $this->php_ext = $php_ext; - $this->notification_types_table = $notification_types_table; $this->user_notifications_table = $user_notifications_table; } diff --git a/phpBB/phpbb/notification/type/bookmark.php b/phpBB/phpbb/notification/type/bookmark.php index 4f66a1ef5c..59423ca248 100644 --- a/phpBB/phpbb/notification/type/bookmark.php +++ b/phpBB/phpbb/notification/type/bookmark.php @@ -48,6 +48,14 @@ class bookmark extends \phpbb\notification\type\post 'group' => 'NOTIFICATION_GROUP_POSTING', ); + /** @var \phpbb\config\config */ + protected $config; + + public function set_config(\phpbb\config\config $config) + { + $this->config = $config; + } + /** * Is available */ @@ -100,6 +108,7 @@ class bookmark extends \phpbb\notification\type\post { unset($notify_users[$user]); + /** @var bookmark $notification */ $notification = $this->notification_manager->get_item_type_class($this->get_type(), $notification_data); $update_responders = $notification->add_responders($post); if (!empty($update_responders)) diff --git a/phpBB/phpbb/notification/type/group_request.php b/phpBB/phpbb/notification/type/group_request.php index 9a5746bcce..8a0027bfec 100644 --- a/phpBB/phpbb/notification/type/group_request.php +++ b/phpBB/phpbb/notification/type/group_request.php @@ -30,6 +30,14 @@ class group_request extends \phpbb\notification\type\base 'lang' => 'NOTIFICATION_TYPE_GROUP_REQUEST', ); + /** @var \phpbb\user_loader */ + protected $user_loader; + + public function set_user_loader(\phpbb\user_loader $user_loader) + { + $this->user_loader = $user_loader; + } + /** * {@inheritdoc} */ diff --git a/phpBB/phpbb/notification/type/pm.php b/phpBB/phpbb/notification/type/pm.php index 6c66c9c057..2de2dcfa0b 100644 --- a/phpBB/phpbb/notification/type/pm.php +++ b/phpBB/phpbb/notification/type/pm.php @@ -40,6 +40,22 @@ class pm extends \phpbb\notification\type\base 'lang' => 'NOTIFICATION_TYPE_PM', ); + /** @var \phpbb\user_loader */ + protected $user_loader; + + /** @var \phpbb\config\config */ + protected $config; + + public function set_config(\phpbb\config\config $config) + { + $this->config = $config; + } + + public function set_user_loader(\phpbb\user_loader $user_loader) + { + $this->user_loader = $user_loader; + } + /** * Is available */ diff --git a/phpBB/phpbb/notification/type/post.php b/phpBB/phpbb/notification/type/post.php index e310484187..f3dd6d531a 100644 --- a/phpBB/phpbb/notification/type/post.php +++ b/phpBB/phpbb/notification/type/post.php @@ -55,6 +55,22 @@ class post extends \phpbb\notification\type\base 'group' => 'NOTIFICATION_GROUP_POSTING', ); + /** @var \phpbb\user_loader */ + protected $user_loader; + + /** @var \phpbb\config\config */ + protected $config; + + public function set_config(\phpbb\config\config $config) + { + $this->config = $config; + } + + public function set_user_loader(\phpbb\user_loader $user_loader) + { + $this->user_loader = $user_loader; + } + /** * Is available */ @@ -140,6 +156,7 @@ class post extends \phpbb\notification\type\base { unset($notify_users[$user]); + /** @var post $notification */ $notification = $this->notification_manager->get_item_type_class($this->get_type(), $notification_data); $update_responders = $notification->add_responders($post); if (!empty($update_responders)) diff --git a/phpBB/phpbb/notification/type/report_pm.php b/phpBB/phpbb/notification/type/report_pm.php index a68685547a..0f7dce0a68 100644 --- a/phpBB/phpbb/notification/type/report_pm.php +++ b/phpBB/phpbb/notification/type/report_pm.php @@ -141,6 +141,8 @@ class report_pm extends \phpbb\notification\type\pm */ public function get_email_template_variables() { + $user_data = $this->user_loader->get_username($this->get_data('reporter_id'), 'no_profile'); + return array( 'AUTHOR_NAME' => htmlspecialchars_decode($user_data['username']), 'SUBJECT' => htmlspecialchars_decode(censor_text($this->get_data('message_subject'))), diff --git a/phpBB/phpbb/notification/type/topic.php b/phpBB/phpbb/notification/type/topic.php index 22eb4bd526..4812e8b5af 100644 --- a/phpBB/phpbb/notification/type/topic.php +++ b/phpBB/phpbb/notification/type/topic.php @@ -55,6 +55,22 @@ class topic extends \phpbb\notification\type\base 'group' => 'NOTIFICATION_GROUP_POSTING', ); + /** @var \phpbb\user_loader */ + protected $user_loader; + + /** @var \phpbb\config\config */ + protected $config; + + public function set_config(\phpbb\config\config $config) + { + $this->config = $config; + } + + public function set_user_loader(\phpbb\user_loader $user_loader) + { + $this->user_loader = $user_loader; + } + /** * Is available */ |