From 336a28fa4a09b968ce4705900bf57693e672f0bf Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Sat, 25 May 2019 15:46:47 +0200 Subject: Introduce Bookmark object and Service layer to retrieve them See https://github.com/shaarli/Shaarli/issues/1307 for details --- application/bookmark/BookmarkServiceInterface.php | 180 ++++++++++++++++++++++ 1 file changed, 180 insertions(+) create mode 100644 application/bookmark/BookmarkServiceInterface.php (limited to 'application/bookmark/BookmarkServiceInterface.php') diff --git a/application/bookmark/BookmarkServiceInterface.php b/application/bookmark/BookmarkServiceInterface.php new file mode 100644 index 00000000..7b7a4f09 --- /dev/null +++ b/application/bookmark/BookmarkServiceInterface.php @@ -0,0 +1,180 @@ + bookmarksCount + */ + public function bookmarksCountPerTag($filteringTags = [], $visibility = 'all'); + + /** + * Returns the list of days containing articles (oldest first) + * + * @return array containing days (in format YYYYMMDD). + */ + public function days(); + + /** + * Returns the list of articles for a given day. + * + * @param string $request day to filter. Format: YYYYMMDD. + * + * @return Bookmark[] list of shaare found. + * + * @throws BookmarkNotFoundException + */ + public function filterDay($request); + + /** + * Creates the default database after a fresh install. + */ + public function initialize(); +} -- cgit v1.2.3 From c4ad3d4f061d05a01db25aa54dda830ba776792d Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Tue, 7 Jul 2020 10:15:56 +0200 Subject: Process Shaarli install through Slim controller --- application/bookmark/BookmarkServiceInterface.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'application/bookmark/BookmarkServiceInterface.php') diff --git a/application/bookmark/BookmarkServiceInterface.php b/application/bookmark/BookmarkServiceInterface.php index 7b7a4f09..37fbda89 100644 --- a/application/bookmark/BookmarkServiceInterface.php +++ b/application/bookmark/BookmarkServiceInterface.php @@ -177,4 +177,17 @@ interface BookmarkServiceInterface * Creates the default database after a fresh install. */ public function initialize(); + + /** + * Allow to write the datastore from anonymous session (not logged in). + * + * This covers a few specific use cases, such as datastore initialization, + * but it should be used carefully as it can lead to security issues. + */ + public function enableAnonymousPermission(); + + /** + * Disable anonymous permission. + */ + public function disableAnonymousPermission(); } -- cgit v1.2.3 From d6e5f04d3987e498c5cb859eed6bff33d67949df Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Sat, 1 Aug 2020 11:10:57 +0200 Subject: Remove anonymous permission and initialize bookmarks on login --- application/bookmark/BookmarkServiceInterface.php | 14 -------------- 1 file changed, 14 deletions(-) (limited to 'application/bookmark/BookmarkServiceInterface.php') diff --git a/application/bookmark/BookmarkServiceInterface.php b/application/bookmark/BookmarkServiceInterface.php index 37fbda89..ce8bd912 100644 --- a/application/bookmark/BookmarkServiceInterface.php +++ b/application/bookmark/BookmarkServiceInterface.php @@ -6,7 +6,6 @@ namespace Shaarli\Bookmark; use Shaarli\Bookmark\Exception\BookmarkNotFoundException; use Shaarli\Bookmark\Exception\NotWritableDataStoreException; use Shaarli\Config\ConfigManager; -use Shaarli\Exceptions\IOException; use Shaarli\History; /** @@ -177,17 +176,4 @@ interface BookmarkServiceInterface * Creates the default database after a fresh install. */ public function initialize(); - - /** - * Allow to write the datastore from anonymous session (not logged in). - * - * This covers a few specific use cases, such as datastore initialization, - * but it should be used carefully as it can lead to security issues. - */ - public function enableAnonymousPermission(); - - /** - * Disable anonymous permission. - */ - public function disableAnonymousPermission(); } -- cgit v1.2.3 From a8e210faa624517ee8b8978b7e659a0b3c689297 Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Sat, 29 Aug 2020 10:06:40 +0200 Subject: Fixed: Pinned bookmarks are displayed first in ATOM/RSS feeds Fixes #1485 --- application/bookmark/BookmarkServiceInterface.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'application/bookmark/BookmarkServiceInterface.php') diff --git a/application/bookmark/BookmarkServiceInterface.php b/application/bookmark/BookmarkServiceInterface.php index ce8bd912..b9b483eb 100644 --- a/application/bookmark/BookmarkServiceInterface.php +++ b/application/bookmark/BookmarkServiceInterface.php @@ -49,10 +49,17 @@ interface BookmarkServiceInterface * @param string $visibility * @param bool $caseSensitive * @param bool $untaggedOnly + * @param bool $ignoreSticky * * @return Bookmark[] */ - public function search($request = [], $visibility = null, $caseSensitive = false, $untaggedOnly = false); + public function search( + $request = [], + $visibility = null, + $caseSensitive = false, + $untaggedOnly = false, + bool $ignoreSticky = false + ); /** * Get a single bookmark by its ID. -- cgit v1.2.3