2 class Text_Wiki_Render_Latex_Image
extends Text_Wiki_Render
{
11 * Renders a token into text matching the requested format.
15 * @param array $options The "options" portion of the token (second
18 * @return string The text rendered from the token options.
22 function token($options)
27 $this->getConf('base', '/') .
28 $options['src'] . '"';
30 if (isset($options['attr']['link'])) {
32 // this image has a link
33 if (strpos($options['attr']['link'], '://')) {
35 $href = $options['attr']['link'];
37 $href = $this->wiki
->getRenderConf('xhtml', 'wikilink', 'view_url') .
38 $options['attr']['link'];
42 // image is not linked
46 // unset these so they don't show up as attributes
47 unset($options['attr']['link']);
51 foreach ($options['attr'] as $key => $val) {
52 if (strtolower($key) == 'alt') {
55 $attr .= " $key=\"$val\"";
58 // always add an "alt" attribute per Stephane Solliec
60 $attr .= ' alt="' . basename($options['src']) . '"';
64 return "<a href=\"$href\"><img src=$src$attr/></a>";
66 return "<img src=$src$attr/>";