function scald_file_scald_render in Scald File Provider 7
Implements hook_scald_render().
Renders a representation that can be used when an atom reference field or views contains both images and files.
File
- ./
scald_file.module, line 427 - Scald File is a Scald Atom Provider for Files.
Code
function scald_file_scald_render($atom, $context, $options = array()) {
if ($context == 'file_representation') {
$config = scald_context_config_load($context);
if ('default' != $config->player['file']['*']) {
return $atom->rendered->player;
}
else {
return theme('scald_file_render', array(
'vars' => array(
'context' => $context,
'file_source' => $atom->file_source,
'file_size' => format_size($atom->base_entity->filesize),
'thumbnail_source' => $atom->type == 'image' ? drupal_get_path('module', 'scald_file') . '/icons/image_jpeg2000.png' : $atom->thumbnail_source,
'file_title' => check_plain($atom->title),
),
));
}
}
}