You are here

function theme_rotor_image in Rotor Banner 7

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

This is a theme function to act as a wrapper for the image either case that we are using imagecache or not.

Parameters

string $rotor_image The path for the image to be themed:

int $preset_id The ID of an ImageCache preview to use on the image:

Return value

string The themed image

2 theme calls to theme_rotor_image()
theme_rotor_item in ./rotor.module
Theme for each Rotor item.
views_field_handler_rotor_image::render in views/views_field_handler_rotor_image.inc
Render the field.

File

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

Code

function theme_rotor_image($rotor_item, $preset_id = NULL) {
  if (module_exists('imagecache') && $preset_id > 0) {
    $pressets = rotor_get_imagecache_presets();
    $presset = $pressets[$preset_id];
    return theme('imagecache', $presset, $rotor_item->fid->filepath, $rotor_item->alt_text, $rotor_item->image_title);
  }
  return theme('image', $rotor_item->fid->filepath, $rotor_item->alt_text, $rotor_item->image_title);
}