Use a single function to create the template data for contacts

This commit is contained in:
Michael 2020-07-30 21:16:15 +00:00
commit 91b0f2c486
6 changed files with 34 additions and 152 deletions

View file

@ -93,21 +93,7 @@ function suggest_content(App $a)
$entries = [];
foreach ($contacts as $contact) {
$entry = [
'url' => Contact::magicLink($contact['url']),
'itemurl' => $contact['addr'] ?: $contact['url'],
'name' => $contact['name'],
'thumb' => Contact::getThumb($contact),
'img_hover' => $contact['url'],
'details' => $contact['location'],
'tags' => $contact['keywords'],
'about' => $contact['about'],
'account_type' => Contact::getAccountType($contact),
'network' => ContactSelector::networkToName($contact['network'], $contact['url']),
'photo_menu' => Contact::photoMenu($contact),
'id' => ++$id,
];
$entries[] = $entry;
$entries[] = Contact::getTemplateData($contact, ++$id);
}
$tpl = Renderer::getMarkupTemplate('viewcontact_template.tpl');