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 ;-)
This commit is contained in:
kaffeeringe 2015-01-18 21:49:05 +01:00
parent 5537bb3216
commit 3052cfb7ca

View file

@ -192,6 +192,7 @@ class Poche
} else {
Tools::redirect('?view=home&closewin=true');
}
return $last_id;
break;
case 'delete':
$msg = 'delete link #' . $id;
@ -625,7 +626,18 @@ class Poche
$urlsInserted[] = $url; //add
if (isset($record['tags']) && trim($record['tags'])) {
// @TODO: set tags
$tags = explode(' ', $record['tags']);
foreach($tags as $tag) {
$entry_id = $id;
$tag_id = $this->store->retrieveTagByValue($tag);
if ($tag_id) {
$this->store->setTagToEntry($tag_id['id'], $entry_id);
} else {
$this->store->createTag($tag);
$tag_id = $this->store->retrieveTagByValue($tag);
$this->store->setTagToEntry($tag_id['id'], $entry_id);
}
}
}
}