aboutsummaryrefslogtreecommitdiffhomepage
path: root/index.php
diff options
context:
space:
mode:
authorLucas Cimon <lucas.cimon@gmail.com>2017-06-01 17:55:26 +0200
committerLucas Cimon <lucas.cimon@gmail.com>2017-07-30 16:19:34 +0200
commitf210d94f716acd86fd22c9651f591a778490e8a9 (patch)
tree7076edacd0b0f1d8fc4137ed8054286a1a68576f /index.php
parentd5d22a6d07917865c44148ad76f43c65a929a890 (diff)
downloadShaarli-f210d94f716acd86fd22c9651f591a778490e8a9.tar.gz
Shaarli-f210d94f716acd86fd22c9651f591a778490e8a9.tar.zst
Shaarli-f210d94f716acd86fd22c9651f591a778490e8a9.zip
Using only one form in linklist.html + adding untaggedonly filter - fix #885
Diffstat (limited to 'index.php')
-rw-r--r--index.php16
1 files changed, 15 insertions, 1 deletions
diff --git a/index.php b/index.php
index 85486eb5..5c292b04 100644
--- a/index.php
+++ b/index.php
@@ -287,6 +287,7 @@ function logout() {
287 unset($_SESSION['ip']); 287 unset($_SESSION['ip']);
288 unset($_SESSION['username']); 288 unset($_SESSION['username']);
289 unset($_SESSION['privateonly']); 289 unset($_SESSION['privateonly']);
290 unset($_SESSION['untaggedonly']);
290 } 291 }
291 setcookie('shaarli_staySignedIn', FALSE, 0, WEB_PATH); 292 setcookie('shaarli_staySignedIn', FALSE, 0, WEB_PATH);
292} 293}
@@ -1017,6 +1018,19 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history)
1017 exit; 1018 exit;
1018 } 1019 }
1019 1020
1021 // -------- User wants to see only untagged links (toggle)
1022 if (isset($_GET['untaggedonly'])) {
1023 $_SESSION['untaggedonly'] = !$_SESSION['untaggedonly'];
1024
1025 if (! empty($_SERVER['HTTP_REFERER'])) {
1026 $location = generateLocation($_SERVER['HTTP_REFERER'], $_SERVER['HTTP_HOST'], array('untaggedonly'));
1027 } else {
1028 $location = '?';
1029 }
1030 header('Location: '. $location);
1031 exit;
1032 }
1033
1020 // -------- Handle other actions allowed for non-logged in users: 1034 // -------- Handle other actions allowed for non-logged in users:
1021 if (!isLoggedIn()) 1035 if (!isLoggedIn())
1022 { 1036 {
@@ -1651,7 +1665,7 @@ function buildLinkList($PAGE,$LINKSDB, $conf, $pluginManager)
1651 'searchtags' => $searchtags, 1665 'searchtags' => $searchtags,
1652 'searchterm' => $searchterm, 1666 'searchterm' => $searchterm,
1653 ]; 1667 ];
1654 $linksToDisplay = $LINKSDB->filterSearch($request, false, $visibility); 1668 $linksToDisplay = $LINKSDB->filterSearch($request, false, $visibility, !empty($_SESSION['untaggedonly']));
1655 } 1669 }
1656 1670
1657 // ---- Handle paging. 1671 // ---- Handle paging.