} else {
Tools::redirect('?view=home&closewin=true');
}
+ return $last_id;
break;
case 'delete':
$msg = 'delete link #' . $id;
$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);
+ }
+ }
}
}