function userpoints_views_handler_field_category::add_self_tokens in User Points 7.2
Same name and namespace in other branches
- 6 views/userpoints_views_handler_field_category.inc \userpoints_views_handler_field_category::add_self_tokens()
- 7 views/userpoints_views_handler_field_category.inc \userpoints_views_handler_field_category::add_self_tokens()
Add any special tokens this field might use for itself.
This method is intended to be overridden by items that generate fields as a list. For example, the field that displays all terms on a node might have tokens for the tid and the term.
By convention, tokens should follow the format of [token-subtoken] where token is the field ID and subtoken is the field. If the field ID is terms, then the tokens might be [terms-tid] and [terms-name].
Overrides views_handler_field::add_self_tokens
File
- views/
userpoints_views_handler_field_category.inc, line 46 - Views field handler for the Userpoints category.
Class
- userpoints_views_handler_field_category
- Field handler for categories.
Code
function add_self_tokens(&$tokens, $item) {
$tokens['[' . $this->options['id'] . '-tid' . ']'] = $item['tid'];
$tokens['[' . $this->options['id'] . '-name' . ']'] = $item['name'];
$tokens['[' . $this->options['id'] . '-vid' . ']'] = $item['vid'];
$tokens['[' . $this->options['id'] . '-vocabulary' . ']'] = $item['vocabulary'];
}