function emfield_handler_field_provider::render_provider in Embedded Media Field 6
Same name and namespace in other branches
- 6.3 includes/views/handlers/emfield_handler_field_provider.inc \emfield_handler_field_provider::render_provider()
- 6.2 includes/views/handlers/emfield_handler_field_provider.inc \emfield_handler_field_provider::render_provider()
1 call to emfield_handler_field_provider::render_provider()
- emfield_handler_field_provider::render in includes/
views/ handlers/ emfield_handler_field_provider.inc
File
- includes/
views/ handlers/ emfield_handler_field_provider.inc, line 30 - Field handler for emfield providers.
Class
- emfield_handler_field_provider
- @file Field handler for emfield providers.
Code
function render_provider($values) {
// We're down to a single node here, so we can retrieve the actual field
// definition for the node type being considered.
$field = content_fields($this->content_field['field_name'], $values->{$this->aliases['type']});
$options = $this->options;
$db_info = content_database_info($field);
// Build a pseudo-node from the retrieved values.
$node = drupal_clone($values);
$node->type = $values->{$this->aliases['type']};
$node->nid = $values->{$this->aliases['nid']};
$node->vid = $values->{$this->aliases['vid']};
// Some formatters need to behave differently depending on the build_mode
// (for instance: preview), so we provide one.
$node->build_mode = NODE_BUILD_NORMAL;
$item = array();
foreach ($db_info['columns'] as $column => $attributes) {
$item[$column] = $values->{$this->aliases[$attributes['column']]};
}
$item['#delta'] = $field['multiple'] ? $values->{$this->aliases['delta']} : 0;
// Render items.
$output = theme('emfield_handler_field_provider', $item, $field, $node, $values, $options['format']);
return $this
->render_link($output, $values);
}