aboutsummaryrefslogtreecommitdiffhomepage
path: root/index.php
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2018-01-24 18:46:31 +0100
committerArthurHoaro <arthur@hoa.ro>2018-01-24 18:46:31 +0100
commitd2f6d909e529898c43b32defb890ec8e2d6b72f5 (patch)
tree1c75ee1302f9968e8a25d5157347d5d4c8c52519 /index.php
parent9d4736a3e95332198896f97ecc8a83abb0cbe85b (diff)
downloadShaarli-d2f6d909e529898c43b32defb890ec8e2d6b72f5.tar.gz
Shaarli-d2f6d909e529898c43b32defb890ec8e2d6b72f5.tar.zst
Shaarli-d2f6d909e529898c43b32defb890ec8e2d6b72f5.zip
Public/private filter: use two separate buttons
#1038
Diffstat (limited to 'index.php')
-rw-r--r--index.php16
1 files changed, 13 insertions, 3 deletions
diff --git a/index.php b/index.php
index 60ac24ac..8770b669 100644
--- a/index.php
+++ b/index.php
@@ -1012,11 +1012,21 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager)
1012 1012
1013 // -------- User wants to see only private links (toggle) 1013 // -------- User wants to see only private links (toggle)
1014 if (isset($_GET['visibility'])) { 1014 if (isset($_GET['visibility'])) {
1015 unset($_SESSION['visibility']);
1016 if ($_GET['visibility'] === 'private') { 1015 if ($_GET['visibility'] === 'private') {
1017 $_SESSION['visibility'] = 'private'; // See only private links 1016 // Visibility not set or not already private, set private, otherwise reset it
1017 if (empty($_SESSION['visibility']) || $_SESSION['visibility'] !== 'private') {
1018 // See only private links
1019 $_SESSION['visibility'] = 'private';
1020 } else {
1021 unset($_SESSION['visibility']);
1022 }
1018 } else if ($_GET['visibility'] === 'public') { 1023 } else if ($_GET['visibility'] === 'public') {
1019 $_SESSION['visibility'] = 'public'; // See only public links 1024 if (empty($_SESSION['visibility']) || $_SESSION['visibility'] !== 'public') {
1025 // See only public links
1026 $_SESSION['visibility'] = 'public';
1027 } else {
1028 unset($_SESSION['visibility']);
1029 }
1020 } 1030 }
1021 1031
1022 if (! empty($_SERVER['HTTP_REFERER'])) { 1032 if (! empty($_SERVER['HTTP_REFERER'])) {