You are here

function filefieldmp3player_field_formatter_view in MP3 Player 7.2

Implements hook_field_formatter_view().

File

filefieldmp3player/filefieldmp3player.module, line 66

Code

function filefieldmp3player_field_formatter_view($entity_type, $entity, $field, $instance, $langcode, $items, $display) {
  $settings = $display['settings'];
  $pid = 1;
  if (isset($settings['player_instance'])) {
    $pid = $settings['player_instance'];
  }
  $file = $items[0];
  $variables = array(
    'player' => $pid,
    'file' => $file['uri'],
    'title' => $file['description'],
  );
  $element = array();
  $element[0]['#markup'] = theme('mp3player', $variables);
  return $element;
}