You are here

class spaces_handler_field_spaces_feature in Spaces 6.2

Same name and namespace in other branches
  1. 6.3 includes/spaces_handler_field_spaces_feature.inc \spaces_handler_field_spaces_feature
  2. 6 includes/spaces_handler_field_spaces_feature.inc \spaces_handler_field_spaces_feature
  3. 7.3 includes/spaces_handler_field_spaces_feature.inc \spaces_handler_field_spaces_feature
  4. 7 includes/spaces_handler_field_spaces_feature.inc \spaces_handler_field_spaces_feature

Field handler to translate a node type into its spaces feature.

Hierarchy

Expanded class hierarchy of spaces_handler_field_spaces_feature

1 string reference to 'spaces_handler_field_spaces_feature'
spaces_views_data in includes/spaces.views.inc
Implementation of hook_views_data(). Adds a meta-filter that provides a layer of abstraction that delegates actual filtering to the implementing space type modules.

File

includes/spaces_handler_field_spaces_feature.inc, line 6

View source
class spaces_handler_field_spaces_feature extends views_handler_field_node_type {
  function render($values) {
    static $map;
    static $features;
    if (!isset($map)) {
      $map = spaces_features_map('node');
      $features = spaces_features();
    }
    $output = '';
    if (isset($map[$values->{$this->field_alias}])) {
      $feature = $map[$values->{$this->field_alias}];
      $label = $features[$feature]->name;
      $output = "<span class='spaces-feature feature-{$feature}'>{$label}</span>";
    }
    return $output;
  }

}

Members