From: pdontthink Date: Sun, 31 Dec 2006 05:09:39 +0000 (+0000) Subject: Allow text alternative for images to percolate all the way through template layers X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=commitdiff_plain;h=bcc55e4b9574a2bf4741cbb091196fecff86ce42;ds=sidebyside Allow text alternative for images to percolate all the way through template layers git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@12031 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- diff --git a/functions/html.php b/functions/html.php index 3ce05b3f..3172bc50 100644 --- a/functions/html.php +++ b/functions/html.php @@ -74,6 +74,12 @@ function create_hyperlink($uri, $text, $target='', $onclick='', $class='', $id=' * (OPTIONAL; default not used) * @param string $vspace The image's vspace attribute value * (OPTIONAL; default not used) + * @param string $text_alternative A text replacement for the entire + * image tag, to be used at the + * discretion of the template set, + * if for some reason the image tag + * cannot or should not be produced + * (OPTIONAL; default not used) * * @return string The desired hyperlink tag. * @@ -82,7 +88,8 @@ function create_hyperlink($uri, $text, $target='', $onclick='', $class='', $id=' */ function create_image($src, $alt='', $width='', $height='', $border='', $class='', $id='', $onclick='', - $title='', $align='', $hspace='', $vspace='') { + $title='', $align='', $hspace='', $vspace='', + $text_alternative='') { global $oTemplate; @@ -98,6 +105,7 @@ function create_image($src, $alt='', $width='', $height='', $oTemplate->assign('align', $align); $oTemplate->assign('hspace', $hspace); $oTemplate->assign('vspace', $vspace); + $oTemplate->assign('text_alternative', $text_alternative); return $oTemplate->fetch('image.tpl'); diff --git a/functions/template/general_util.php b/functions/template/general_util.php index 48db0e68..8ea12de5 100644 --- a/functions/template/general_util.php +++ b/functions/template/general_util.php @@ -103,7 +103,8 @@ function getIcon($icon_theme_path, $icon_name, $text_icon, $alt_text='', $w=NULL // If we found an icon, build an img tag to display it. If we didn't // find an image, we will revert back to the text icon. if (!is_null($icon_path)) { - $icon = create_image($icon_path, $alt_text, $w, $h, '', '', '', '', $alt_text); + $icon = create_image($icon_path, $alt_text, $w, $h, '', '', '', + '', $alt_text, '', '', '', $text_icon); } else { $icon = $text_icon; } diff --git a/templates/default/image.tpl b/templates/default/image.tpl index 3f06277d..61ad8cf8 100644 --- a/templates/default/image.tpl +++ b/templates/default/image.tpl @@ -26,6 +26,10 @@ * + $vspace - the image's vspace attribute value * (optional; may not be present) * + $onclick - onClick JavaScript handler (optional; may not be present) + * + $text_alternative - A text replacement for the entire + * image tag, if for some reason the + * image tag cannot or should not be + * produced (optional; may not be present) * * @copyright © 1999-2006 The SquirrelMail Project Team * @license http://opensource.org/licenses/gpl-license.php GNU Public License