namespace Shaarli\Front\Controller\Admin;
use Shaarli\Bookmark\Exception\BookmarkNotFoundException;
+use Shaarli\Render\TemplatePage;
use Slim\Http\Request;
use Slim\Http\Response;
public function index(Request $request, Response $response): Response
{
$ids = [];
- foreach ($this->container->bookmarkService->search() as $bookmark) {
+ foreach ($this->container->bookmarkService->search()->getBookmarks() as $bookmark) {
// A note or not HTTP(S)
if ($bookmark->isNote() || !startsWith(strtolower($bookmark->getUrl()), 'http')) {
continue;
$this->assignView('ids', $ids);
$this->assignView(
'pagetitle',
- t('Thumbnails update') .' - '. $this->container->conf->get('general.title', 'Shaarli')
+ t('Thumbnails update') . ' - ' . $this->container->conf->get('general.title', 'Shaarli')
);
- return $response->write($this->render('thumbnails'));
+ return $response->write($this->render(TemplatePage::THUMBNAILS));
}
/**
}
try {
- $bookmark = $this->container->bookmarkService->get($id);
+ $bookmark = $this->container->bookmarkService->get((int) $id);
} catch (BookmarkNotFoundException $e) {
return $response->withStatus(404);
}
return $response->withJson($this->container->formatterFactory->getFormatter('raw')->format($bookmark));
}
-
- /**
- * @param mixed[] $data Variables passed to the template engine
- *
- * @return mixed[] Template data after active plugins render_picwall hook execution.
- */
- protected function executeHooks(array $data): array
- {
- $this->container->pluginManager->executeHooks(
- 'render_tools',
- $data
- );
-
- return $data;
- }
}