You are here

function sweaver_theme_image in Sweaver 7

Same name and namespace in other branches
  1. 6 sweaver.module \sweaver_theme_image()

Theme an image. Mimics theme('image') but uses the alias => TRUE option.

Return value

$image A themed image.

1 call to sweaver_theme_image()
sweaver_plugin_themeswitch::sweaver_form in plugins/sweaver_plugin_themeswitch/sweaver_plugin_themeswitch.inc
Frontend form.

File

./sweaver.module, line 505
Sweaver functions.

Code

function sweaver_theme_image($path, $alt = '', $title = '', $attributes = NULL, $getsize = TRUE) {
  if (!$getsize || is_file($path) && (list($width, $height, $type, $image_attributes) = @getimagesize($path))) {
    $attributes = drupal_attributes($attributes);
    $url = url($path, array(
      'alias' => TRUE,
    )) == $path ? $path : base_path() . $path;
    return '<img src="' . check_url($url) . '" alt="' . check_plain($alt) . '" title="' . check_plain($title) . '" ' . (isset($image_attributes) ? $image_attributes : '') . $attributes . ' />';
  }
}