]> git.mxchange.org Git - friendica.git/blobdiff - mod/allfriends.php
Merge pull request #6252 from annando/memory
[friendica.git] / mod / allfriends.php
index aa5fb0a679430dadddae06deb58e5bc67826e8de..b233a46182050ddc8d37b3d266950117bb300132 100644 (file)
@@ -5,11 +5,13 @@
 
 use Friendica\App;
 use Friendica\Content\ContactSelector;
+use Friendica\Content\Pager;
 use Friendica\Core\L10n;
+use Friendica\Core\Renderer;
 use Friendica\Core\System;
 use Friendica\Database\DBA;
-use Friendica\Model;\
-use Friendica\Module\Contact;
+use Friendica\Model;
+use Friendica\Module;
 use Friendica\Util\Proxy as ProxyUtils;
 
 
@@ -45,9 +47,9 @@ function allfriends_content(App $a)
 
        $total = Model\GContact::countAllFriends(local_user(), $cid);
 
-       $a->setPagerTotal($total);
+       $pager = new Pager($a->query_string);
 
-       $r = Model\GContact::allFriends(local_user(), $cid, $a->pager['start'], $a->pager['itemspage']);
+       $r = Model\GContact::allFriends(local_user(), $cid, $pager->getStart(), $pager->getItemsPerPage());
        if (!DBA::isResult($r)) {
                $o .= L10n::t('No friends to display.');
                return $o;
@@ -95,15 +97,15 @@ function allfriends_content(App $a)
                $entries[] = $entry;
        }
 
-       $tab_str = Contact::getTabsHTML($a, $contact, 4);
+       $tab_str = Module\Contact::getTabsHTML($a, $contact, 4);
 
-       $tpl = get_markup_template('viewcontact_template.tpl');
+       $tpl = Renderer::getMarkupTemplate('viewcontact_template.tpl');
 
-       $o .= replace_macros($tpl, [
+       $o .= Renderer::replaceMacros($tpl, [
                //'$title' => L10n::t('Friends of %s', htmlentities($c[0]['name'])),
                '$tab_str' => $tab_str,
                '$contacts' => $entries,
-               '$paginate' => paginate($a),
+               '$paginate' => $pager->renderFull($total),
        ]);
 
        return $o;