]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/AllFriends.php
Create new page_tabs template
[friendica.git] / src / Module / AllFriends.php
index 68a4f304e658247e931ce1d585d88ccd5c3e99a6..9f1152f26ec1da81c2e0b26aa05ad07a959ca871 100644 (file)
@@ -54,34 +54,31 @@ class AllFriends extends BaseModule
 
                $uid = $app->user['uid'];
 
-               $contact = Model\Contact::getContactForUser($cid, local_user(), ['name', 'url', 'photo', 'uid', 'id']);
+               $contact = Model\Contact::getById($cid, []);
 
                if (empty($contact)) {
                        throw new HTTPException\BadRequestException(DI::l10n()->t('Invalid contact.'));
                }
 
                DI::page()['aside'] = "";
-               Model\Profile::load($app, "", Model\Contact::getByURL($contact["url"], false));
+               Model\Profile::load($app, "", $contact);
 
-               $total = Model\GContact::countAllFriends(local_user(), $cid);
+               $total = Model\Contact\Relation::countFollows($cid);
 
                $pager = new Pager(DI::l10n(), DI::args()->getQueryString());
 
-               $friends = Model\GContact::allFriends(local_user(), $cid, $pager->getStart(), $pager->getItemsPerPage());
+               $friends = Model\Contact\Relation::listFollows($cid, [], [], $pager->getItemsPerPage(), $pager->getStart());
                if (empty($friends)) {
                        return DI::l10n()->t('No friends to display.');
                }
 
+               $tab_str = Contact::getTabsHTML($contact, 4);
+
                $entries = [];
                foreach ($friends as $friend) {
-                       $contact = Model\Contact::getByURLForUser($friend['url'], local_user());
-                       if (!empty($contact)) {
-                               $entries[] = Contact::getContactTemplateVars($contact);
-                       }
+                       $entries[] = Contact::getContactTemplateVars($friend);
                }
 
-               $tab_str = Contact::getTabsHTML($app, $contact, 4);
-
                $tpl = Renderer::getMarkupTemplate('viewcontact_template.tpl');
                return Renderer::replaceMacros($tpl, [
                        '$tab_str'  => $tab_str,