From 1c882ba8aab7be62fd4e47cccf74acab65a7ff4d Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Sat, 11 Oct 2008 16:44:59 +0200 Subject: make linkonly parameter work for flash files FS#1472 darcs-hash:20081011144459-7ad00-58619ee91188127feb7c26a1d8d6b051c6981505.gz --- inc/parser/xhtml.php | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'inc/parser') diff --git a/inc/parser/xhtml.php b/inc/parser/xhtml.php index 1f646c4d3..9b8736256 100644 --- a/inc/parser/xhtml.php +++ b/inc/parser/xhtml.php @@ -682,7 +682,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer { list($ext,$mime) = mimetype($src); if(substr($mime,0,5) == 'image' && $render){ $link['url'] = ml($src,array('id'=>$ID,'cache'=>$cache),($linking=='direct')); - }elseif($mime == 'application/x-shockwave-flash'){ + }elseif($mime == 'application/x-shockwave-flash' && $render){ // don't link flash movies $noLink = true; }else{ @@ -701,9 +701,6 @@ class Doku_Renderer_xhtml extends Doku_Renderer { else $this->doc .= $this->_formatLink($link); } - /** - * @todo don't add link for flash - */ function externalmedia ($src, $title=NULL, $align=NULL, $width=NULL, $height=NULL, $cache=NULL, $linking=NULL) { $noLink = false; @@ -716,7 +713,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer { if(substr($mime,0,5) == 'image' && $render){ // link only jpeg images // if ($ext != 'jpg' && $ext != 'jpeg') $noLink = true; - }elseif($mime == 'application/x-shockwave-flash'){ + }elseif($mime == 'application/x-shockwave-flash' && $render){ // don't link flash movies $noLink = true; }else{ @@ -963,6 +960,16 @@ class Doku_Renderer_xhtml extends Doku_Renderer { $ret .= ' />'; }elseif($mime == 'application/x-shockwave-flash'){ + if (!$render) { + // if the flash is not supposed to be rendered + // return the title of the flash + if (!$title) { + // just show the sourcename + $title = $this->_xmlEntities(basename(noNS($src))); + } + return $title; + } + $ret .= '_xmlEntities($width).'"'; -- cgit v1.2.3