- $a->data['contact'] = $contact;
-
- if (($contact['network'] != '') && ($contact['network'] != Protocol::DFRN)) {
- $network_link = Strings::formatNetworkName($contact['network'], $contact['url']);
- } else {
- $network_link = '';
- }
-
- $follow_link = '';
- $unfollow_link = '';
- if (in_array($contact['network'], Protocol::NATIVE_SUPPORT)) {
- if ($contact['uid'] && in_array($contact['rel'], [Model\Contact::SHARING, Model\Contact::FRIEND])) {
- $unfollow_link = 'unfollow?url=' . urlencode($contact['url']);
- } elseif(!$contact['pending']) {
- $follow_link = 'follow?url=' . urlencode($contact['url']);
- }
- }
-
- $wallmessage_link = '';
- if ($contact['uid'] && Model\Contact::canReceivePrivateMessages($contact)) {
- $wallmessage_link = 'message/new/' . $contact['id'];
- }
-
- $vcard_widget = Renderer::replaceMacros(Renderer::getMarkupTemplate('widget/vcard.tpl'), [
- '$name' => $contact['name'],
- '$photo' => Model\Contact::getPhoto($contact),
- '$url' => Model\Contact::magicLinkByContact($contact, $contact['url']),
- '$addr' => $contact['addr'] ?? '',
- '$network_link' => $network_link,
- '$network' => DI::l10n()->t('Network:'),
- '$account_type' => Model\Contact::getAccountType($contact),
- '$follow' => DI::l10n()->t('Follow'),
- '$follow_link' => $follow_link,
- '$unfollow' => DI::l10n()->t('Unfollow'),
- '$unfollow_link' => $unfollow_link,
- '$wallmessage' => DI::l10n()->t('Message'),
- '$wallmessage_link' => $wallmessage_link,
- ]);