You are here

function template_preprocess_sdl_library in Scald: Media Management made easy 6

Same name and namespace in other branches
  1. 7 modules/library/scald_dnd_library/scald_dnd_library.module \template_preprocess_sdl_library()

Implements hook_preprocess_sdl_library.

File

scald_dnd_library/scald_dnd_library.module, line 62
Scald DnD Library

Code

function template_preprocess_sdl_library(&$variables) {
  if (is_object($variables['view'])) {
    $variables['library_items'] = array();
    $results = $variables['view']->result;
    foreach ($results as $result) {
      $sid = $result->sid;
      $variables['library_items'][$sid] = scald_render($sid, 'sdl_library_item');
    }
  }
  elseif (empty($variables['library_items']) && isset($variables['options'])) {
    $variables['library_items'] = $variables['options'];
  }
}