diff options
author | Lucas Cimon <lucas.cimon@gmail.com> | 2017-06-01 17:55:26 +0200 |
---|---|---|
committer | Lucas Cimon <lucas.cimon@gmail.com> | 2017-07-30 16:19:34 +0200 |
commit | f210d94f716acd86fd22c9651f591a778490e8a9 (patch) | |
tree | 7076edacd0b0f1d8fc4137ed8054286a1a68576f /application/LinkDB.php | |
parent | d5d22a6d07917865c44148ad76f43c65a929a890 (diff) | |
download | Shaarli-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 'application/LinkDB.php')
-rw-r--r-- | application/LinkDB.php | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/application/LinkDB.php b/application/LinkDB.php index 8ca0fab3..9e3efd6b 100644 --- a/application/LinkDB.php +++ b/application/LinkDB.php | |||
@@ -417,21 +417,22 @@ You use the community supported version of the original Shaarli project, by Seba | |||
417 | * - searchterm: term search | 417 | * - searchterm: term search |
418 | * @param bool $casesensitive Optional: Perform case sensitive filter | 418 | * @param bool $casesensitive Optional: Perform case sensitive filter |
419 | * @param string $visibility return only all/private/public links | 419 | * @param string $visibility return only all/private/public links |
420 | * @param string $untaggedonly return only untagged links | ||
420 | * | 421 | * |
421 | * @return array filtered links, all links if no suitable filter was provided. | 422 | * @return array filtered links, all links if no suitable filter was provided. |
422 | */ | 423 | */ |
423 | public function filterSearch($filterRequest = array(), $casesensitive = false, $visibility = 'all') | 424 | public function filterSearch($filterRequest = array(), $casesensitive = false, $visibility = 'all', $untaggedonly = false) |
424 | { | 425 | { |
425 | // Filter link database according to parameters. | 426 | // Filter link database according to parameters. |
426 | $searchtags = isset($filterRequest['searchtags']) ? escape($filterRequest['searchtags']) : ''; | 427 | $searchtags = isset($filterRequest['searchtags']) ? escape($filterRequest['searchtags']) : ''; |
427 | $searchterm = isset($filterRequest['searchterm']) ? escape($filterRequest['searchterm']) : ''; | 428 | $searchterm = isset($filterRequest['searchterm']) ? escape($filterRequest['searchterm']) : ''; |
428 | 429 | ||
429 | // Search tags + fullsearch - blank string parameter will return all links. | 430 | // Search tags + fullsearch - blank string parameter will return all links. |
430 | $type = LinkFilter::$FILTER_TAG | LinkFilter::$FILTER_TEXT; | 431 | $type = LinkFilter::$FILTER_TAG | LinkFilter::$FILTER_TEXT; // == "vuotext" |
431 | $request = [$searchtags, $searchterm]; | 432 | $request = [$searchtags, $searchterm]; |
432 | 433 | ||
433 | $linkFilter = new LinkFilter($this); | 434 | $linkFilter = new LinkFilter($this); |
434 | return $linkFilter->filter($type, $request, $casesensitive, $visibility); | 435 | return $linkFilter->filter($type, $request, $casesensitive, $visibility, $untaggedonly); |
435 | } | 436 | } |
436 | 437 | ||
437 | /** | 438 | /** |