diff options
author | Matt Friedman <maf675@gmail.com> | 2015-10-13 23:40:52 -0700 |
---|---|---|
committer | Matt Friedman <maf675@gmail.com> | 2015-10-13 23:40:52 -0700 |
commit | b64a37d451132dcf7ef5fc3d6e700a6fb6decd90 (patch) | |
tree | 8432ace2597886cfbf20bcfdd27e39cd17c1f6b1 /phpBB/phpbb/notification/type/base.php | |
parent | 03cb2a7b0c5a3756522c27d708bdaf0bfa771706 (diff) | |
download | forums-b64a37d451132dcf7ef5fc3d6e700a6fb6decd90.tar forums-b64a37d451132dcf7ef5fc3d6e700a6fb6decd90.tar.gz forums-b64a37d451132dcf7ef5fc3d6e700a6fb6decd90.tar.bz2 forums-b64a37d451132dcf7ef5fc3d6e700a6fb6decd90.tar.xz forums-b64a37d451132dcf7ef5fc3d6e700a6fb6decd90.zip |
[ticket/14237] Use $language class for notifications
PHPBB3-14237
Diffstat (limited to 'phpBB/phpbb/notification/type/base.php')
-rw-r--r-- | phpBB/phpbb/notification/type/base.php | 64 |
1 files changed, 38 insertions, 26 deletions
diff --git a/phpBB/phpbb/notification/type/base.php b/phpBB/phpbb/notification/type/base.php index 31e853d7d9..4aacb1c99e 100644 --- a/phpBB/phpbb/notification/type/base.php +++ b/phpBB/phpbb/notification/type/base.php @@ -24,6 +24,9 @@ abstract class base implements \phpbb\notification\type\type_interface /** @var \phpbb\db\driver\driver_interface */ protected $db; + /** @var \phpbb\language\language */ + protected $language; + /** @var \phpbb\user */ protected $user; @@ -56,7 +59,7 @@ abstract class base implements \phpbb\notification\type\type_interface protected $notification_type_id; /** - * Indentification data + * Identification data * notification_type_id - ID of the item type (auto generated, from notification types table) * item_id - ID of the item (e.g. post_id, msg_id) * item_parent_id - Parent item id (ex: for topic => forum_id, for post => topic_id, etc) @@ -71,19 +74,20 @@ abstract class base implements \phpbb\notification\type\type_interface private $data = array(); /** - * Notification Type Base Constructor - * - * @param \phpbb\db\driver\driver_interface $db - * @param \phpbb\user $user - * @param \phpbb\auth\auth $auth - * @param string $phpbb_root_path - * @param string $php_ext - * @param string $user_notifications_table - * @return \phpbb\notification\type\base - */ - public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\user $user, \phpbb\auth\auth $auth, $phpbb_root_path, $php_ext, $user_notifications_table) + * Notification Type Base Constructor + * + * @param \phpbb\db\driver\driver_interface $db + * @param \phpbb\language\language $language + * @param \phpbb\user $user + * @param \phpbb\auth\auth $auth + * @param string $phpbb_root_path + * @param string $php_ext + * @param string $user_notifications_table + */ + public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\language\language $language, \phpbb\user $user, \phpbb\auth\auth $auth, $phpbb_root_path, $php_ext, $user_notifications_table) { $this->db = $db; + $this->language = $language; $this->user = $user; $this->auth = $auth; @@ -192,7 +196,7 @@ abstract class base implements \phpbb\notification\type\type_interface 'notification_time' => time(), 'notification_read' => false, - 'notification_data' => array(), + 'notification_data' => array(), ), $this->data); } @@ -304,6 +308,7 @@ abstract class base implements \phpbb\notification\type\type_interface * URL to unsubscribe to this notification (fall back) * * @param string|bool $method Method name to unsubscribe from (email|jabber|etc), False to unsubscribe from all notifications for this item + * @return false */ public function get_unsubscribe_url($method = false) { @@ -371,8 +376,11 @@ abstract class base implements \phpbb\notification\type\type_interface } /** - * Load the special items (fall back) - */ + * Load the special items (fall back) + * + * @param array $data + * @param array $notifications + */ public function load_special($data, $notifications) { return; @@ -389,10 +397,12 @@ abstract class base implements \phpbb\notification\type\type_interface } /** - * Pre create insert array function (fall back) - * - * @return array - */ + * Pre create insert array function (fall back) + * + * @param array $type_data + * @param array $notify_users + * @return array + */ public function pre_create_insert_array($type_data, $notify_users) { return array(); @@ -403,13 +413,13 @@ abstract class base implements \phpbb\notification\type\type_interface */ /** - * Find the users who want to receive notifications (helper) - * - * @param array $user_ids User IDs to check if they want to receive notifications - * (Bool False to check all users besides anonymous and bots (USER_IGNORE)) - * - * @return array - */ + * Find the users who want to receive notifications (helper) + * + * @param array|bool $user_ids User IDs to check if they want to receive notifications + * (Bool False to check all users besides anonymous and bots (USER_IGNORE)) + * @param array $options + * @return array + */ protected function check_user_notification_options($user_ids = false, $options = array()) { $options = array_merge(array( @@ -505,6 +515,8 @@ abstract class base implements \phpbb\notification\type\type_interface { $this->notification_manager->mark_notifications($this->get_type(), (int) $this->item_id, (int) $this->user_id, false, $this->notification_read); } + + return null; } /** |