diff options
-rw-r--r-- | data/wiki/syntax.txt | 12 | ||||
-rw-r--r-- | inc/parser/xhtml.php | 51 |
2 files changed, 38 insertions, 25 deletions
diff --git a/data/wiki/syntax.txt b/data/wiki/syntax.txt index 3e36aac2b..335545226 100644 --- a/data/wiki/syntax.txt +++ b/data/wiki/syntax.txt @@ -123,16 +123,16 @@ You can include external and internal [[doku>images]] with curly brackets. Optio Real size: {{wiki:dokuwiki-128.png}} -Resize to given width: {{wiki:dokuwiki-128.png?100}} +Resize to given width: {{wiki:dokuwiki-128.png?50}} -Resize to given width and height: {{wiki:dokuwiki-128.png?100x200}} +Resize to given width and height: {{wiki:dokuwiki-128.png?200x50}} -Resized external image: {{http://de3.php.net/images/php.gif?100x100}} +Resized external image: {{http://de3.php.net/images/php.gif?200x50}} Real size: {{wiki:dokuwiki-128.png}} - Resize to given width: {{wiki:dokuwiki-128.png?100}} - Resize to given width and height: {{wiki:dokuwiki-128.png?100x200}} - Resized external image: {{http://de3.php.net/images/php.gif?100x100}} + Resize to given width: {{wiki:dokuwiki-128.png?50}} + Resize to given width and height: {{wiki:dokuwiki-128.png?200x50}} + Resized external image: {{http://de3.php.net/images/php.gif?200x50}} By using left or right whitespaces you can choose the alignment diff --git a/inc/parser/xhtml.php b/inc/parser/xhtml.php index 71282bd17..23e351b84 100644 --- a/inc/parser/xhtml.php +++ b/inc/parser/xhtml.php @@ -599,18 +599,24 @@ class Doku_Renderer_XHTML extends Doku_Renderer { */ function internalmedia ($src, $title=NULL, $align=NULL, $width=NULL, $height=NULL, $cache=NULL) { - + global $conf; resolve_mediaid($src, $exists); - $this->internallink($src, $title = - array( 'type' => 'internalmedia', - 'src' => $src, - 'title' => $title, - 'align' => $align, - 'width' => $width, - 'height' => $height, - 'cache' => $cache, - 'link' => $link )); + $link = array(); + $link['class'] = 'media'; + $link['style'] = ''; + $link['pre'] = ''; + $link['suf'] = ''; + $link['more'] = 'onclick="return svchk()" onkeypress="return svchk()"'; + $link['target'] = $conf['target']['media']; + + $link['title'] = $this->__xmlEntities($src); + $link['url'] = DOKU_BASE.'fetch.php?cache='.$cache.'&media='.urlencode($src); + $link['name'] = $this->__media ($src, $title, $align, $width, $height, $cache); + + + //output formatted + echo $this->__formatLink($link); } /** @@ -618,16 +624,23 @@ class Doku_Renderer_XHTML extends Doku_Renderer { */ function externalmedia ($src, $title=NULL, $align=NULL, $width=NULL, $height=NULL, $cache=NULL) { + global $conf; - $this->externallink($src, $title = - array( 'type' => 'externalmedia', - 'src' => $src, - 'title' => $title, - 'align' => $align, - 'width' => $width, - 'height' => $height, - 'cache' => $cache, - 'link' => $link )); + $link = array(); + $link['class'] = 'media'; + $link['style'] = ''; + $link['pre'] = ''; + $link['suf'] = ''; + $link['more'] = 'onclick="return svchk()" onkeypress="return svchk()"'; + $link['target'] = $conf['target']['media']; + + $link['title'] = $this->__xmlEntities($src); + $link['url'] = DOKU_BASE.'fetch.php?cache='.$cache.'&media='.urlencode($src); + $link['name'] = $this->__media ($src, $title, $align, $width, $height, $cache); + + + //output formatted + echo $this->__formatLink($link); } /** |