function template_preprocess_sdl_library in Scald: Media Management made easy 7
Same name and namespace in other branches
- 6 scald_dnd_library/scald_dnd_library.module \template_preprocess_sdl_library()
Implements hook_preprocess_sdl_library().
File
- modules/
library/ scald_dnd_library/ scald_dnd_library.module, line 112 - Scald DnD Library
Code
function template_preprocess_sdl_library(&$variables) {
if (is_object($variables['view'])) {
$variables['library_items'] = array();
$results = $variables['view']->result;
$context = $variables['view']->field['representation']->options['context'];
foreach ($results as $result) {
$sid = $result->sid;
$variables['library_items'][$sid] = scald_render($sid, $context);
}
}
elseif (empty($variables['library_items']) && isset($variables['options'])) {
$variables['library_items'] = $variables['options'];
}
}