Merge pull request #5746 from MrPetovan/bug/fix-empty-notifications

Restore template choice by notification label
pull/5748/head
Michael Vogel 2018-09-07 15:45:10 +00:00 zatwierdzone przez GitHub
commit 05567b9866
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 13 dodań i 3 usunięć

Wyświetl plik

@ -274,9 +274,19 @@ function notifications_content(App $a)
// Loop trough ever notification This creates an array with the output html for each
// notification and apply the correct template according to the notificationtype (label).
foreach ($notifs['notifications'] as $notif) {
// We use the notification label to get the correct template file
$tpl_var_name = 'tpl_item_' . $notif['label'];
$tpl_notif = get_markup_template($$tpl_var_name);
$notification_templates = [
'like' => 'notifications_likes_item.tpl',
'dislike' => 'notifications_dislikes_item.tpl',
'attend' => 'notifications_attend_item.tpl',
'attendno' => 'notifications_attend_item.tpl',
'attendmaybe' => 'notifications_attend_item.tpl',
'friend' => 'notifications_friends_item.tpl',
'comment' => 'notifications_comments_item.tpl',
'post' => 'notifications_posts_item.tpl',
'notify' => 'notify.tpl',
];
$tpl_notif = get_markup_template($notification_templates[$notif['label']]);
$notif_content[] = replace_macros($tpl_notif, [
'$item_label' => $notif['label'],