aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Controller/ConfigController.php
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas@loeuillet.org>2016-11-28 16:47:41 +0100
committerGitHub <noreply@github.com>2016-11-28 16:47:41 +0100
commitad51d77146494f04466c288b05b57b0d96113fd5 (patch)
tree278c6a17d808bd3d9aa132d9ef93d7e54842de58 /src/Wallabag/CoreBundle/Controller/ConfigController.php
parent34ea7be6228c633ef8da703994eed034026e9c18 (diff)
parent9aa991281ddd315f607cabcfc3b917401d3d2104 (diff)
downloadwallabag-ad51d77146494f04466c288b05b57b0d96113fd5.tar.gz
wallabag-ad51d77146494f04466c288b05b57b0d96113fd5.tar.zst
wallabag-ad51d77146494f04466c288b05b57b0d96113fd5.zip
Merge pull request #2662 from wallabag/add-list-view
Add list view
Diffstat (limited to 'src/Wallabag/CoreBundle/Controller/ConfigController.php')
-rw-r--r--src/Wallabag/CoreBundle/Controller/ConfigController.php21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/Controller/ConfigController.php b/src/Wallabag/CoreBundle/Controller/ConfigController.php
index 52a03070..68f30f6e 100644
--- a/src/Wallabag/CoreBundle/Controller/ConfigController.php
+++ b/src/Wallabag/CoreBundle/Controller/ConfigController.php
@@ -363,4 +363,25 @@ class ConfigController extends Controller
363 363
364 return $this->redirect($this->generateUrl('fos_user_security_login')); 364 return $this->redirect($this->generateUrl('fos_user_security_login'));
365 } 365 }
366
367 /**
368 * Switch view mode for current user.
369 *
370 * @Route("/config/view-mode", name="switch_view_mode")
371 *
372 * @param Request $request
373 *
374 * @return \Symfony\Component\HttpFoundation\RedirectResponse
375 */
376 public function changeViewModeAction(Request $request)
377 {
378 $user = $this->getUser();
379 $user->getConfig()->setListMode(!$user->getConfig()->getListMode());
380
381 $em = $this->getDoctrine()->getManager();
382 $em->persist($user);
383 $em->flush();
384
385 return $this->redirect($request->headers->get('referer'));
386 }
366} 387}