function spaces_handler_field_spaces_feature::render in Spaces 6
Same name and namespace in other branches
- 6.3 includes/spaces_handler_field_spaces_feature.inc \spaces_handler_field_spaces_feature::render()
- 6.2 includes/spaces_handler_field_spaces_feature.inc \spaces_handler_field_spaces_feature::render()
- 7.3 includes/spaces_handler_field_spaces_feature.inc \spaces_handler_field_spaces_feature::render()
- 7 includes/spaces_handler_field_spaces_feature.inc \spaces_handler_field_spaces_feature::render()
File
- includes/
spaces_handler_field_spaces_feature.inc, line 7
Class
- spaces_handler_field_spaces_feature
- Field handler to translate a node type into its spaces feature.
Code
function render($values) {
static $map;
static $features;
if (!isset($map)) {
$map = spaces_content_types();
$features = spaces_features();
}
$output = '';
if (isset($map[$values->{$this->field_alias}])) {
$feature = $map[$values->{$this->field_alias}];
$label = $features[$feature]->spaces['label'];
$output = "<span class='spaces-feature feature-{$feature}'>{$label}</span>";
}
return $output;
}