diff options
Diffstat (limited to 'application/front/controller/admin')
-rw-r--r-- | application/front/controller/admin/SessionFilterController.php | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/application/front/controller/admin/SessionFilterController.php b/application/front/controller/admin/SessionFilterController.php index 69a16ec3..081c0ba0 100644 --- a/application/front/controller/admin/SessionFilterController.php +++ b/application/front/controller/admin/SessionFilterController.php | |||
@@ -12,29 +12,11 @@ use Slim\Http\Response; | |||
12 | /** | 12 | /** |
13 | * Class SessionFilterController | 13 | * Class SessionFilterController |
14 | * | 14 | * |
15 | * Slim controller used to handle filters stored in the user session, such as visibility, links per page, etc. | 15 | * Slim controller used to handle filters stored in the user session, such as visibility, etc. |
16 | */ | 16 | */ |
17 | class SessionFilterController extends ShaarliAdminController | 17 | class SessionFilterController extends ShaarliAdminController |
18 | { | 18 | { |
19 | /** | 19 | /** |
20 | * GET /links-per-page: set the number of bookmarks to display per page in homepage | ||
21 | */ | ||
22 | public function linksPerPage(Request $request, Response $response): Response | ||
23 | { | ||
24 | $linksPerPage = $request->getParam('nb') ?? null; | ||
25 | if (null === $linksPerPage || false === is_numeric($linksPerPage)) { | ||
26 | $linksPerPage = $this->container->conf->get('general.links_per_page', 20); | ||
27 | } | ||
28 | |||
29 | $this->container->sessionManager->setSessionParameter( | ||
30 | SessionManager::KEY_LINKS_PER_PAGE, | ||
31 | abs(intval($linksPerPage)) | ||
32 | ); | ||
33 | |||
34 | return $this->redirectFromReferer($request, $response, ['linksperpage'], ['nb']); | ||
35 | } | ||
36 | |||
37 | /** | ||
38 | * GET /visibility: allows to display only public or only private bookmarks in linklist | 20 | * GET /visibility: allows to display only public or only private bookmarks in linklist |
39 | */ | 21 | */ |
40 | public function visibility(Request $request, Response $response, array $args): Response | 22 | public function visibility(Request $request, Response $response, array $args): Response |