summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2008-10-11 16:44:59 +0200
committerAndreas Gohr <andi@splitbrain.org>2008-10-11 16:44:59 +0200
commit1c882ba8aab7be62fd4e47cccf74acab65a7ff4d (patch)
treefd859ebcbede804406c6bc6157e2920b67f693c7
parentc9a8f912634065b1d643022ada92da161e978a56 (diff)
downloadrpg-1c882ba8aab7be62fd4e47cccf74acab65a7ff4d.tar.gz
rpg-1c882ba8aab7be62fd4e47cccf74acab65a7ff4d.tar.bz2
make linkonly parameter work for flash files FS#1472
darcs-hash:20081011144459-7ad00-58619ee91188127feb7c26a1d8d6b051c6981505.gz
-rw-r--r--inc/parser/xhtml.php17
1 files changed, 12 insertions, 5 deletions
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 .= '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'.
' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"';
if ( !is_null($width) ) $ret .= ' width="'.$this->_xmlEntities($width).'"';