From dc673a5b4730b9b706001e8f06ded3dc9986908c Mon Sep 17 00:00:00 2001 From: "joe.lapp" Date: Thu, 15 Sep 2005 05:23:48 +0200 Subject: Added media 'nolink' and 'direct' options {{image.jpg?nolink}} darcs-hash:20050915032348-36b45-f298b21de05001cd9a56b4859bf265079b57bf69.gz --- inc/parser/handler.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'inc/parser/handler.php') diff --git a/inc/parser/handler.php b/inc/parser/handler.php index 55cbcf342..20a9433bd 100644 --- a/inc/parser/handler.php +++ b/inc/parser/handler.php @@ -459,7 +459,8 @@ class Doku_Handler { $this->_addCall( $p['type'], - array($p['src'], $p['title'], $p['align'], $p['width'], $p['height'], $p['cache']), + array($p['src'], $p['title'], $p['align'], $p['width'], + $p['height'], $p['cache'], $p['linking']), $pos ); return TRUE; @@ -589,13 +590,22 @@ function Doku_Handler_Parse_Media($match) { ($size[3]) ? $h = $size[3] : $h = NULL; } + //get linking command + if(preg_match('/nolink/i',$param)){ + $linking = 'nolink'; + }else if(preg_match('/direct/i',$param)){ + $linking = 'direct'; + }else{ + $linking = 'details'; + } + //get caching command if (preg_match('/(nocache|recache)/i',$param,$cachemode)){ $cache = $cachemode[1]; }else{ $cache = 'cache'; } - + // Check whether this is a local or remote image if ( preg_match('#^(https?|ftp)#i',$src) ) { $call = 'externalmedia'; @@ -611,6 +621,7 @@ function Doku_Handler_Parse_Media($match) { 'width'=>$w, 'height'=>$h, 'cache'=>$cache, + 'linking'=>$linking, ); return $params; -- cgit v1.2.3