diff options
author | ArthurHoaro <arthur@hoa.ro> | 2021-02-04 10:57:44 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-04 10:57:44 +0100 |
commit | 8997ae6c8e24286f7d47981eaf905e80d2481c10 (patch) | |
tree | 9906b122998ca4420af68b1bb110033b99f7d8bf /application/front/controller/admin/ManageTagController.php | |
parent | 11edc143b42a7be09c0c9dc02730c83e8cbb73c2 (diff) | |
parent | 9b8c0a4560fa1d87cab1529099b1b4677e92e265 (diff) | |
download | Shaarli-8997ae6c8e24286f7d47981eaf905e80d2481c10.tar.gz Shaarli-8997ae6c8e24286f7d47981eaf905e80d2481c10.tar.zst Shaarli-8997ae6c8e24286f7d47981eaf905e80d2481c10.zip |
Merge pull request #1697 from ArthurHoaro/feature/pagination
Handle pagination through BookmarkService
Diffstat (limited to 'application/front/controller/admin/ManageTagController.php')
-rw-r--r-- | application/front/controller/admin/ManageTagController.php | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/application/front/controller/admin/ManageTagController.php b/application/front/controller/admin/ManageTagController.php index 8675a0c5..1333cce7 100644 --- a/application/front/controller/admin/ManageTagController.php +++ b/application/front/controller/admin/ManageTagController.php | |||
@@ -57,9 +57,12 @@ class ManageTagController extends ShaarliAdminController | |||
57 | } | 57 | } |
58 | 58 | ||
59 | // TODO: move this to bookmark service | 59 | // TODO: move this to bookmark service |
60 | $count = 0; | 60 | $searchResult = $this->container->bookmarkService->search( |
61 | $bookmarks = $this->container->bookmarkService->search(['searchtags' => $fromTag], BookmarkFilter::$ALL, true); | 61 | ['searchtags' => $fromTag], |
62 | foreach ($bookmarks as $bookmark) { | 62 | BookmarkFilter::$ALL, |
63 | true | ||
64 | ); | ||
65 | foreach ($searchResult->getBookmarks() as $bookmark) { | ||
63 | if (false === $isDelete) { | 66 | if (false === $isDelete) { |
64 | $bookmark->renameTag($fromTag, $toTag); | 67 | $bookmark->renameTag($fromTag, $toTag); |
65 | } else { | 68 | } else { |
@@ -68,11 +71,11 @@ class ManageTagController extends ShaarliAdminController | |||
68 | 71 | ||
69 | $this->container->bookmarkService->set($bookmark, false); | 72 | $this->container->bookmarkService->set($bookmark, false); |
70 | $this->container->history->updateLink($bookmark); | 73 | $this->container->history->updateLink($bookmark); |
71 | $count++; | ||
72 | } | 74 | } |
73 | 75 | ||
74 | $this->container->bookmarkService->save(); | 76 | $this->container->bookmarkService->save(); |
75 | 77 | ||
78 | $count = $searchResult->getResultCount(); | ||
76 | if (true === $isDelete) { | 79 | if (true === $isDelete) { |
77 | $alert = sprintf( | 80 | $alert = sprintf( |
78 | t('The tag was removed from %d bookmark.', 'The tag was removed from %d bookmarks.', $count), | 81 | t('The tag was removed from %d bookmark.', 'The tag was removed from %d bookmarks.', $count), |