aboutsummaryrefslogtreecommitdiffhomepage
path: root/application/front/controller/visitor/PictureWallController.php
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2021-01-20 14:45:59 +0100
committerArthurHoaro <arthur@hoa.ro>2021-01-20 15:01:29 +0100
commit9b8c0a4560fa1d87cab1529099b1b4677e92e265 (patch)
tree330a9b1a42ff7b7f24a76612b57fae63417ef483 /application/front/controller/visitor/PictureWallController.php
parent055d97f9a9e67d8ee8ae81bbf59a4b846a145d9f (diff)
downloadShaarli-9b8c0a4560fa1d87cab1529099b1b4677e92e265.tar.gz
Shaarli-9b8c0a4560fa1d87cab1529099b1b4677e92e265.tar.zst
Shaarli-9b8c0a4560fa1d87cab1529099b1b4677e92e265.zip
Handle pagination through BookmarkService
Handle all search results through SearchResult object. This is a required step toward implementing a BookmarkService based on SQL database. Related to #953
Diffstat (limited to 'application/front/controller/visitor/PictureWallController.php')
-rw-r--r--application/front/controller/visitor/PictureWallController.php12
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) {