function scald_gallery_update_gallery_thumbnail in Scald: Gallery 7.2
Updates the gallery thumbnail.
If the thumbnail field is empty, use the first item thumbnail as the gallery thumbnail.
2 calls to scald_gallery_update_gallery_thumbnail()
- scald_gallery_scald_register_atom in ./
scald_gallery.module - Implements hook_scald_register_atom().
- scald_gallery_scald_update_atom in ./
scald_gallery.module - Implements hook_scald_update_atom().
File
- ./
scald_gallery.module, line 244 - Scald Gallery is a Scald Atom Provider for image galleries.
Code
function scald_gallery_update_gallery_thumbnail($atom) {
if (!field_get_items('scald_atom', $atom, 'scald_thumbnail') && ($items = field_get_items('scald_atom', $atom, 'gallery_items'))) {
foreach ($items as $item) {
$item_atom = scald_atom_load($item['sid']);
if (field_get_items('scald_atom', $item_atom, 'scald_thumbnail')) {
$atom->scald_thumbnail = $item_atom->scald_thumbnail;
break;
}
}
}
}