From 65a5b2c0df7d76a914f83b43f86b382cd4c0101a Mon Sep 17 00:00:00 2001 From: Michael Braun Date: Tue, 26 Feb 2013 12:03:05 +0100 Subject: [PATCH] attach media as file annotation --- conf/default.php | 1 + conf/metadata.php | 1 + lang/de/lang.php | 3 +++ lang/de/settings.php | 1 + lang/en/lang.php | 3 +++ lang/en/settings.php | 1 + renderer.php | 10 ++++++++++ 7 files changed, 20 insertions(+) create mode 100755 lang/de/lang.php create mode 100755 lang/en/lang.php diff --git a/conf/default.php b/conf/default.php index 1c58547e..05ad4da0 100644 --- a/conf/default.php +++ b/conf/default.php @@ -5,3 +5,4 @@ $conf['maxbookmarks'] = 5; $conf['usestyles'] = ''; $conf['qrcodesize'] = '120x120'; +$conf['attachment'] = 1; diff --git a/conf/metadata.php b/conf/metadata.php index 00730b7f..e1950b27 100644 --- a/conf/metadata.php +++ b/conf/metadata.php @@ -5,3 +5,4 @@ $meta['maxbookmarks'] = array('numeric'); $meta['usestyles'] = array('string'); $meta['qrcodesize'] = array('string', '_pattern'=>'/^(|\d+x\d+)$/'); +$meta['attachment'] = array('onoff'); diff --git a/lang/de/lang.php b/lang/de/lang.php new file mode 100755 index 00000000..50e4ce8f --- /dev/null +++ b/lang/de/lang.php @@ -0,0 +1,3 @@ +(0=none, 5=all)'; $lang['usestyles'] = 'You can give a comma separated list of plugins of which the style.css or screen.css should be used for PDF generation. By default only print.css and pdf.css are used.'; $lang['qrcodesize'] = 'Size of embedded QR code (in pixels widthxheight). Empty to disable'; +$lang['attachment'] = 'Embed linked media'; diff --git a/renderer.php b/renderer.php index 3b70dffb..263d5e1e 100644 --- a/renderer.php +++ b/renderer.php @@ -63,6 +63,16 @@ function _media ($src, $title=NULL, $align=NULL, $width=NULL, $out .= '
'; } + $NS = getNS($src); + $AUTH = auth_quickaclcheck("$NS:*"); + $confAttachment = $this->getConf('attachment'); + if($AUTH >= AUTH_READ && $confAttachment) { + $file = mediaFN($src); + $filename = basename($file); + $mediatitle = sprintf($this->getLang('mediatitle'), $filename); + $out .= "   "; + } + $out .= parent::_media ($src, $title, $align, $width, $height, $cache, $render); if($align == 'center'){