You are here

function rotor_get_imagecache_presets in Rotor Banner 5

Same name and namespace in other branches
  1. 6.2 rotor.module \rotor_get_imagecache_presets()
  2. 6 rotor.module \rotor_get_imagecache_presets()
  3. 7 rotor.module \rotor_get_imagecache_presets()

Wrapper function to get imagecache presets. It checks which function should use, the imagecache2 or imagecache function.

Return value

array Imagecache presets.

2 calls to rotor_get_imagecache_presets()
rotor_admin_form in ./rotor.module
Admin settings form page.
theme_rotor_image in ./rotor.module
This is a theme function to act as a wrapper for the image either case that we are using imagecache or not.

File

./rotor.module, line 505
A rotor banner consists in a set of images that will be changing. This module is made using jquery.

Code

function rotor_get_imagecache_presets($reset = FALSE) {
  if (module_exists('imagecache')) {
    if (function_exists('imagecache_presets')) {
      $presets_full = imagecache_presets($reset);
      $presets = array();
      foreach ($presets_full as $preset_id => $preset) {
        $presets[$preset_id] = $preset['presetname'];
      }
      return $presets;
    }
    else {
      return _imagecache_get_presets($reset);
    }
  }
  return array();
}