You are here

function emvideo_handler_field_duration::render_provider in Embedded Media Field 6.3

Same name and namespace in other branches
  1. 6 contrib/emvideo/includes/views/handlers/emvideo_handler_field_duration.inc \emvideo_handler_field_duration::render_provider()
  2. 6.2 contrib/emvideo/includes/views/handlers/emvideo_handler_field_duration.inc \emvideo_handler_field_duration::render_provider()
1 call to emvideo_handler_field_duration::render_provider()
emvideo_handler_field_duration::render in contrib/emvideo/includes/views/handlers/emvideo_handler_field_duration.inc

File

contrib/emvideo/includes/views/handlers/emvideo_handler_field_duration.inc, line 26
Field handler for emvideo providers.

Class

emvideo_handler_field_duration
@file Field handler for emvideo 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('emvideo_handler_field_duration', $item, $field, $node, $values, $options['format']);
  return $this
    ->render_link($output, $values);
}