use Friendica\Content\Text\HTML;
use Friendica\Core\Hook;
-use Friendica\Core\L10n;
-use Friendica\Core\PConfig;
use Friendica\Core\Protocol;
use Friendica\Core\Renderer;
use Friendica\Database\DBA;
+use Friendica\DI;
use Friendica\Model\Contact;
use Friendica\Model\User;
{
$o = '';
- $shown = PConfig::get($profile['uid'], 'system', 'display_friend_count', 24);
+ $shown = DI::pConfig()->get($profile['uid'], 'system', 'display_friend_count', 24);
if ($shown == 0) {
return $o;
}
'network' => [Protocol::DFRN, Protocol::ACTIVITYPUB, Protocol::OSTATUS, Protocol::DIASPORA, Protocol::FEED],
]);
- $contacts_title = L10n::t('No contacts');
+ $contacts_title = DI::l10n()->t('No contacts');
$micropro = [];
if ($total) {
// Only show followed for personal accounts, followers for pages
- if (defaults($profile, 'account-type', User::ACCOUNT_TYPE_PERSON) == User::ACCOUNT_TYPE_PERSON) {
+ if ((($profile['account-type'] ?? '') ?: User::ACCOUNT_TYPE_PERSON) == User::ACCOUNT_TYPE_PERSON) {
$rel = [Contact::SHARING, Contact::FRIEND];
} else {
$rel = [Contact::FOLLOWER, Contact::FRIEND];
$contacts_stmt = DBA::select('contact', ['id', 'uid', 'addr', 'url', 'name', 'thumb', 'network'], ['id' => $contact_ids]);
if (DBA::isResult($contacts_stmt)) {
- $contacts_title = L10n::tt('%d Contact', '%d Contacts', $total);
+ $contacts_title = DI::l10n()->tt('%d Contact', '%d Contacts', $total);
$micropro = [];
while ($contact = DBA::fetch($contacts_stmt)) {
$o = Renderer::replaceMacros($tpl, [
'$contacts' => $contacts_title,
'$nickname' => $profile['nickname'],
- '$viewcontacts' => L10n::t('View Contacts'),
+ '$viewcontacts' => DI::l10n()->t('View Contacts'),
'$micropro' => $micropro,
]);