Conditions | 2 |
Paths | 2 |
Total Lines | 21 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
41 | public function query() |
||
42 | { |
||
43 | $phpbb_notifications = $this->phpbb_container->get('notification_manager'); |
||
44 | $notifications = $phpbb_notifications->load_notifications(array( |
||
45 | 'user_id' => $this->user->data['user_id'], |
||
46 | 'all_unread' => true, |
||
47 | 'limit' => 5, |
||
48 | )); |
||
49 | |||
50 | $result = array(); |
||
51 | foreach ($notifications['notifications'] as $notification) |
||
52 | { |
||
53 | $data = $notification->prepare_for_display(); |
||
54 | $data['U_MARK_READ'] = $this->path_helper->update_web_root_path($data['U_MARK_READ']); |
||
55 | $data['URL'] = $this->path_helper->update_web_root_path($data['URL']); |
||
56 | $data['L_MARK_READ'] = $this->user->lang['MARK_READ']; |
||
57 | $result[] =$data; |
||
58 | } |
||
59 | |||
60 | return new JsonResponse($result); |
||
61 | } |
||
62 | } |
||
63 |