aboutsummaryrefslogtreecommitdiffhomepage
path: root/inc
diff options
context:
space:
mode:
authorThomas Citharel <tcit@tcit.fr>2015-01-20 00:07:57 +0100
committerThomas Citharel <tcit@tcit.fr>2015-01-20 00:07:57 +0100
commitcdde19d6096c85a3ed9b9399482bcc04bb79583c (patch)
tree5aa6978d736ee6df694f9024fc366c994598966b /inc
parent1cedeb681f84b2c9b17f4f8b88d4fffabb15d6c8 (diff)
parent9a490ad63a08c619bb45ad9bf090790c31ebe92e (diff)
downloadwallabag-cdde19d6096c85a3ed9b9399482bcc04bb79583c.tar.gz
wallabag-cdde19d6096c85a3ed9b9399482bcc04bb79583c.tar.zst
wallabag-cdde19d6096c85a3ed9b9399482bcc04bb79583c.zip
Merge pull request #1013 from wallabag/importtags
Importtags
Diffstat (limited to 'inc')
-rwxr-xr-xinc/poche/Poche.class.php14
1 files changed, 13 insertions, 1 deletions
diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php
index 8b0d3a19..81a18c86 100755
--- a/inc/poche/Poche.class.php
+++ b/inc/poche/Poche.class.php
@@ -199,6 +199,7 @@ class Poche
199 } else { 199 } else {
200 Tools::redirect('?view=home&closewin=true'); 200 Tools::redirect('?view=home&closewin=true');
201 } 201 }
202 return $last_id;
202 break; 203 break;
203 case 'delete': 204 case 'delete':
204 if (isset($_GET['search'])) { 205 if (isset($_GET['search'])) {
@@ -663,7 +664,18 @@ class Poche
663 $urlsInserted[] = $url; //add 664 $urlsInserted[] = $url; //add
664 if (isset($record['tags']) && trim($record['tags'])) { 665 if (isset($record['tags']) && trim($record['tags'])) {
665 666
666 // @TODO: set tags 667 $tags = explode(',', $record['tags']);
668 foreach($tags as $tag) {
669 $entry_id = $id;
670 $tag_id = $this->store->retrieveTagByValue($tag);
671 if ($tag_id) {
672 $this->store->setTagToEntry($tag_id['id'], $entry_id);
673 } else {
674 $this->store->createTag($tag);
675 $tag_id = $this->store->retrieveTagByValue($tag);
676 $this->store->setTagToEntry($tag_id['id'], $entry_id);
677 }
678 }
667 679
668 } 680 }
669 } 681 }