X-Git-Url: http://git.harvie.cz/?a=blobdiff_plain;f=syntax.php;h=f30659e415559574c55142553addb0995cf0a572;hb=f6377891544ef2a4d2706426556568553a15c77b;hp=6c920737740b3b804c6d1cce5e2a8450241a4878;hpb=3aaf5eeedbd3c4d718955628e74d392756633dfc;p=mirrors%2FDokuWiki-Plugin-SVGEdit.git diff --git a/syntax.php b/syntax.php index 6c92073..f30659e 100755 --- a/syntax.php +++ b/syntax.php @@ -26,7 +26,7 @@ class syntax_plugin_svgedit extends DokuWiki_Syntax_Plugin { function getInfo() { return array('author' => 'Thomas Mudrunka', 'email' => 'harvie--email-cz', - 'date' => '2010-02-21', + 'date' => '2010-06-20', 'name' => 'SVG-Edit Plugin', 'desc' => 'Nice way, to create, store, edit and embed SVG images into DokuWiki', 'url' => 'http://www.dokuwiki.org/plugin:svgedit' @@ -52,7 +52,7 @@ class syntax_plugin_svgedit extends DokuWiki_Syntax_Plugin { return 'data:image/svg+xml;base64,'.base64_encode($svg).'" type="image/svg+xml'; } - function svg_format_embed($svglink, $alt, $svg_parameters) { //create xhtml code for svg embeding + function svg_format_embed($svglink, $title, $svg_parameters) { //create xhtml code for svg embeding global $ID; //use object tag for stupid browsers (like firefox) - ugly (relies on browser identification) @@ -62,7 +62,7 @@ class syntax_plugin_svgedit extends DokuWiki_Syntax_Plugin { else $svgtag='object '.$svg_parameters.' data'; - return '<'.$svgtag.'="'.$svglink.'" alt="'.$alt.'" type="image/svg+xml" />'."
"; + return '<'.$svgtag.'="'.$svglink.'" alt="'.$title.'" title="'.$title.'" type="image/svg+xml" />'."
"; } function render($format, &$renderer, $data) { @@ -70,6 +70,7 @@ class syntax_plugin_svgedit extends DokuWiki_Syntax_Plugin { global $ID; $svg_wiki_page = trim(substr($data[1], 6, -2)); //name of wiki page containing SVG image + resolve_pageid(getNS($ID),$svg_wiki_page,$exists); //resolve relative IDs //detect image size for stupid browsers (like firefox) - ugly (fails if svg does not contain information about it's size) $svg_dimensions = ''; @@ -78,19 +79,19 @@ class syntax_plugin_svgedit extends DokuWiki_Syntax_Plugin { if($data[0]==='svg_base64_encode($data[1]); - $renderer->doc .= $this->svg_format_embed($svgenc, 'svg-image@'.$ID, $svg_dimensions); + $renderer->doc .= $this->svg_format_embed($svgenc, 'inline-svg@'.$ID, $svg_dimensions); return true; } if($data[0]==='{{sv') { $svglink = exportlink($svg_wiki_page,'svg'); $renderer->doc .= $this->svg_format_embed($svglink, 'image:'.htmlspecialchars($svg_wiki_page), $svg_dimensions); - $renderer->doc .= html_wikilink($svg_wiki_page,'svg@'.$svg_wiki_page); + $renderer->doc .= ''.html_wikilink($svg_wiki_page,'svg@'.$svg_wiki_page).''; return true; } if($data[0]==='{{SV') { $svgenc = $this->svg_base64_encode(rawWiki($svg_wiki_page)); $renderer->doc .= $this->svg_format_embed($svgenc, 'image:'.htmlspecialchars($svg_wiki_page), $svg_dimensions); - $renderer->doc .= html_wikilink($svg_wiki_page,'SVG@'.$svg_wiki_page); + $renderer->doc .= ''.html_wikilink($svg_wiki_page,'SVG@'.$svg_wiki_page).''; return true; } }