1010
1111namespace phpbb \webpushnotifications \ucp \controller ;
1212
13+ use phpbb \config \config ;
1314use phpbb \controller \helper as controller_helper ;
1415use phpbb \db \driver \driver_interface ;
1516use phpbb \exception \http_exception ;
@@ -31,6 +32,9 @@ class webpush
3132 /** @var string UCP form token name */
3233 public const FORM_TOKEN_UCP = 'ucp_webpush ' ;
3334
35+ /** @var config */
36+ protected $ config ;
37+
3438 /** @var controller_helper */
3539 protected $ controller_helper ;
3640
@@ -61,6 +65,7 @@ class webpush
6165 /**
6266 * Constructor for webpush controller
6367 *
68+ * @param config $config
6469 * @param controller_helper $controller_helper
6570 * @param driver_interface $db
6671 * @param form_helper $form_helper
@@ -71,9 +76,10 @@ class webpush
7176 * @param string $notification_webpush_table
7277 * @param string $push_subscriptions_table
7378 */
74- public function __construct (controller_helper $ controller_helper , driver_interface $ db , form_helper $ form_helper , path_helper $ path_helper ,
79+ public function __construct (config $ config , controller_helper $ controller_helper , driver_interface $ db , form_helper $ form_helper , path_helper $ path_helper ,
7580 request_interface $ request , user $ user , Environment $ template , string $ notification_webpush_table , string $ push_subscriptions_table )
7681 {
82+ $ this ->config = $ config ;
7783 $ this ->controller_helper = $ controller_helper ;
7884 $ this ->db = $ db ;
7985 $ this ->form_helper = $ form_helper ;
@@ -129,6 +135,7 @@ public function worker(): Response
129135 // @todo: only work for logged in users, no anonymous & bot
130136 $ content = $ this ->template ->render ('@phpbb_webpushnotifications/push_worker.js.twig ' , [
131137 'U_WEBPUSH_GET_NOTIFICATION ' => $ this ->controller_helper ->route ('phpbb_webpushnotifications_ucp_push_get_notification_controller ' ),
138+ 'ASSETS_VERSION ' => $ this ->config ['assets_version ' ],
132139 ]);
133140
134141 $ response = new Response ($ content );
0 commit comments