- '$as_friend' => t('Friend'),
- '$as_fan' => (($it['network'] == NETWORK_DIASPORA) ? t('Sharer') : t('Subscriber'))
- ));
-
- $header = $it["name"];
-
- if ($it["addr"] != "")
- $header .= " <".$it["addr"].">";
-
- $header .= " (".network_to_name($it['network'], $it['url']).")";
-
- $notif_content[] = replace_macros($tpl, array(
- '$header' => htmlentities($header),
- '$str_notifytype' => t('Notification type: '),
- '$notify_type' => $it['notify_type'],
- '$dfrn_text' => $dfrn_text,
- '$dfrn_id' => $it['dfrn_id'],
- '$uid' => $it['uid'],
- '$intro_id' => $it['intro_id'],
- '$contact_id' => $it['contact_id'],
- '$photo' => $it['photo'],
- '$fullname' => $it['name'],
- '$location' => $it['location'],
- '$lbl_location' => t('Location:'),
- '$about' => $it['about'],
- '$lbl_about' => t('About:'),
- '$keywords' => $it['keywords'],
- '$lbl_keywords' => t('Tags:'),
- '$gender' => $it['gender'],
- '$lbl_gender' => t('Gender:'),
- '$hidden' => array('hidden', t('Hide this contact from others'), ($it['hidden'] == 1), ''),
- '$activity' => array('activity', t('Post a new friend activity'), $it['post_newfriend'], t('if applicable')),
- '$url' => $it['url'],
- '$zrl' => $it['zrl'],
- '$lbl_url' => t('Profile URL'),
- '$addr' => $it['addr'],
+ '$as_friend' => L10n::t('Friend'),
+ '$as_fan' => (($notif['network'] == Protocol::DIASPORA) ? L10n::t('Sharer') : L10n::t('Subscriber'))
+ ]);
+
+ $header = $notif['name'];
+
+ if ($notif['addr'] != '') {
+ $header .= ' <' . $notif['addr'] . '>';
+ }
+
+ $header .= ' (' . ContactSelector::networkToName($notif['network'], $notif['url']) . ')';
+
+ if ($notif['network'] != Protocol::DIASPORA) {
+ $discard = L10n::t('Discard');
+ } else {
+ $discard = '';
+ }
+
+ $notif_content[] = replace_macros($tpl, [
+ '$type' => $notif['label'],
+ '$header' => htmlentities($header),
+ '$str_notifytype' => L10n::t('Notification type:'),
+ '$notify_type' => $notif['notify_type'],
+ '$dfrn_text' => $dfrn_text,
+ '$dfrn_id' => $notif['dfrn_id'],
+ '$uid' => $notif['uid'],
+ '$intro_id' => $notif['intro_id'],
+ '$contact_id' => $notif['contact_id'],
+ '$photo' => $notif['photo'],
+ '$fullname' => $notif['name'],
+ '$location' => $notif['location'],
+ '$lbl_location'=> L10n::t('Location:'),
+ '$about' => $notif['about'],
+ '$lbl_about' => L10n::t('About:'),
+ '$keywords' => $notif['keywords'],
+ '$lbl_keywords'=> L10n::t('Tags:'),
+ '$gender' => $notif['gender'],
+ '$lbl_gender' => L10n::t('Gender:'),
+ '$hidden' => ['hidden', L10n::t('Hide this contact from others'), ($notif['hidden'] == 1), ''],
+ '$url' => $notif['url'],
+ '$zrl' => $notif['zrl'],
+ '$lbl_url' => L10n::t('Profile URL'),
+ '$addr' => $notif['addr'],