You are here

function slick_render_cache in Slick Carousel 7.2

Same name and namespace in other branches
  1. 7.3 slick.deprecated.inc \slick_render_cache()

Returns slick instances from the cache with simplified renderable.

1 call to slick_render_cache()
slick_fields_field_formatter_view in slick_fields/slick_fields.module
Implements hook_field_formatter_view().

File

includes/slick.global.inc, line 296
Global functions across Slick field formatters and Views.

Code

function slick_render_cache($settings = array()) {
  $cached = FALSE;
  $cid = $settings['id'] . ':' . $settings['cid'];
  if ($cache = cache_get($cid)) {
    $cached = $settings['cache'] == 'persistent' ? TRUE : REQUEST_TIME < $cache->expire;
  }
  if ($cached) {
    $slick[0] = $cache->data;
    if ($settings['nav'] && ($thumb_cache = cache_get($cid . ':thumbnail'))) {
      $slick[1] = $thumb_cache->data;
    }
    return $slick;
  }
  return $cached;
}