X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fcommon.php;h=0ff523b3f77c0d0f38b8ba9d3ce5c960a597908e;hb=fd1da749808cdfccf05a4fa9ba8ba6aeafd35a9b;hp=c66da0385092912ff12461f9074673949cc31ab6;hpb=e6f61c2cc77f23ad7f2fd34bab3f9b374fc48618;p=friendica.git diff --git a/mod/common.php b/mod/common.php index c66da03850..0ff523b3f7 100644 --- a/mod/common.php +++ b/mod/common.php @@ -1,12 +1,27 @@ . + * */ use Friendica\App; use Friendica\Content\ContactSelector; use Friendica\Content\Pager; -use Friendica\Core\L10n; use Friendica\Core\Renderer; use Friendica\Database\DBA; use Friendica\DI; @@ -25,7 +40,7 @@ function common_content(App $a) $zcid = 0; if (!local_user()) { - notice(L10n::t('Permission denied.') . EOL); + notice(DI::l10n()->t('Permission denied.')); return; } @@ -41,23 +56,23 @@ function common_content(App $a) $contact = DBA::selectFirst('contact', ['name', 'url', 'photo', 'uid', 'id'], ['id' => $cid, 'uid' => $uid]); if (DBA::isResult($contact)) { - $a->page['aside'] = ""; - Model\Profile::load($a, "", 0, Model\Contact::getDetailsByURL($contact["url"])); + DI::page()['aside'] = ""; + Model\Profile::load($a, "", Model\Contact::getByURL($contact["url"], false)); } } else { $contact = DBA::selectFirst('contact', ['name', 'url', 'photo', 'uid', 'id'], ['self' => true, 'uid' => $uid]); if (DBA::isResult($contact)) { - $vcard_widget = Renderer::replaceMacros(Renderer::getMarkupTemplate("widget/vcard.tpl"), [ + $vcard_widget = Renderer::replaceMacros(Renderer::getMarkupTemplate('widget/vcard.tpl'), [ '$name' => $contact['name'], '$photo' => $contact['photo'], 'url' => 'contact/' . $cid ]); - if (empty($a->page['aside'])) { - $a->page['aside'] = ''; + if (empty(DI::page()['aside'])) { + DI::page()['aside'] = ''; } - $a->page['aside'] .= $vcard_widget; + DI::page()['aside'] .= $vcard_widget; } } @@ -88,11 +103,11 @@ function common_content(App $a) } if ($total < 1) { - notice(L10n::t('No contacts in common.') . EOL); + notice(DI::l10n()->t('No contacts in common.')); return $o; } - $pager = new Pager(DI::args()->getQueryString()); + $pager = new Pager(DI::l10n(), DI::args()->getQueryString()); if ($cid) { $common_friends = Model\GContact::commonFriends($uid, $cid, $pager->getStart(), $pager->getItemsPerPage()); @@ -109,7 +124,7 @@ function common_content(App $a) $entries = []; foreach ($common_friends as $common_friend) { //get further details of the contact - $contact_details = Model\Contact::getDetailsByURL($common_friend['url'], $uid); + $contact_details = Model\Contact::getByURLForUser($common_friend['url'], $uid); // $rr['id'] is needed to use contact_photo_menu() /// @TODO Adding '/" here avoids E_NOTICE on missing constants @@ -139,7 +154,7 @@ function common_content(App $a) if ($cmd === 'loc' && $cid && local_user() == $uid) { $tab_str = Module\Contact::getTabsHTML($a, $contact, 5); } else { - $title = L10n::t('Common Friends'); + $title = DI::l10n()->t('Common Friends'); } $tpl = Renderer::getMarkupTemplate('viewcontact_template.tpl');