function fivestar_get_tags in Fivestar 6.2
Same name and namespace in other branches
- 7.2 fivestar.module \fivestar_get_tags()
6 calls to fivestar_get_tags()
- fivestar_block in ./
fivestar.module - fivestar_comment in ./
fivestar_comment.module - Implementation of hook_comment().
- fivestar_comment_form_alter in ./
fivestar_comment.module - Form alter specification for comments.
- fivestar_menu in ./
fivestar.module - Implementation of hook_menu().
- fivestar_nodeapi in ./
fivestar.module - Implementation of hook_nodeapi().
File
- ./
fivestar.module, line 1497 - A simple n-star voting widget, usable in other forms.
Code
function fivestar_get_tags() {
$tags_txt = variable_get('fivestar_tags', 'vote');
$tags_exploded = explode(',', $tags_txt);
$tags = array();
$got_vote = false;
foreach ($tags_exploded as $tag) {
$tag_trimmed = trim($tag);
if ($tag_trimmed) {
$tags[] = $tag_trimmed;
if ($tag_trimmed == 'vote') {
$got_vote = true;
}
}
}
if (!$got_vote) {
$tags[] = 'vote';
}
return $tags;
}