]> git.mxchange.org Git - friendica.git/blobdiff - mod/common.php
Remove deprecated App::cmd - replace with DI::args()->getCommand()
[friendica.git] / mod / common.php
index 6b6090e19beedef238ac97652a75a628e5ef4019..c66da0385092912ff12461f9074673949cc31ab6 100644 (file)
@@ -9,6 +9,7 @@ use Friendica\Content\Pager;
 use Friendica\Core\L10n;
 use Friendica\Core\Renderer;
 use Friendica\Database\DBA;
+use Friendica\DI;
 use Friendica\Model;
 use Friendica\Module;
 use Friendica\Util\Proxy as ProxyUtils;
@@ -47,7 +48,7 @@ function common_content(App $a)
                $contact = DBA::selectFirst('contact', ['name', 'url', 'photo', 'uid', 'id'], ['self' => true, 'uid' => $uid]);
 
                if (DBA::isResult($contact)) {
-                       $vcard_widget = Renderer::replaceMacros(Renderer::getMarkupTemplate("vcard-widget.tpl"), [
+                       $vcard_widget = Renderer::replaceMacros(Renderer::getMarkupTemplate("widget/vcard.tpl"), [
                                '$name'  => $contact['name'],
                                '$photo' => $contact['photo'],
                                'url'    => 'contact/' . $cid
@@ -91,7 +92,7 @@ function common_content(App $a)
                return $o;
        }
 
-       $pager = new Pager($a->query_string);
+       $pager = new Pager(DI::args()->getQueryString());
 
        if ($cid) {
                $common_friends = Model\GContact::commonFriends($uid, $cid, $pager->getStart(), $pager->getItemsPerPage());
@@ -118,7 +119,7 @@ function common_content(App $a)
 
                $entry = [
                        'url'          => Model\Contact::magicLink($common_friend['url']),
-                       'itemurl'      => defaults($contact_details, 'addr', $common_friend['url']),
+                       'itemurl'      => ($contact_details['addr'] ?? '') ?: $common_friend['url'],
                        'name'         => $contact_details['name'],
                        'thumb'        => ProxyUtils::proxifyUrl($contact_details['thumb'], false, ProxyUtils::SIZE_THUMB),
                        'img_hover'    => $contact_details['name'],
@@ -136,7 +137,7 @@ function common_content(App $a)
        $title = '';
        $tab_str = '';
        if ($cmd === 'loc' && $cid && local_user() == $uid) {
-               $tab_str = Module\Contact::getTabsHTML($a, $contact, 4);
+               $tab_str = Module\Contact::getTabsHTML($a, $contact, 5);
        } else {
                $title = L10n::t('Common Friends');
        }