You are here

function template_preprocess_asset__video__widget_search in Asset 7

Preprocess variables for asset--video--widget-search.tpl.php.

See also

asset--image--video-search.tpl.php

File

modules/asset_widget/theme/theme.inc, line 177
Module related preprocesses and theme overrides.

Code

function template_preprocess_asset__video__widget_search(&$vars) {

  // Listing content.
  $video = field_get_items('asset', $vars['asset'], 'field_asset_video_file');
  if (!empty($video[0]['snapshot'])) {
    $vars['media_field'] = field_view_value('asset', $vars['asset'], 'field_asset_video_file', $video[0], array(
      'type' => 'emvideo_snapshot',
      'settings' => array(
        'width' => '100',
      ),
    ));
  }
  $description = field_get_items('asset', $vars['asset'], 'field_asset_video_desc');
  if (!empty($description[0]['value'])) {
    $vars['short_description'] = field_view_value('asset', $vars['asset'], 'field_asset_video_desc', $description[0], array(
      'type' => 'text_trimmed',
      'settings' => array(
        'trim_length' => '140',
      ),
    ));
  }
}