use Friendica\App;
use Friendica\Content\ContactSelector;
+use Friendica\Content\Pager;
use Friendica\Content\Widget;
use Friendica\Core\Config;
use Friendica\Core\L10n;
$j = new stdClass();
$j->total = 1;
$j->items_page = 1;
- $j->page = $a->pager['page'];
+ $j->page = $pager->getPage();
$objresult = new stdClass();
$objresult->cid = 0;
$extra_sql = "";
$perpage = 80;
- $startrec = (($a->pager['page']) * $perpage) - $perpage;
+ $startrec = (($pager->getPage()) * $perpage) - $perpage;
if (Config::get('system','diaspora_enabled')) {
$diaspora = Protocol::DIASPORA;
$j = new stdClass();
$j->total = $count[0]["total"];
$j->items_page = $perpage;
- $j->page = $a->pager['page'];
+ $j->page = $pager->getPage();
foreach ($results AS $result) {
if (PortableContact::alternateOStatusUrl($result["nurl"])) {
continue;
Worker::add(PRIORITY_LOW, 'DiscoverPoCo', "dirsearch", urlencode($search));
} else {
- $p = (($a->pager['page'] != 1) ? '&p=' . $a->pager['page'] : '');
+ $p = (($pager->getPage() != 1) ? '&p=' . $pager->getPage() : '');
if(strlen(Config::get('system','directory')))
$x = Network::fetchUrl(get_server().'/lsearch?f=' . $p . '&search=' . urlencode($search));
$j = json_decode($x);
}
- if ($j->total) {
- $a->setPagerTotal($j->total);
- $a->setPagerItemsPage($j->items_page);
- }
-
if (!empty($j->results)) {
+ $pager = new Pager($a->query_string, $j->total, $j->items_page);
$id = 0;
$entries[] = $entry;
}
- $tpl = get_markup_template('viewcontact_template.tpl');
+ $tpl = get_markup_template('viewcontact_template.tpl');
- $o .= replace_macros($tpl,[
- 'title' => $header,
- '$contacts' => $entries,
- '$paginate' => paginate($a),
- ]);
+ $o .= replace_macros($tpl,[
+ 'title' => $header,
+ '$contacts' => $entries,
+ '$paginate' => $pager->renderFull(),
+ ]);
} else {
info(L10n::t('No matches') . EOL);