mirror of
https://github.com/wallabag/wallabag.git
synced 2025-06-27 16:36:00 +00:00
Implement tagging rules reset
Adding tagging rule reset to templates Adding messages to tagging rule reset Adding translation for Traditional and Simplified Chinese
This commit is contained in:
parent
f78353910f
commit
c65850050d
6 changed files with 34 additions and 2 deletions
|
@ -561,11 +561,11 @@ class ConfigController extends AbstractController
|
|||
/**
|
||||
* Remove all annotations OR tags OR entries for the current user.
|
||||
*
|
||||
* @Route("/reset/{type}", requirements={"id" = "annotations|tags|entries"}, name="config_reset", methods={"POST"})
|
||||
* @Route("/reset/{type}", requirements={"id" = "annotations|tags|entries|tagging_rules"}, name="config_reset", methods={"POST"})
|
||||
*
|
||||
* @return RedirectResponse
|
||||
*/
|
||||
public function resetAction(Request $request, string $type, AnnotationRepository $annotationRepository, EntryRepository $entryRepository)
|
||||
public function resetAction(Request $request, string $type, AnnotationRepository $annotationRepository, EntryRepository $entryRepository, TaggingRuleRepository $taggingRuleRepository)
|
||||
{
|
||||
if (!$this->isCsrfTokenValid('reset-area', $request->request->get('token'))) {
|
||||
throw $this->createAccessDeniedException('Bad CSRF token.');
|
||||
|
@ -575,6 +575,9 @@ class ConfigController extends AbstractController
|
|||
case 'annotations':
|
||||
$annotationRepository->removeAllByUserId($this->getUser()->getId());
|
||||
break;
|
||||
case 'tagging_rules':
|
||||
$taggingRuleRepository->removeAllTaggingRules($this->getConfig()->getId());
|
||||
break;
|
||||
case 'tags':
|
||||
$this->removeAllTagsByUserId($this->getUser()->getId());
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue