]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - application/front/controller/visitor/PictureWallController.php
Handle pagination through BookmarkService
[github/shaarli/Shaarli.git] / application / front / controller / visitor / PictureWallController.php
index 3c57f8dd61869787565703ad492fb764dd0b5a67..9c8f07d7a18e07990c1a488224563e1ec199d104 100644 (file)
@@ -26,23 +26,23 @@ class PictureWallController extends ShaarliVisitorController
 
         $this->assignView(
             'pagetitle',
-            t('Picture wall') .' - '. $this->container->conf->get('general.title', 'Shaarli')
+            t('Picture wall') . ' - ' . $this->container->conf->get('general.title', 'Shaarli')
         );
 
         // Optionally filter the results:
-        $links = $this->container->bookmarkService->search($request->getQueryParams());
-        $linksToDisplay = [];
+        $bookmarks = $this->container->bookmarkService->search($request->getQueryParams())->getBookmarks();
+        $links = [];
 
         // Get only bookmarks which have a thumbnail.
         // Note: we do not retrieve thumbnails here, the request is too heavy.
         $formatter = $this->container->formatterFactory->getFormatter('raw');
-        foreach ($links as $key => $link) {
-            if (!empty($link->getThumbnail())) {
-                $linksToDisplay[] = $formatter->format($link);
+        foreach ($bookmarks as $key => $bookmark) {
+            if (!empty($bookmark->getThumbnail())) {
+                $links[] = $formatter->format($bookmark);
             }
         }
 
-        $data = ['linksToDisplay' => $linksToDisplay];
+        $data = ['linksToDisplay' => $links];
         $this->executePageHooks('render_picwall', $data, TemplatePage::PICTURE_WALL);
 
         foreach ($data as $key => $value) {