diff --git a/data/System/AttachmentUrlShortcutPlugin.txt b/data/System/AttachmentUrlShortcutPlugin.txt index 07904b0..16a86be 100644 --- a/data/System/AttachmentUrlShortcutPlugin.txt +++ b/data/System/AttachmentUrlShortcutPlugin.txt @@ -12,15 +12,15 @@ Use the macro !%A% *or the one you configured in the Configuration-System under | *Parameter* (both working, but only use one) | *Default* | *Description* | | _web_ or _Bereich_ | Current web | Sets the web of the topic, where the attachment is attached to | | _topic_ or _Dokument_ | Current topic | Sets the topic name, where the attachment is attached to | -| _name_ or _Anhang_ | - | Sets the name of the attachment. It must match the filename! | +| _name_ or _Anhang_ or default (=%A{"file"}%=)| required | Sets the name of the attachment. It must match the filename! | | _Label_ or _Name__ | _name_ | Optional to set the name of the link. If its not set, _file is used as name | If you use file to define the file to attache to, the link is create automatically, so you dont need to use braces[[]] like in example 1. ----+++ Example +---+++ Examples Different ways to link the attachment TestAttachement.pdf of this topic + 1 %A{"TestAttachment.pdf"}% %A{"TestAttachment.pdf"}% + 1 %A{name="TestAttachment.pdf" label="Test attachment"}% %A{name="TestAttachment.pdf" label="Test attachment"}% 1 [[%A{web="System" topic="AttachmentUrlShortcutPlugin"}%TestAttachment.pdf][Test attachment]] [[%A{web="System" topic="AttachmentUrlShortcutPlugin"}%TestAttachment.pdf][Test attachment]] 1 %A{web="System" topic="AttachmentUrlShortcutPlugin" name="TestAttachment.pdf" label="Test attachment"}% %A{web="System" topic="AttachmentUrlShortcutPlugin" file="TestAttachment.pdf" name="Test attachment"}% - 1 %A{name="TestAttachment.pdf" label="Test attachment"}% %A{name="TestAttachment.pdf" label="Test attachment"}% - 1 %A{name="TestAttachment.pdf"}% %A{file="TestAttachment.pdf"}% ---++ Plugin Installation Instructions __Note:__ You do not need to install anything on the browser to use this Plugin. The following instructions are for the administrator who installs the Plugin on the server where Foswiki is running. @@ -33,8 +33,9 @@ __Note:__ You do not need to install anything on the browser to use this Plugin. | Plugin Author: | Foswiki:Main.EugenMayer | | Copyright: | © 2009, Collaborganize [[www.collaborganize.com]] | | License: | GPL ([[http://www.gnu.org/copyleft/gpl.html][GNU General Public License]]) | -| Plugin Version: | 07 Jan 2008 (V0.3) | +| Plugin Version: | 12 Feb 2009 (V0.4) | | Change History: | | +| 12 Feb 2009: | Simplified default use-case ( you can use =%A{"filename.ext"}= for linking the file in the current topic ). All other sytanxes are still supported | | 07 Jan 2009: | * You can now choose the MacroName to fit your own needs %BR% Changed the name / label systax to be conform with AttachLinkPlugin | | 11 Dez 2008: | Renewed plugin for Foswiki | | 01 Dez 2007: | Initial version for TWiki | diff --git a/lib/Foswiki/Plugins/AttachmentUrlShortcutPlugin.pm b/lib/Foswiki/Plugins/AttachmentUrlShortcutPlugin.pm index c1a505c..455ff8a 100644 --- a/lib/Foswiki/Plugins/AttachmentUrlShortcutPlugin.pm +++ b/lib/Foswiki/Plugins/AttachmentUrlShortcutPlugin.pm @@ -46,7 +46,7 @@ sub _AURLSHORT { my($this, $params, $topic, $web) = @_; $web = $params->{'Bereich'} || $params->{'web'} || $web; $topic = $params->{'Dokument'} || $params->{'topic'} || $topic; - my $file = $params->{'Anhang'} || $params->{'name'} || ""; + my $file = $params->{'Anhang'} || $params->{'name'} || $params->{_DEFAULT} || ""; my $name = $params->{'Name'} || $params->{'label'} || $file; my $url; if($file eq "") {