Use the function from the contact template instead

This commit is contained in:
Michael 2020-07-31 03:55:01 +00:00
parent 91b0f2c486
commit 893f6bd692
7 changed files with 23 additions and 33 deletions

View file

@ -1009,7 +1009,14 @@ class Contact extends BaseModule
return $o;
}
public static function getContactTemplateVars(array $rr)
/**
* Return the fields for the contact template
*
* @param array $rr Contact array
* @param integer $id
* @return array Template fields
*/
public static function getContactTemplateVars(array $rr, int $id = 0)
{
$dir_icon = '';
$alt_text = '';
@ -1069,12 +1076,16 @@ class Contact extends BaseModule
'thumb' => Model\Contact::getThumb($rr),
'name' => $rr['name'],
'username' => $rr['name'],
'details' => $rr['location'],
'tags' => $rr['keywords'],
'about' => $rr['about'],
'account_type' => Model\Contact::getAccountType($rr),
'sparkle' => $sparkle,
'itemurl' => ($rr['addr'] ?? '') ?: $rr['url'],
'url' => $url,
'network' => ContactSelector::networkToName($rr['network'], $rr['url'], $rr['protocol']),
'nick' => $rr['nick'],
'id' => $id,
];
}