You are here

function theme_emwave_wave_preview in Embedded Media Field 6.2

Same name and namespace in other branches
  1. 6.3 contrib/emwave/emwave.theme.inc \theme_emwave_wave_preview()
  2. 6 contrib/emwave/emwave.theme.inc \theme_emwave_wave_preview()

File

contrib/emwave/emwave.theme.inc, line 110

Code

function theme_emwave_wave_preview($field, $item, $formatter, $node) {
  if ($item['value'] && $item['provider']) {
    $code = $item['value'];
    $width = $field['widget']['preview_width'];
    $height = $field['widget']['preview_height'];
    $bg_color = $field['widget']['bg_color'];
    $color = $field['widget']['color'];
    $font = $field['widget']['font'];
    $font_size = $field['widget']['font_size'];
    $link = $field['widget']['preview_link'];
    if ($link == emwave_LINK_CONTENT) {
      $link = 'node/' . $node->nid;
    }
    else {
      if ($link == emwave_LINK_PROVIDER) {
        $link = module_invoke('emfield', 'include_invoke', 'emwave', $item['provider'], 'embedded_link', $code, $item['data']);
      }
      else {
        $link = NULL;
      }
    }
    $title = module_invoke('emfield', 'include_invoke', 'emwave', $item['provider'], 'wave_title', $code, $item['data']);
    $output = theme('emwave_wave', $field, $item, $formatter, $node, $code, $width, $height, $bg_color, $color, $font, $font_size, $title, $link);
  }
  return $output;
}