From 9c743ab965b978aa72a6272172b33f562d1f1f96 Mon Sep 17 00:00:00 2001 From: tcit Date: Wed, 30 Apr 2014 12:14:20 +0200 Subject: Clean old unused tags when deleting a tag --- inc/poche/Poche.class.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'inc/poche/Poche.class.php') diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php index 61bc8e13..dc7b76d0 100755 --- a/inc/poche/Poche.class.php +++ b/inc/poche/Poche.class.php @@ -558,7 +558,7 @@ class Poche } } } - $this->messages->add('s', _('the tag has been applied successfully')); + $this->messages->add('s', _('The tag has been applied successfully')); Tools::redirect(); break; case 'remove_tag' : @@ -570,6 +570,10 @@ class Poche Tools::redirect(); } $this->store->removeTagForEntry($id, $tag_id); + Tools::logm('tag entry deleted'); + $this->store->cleanUnusedTags(); + Tools::logm('old tags cleaned'); + $this->messages->add('s', _('The tag has been successfully deleted')); Tools::redirect(); break; default: @@ -1131,6 +1135,13 @@ class Poche $this->messages->add('s', _('Cache deleted.')); Tools::redirect(); } + + public function cleanTags() { + $this->store->cleanUnusedTags(); + $this->messages->add('s', _('The unused tags have been cleaned.')); + Tools::logm('clean tags'); + Tools::redirect(); + } /** * return new purifier object with actual config -- cgit v1.2.3