function theme_imceimage_image in Imce CCK Image 6.2
Same name and namespace in other branches
- 6 imceimage.module \theme_imceimage_image()
Theme an image
1 call to theme_imceimage_image()
File
- ./
imceimage.module, line 310
Code
function theme_imceimage_image($path, $width = '', $height = '', $alt = '', $title = '', $class = '') {
//if is a blank image - deliver a blank image
if ($path == '' || empty($path)) {
$path = base_path() . drupal_get_path('module', 'imceimage') . '/images/1x1.png';
}
//make sure that this is a valid image..
$file_path = _imceimage_image_to_filepath($path);
if (($info = image_get_info($file_path)) == false) {
$path = base_path() . drupal_get_path('module', 'imceimage') . '/images/warning.png';
$alt = 'Image does not exist anymore or an invalid image';
$width = 32;
$height = 32;
}
$path = 'src="' . $path . '" ';
$alt = 'alt="' . $alt . '" ';
$title = 'title="' . $title . '"';
$class = !empty($class) ? 'class="' . $class . '" ' : '';
$width = !empty($width) ? 'width="' . $width . '" ' : '';
$height = !empty($height) ? 'height="' . $height . '" ' : '';
return '<img ' . $path . $alt . $title . $width . $height . $class . '/>';
}