diff options
author | Dries Buytaert <dries@buytaert.net> | 2005-05-06 09:01:46 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2005-05-06 09:01:46 +0000 |
commit | 03250bd3e3146b1bf8b9bb356fcb0dc621ac92b2 (patch) | |
tree | 53425ce3e455e712467f0e429fdd5afa932fab9b | |
parent | 30da942645a5fef2329ec193fbd8572e2e1d00ed (diff) | |
download | brdo-03250bd3e3146b1bf8b9bb356fcb0dc621ac92b2.tar.gz brdo-03250bd3e3146b1bf8b9bb356fcb0dc621ac92b2.tar.bz2 |
- Patch #21397 by jjeff: fixed behavior of theme_image with regard to attributes.
-rw-r--r-- | includes/theme.inc | 11 |
1 files 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 "<img src=\"$path\" $attr alt=\"$alt\" title=\"$title\" />"; +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 "<img src=\"$path\" alt=\"$alt\" title=\"$title\" $image_attributes $attributes />"; } } |