diff options
author | ArthurHoaro <arthur@hoa.ro> | 2021-02-04 10:57:44 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-04 10:57:44 +0100 |
commit | 8997ae6c8e24286f7d47981eaf905e80d2481c10 (patch) | |
tree | 9906b122998ca4420af68b1bb110033b99f7d8bf /application/front/controller/visitor/PictureWallController.php | |
parent | 11edc143b42a7be09c0c9dc02730c83e8cbb73c2 (diff) | |
parent | 9b8c0a4560fa1d87cab1529099b1b4677e92e265 (diff) | |
download | Shaarli-8997ae6c8e24286f7d47981eaf905e80d2481c10.tar.gz Shaarli-8997ae6c8e24286f7d47981eaf905e80d2481c10.tar.zst Shaarli-8997ae6c8e24286f7d47981eaf905e80d2481c10.zip |
Merge pull request #1697 from ArthurHoaro/feature/pagination
Handle pagination through BookmarkService
Diffstat (limited to 'application/front/controller/visitor/PictureWallController.php')
-rw-r--r-- | application/front/controller/visitor/PictureWallController.php | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/application/front/controller/visitor/PictureWallController.php b/application/front/controller/visitor/PictureWallController.php index 23553ee6..9c8f07d7 100644 --- a/application/front/controller/visitor/PictureWallController.php +++ b/application/front/controller/visitor/PictureWallController.php | |||
@@ -30,19 +30,19 @@ class PictureWallController extends ShaarliVisitorController | |||
30 | ); | 30 | ); |
31 | 31 | ||
32 | // Optionally filter the results: | 32 | // Optionally filter the results: |
33 | $links = $this->container->bookmarkService->search($request->getQueryParams()); | 33 | $bookmarks = $this->container->bookmarkService->search($request->getQueryParams())->getBookmarks(); |
34 | $linksToDisplay = []; | 34 | $links = []; |
35 | 35 | ||
36 | // Get only bookmarks which have a thumbnail. | 36 | // Get only bookmarks which have a thumbnail. |
37 | // Note: we do not retrieve thumbnails here, the request is too heavy. | 37 | // Note: we do not retrieve thumbnails here, the request is too heavy. |
38 | $formatter = $this->container->formatterFactory->getFormatter('raw'); | 38 | $formatter = $this->container->formatterFactory->getFormatter('raw'); |
39 | foreach ($links as $key => $link) { | 39 | foreach ($bookmarks as $key => $bookmark) { |
40 | if (!empty($link->getThumbnail())) { | 40 | if (!empty($bookmark->getThumbnail())) { |
41 | $linksToDisplay[] = $formatter->format($link); | 41 | $links[] = $formatter->format($bookmark); |
42 | } | 42 | } |
43 | } | 43 | } |
44 | 44 | ||
45 | $data = ['linksToDisplay' => $linksToDisplay]; | 45 | $data = ['linksToDisplay' => $links]; |
46 | $this->executePageHooks('render_picwall', $data, TemplatePage::PICTURE_WALL); | 46 | $this->executePageHooks('render_picwall', $data, TemplatePage::PICTURE_WALL); |
47 | 47 | ||
48 | foreach ($data as $key => $value) { | 48 | foreach ($data as $key => $value) { |