diff options
Diffstat (limited to 'application/bookmark/BookmarkFileService.php')
-rw-r--r-- | application/bookmark/BookmarkFileService.php | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/application/bookmark/BookmarkFileService.php b/application/bookmark/BookmarkFileService.php index b3a90ed4..c9ec2609 100644 --- a/application/bookmark/BookmarkFileService.php +++ b/application/bookmark/BookmarkFileService.php | |||
@@ -114,8 +114,13 @@ class BookmarkFileService implements BookmarkServiceInterface | |||
114 | /** | 114 | /** |
115 | * @inheritDoc | 115 | * @inheritDoc |
116 | */ | 116 | */ |
117 | public function search($request = [], $visibility = null, $caseSensitive = false, $untaggedOnly = false) | 117 | public function search( |
118 | { | 118 | $request = [], |
119 | $visibility = null, | ||
120 | $caseSensitive = false, | ||
121 | $untaggedOnly = false, | ||
122 | bool $ignoreSticky = false | ||
123 | ) { | ||
119 | if ($visibility === null) { | 124 | if ($visibility === null) { |
120 | $visibility = $this->isLoggedIn ? BookmarkFilter::$ALL : BookmarkFilter::$PUBLIC; | 125 | $visibility = $this->isLoggedIn ? BookmarkFilter::$ALL : BookmarkFilter::$PUBLIC; |
121 | } | 126 | } |
@@ -124,6 +129,10 @@ class BookmarkFileService implements BookmarkServiceInterface | |||
124 | $searchtags = isset($request['searchtags']) ? $request['searchtags'] : ''; | 129 | $searchtags = isset($request['searchtags']) ? $request['searchtags'] : ''; |
125 | $searchterm = isset($request['searchterm']) ? $request['searchterm'] : ''; | 130 | $searchterm = isset($request['searchterm']) ? $request['searchterm'] : ''; |
126 | 131 | ||
132 | if ($ignoreSticky) { | ||
133 | $this->bookmarks->reorder('DESC', true); | ||
134 | } | ||
135 | |||
127 | return $this->bookmarkFilter->filter( | 136 | return $this->bookmarkFilter->filter( |
128 | BookmarkFilter::$FILTER_TAG | BookmarkFilter::$FILTER_TEXT, | 137 | BookmarkFilter::$FILTER_TAG | BookmarkFilter::$FILTER_TEXT, |
129 | [$searchtags, $searchterm], | 138 | [$searchtags, $searchterm], |
@@ -353,7 +362,9 @@ class BookmarkFileService implements BookmarkServiceInterface | |||
353 | */ | 362 | */ |
354 | public function filterDay($request) | 363 | public function filterDay($request) |
355 | { | 364 | { |
356 | return $this->bookmarkFilter->filter(BookmarkFilter::$FILTER_DAY, $request); | 365 | $visibility = $this->isLoggedIn ? BookmarkFilter::$ALL : BookmarkFilter::$PUBLIC; |
366 | |||
367 | return $this->bookmarkFilter->filter(BookmarkFilter::$FILTER_DAY, $request, false, $visibility); | ||
357 | } | 368 | } |
358 | 369 | ||
359 | /** | 370 | /** |