You are here

function kaltura_get_thumbnail_display in Kaltura 5

Same name and namespace in other branches
  1. 6.2 plugins/field_kaltura/field_kaltura.module \kaltura_get_thumbnail_display()
  2. 6 plugins/field_kaltura/field_kaltura.module \kaltura_get_thumbnail_display()
1 call to kaltura_get_thumbnail_display()
theme_field_kaltura_formatter_thumbnail in plugins/field_kaltura/field_kaltura.module
Theme function for 'thumbnail' text field formatter.

File

plugins/field_kaltura/field_kaltura.module, line 172
kaltura integration module - functions to provide kaltura as CCK field

Code

function kaltura_get_thumbnail_display($item, $teaser, $field) {
  $size = array(
    'width' => !empty($field['thumbsize_width']) ? $field['thumbsize_width'] : NULL,
    'height' => !empty($field['thumbsize_height']) ? $field['thumbsize_height'] : NULL,
  );
  if (!$size['width'] && !$size['height']) {
    unset($size);
  }
  $entries = explode(',', rtrim($item['value'], ','));
  $all_field = '';
  if (is_array($entries) && count($entries)) {
    foreach ($entries as $entry_id) {
      if (!$entry_id) {
        continue;
      }
      $mynode = node_load(kaltura_get_node_for_mix($entry_id));
      if ($mynode) {
        if ($mynode->type == 'kaltura_entry') {
          $all_field .= '<div class="field-entry-' . $entry_id . '">' . theme('node_kaltura_entry_thumbnail_url', $mynode, $teaser, FALSE, $size) . '</div>';
        }
        else {
          $all_field .= '<div class="field-entry-' . $entry_id . '">' . theme('node_kaltura_mix_thumbnail_url', $mynode, $teaser, FALSE, $size) . '</div>';
        }
      }
    }
  }
  $text = $all_field;
  return $text;
}