cvs: pear /Text_Wiki/Text/Wiki/Render/Xhtml Image.php
| From: | Paul Jones | Date: | Fri, 11 Jun 2004 16:53:01 +0000 |
| Subject: | cvs: pear /Text_Wiki/Text/Wiki/Render/Xhtml Image.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-20524@lists.php.net to get a copy of this message | ||
pmjones Fri Jun 11 12:53:01 2004 EDT
Modified files:
/pear/Text_Wiki/Text/Wiki/Render/Xhtml Image.php
Log:
per note from Stephane Solliec, images now always render with an "alt" attribute
http://cvs.php.net/diff.php/pear/Text_Wiki/Text/Wiki/Render/Xhtml/Image.php?r1=1.1&r2=1.2&ty=u
Index: pear/Text_Wiki/Text/Wiki/Render/Xhtml/Image.php
diff -u pear/Text_Wiki/Text/Wiki/Render/Xhtml/Image.php:1.1
pear/Text_Wiki/Text/Wiki/Render/Xhtml/Image.php:1.2
--- pear/Text_Wiki/Text/Wiki/Render/Xhtml/Image.php:1.1 Sun Jun 6 11:44:35 2004
+++ pear/Text_Wiki/Text/Wiki/Render/Xhtml/Image.php Fri Jun 11 12:53:01 2004
@@ -38,10 +38,19 @@
unset($options['attr']['link']);
$attr = '';
+ $alt = false;
foreach ($options['attr'] as $key => $val) {
- $attr .= "$key=\"$val\" ";
+ if (strtolower($key) == 'alt') {
+ $alt = true;
+ }
+ $attr .= " $key=\"$val\"";
}
+ // always add an "alt" attribute per Stephane Solliec
+ if (! $alt) {
+ $attr .= ' alt="' . basename($options['src']) . '"';
+ }
+
if ($href) {
return "<a href=\"$href\"><img src=$src$attr/></a>";
} else {