add alt_pager to mod_moderate, remove legacy $a parameter from all occurrences of alt_pager

This commit is contained in:
zotlabs 2018-04-17 23:36:35 -07:00
parent fc7d9c235c
commit c53f788cc8
9 changed files with 14 additions and 10 deletions

View file

@ -191,7 +191,7 @@ class Articles extends \Zotlabs\Web\Controller {
'$title' => t('Articles'),
'$editor' => $editor,
'$content' => $content,
'$pager' => alt_pager($a,$pager_total)
'$pager' => alt_pager($pager_total)
]);
return $o;

View file

@ -194,7 +194,7 @@ class Cards extends \Zotlabs\Web\Controller {
'$title' => t('Cards'),
'$editor' => $editor,
'$content' => $content,
'$pager' => alt_pager($a, $pager_total)
'$pager' => alt_pager($pager_total)
]);
return $o;

View file

@ -380,7 +380,7 @@ class Channel extends \Zotlabs\Web\Controller {
}
if((! $update) || ($checkjs->disabled())) {
$o .= alt_pager($a,count($items));
$o .= alt_pager(count($items));
if ($mid && $items[0]['title'])
\App::$page['title'] = $items[0]['title'] . " - " . \App::$page['title'];
}

View file

@ -404,7 +404,7 @@ class Directory extends \Zotlabs\Web\Controller {
'$entries' => $entries,
'$dirlbl' => $suggest ? t('Channel Suggestions') : $dirtitle,
'$submit' => t('Find'),
'$next' => alt_pager($a,$j['records'], t('next page'), t('previous page')),
'$next' => alt_pager($j['records'], t('next page'), t('previous page')),
'$sort' => t('Sort options'),
'$normal' => t('Alphabetic'),
'$reverse' => t('Reverse Alphabetic'),

View file

@ -93,7 +93,7 @@ class Message extends \Zotlabs\Web\Controller {
));
$o .= alt_pager($a,count($r));
$o .= alt_pager(count($r));
return $o;

View file

@ -14,9 +14,12 @@ class Moderate extends \Zotlabs\Web\Controller {
return;
}
\App::set_pager_itemspage(60);
$pager_sql = sprintf(" LIMIT %d OFFSET %d ", intval(\App::$pager['itemspage']), intval(\App::$pager['start']));
//show all items
if(argc() == 1) {
$r = q("select item.id as item_id, item.* from item where item.uid = %d and item_blocked = %d and item_deleted = 0 order by created desc limit 60",
$r = q("select item.id as item_id, item.* from item where item.uid = %d and item_blocked = %d and item_deleted = 0 order by created desc $pager_sql",
intval(local_channel()),
intval(ITEM_MODERATED)
);
@ -26,7 +29,7 @@ class Moderate extends \Zotlabs\Web\Controller {
if(argc() == 2) {
$post_id = intval(argv(1));
$r = q("select item.id as item_id, item.* from item where item.id = %d and item.uid = %d and item_blocked = %d and item_deleted = 0 order by created desc limit 60",
$r = q("select item.id as item_id, item.* from item where item.id = %d and item.uid = %d and item_blocked = %d and item_deleted = 0 order by created desc $pager_sql",
intval($post_id),
intval(local_channel()),
intval(ITEM_MODERATED)
@ -92,6 +95,7 @@ class Moderate extends \Zotlabs\Web\Controller {
}
$o = conversation($items,'moderate',false,'traditional');
$o .= alt_pager(count($items));
return $o;
}

View file

@ -565,7 +565,7 @@ class Network extends \Zotlabs\Web\Controller {
$o .= conversation($items,$mode,$update,$page_mode);
if(($items) && (! $update))
$o .= alt_pager($a,count($items));
$o .= alt_pager(count($items));
return $o;
}

View file

@ -279,7 +279,7 @@ class Pubstream extends \Zotlabs\Web\Controller {
$o .= '<div id="content-complete"></div>';
if(($items) && (! $update))
$o .= alt_pager($a,count($items));
$o .= alt_pager(count($items));
return $o;

View file

@ -531,7 +531,7 @@ function paginate(&$a) {
}
function alt_pager(&$a, $i, $more = '', $less = '') {
function alt_pager($i, $more = '', $less = '') {
if(! $more)
$more = t('older');