From 03250bd3e3146b1bf8b9bb356fcb0dc621ac92b2 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Fri, 6 May 2005 09:01:46 +0000 Subject: - Patch #21397 by jjeff: fixed behavior of theme_image with regard to attributes. --- includes/theme.inc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/includes/theme.inc b/includes/theme.inc index e61c606cb..46e76581d 100644 --- a/includes/theme.inc +++ b/includes/theme.inc @@ -474,16 +474,17 @@ function theme_links($links, $delimiter = ' | ') { * The alternative text for text-based browsers. * @param $title * The title text is displayed when the image is hovered in some popular browsers. - * @param $attr - * Attributes placed in the img tag. + * @param $attributes + * Associative array of attributes to be placed in the img tag. * @param $getsize * If set to true, the image's dimension are fetched and added as width/height attributes. * @return * A string containing the image tag. */ -function theme_image($path, $alt = '', $title = '', $attr = '', $getsize = true) { - if (!$getsize || (file_exists($path) && (list($width, $height, $type, $attr) = @getimagesize($path)))) { - return "\"$alt\""; +function theme_image($path, $alt = '', $title = '', $attributes = NULL, $getsize = TRUE) { + if (!$getsize || (file_exists($path) && (list($width, $height, $type, $image_attributes) = @getimagesize($path)))) { + $attributes = drupal_attributes($attributes); + return "\"$alt\""; } } -- cgit v1.2.3