diff options
author | Christian Weiske <cweiske@cweiske.de> | 2011-08-06 10:38:44 +0200 |
---|---|---|
committer | Christian Weiske <cweiske@cweiske.de> | 2011-08-06 10:38:44 +0200 |
commit | d2e437b4db84300e2b543c5827d8f517a81afaef (patch) | |
tree | 7863a0a733514684bef0917ccf3ebf3b2a0aac5a /src/SemanticScuttle | |
parent | 5743a34a6c7757d3030479f96326f09fe5dce0b2 (diff) | |
parent | 097ecf9c510e1435d02be7843bc7e865570338ac (diff) | |
download | semanticscuttle-d2e437b4db84300e2b543c5827d8f517a81afaef.tar.gz semanticscuttle-d2e437b4db84300e2b543c5827d8f517a81afaef.tar.bz2 |
Merge branch '0.98'
Diffstat (limited to 'src/SemanticScuttle')
-rw-r--r-- | src/SemanticScuttle/Service/Bookmark2Tag.php | 11 | ||||
-rw-r--r-- | src/SemanticScuttle/Service/Tag.php | 1 |
2 files changed, 8 insertions, 4 deletions
diff --git a/src/SemanticScuttle/Service/Bookmark2Tag.php b/src/SemanticScuttle/Service/Bookmark2Tag.php index 914abc6..3e5c533 100644 --- a/src/SemanticScuttle/Service/Bookmark2Tag.php +++ b/src/SemanticScuttle/Service/Bookmark2Tag.php @@ -271,10 +271,11 @@ class SemanticScuttle_Service_Bookmark2Tag extends SemanticScuttle_DbService * Retrieves all tags for a given bookmark except system tags. * * @param integer $bookmarkid ID of the bookmark + * @param boolean $systemTags Return "system:*" tags or not * * @return array Array of tags */ - public function getTagsForBookmark($bookmarkid) + public function getTagsForBookmark($bookmarkid, $systemTags = false) { if (!is_numeric($bookmarkid)) { message_die( @@ -285,9 +286,11 @@ class SemanticScuttle_Service_Bookmark2Tag extends SemanticScuttle_DbService } $query = 'SELECT tag FROM ' . $this->getTableName() - . ' WHERE bId = ' . intval($bookmarkid) - . ' AND LEFT(tag, 7) <> "system:"' - . ' ORDER BY id ASC'; + . ' WHERE bId = ' . intval($bookmarkid); + if (!$systemTags) { + $query .= ' AND LEFT(tag, 7) <> "system:"'; + } + $query .= ' ORDER BY id ASC'; if (!($dbresult = $this->db->sql_query($query))) { message_die( diff --git a/src/SemanticScuttle/Service/Tag.php b/src/SemanticScuttle/Service/Tag.php index 8325285..2476608 100644 --- a/src/SemanticScuttle/Service/Tag.php +++ b/src/SemanticScuttle/Service/Tag.php @@ -143,6 +143,7 @@ class SemanticScuttle_Service_Tag extends SemanticScuttle_DbService if(!is_array($tags)) { $tags = utf8_strtolower(trim($tags)); } else { + $tags = array_filter($tags);//remove empty values for($i=0; $i<count($tags); $i++) { $tags[$i] = utf8_strtolower(trim($tags[$i])); } |