diff options
author | Nathan Guse <nathaniel.guse@gmail.com> | 2012-11-20 18:14:48 -0600 |
---|---|---|
committer | Nathan Guse <nathaniel.guse@gmail.com> | 2012-11-20 22:54:16 -0600 |
commit | 2afb8b9df873c3f9572a32ab7a62ea8ba8d8a45b (patch) | |
tree | ab584092e7e54f50a15dd9a22ed5b31200ea03f1 /phpBB/includes/notification | |
parent | d2187424da6ff2e0d4a69a6e21bac7e92f68335a (diff) | |
download | forums-2afb8b9df873c3f9572a32ab7a62ea8ba8d8a45b.tar forums-2afb8b9df873c3f9572a32ab7a62ea8ba8d8a45b.tar.gz forums-2afb8b9df873c3f9572a32ab7a62ea8ba8d8a45b.tar.bz2 forums-2afb8b9df873c3f9572a32ab7a62ea8ba8d8a45b.tar.xz forums-2afb8b9df873c3f9572a32ab7a62ea8ba8d8a45b.zip |
[ticket/11103] Create user loader class, update for DIC
Create a very basic user loader class to handle querying/storing
user data in a centralized location.
Use DIC collection service for notification types/methods.
Cleanup unused dependencies.
Fix some other issues.
PHPBB3-11103
Diffstat (limited to 'phpBB/includes/notification')
-rw-r--r-- | phpBB/includes/notification/manager.php | 127 | ||||
-rw-r--r-- | phpBB/includes/notification/method/base.php | 14 | ||||
-rw-r--r-- | phpBB/includes/notification/method/email.php | 4 | ||||
-rw-r--r-- | phpBB/includes/notification/type/base.php | 39 | ||||
-rw-r--r-- | phpBB/includes/notification/type/bookmark.php | 4 | ||||
-rw-r--r-- | phpBB/includes/notification/type/pm.php | 8 | ||||
-rw-r--r-- | phpBB/includes/notification/type/post.php | 10 | ||||
-rw-r--r-- | phpBB/includes/notification/type/quote.php | 10 | ||||
-rw-r--r-- | phpBB/includes/notification/type/report_pm.php | 4 | ||||
-rw-r--r-- | phpBB/includes/notification/type/report_pm_closed.php | 2 | ||||
-rw-r--r-- | phpBB/includes/notification/type/report_post.php | 4 | ||||
-rw-r--r-- | phpBB/includes/notification/type/report_post_closed.php | 4 | ||||
-rw-r--r-- | phpBB/includes/notification/type/topic.php | 6 |
13 files changed, 98 insertions, 138 deletions
diff --git a/phpBB/includes/notification/manager.php b/phpBB/includes/notification/manager.php index 3d0ada4a43..fbfe388c80 100644 --- a/phpBB/includes/notification/manager.php +++ b/phpBB/includes/notification/manager.php @@ -7,8 +7,6 @@ * */ -use Symfony\Component\DependencyInjection\ContainerBuilder; - /** * @ignore */ @@ -23,30 +21,24 @@ if (!defined('IN_PHPBB')) */ class phpbb_notification_manager { + /** @var array */ + protected $notification_types = null; + + /** @var array */ + protected $notification_methods = null; + /** @var ContainerBuilder */ protected $phpbb_container = null; - - /** @var dbal */ - protected $db = null; - - /** @var phpbb_cache_service */ - protected $cache = null; - /** @var phpbb_template */ - protected $template = null; + /** @var phpbb_user_loader */ + protected $user_loader = null; - /** @var phpbb_extension_manager */ - protected $extension_manager = null; + /** @var dbal */ + protected $db = null; /** @var phpbb_user */ protected $user = null; - /** @var phpbb_auth */ - protected $auth = null; - - /** @var phpbb_config */ - protected $config = null; - /** @var string */ protected $phpbb_root_path = null; @@ -59,23 +51,15 @@ class phpbb_notification_manager /** @var string */ protected $user_notifications_table = null; - /** - * Users loaded from the DB - * - * @var array Array of user data that we've loaded from the DB - */ - protected $users = array(); - - public function __construct(ContainerBuilder $phpbb_container, dbal $db, phpbb_cache_driver_interface $cache, phpbb_template $template, phpbb_extension_manager $extension_manager, $user, phpbb_auth $auth, phpbb_config $config, $phpbb_root_path, $php_ext, $notifications_table, $user_notifications_table) + public function __construct($notification_types, $notification_methods, $phpbb_container, phpbb_user_loader $user_loader, dbal $db, $user, $phpbb_root_path, $php_ext, $notifications_table, $user_notifications_table) { + $this->notification_types = $notification_types; + $this->notification_methods = $notification_methods; $this->phpbb_container = $phpbb_container; + + $this->user_loader = $user_loader; $this->db = $db; - $this->cache = $cache; - $this->template = $template; - $this->extension_manager = $extension_manager; $this->user = $user; - $this->auth = $auth; - $this->config = $config; $this->phpbb_root_path = $phpbb_root_path; $this->php_ext = $php_ext; @@ -209,7 +193,7 @@ class phpbb_notification_manager $notifications[$row['notification_id']] = $notification; } - $this->load_users($user_ids); + $this->user_loader->load_users($user_ids); // Allow each type to load its own special items foreach ($load_special as $item_type => $data) @@ -334,7 +318,7 @@ class phpbb_notification_manager return $notified_users; } - $item_id = $item_type::get_item_id($data); + $item_id = $this->get_item_type_class($item_type)->get_item_id($data); // find out which users want to receive this type of notification $notify_users = $this->get_item_type_class($item_type)->find_users_for_notification($data, $options); @@ -363,7 +347,7 @@ class phpbb_notification_manager return; } - $item_id = $item_type::get_item_id($data); + $item_id = $this->get_item_type_class($item_type)->get_item_id($data); $user_ids = array(); $notification_objects = $notification_methods = array(); @@ -428,7 +412,7 @@ class phpbb_notification_manager $this->db->sql_multi_insert($this->notifications_table, $new_rows); // We need to load all of the users to send notifications - $this->load_users($user_ids); + $this->user_loader->load_users($user_ids); // run the queue for each method to send notifications foreach ($notification_methods as $method) @@ -467,7 +451,7 @@ class phpbb_notification_manager } } - $item_id = $item_type::get_item_id($data); + $item_id = $notification->get_item_id($data); $update_array = $notification->create_update_array($data); $sql = 'UPDATE ' . $this->notifications_table . ' @@ -511,7 +495,7 @@ class phpbb_notification_manager { $subscription_types = array(); - foreach ($this->phpbb_container->findTaggedServiceIds('notification.type') as $type_name => $data) + foreach ($this->notification_types as $type_name => $data) { $type = $this->get_item_type_class($type_name); @@ -547,7 +531,7 @@ class phpbb_notification_manager { $subscription_methods = array(); - foreach ($this->phpbb_container->findTaggedServiceIds('notification.method') as $method_name => $data) + foreach ($this->notification_methods as $method_name => $data) { $method = $this->get_method_class($method_name); @@ -759,63 +743,48 @@ class phpbb_notification_manager } /** - * Load user helper - * - * @param array $user_ids + * Helper to get the notifications item type class and set it up */ - public function load_users($user_ids) + public function get_item_type_class($item_type, $data = array()) { - $user_ids[] = ANONYMOUS; - - // Load the users - $user_ids = array_unique($user_ids); - - // Do not load users we already have in $this->users - $user_ids = array_diff($user_ids, array_keys($this->users)); + $item = $this->load_object('notification.type.' . $item_type); - if (sizeof($user_ids)) - { - $sql = 'SELECT * - FROM ' . USERS_TABLE . ' - WHERE ' . $this->db->sql_in_set('user_id', $user_ids); - $result = $this->db->sql_query($sql); + $item->set_initial_data($data); - while ($row = $this->db->sql_fetchrow($result)) - { - $this->users[$row['user_id']] = $row; - } - $this->db->sql_freeresult($result); - } + return $item; } /** - * Get a user row from our users cache - * - * @param int $user_id - * @return array + * Helper to get the notifications method class and set it up */ - public function get_user($user_id) + public function get_method_class($method_name) { - return (isset($this->users[$user_id])) ? $this->users[$user_id] : $this->users[ANONYMOUS]; + return $this->load_object('notification.method.' . $method_name); } /** - * Helper to get the notifications item type class and set it up + * Helper to load objects (notification types/methods) */ - public function get_item_type_class($item_type, $data = array()) + protected function load_object($object_name) { - $item = $this->phpbb_container->get($item_type); + // Here we cannot just use ContainerBuilder->get(name) + // The reason for this is because get handles services + // which are initialized once and shared. Here we need + // separate new objects because we pass around objects + // that store row data in each object, which would lead + // to over-writing of data if we used get() - $item->set_initial_data($data); + $parameterBag = $this->phpbb_container->getParameterBag(); + $definition = $this->phpbb_container->getDefinition($object_name); + $arguments = $this->phpbb_container->resolveServices( + $parameterBag->unescapeValue($parameterBag->resolveValue($definition->getArguments())) + ); + $r = new \ReflectionClass($parameterBag->resolveValue($definition->getClass())); - return $item; - } + $object = null === $r->getConstructor() ? $r->newInstance() : $r->newInstanceArgs($arguments); - /** - * Helper to get the notifications method class and set it up - */ - public function get_method_class($method_name) - { - return $this->phpbb_container->get($method_name); + $object->set_notification_manager($this); + + return $object; } } diff --git a/phpBB/includes/notification/method/base.php b/phpBB/includes/notification/method/base.php index 88ec2674be..3f85d62a09 100644 --- a/phpBB/includes/notification/method/base.php +++ b/phpBB/includes/notification/method/base.php @@ -24,6 +24,9 @@ abstract class phpbb_notification_method_base implements phpbb_notification_meth /** @var phpbb_notification_manager */ protected $notification_manager = null; + /** @var phpbb_user_loader */ + protected $user_loader = null; + /** @var dbal */ protected $db = null; @@ -58,13 +61,11 @@ abstract class phpbb_notification_method_base implements phpbb_notification_meth */ protected $queue = array(); - public function __construct(phpbb_notification_manager $notification_manager, dbal $db, phpbb_cache_driver_interface $cache, phpbb_template $template, phpbb_extension_manager $extension_manager, $user, phpbb_auth $auth, phpbb_config $config, $phpbb_root_path, $php_ext) + public function __construct(phpbb_user_loader $user_loader, dbal $db, phpbb_cache_driver_interface $cache, $user, phpbb_auth $auth, phpbb_config $config, $phpbb_root_path, $php_ext) { - $this->notification_manager = $notification_manager; + $this->user_loader = $user_loader; $this->db = $db; $this->cache = $cache; - $this->template = $template; - $this->extension_manager = $extension_manager; $this->user = $user; $this->auth = $auth; $this->config = $config; @@ -72,6 +73,11 @@ abstract class phpbb_notification_method_base implements phpbb_notification_meth $this->php_ext = $php_ext; } + public function set_notification_manager(phpbb_notification_manager $notification_manager) + { + $this->notification_manager = $notification_manager; + } + /** * Add a notification to the queue * diff --git a/phpBB/includes/notification/method/email.php b/phpBB/includes/notification/method/email.php index 2ff30b177f..429dfda2ba 100644 --- a/phpBB/includes/notification/method/email.php +++ b/phpBB/includes/notification/method/email.php @@ -82,7 +82,7 @@ class phpbb_notification_method_email extends phpbb_notification_method_base $banned_users = phpbb_get_banned_user_ids($user_ids); // Load all the users we need - $this->notification_manager->load_users($user_ids); + $this->user_loader->load_users($user_ids); // Load the messenger if (!class_exists('messenger')) @@ -100,7 +100,7 @@ class phpbb_notification_method_email extends phpbb_notification_method_base continue; } - $user = $this->notification_manager->get_user($notification->user_id); + $user = $this->user_loader->get_user($notification->user_id); if ($user['user_type'] == USER_IGNORE || in_array($notification->user_id, $banned_users)) { diff --git a/phpBB/includes/notification/type/base.php b/phpBB/includes/notification/type/base.php index 419dce3dd0..d596c06167 100644 --- a/phpBB/includes/notification/type/base.php +++ b/phpBB/includes/notification/type/base.php @@ -24,6 +24,9 @@ abstract class phpbb_notification_type_base implements phpbb_notification_type_i /** @var phpbb_notification_manager */ protected $notification_manager = null; + /** @var phpbb_user_loader */ + protected $user_loader = null; + /** @var dbal */ protected $db = null; @@ -33,9 +36,6 @@ abstract class phpbb_notification_type_base implements phpbb_notification_type_i /** @var phpbb_template */ protected $template = null; - /** @var phpbb_extension_manager */ - protected $extension_manager = null; - /** @var phpbb_user */ protected $user = null; @@ -84,13 +84,11 @@ abstract class phpbb_notification_type_base implements phpbb_notification_type_i */ private $data = array(); - public function __construct(phpbb_notification_manager $notification_manager, dbal $db, phpbb_cache_driver_interface $cache, phpbb_template $template, phpbb_extension_manager $extension_manager, $user, phpbb_auth $auth, phpbb_config $config, $phpbb_root_path, $php_ext, $notifications_table, $user_notifications_table) + public function __construct(phpbb_user_loader $user_loader, dbal $db, phpbb_cache_driver_interface $cache, $user, phpbb_auth $auth, phpbb_config $config, $phpbb_root_path, $php_ext, $notifications_table, $user_notifications_table) { - $this->notification_manager = $notification_manager; + $this->user_loader = $user_loader; $this->db = $db; $this->cache = $cache; - $this->template = $template; - $this->extension_manager = $extension_manager; $this->user = $user; $this->auth = $auth; $this->config = $config; @@ -102,6 +100,11 @@ abstract class phpbb_notification_type_base implements phpbb_notification_type_i $this->user_notifications_table = $user_notifications_table; } + public function set_notification_manager(phpbb_notification_manager $notification_manager) + { + $this->notification_manager = $notification_manager; + } + /** * Set initial data from the database * @@ -357,7 +360,7 @@ abstract class phpbb_notification_type_base implements phpbb_notification_type_i $rowset = $resulting_user_ids = array(); $sql = 'SELECT user_id, method, notify - FROM ' . USER_NOTIFICATIONS_TABLE . ' + FROM ' . $this->user_notifications_table . ' WHERE ' . $this->db->sql_in_set('user_id', $user_ids) . " AND item_type = '" . $this->db->sql_escape($options['item_type']) . "' AND item_id = " . (int) $options['item_id']; @@ -395,24 +398,6 @@ abstract class phpbb_notification_type_base implements phpbb_notification_type_i } /** - * Get avatar helper - * - * @param int $user_id - * @return string - */ - protected function get_user_avatar($user_id) - { - $user = $this->notification_manager->get_user($user_id); - - if (!function_exists('get_user_avatar')) - { - include($this->phpbb_root_path . 'includes/functions_display.' . $this->php_ext); - } - - return get_user_avatar($user['user_avatar'], $user['user_avatar_type'], $user['user_avatar_width'], $user['user_avatar_height'], $user['username'], false, 'notifications-avatar'); - } - - /** * Mark this item read/unread helper * * @param bool $unread Unread (True/False) (Default: False) @@ -435,7 +420,7 @@ abstract class phpbb_notification_type_base implements phpbb_notification_type_i return $where; } - $sql = 'UPDATE ' . NOTIFICATIONS_TABLE . ' + $sql = 'UPDATE ' . $this->notifications_table . ' SET unread = ' . (int) $this->unread . ' WHERE ' . $where; $this->db->sql_query($sql); diff --git a/phpBB/includes/notification/type/bookmark.php b/phpBB/includes/notification/type/bookmark.php index a40bbde5e4..a17d8f5db7 100644 --- a/phpBB/includes/notification/type/bookmark.php +++ b/phpBB/includes/notification/type/bookmark.php @@ -102,7 +102,7 @@ class phpbb_notification_type_bookmark extends phpbb_notification_type_post // Try to find the users who already have been notified about replies and have not read the topic since and just update their notifications $update_notifications = array(); $sql = 'SELECT * - FROM ' . NOTIFICATIONS_TABLE . " + FROM ' . $this->notifications_table . " WHERE item_type = '" . $this->get_type() . "' AND item_parent_id = " . (int) self::get_item_parent_id($post) . ' AND unread = 1 @@ -114,7 +114,7 @@ class phpbb_notification_type_bookmark extends phpbb_notification_type_post unset($notify_users[$row['user_id']]); $notification = $this->notification_manager->get_item_type_class($this->get_type(), $row); - $sql = 'UPDATE ' . NOTIFICATIONS_TABLE . ' + $sql = 'UPDATE ' . $this->notifications_table . ' SET ' . $this->db->sql_build_array('UPDATE', $notification->add_responders($post)) . ' WHERE notification_id = ' . $row['notification_id']; $this->db->sql_query($sql); diff --git a/phpBB/includes/notification/type/pm.php b/phpBB/includes/notification/type/pm.php index fbdf351062..1eaeb1a250 100644 --- a/phpBB/includes/notification/type/pm.php +++ b/phpBB/includes/notification/type/pm.php @@ -92,7 +92,7 @@ class phpbb_notification_type_pm extends phpbb_notification_type_base unset($pm['recipients'][$pm['from_user_id']]); - $this->notification_manager->load_users(array_keys($pm['recipients'])); + $this->user_loader->load_users(array_keys($pm['recipients'])); return $this->check_user_notification_options(array_keys($pm['recipients']), $options); } @@ -102,7 +102,7 @@ class phpbb_notification_type_pm extends phpbb_notification_type_base */ public function get_avatar() { - return $this->get_user_avatar($this->get_data('from_user_id')); + return $this->user_loader->get_avatar($this->get_data('from_user_id')); } /** @@ -112,7 +112,7 @@ class phpbb_notification_type_pm extends phpbb_notification_type_base */ public function get_title() { - $user_data = $this->notification_manager->get_user($this->get_data('from_user_id')); + $user_data = $this->user_loader->get_user($this->get_data('from_user_id')); $username = get_username_string('no_profile', $user_data['user_id'], $user_data['username'], $user_data['user_colour']); @@ -136,7 +136,7 @@ class phpbb_notification_type_pm extends phpbb_notification_type_base */ public function get_email_template_variables() { - $user_data = $this->notification_manager->get_user($this->get_data('from_user_id')); + $user_data = $this->user_loader->get_user($this->get_data('from_user_id')); return array( 'AUTHOR_NAME' => htmlspecialchars_decode($user_data['username']), diff --git a/phpBB/includes/notification/type/post.php b/phpBB/includes/notification/type/post.php index a99558efe7..7e06779982 100644 --- a/phpBB/includes/notification/type/post.php +++ b/phpBB/includes/notification/type/post.php @@ -123,7 +123,7 @@ class phpbb_notification_type_post extends phpbb_notification_type_base // Try to find the users who already have been notified about replies and have not read the topic since and just update their notifications $update_notifications = array(); $sql = 'SELECT * - FROM ' . NOTIFICATIONS_TABLE . " + FROM ' . $this->notifications_table . " WHERE item_type = '" . $this->get_type() . "' AND item_parent_id = " . (int) self::get_item_parent_id($post) . ' AND unread = 1 @@ -135,7 +135,7 @@ class phpbb_notification_type_post extends phpbb_notification_type_base unset($notify_users[$row['user_id']]); $notification = $this->notification_manager->get_item_type_class($this->get_type(), $row); - $sql = 'UPDATE ' . NOTIFICATIONS_TABLE . ' + $sql = 'UPDATE ' . $this->notifications_table . ' SET ' . $this->db->sql_build_array('UPDATE', $notification->add_responders($post)) . ' WHERE notification_id = ' . $row['notification_id']; $this->db->sql_query($sql); @@ -150,7 +150,7 @@ class phpbb_notification_type_post extends phpbb_notification_type_base */ public function get_avatar() { - return $this->get_user_avatar($this->get_data('poster_id')); + return $this->user_loader->get_avatar($this->get_data('poster_id')); } /** @@ -181,7 +181,7 @@ class phpbb_notification_type_post extends phpbb_notification_type_base } else { - $user_data = $this->notification_manager->get_user($responder['poster_id']); + $user_data = $this->user_loader->get_user($responder['poster_id']); $usernames[] = get_username_string('no_profile', $user_data['user_id'], $user_data['username'], $user_data['user_colour']); } @@ -217,7 +217,7 @@ class phpbb_notification_type_post extends phpbb_notification_type_base } else { - $user_data = $this->notification_manager->get_user($this->get_data('poster_id')); + $user_data = $this->user_loader->get_user($this->get_data('poster_id')); $username = get_username_string('username', $user_data['user_id'], $user_data['username'], $user_data['user_colour']); } diff --git a/phpBB/includes/notification/type/quote.php b/phpBB/includes/notification/type/quote.php index f45bb1ae7d..1796343a0e 100644 --- a/phpBB/includes/notification/type/quote.php +++ b/phpBB/includes/notification/type/quote.php @@ -121,7 +121,7 @@ class phpbb_notification_type_quote extends phpbb_notification_type_post // Try to find the users who already have been notified about replies and have not read the topic since and just update their notifications $update_notifications = array(); $sql = 'SELECT * - FROM ' . NOTIFICATIONS_TABLE . " + FROM ' . $this->notifications_table . " WHERE item_type = '" . $this->get_type() . "' AND item_parent_id = " . (int) self::get_item_parent_id($post) . ' AND unread = 1 @@ -133,7 +133,7 @@ class phpbb_notification_type_quote extends phpbb_notification_type_post unset($notify_users[$row['user_id']]); $notification = $this->notification_manager->get_item_type_class($this->get_type(), $row); - $sql = 'UPDATE ' . NOTIFICATIONS_TABLE . ' + $sql = 'UPDATE ' . $this->notifications_table . ' SET ' . $this->db->sql_build_array('UPDATE', $notification->add_responders($post)) . ' WHERE notification_id = ' . $row['notification_id']; $this->db->sql_query($sql); @@ -152,7 +152,7 @@ class phpbb_notification_type_quote extends phpbb_notification_type_post { $old_notifications = array(); $sql = 'SELECT user_id - FROM ' . NOTIFICATIONS_TABLE . " + FROM ' . $this->notifications_table . " WHERE item_type = '" . $this->get_type() . "' AND item_id = " . self::get_item_id($post) . ' AND is_enabled = 1'; @@ -182,7 +182,7 @@ class phpbb_notification_type_quote extends phpbb_notification_type_post // Remove the necessary notifications if (!empty($remove_notifications)) { - $sql = 'DELETE FROM ' . NOTIFICATIONS_TABLE . " + $sql = 'DELETE FROM ' . $this->notifications_table . " WHERE item_type = '" . $this->get_type() . "' AND item_id = " . self::get_item_id($post) . ' AND ' . $this->db->sql_in_set('user_id', $remove_notifications); @@ -210,7 +210,7 @@ class phpbb_notification_type_quote extends phpbb_notification_type_post */ public function get_email_template_variables() { - $user_data = $this->notification_manager->get_user($this->get_data('poster_id')); + $user_data = $this->user_loader->get_user($this->get_data('poster_id')); return array_merge(parent::get_email_template_variables(), array( 'AUTHOR_NAME' => htmlspecialchars_decode($user_data['username']), diff --git a/phpBB/includes/notification/type/report_pm.php b/phpBB/includes/notification/type/report_pm.php index 9bdc59a4ef..73e22dc83b 100644 --- a/phpBB/includes/notification/type/report_pm.php +++ b/phpBB/includes/notification/type/report_pm.php @@ -160,7 +160,7 @@ class phpbb_notification_type_report_pm extends phpbb_notification_type_pm { $this->user->add_lang('mcp'); - $user_data = $this->notification_manager->get_user($this->get_data('reporter_id')); + $user_data = $this->user_loader->get_user($this->get_data('reporter_id')); $username = get_username_string('no_profile', $user_data['user_id'], $user_data['username'], $user_data['user_colour']); @@ -197,7 +197,7 @@ class phpbb_notification_type_report_pm extends phpbb_notification_type_pm */ public function get_avatar() { - return $this->get_user_avatar($this->get_data('reporter_id')); + return $this->user_loader->get_avatar($this->get_data('reporter_id')); } /** diff --git a/phpBB/includes/notification/type/report_pm_closed.php b/phpBB/includes/notification/type/report_pm_closed.php index de87c9f760..51e5204304 100644 --- a/phpBB/includes/notification/type/report_pm_closed.php +++ b/phpBB/includes/notification/type/report_pm_closed.php @@ -106,7 +106,7 @@ class phpbb_notification_type_report_pm_closed extends phpbb_notification_type_p */ public function get_title() { - $user_data = $this->notification_manager->get_user($this->get_data('closer_id')); + $user_data = $this->user_loader->get_user($this->get_data('closer_id')); $username = get_username_string('no_profile', $user_data['user_id'], $user_data['username'], $user_data['user_colour']); diff --git a/phpBB/includes/notification/type/report_post.php b/phpBB/includes/notification/type/report_post.php index d80c7b754f..2508644b0b 100644 --- a/phpBB/includes/notification/type/report_post.php +++ b/phpBB/includes/notification/type/report_post.php @@ -127,7 +127,7 @@ class phpbb_notification_type_report_post extends phpbb_notification_type_post_i { $this->user->add_lang('mcp'); - $user_data = $this->notification_manager->get_user($this->get_data('reporter_id')); + $user_data = $this->user_loader->get_user($this->get_data('reporter_id')); $username = get_username_string('no_profile', $user_data['user_id'], $user_data['username'], $user_data['user_colour']); @@ -164,7 +164,7 @@ class phpbb_notification_type_report_post extends phpbb_notification_type_post_i */ public function get_avatar() { - return $this->get_user_avatar($this->get_data('reporter_id')); + return $this->user_loader->get_avatar($this->get_data('reporter_id')); } /** diff --git a/phpBB/includes/notification/type/report_post_closed.php b/phpBB/includes/notification/type/report_post_closed.php index cde0ff85a8..a7016a8f3d 100644 --- a/phpBB/includes/notification/type/report_post_closed.php +++ b/phpBB/includes/notification/type/report_post_closed.php @@ -106,7 +106,7 @@ class phpbb_notification_type_report_post_closed extends phpbb_notification_type */ public function get_title() { - $user_data = $this->notification_manager->get_user($this->get_data('closer_id')); + $user_data = $this->user_loader->get_user($this->get_data('closer_id')); $username = get_username_string('no_profile', $user_data['user_id'], $user_data['username'], $user_data['user_colour']); @@ -122,7 +122,7 @@ class phpbb_notification_type_report_post_closed extends phpbb_notification_type */ public function get_avatar() { - return $this->get_user_avatar($this->get_data('closer_id')); + return $this->user_loader->get_avatar($this->get_data('closer_id')); } /** diff --git a/phpBB/includes/notification/type/topic.php b/phpBB/includes/notification/type/topic.php index 4eb03194f5..6e9347d4a8 100644 --- a/phpBB/includes/notification/type/topic.php +++ b/phpBB/includes/notification/type/topic.php @@ -126,7 +126,7 @@ class phpbb_notification_type_topic extends phpbb_notification_type_base */ public function get_avatar() { - return $this->get_user_avatar($this->get_data('poster_id')); + return $this->user_loader->get_avatar($this->get_data('poster_id')); } /** @@ -142,7 +142,7 @@ class phpbb_notification_type_topic extends phpbb_notification_type_base } else { - $user_data = $this->notification_manager->get_user($this->get_data('poster_id')); + $user_data = $this->user_loader->get_user($this->get_data('poster_id')); $username = get_username_string('no_profile', $user_data['user_id'], $user_data['username'], $user_data['user_colour']); } @@ -178,7 +178,7 @@ class phpbb_notification_type_topic extends phpbb_notification_type_base } else { - $user_data = $this->notification_manager->get_user($this->get_data('poster_id')); + $user_data = $this->user_loader->get_user($this->get_data('poster_id')); $username = get_username_string('username', $user_data['user_id'], $user_data['username'], $user_data['user_colour']); } |