Skip to content

Commit

Permalink
feat(upgrades): the finished upgrades list now has pagination
Browse files Browse the repository at this point in the history
fixes #12968
  • Loading branch information
jdalsem committed Oct 12, 2021
1 parent 264b021 commit 09a1ea5
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions views/default/admin/upgrades/finished.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,17 @@
]);

$upgrades = _elgg_services()->upgrades->getCompletedUpgrades();
echo elgg_view_entity_list($upgrades, [
'limit' => false,
'pagination' => false,

$offset = (int) get_input('offset', 0);
$limit = 5;
$count = count($upgrades);

$items = array_slice($upgrades, $offset, $limit);

echo elgg_view_entity_list($items, [
'offset' => $offset,
'limit' => $limit,
'count' => $count,
'pagination_behaviour' => 'ajax-replace',
'no_results' => true,
]);

0 comments on commit 09a1ea5

Please sign in to comment.