aboutsummaryrefslogtreecommitdiffhomepage
path: root/inc/poche/Poche.class.php
diff options
context:
space:
mode:
authorkaffeeringe <kontakt@kaffeeringe.de>2015-01-18 21:49:05 +0100
committerkaffeeringe <kontakt@kaffeeringe.de>2015-01-18 21:49:05 +0100
commit3052cfb7cab3b37e7258f31d18624a9335c0680f (patch)
tree13bcfc75baab10c794eafd14245a42629221989d /inc/poche/Poche.class.php
parent5537bb321626d0c28b48aa8fed050c21d7d00f1f (diff)
downloadwallabag-3052cfb7cab3b37e7258f31d18624a9335c0680f.tar.gz
wallabag-3052cfb7cab3b37e7258f31d18624a9335c0680f.tar.zst
wallabag-3052cfb7cab3b37e7258f31d18624a9335c0680f.zip
Add Tags on Import
I fixed it! And it works for me. But: I am not too good with programming. So better check the code ;-)
Diffstat (limited to 'inc/poche/Poche.class.php')
-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 16235474..01f919d9 100755
--- a/inc/poche/Poche.class.php
+++ b/inc/poche/Poche.class.php
@@ -192,6 +192,7 @@ class Poche
192 } else { 192 } else {
193 Tools::redirect('?view=home&closewin=true'); 193 Tools::redirect('?view=home&closewin=true');
194 } 194 }
195 return $last_id;
195 break; 196 break;
196 case 'delete': 197 case 'delete':
197 $msg = 'delete link #' . $id; 198 $msg = 'delete link #' . $id;
@@ -625,7 +626,18 @@ class Poche
625 $urlsInserted[] = $url; //add 626 $urlsInserted[] = $url; //add
626 if (isset($record['tags']) && trim($record['tags'])) { 627 if (isset($record['tags']) && trim($record['tags'])) {
627 628
628 // @TODO: set tags 629 $tags = explode(' ', $record['tags']);
630 foreach($tags as $tag) {
631 $entry_id = $id;
632 $tag_id = $this->store->retrieveTagByValue($tag);
633 if ($tag_id) {
634 $this->store->setTagToEntry($tag_id['id'], $entry_id);
635 } else {
636 $this->store->createTag($tag);
637 $tag_id = $this->store->retrieveTagByValue($tag);
638 $this->store->setTagToEntry($tag_id['id'], $entry_id);
639 }
640 }
629 641
630 } 642 }
631 } 643 }