Skip to content

Commit

Permalink
Item14069: Merge branch 'master' into Item13897
Browse files Browse the repository at this point in the history
  • Loading branch information
gac410 committed Oct 14, 2016
2 parents 1625ca4 + 8c1e7e4 commit 5f318c5
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 32 deletions.
4 changes: 2 additions & 2 deletions PatternSkin/templates/attach.pattern.tmpl
Expand Up @@ -42,8 +42,8 @@ class="foswikiHelp"

%TMPL:P{"previous"}%%IF{"$ATTACHFILESIZELIMIT > 0" then="%MAKETEXT{"Upload up to [_1] KB." args="%ATTACHFILESIZELIMIT%"}%"}%

<noautolink><input type="hidden" name="filename" value="%FILENAME%" />
<input class="foswikiInputField" type="file" name="filepath" value="%FILEPATH%" size="70" /></noautolink>
<noautolink><input type="hidden" name="filename" value="%ENCODE{"%FILENAME%"}%" />
<input class="foswikiInputField" type="file" name="filepath" value="%ENCODE{"%FILEPATH%"}%" size="70" /></noautolink>
</div>
%TMPL:P{context="BatchUploadPluginEnabled" then="batchupload"}%%TMPL:END%

Expand Down
12 changes: 6 additions & 6 deletions PatternSkin/templates/attachagain.pattern.tmpl
@@ -1,10 +1,10 @@
%TMPL:INCLUDE{"attachagain"}%
%TMPL:INCLUDE{"attachtables"}%
%TMPL:DEF{"pagetitle"}%%MAKETEXT{"Update attachment [_1] on [_2]" args="[[%ATTACHURLPATH%/%ENCODE{%FILENAME%}%][%FILENAME%]],[[%TOPIC%]]"}%%TMPL:END%
%TMPL:DEF{"pagetitle"}%%MAKETEXT{"Update attachment [_1] on [_2]" args="[[%ATTACHURLPATH%/%ENCODE{"%FILENAME%"}%][%ENCODE{"%FILENAME%" type="entity"}%]],[[%TOPIC%]]"}%%TMPL:END%



%TMPL:DEF{"versions"}%---++ %MAKETEXT{"Version history of [_1]" args="<nop>%FILENAME%"}%
%TMPL:DEF{"versions"}%---++ %MAKETEXT{"Version history of [_1]" args="<nop>%ENCODE{"%FILENAME%" type="entity"}%"}%
<div class="foswikiAttachments">
%TABLE{%TMPL:P{"commonattachtableattributes"}% summary="%MAKETEXT{"Version history"}%" caption="%MAKETEXT{"Version history"}%"}%
%ATTACHTABLE%</div>%TMPL:END%
Expand All @@ -15,14 +15,14 @@



%TMPL:DEF{"previous"}%<p>%MAKETEXT{"Select a new local file to update attachment"}% <code>%FILEPATH%</code> <span class="foswikiGrayText">%TMPL:P{"fileuser"}%</span></p>%TMPL:END%
%TMPL:DEF{"previous"}%<p>%MAKETEXT{"Select a new local file to update attachment"}% <code>%ENCODE{"%FILENAME%" type="entity"}%</code> <span class="foswikiGrayText">%TMPL:P{"fileuser"}%</span></p>%TMPL:END%



%TMPL:DEF{"movedelete"}%<div class="patternMoveAttachment foswikiUnvisited">
%MAKETEXT{"More actions for [_1]:" args="=%FILENAME%="}%
%BUTTON{ href="%SCRIPTURLPATH{"rename"}%/%WEB%/%TOPIC%?template=moveattachment&attachment=%ENCODE{%FILENAME%}%" value=" %MAKETEXT{"Move"}% "}%
%BUTTON{ href="%SCRIPTURLPATH{"rename"}%/%WEB%/%TOPIC%?newweb=%TRASHWEB%;newtopic=TrashAttachment;template=renameattachmentdelete;attachment=%ENCODE{%FILENAME%}%" value=" %MAKETEXT{"Delete"}% "}%
%MAKETEXT{"More actions for [_1]:" args="=%ENCODE{"%FILENAME%" type="entity"}%="}%
%BUTTON{ href="%SCRIPTURLPATH{"rename"}%/%WEB%/%TOPIC%?template=moveattachment&attachment=%ENCODE{"%FILENAME%"}%" value=" %MAKETEXT{"Move"}% "}%
%BUTTON{ href="%SCRIPTURLPATH{"rename"}%/%WEB%/%TOPIC%?newweb=%TRASHWEB%;newtopic=TrashAttachment;template=renameattachmentdelete;attachment=%ENCODE{"%FILENAME%"}%" value=" %MAKETEXT{"Delete"}% "}%
</input></div>
%TMPL:END%

Expand Down
12 changes: 6 additions & 6 deletions core/lib/Foswiki/UI/Attach.pm
Expand Up @@ -89,25 +89,25 @@ sub attach {
}
$tmpl =~ s/%ATTACHTABLE%/$atext/g;
$tmpl =~ s/%FILEUSER%/$fileWikiUser/g;
$args->{name} = Foswiki::entityEncode( $args->{name} );
$tmpl =~ s/%FILENAME%/$args->{name}/g;
$tmpl = $topicObject->expandMacros($tmpl);
$tmpl = $topicObject->renderTML($tmpl);
$tmpl =~ s/%FILENAME%/$fileName/g;
$tmpl =~ s/%HIDEFILE%/$isHideChecked/g;

my $filePath = Foswiki::entityEncode( $args->{path} ) || $args->{name};
my $filePath = $args->{path} || $fileName;
$tmpl =~ s/%FILEPATH%/$filePath/g;
$args->{comment} = Foswiki::entityEncode( $args->{comment} );
$tmpl =~ s/%FILECOMMENT%/$args->{comment}/g;

$tmpl = $topicObject->expandMacros($tmpl);
$tmpl = $topicObject->renderTML($tmpl);

$app->writeCompletePage($tmpl);
}

1;
__END__
Foswiki - The Free and Open Source Wiki, http://foswiki.org/
Copyright (C) 2008-2010 Foswiki Contributors. Foswiki Contributors
Copyright (C) 2008-2016 Foswiki Contributors. Foswiki Contributors
are listed in the AUTHORS file in the root of this distribution.
NOTE: Please extend that file, not this notice.
Expand Down
4 changes: 2 additions & 2 deletions core/templates/attach.tmpl
Expand Up @@ -14,8 +14,8 @@
<td align="right">
%MAKETEXT{"Attach new file"}%
</td><td>
<noautolink><input type="hidden" name="filename" value="%FILENAME%" />
<input type="file" name="filepath" value="%FILEPATH%" size="50" /></noautolink>
<noautolink><input type="hidden" name="filename" value="%ENCODE{"%FILENAME%"}%" />
<input type="file" name="filepath" value="%ENCODE{"%FILEPATH%"}%" size="50" /></noautolink>
</td>
</tr>%TMPL:END%

Expand Down
10 changes: 5 additions & 5 deletions core/templates/attachagain.tmpl
Expand Up @@ -2,22 +2,22 @@

%TMPL:DEF{"titleaction"}%(attach) %TMPL:END%
%TMPL:DEF{"headerhelp"}% %TMPL:END%
%TMPL:DEF{"webaction"}% Update attachment *%FILENAME%* on *%TOPIC%* %TMPL:END%
%TMPL:DEF{"webaction"}% Update attachment *%ENCODE{"%FILENAME%" type="entity"}%* on *%TOPIC%* %TMPL:END%
%TMPL:DEF{"previousdetails"}%
---++ Update attachment <code>%FILENAME%</code>
---++ Update attachment <code>%ENCODE{"%FILENAME%" type="entity"}%</code>
%ATTACHTABLE% %TMPL:END%
%TMPL:DEF{"previous"}%
<tr>
<td align="right">
Previous <br /> upload:
</td><td>
<code>%FILEPATH%</code> %TMPL:P{"fileuser"}%
<code>%ENCODE{"%FILEPATH%" type="entity"}%</code> %TMPL:P{"fileuser"}%
</td>
</tr>%TMPL:END%
%TMPL:DEF{"extranotes"}% * %MAKETEXT{"*Properties:* The comment and visibility (i.e. is attachment hidden) can be changed without uploading a file by pressing \"Change Properties only\"."}% %POPUPWINDOW{"%SYSTEMWEB%.HiddenAttachment" label="%MAKETEXT{"More on hiding attachments"}%"}%%JQREQUIRE{"popupwindow"}%
* %MAKETEXT{"*Change comment:* If you use _Change Properties_ to change a comment, the comment shown in the topic will change, but the comment shown against the attachment history will be the comment when the file was uploaded."}%
* %MAKETEXT{"*Attach new file:* If you select a different file in the browser, it is this that will be updated or added."}%
%TMPL:END%
%TMPL:DEF{"topicactionbuttons"}%<input type="submit" class="foswikiSubmit" value="%MAKETEXT{"Upload file"}%" />%TMPL:P{"sep"}%<input type="submit" class="foswikiSubmit" name="changeproperties" value="%MAKETEXT{"Change properties only"}%" />%TMPL:P{"sep"}%<a href="%SCRIPTURLPATH{"rename"}%/%WEB%/%TOPIC%?attachment=%ENCODE{%FILENAME%}%" rel='nofollow'>%MAKETEXT{"Move or delete attachment"}%</a>%TMPL:P{"sep"}%%TMPL:P{"canceltopicaction"}%%TMPL:END%
%TMPL:DEF{"topicactionbuttons"}%<input type="submit" class="foswikiSubmit" value="%MAKETEXT{"Upload file"}%" />%TMPL:P{"sep"}%<input type="submit" class="foswikiSubmit" name="changeproperties" value="%MAKETEXT{"Change properties only"}%" />%TMPL:P{"sep"}%<a href="%SCRIPTURLPATH{"rename"}%/%WEB%/%TOPIC%?attachment=%ENCODE{"%FILENAME%"}%" rel='nofollow'>%MAKETEXT{"Move or delete attachment"}%</a>%TMPL:P{"sep"}%%TMPL:P{"canceltopicaction"}%%TMPL:END%
%TMPL:DEF{"fileuser"}%(%FILEUSER%)%TMPL:END%
%TMPL:P{"attach"}%
%TMPL:P{"attach"}%%{ end }%
6 changes: 3 additions & 3 deletions core/templates/moveattachment.tmpl
Expand Up @@ -6,7 +6,7 @@
%TMPL:DEF{"webaction"}% *%MAKETEXT{"Move file attachment"}%* %TMPL:END%


%TMPL:DEF{"pagetitle"}%%MAKETEXT{"Move attachment [_1]" args="[[%ATTACHURL%/%ENCODE{"%FILENAME%"}%][%FILENAME%]]"}% %TMPL:END%
%TMPL:DEF{"pagetitle"}%%MAKETEXT{"Move attachment [_1]" args="[[%ATTACHURL%/%ENCODE{"%FILENAME%"}%][%ENCODE{"%FILENAME%" type="entity"}%]]"}% %TMPL:END%


%TMPL:DEF{"renameformsteps"}%<div class="foswikiFormSteps">
Expand All @@ -25,7 +25,7 @@

%TMPL:DEF{"attachmenthelp"}%<p>%MAKETEXT{"The attachment may be renamed (by appending a number to the name) if an attachment of that name already exists in the target topic."}%</p>%TMPL:END%

%TMPL:DEF{"newweb"}%<p><select class="foswikiSelect" name="newweb" onchange="if (document.rename.newweb.value == 'Trash') { document.rename.newtopic.value = 'TrashAttachment'; }"> %WEBLIST{"<option $marker value=$qname>$name</option>" webs="%TRASHWEB%,public" selection="%WEB%" separator=" "}% </select><input type="hidden" name="attachment" value="%FILENAME%" /></p>%TMPL:END%
%TMPL:DEF{"newweb"}%<p><select class="foswikiSelect" name="newweb" onchange="if (document.rename.newweb.value == 'Trash') { document.rename.newtopic.value = 'TrashAttachment'; }"> %WEBLIST{"<option $marker value=$qname>$name</option>" webs="%TRASHWEB%,public" selection="%WEB%" separator=" "}% </select><input type="hidden" name="attachment" value="%ENCODE{"%FILENAME%"}%" /></p>%TMPL:END%


%TMPL:DEF{"towebtitle"}%---+++ %MAKETEXT{"Move to web:"}%%TMPL:END%
Expand Down Expand Up @@ -60,4 +60,4 @@



%TMPL:DEF{"updatenote"}%%TMPL:END%
%TMPL:DEF{"updatenote"}%%TMPL:END%%{ end }%
4 changes: 2 additions & 2 deletions core/templates/rename.tmpl
Expand Up @@ -9,7 +9,7 @@
%TMPL:DEF{"newwebhelp"}%%TMPL:END%


%TMPL:DEF{"newattachment"}%<input name="newattachment" class="foswikiInputField" value="%NEW_FILENAME%" size="36" />%TMPL:END%
%TMPL:DEF{"newattachment"}%<input name="newattachment" class="foswikiInputField" value="%ENCODE{"%NEW_FILENAME%"}%" size="36" />%TMPL:END%

%TMPL:DEF{"newtopic"}%<input name="newtopic" class="foswikiInputField" value="%NEW_TOPIC%" size="36" /><br />
%TMPL:P{"onlywikiname"}%%TMPL:END%
Expand All @@ -18,4 +18,4 @@
%TMPL:DEF{"newweb"}%<select name="newweb" class="foswikiSelect">%WEBLIST{"<option $marker value=$qname>$name</option>" webs="%NEW_WEB%,public" selection="%NEW_WEB%" separator=" "}%</select>%TMPL:END%


%TMPL:DEF{"topicactionbuttons"}%<input type="submit" class="foswikiSubmit" value='%MAKETEXT{"Rename/Move"}%' /> %MAKETEXT{"or"}% %TMPL:P{"canceltopicaction"}%%TMPL:END%
%TMPL:DEF{"topicactionbuttons"}%<input type="submit" class="foswikiSubmit" value='%MAKETEXT{"Rename/Move"}%' /> %MAKETEXT{"or"}% %TMPL:P{"canceltopicaction"}%%TMPL:END%%{ end }%
8 changes: 4 additions & 4 deletions core/templates/renameattachmentdelete.tmpl
Expand Up @@ -25,22 +25,22 @@
%TMPL:DEF{"topicactionbuttons"}%<input type="submit" class="foswikiSubmit" value=' %MAKETEXT{"Delete"}% ' /> %MAKETEXT{"or"}% %TMPL:P{"canceltopicaction"}%%TMPL:END%


%TMPL:DEF{"pagetitle"}%%MAKETEXT{"Delete attachment [_1]" args="[[%ATTACHURL%/%ENCODE{"%FILENAME%"}%][%FILENAME%]]"}%%TMPL:END%
%TMPL:DEF{"pagetitle"}%%MAKETEXT{"Delete attachment [_1]" args="[[%ATTACHURL%/%ENCODE{"%FILENAME%"}%][%ENCODE{"%FILENAME%" type="entity"}%]]"}%%TMPL:END%



%TMPL:DEF{"totopictitle"}%---+++ %MAKETEXT{"Optionally enter a different topic name:"}%%TMPL:END%

%TMPL:DEF{"toattachmenttitle"}%---+++ %MAKETEXT{"Optionally enter a different attachment name:"}%%TMPL:END%

%TMPL:DEF{"newattachment"}%<p><input name="newattachment" class="foswikiInputField" value="%NEW_FILENAME%" size="36" /><input type="hidden" name="attachment" value="%FILENAME%" /></p>%TMPL:P{"attachmenthelp"}%%TMPL:END%
%TMPL:DEF{"newattachment"}%<p><input name="newattachment" class="foswikiInputField" value="%ENCODE{"%NEW_FILENAME%"}%" size="36" /><input type="hidden" name="attachment" value="%ENCODE{"%FILENAME%"}%" /></p>%TMPL:P{"attachmenthelp"}%%TMPL:END%

%TMPL:DEF{"newtopic"}%<p><input name="newtopic" class="foswikiInputField" value="%URLPARAM{"newtopic" default="TrashAttachment"}%" size="36" /><input type="hidden" name="onlywikiname" value="on" /></p>%TMPL:P{"namehelp"}%%TMPL:END%


%TMPL:DEF{"namehelp"}%<p>%MAKETEXT{"[_1] is the default topic for deleted attachments." args="[[%TRASHWEB%.TrashAttachment][TrashAttachment]]"}% %MAKETEXT{"If you enter a different name, make sure the topic exists."}%</p>%TMPL:END%

%TMPL:DEF{"attachmenthelp"}%<p>%MAKETEXT{"The attachment may have to be renamed if an attachment called '%FILENAME%' already exists in the target topic."}%</p>%TMPL:END%
%TMPL:DEF{"attachmenthelp"}%<p>%MAKETEXT{"The attachment may have to be renamed if an attachment called '[_1]' already exists in the target topic." args="%ENCODE{"%FILENAME%" type="entity"}%"}%</p>%TMPL:END%

%TMPL:DEF{"toolbar"}%%TMPL:END%
%TMPL:DEF{"pagehelp"}%%TMPL:END%
Expand All @@ -52,4 +52,4 @@



%TMPL:DEF{"updatenote"}%%TMPL:END%
%TMPL:DEF{"updatenote"}%%TMPL:END%%{ end }%
4 changes: 2 additions & 2 deletions core/templates/renamedelete.tmpl
Expand Up @@ -25,7 +25,7 @@

%TMPL:DEF{"newtopic"}%<p><input name="newtopic" class="foswikiInputField" value="%NEW_TOPIC%" size="36" /> %TMPL:P{"namehelp"}%</p>%TMPL:P{"onlywikiname"}% %TMPL:END%

%TMPL:DEF{"newattachment"}%<p><input name="newattachment" class="foswikiInputField" value="%NEW_FILENAME%" size="36" /> %TMPL:P{"namehelp"}%</p>%TMPL:END%
%TMPL:DEF{"newattachment"}%<p><input name="newattachment" class="foswikiInputField" value="%ENCODE{"%NEW_FILENAME%"}%" size="36" /> %TMPL:P{"namehelp"}%</p>%TMPL:END%


%TMPL:DEF{"namehelp"}%<span>%MAKETEXT{"This name has been chosen so it doesn't conflict with any other topics already in the [_1] web." args="%NEW_WEB%"}%</span>%TMPL:END%
Expand All @@ -37,4 +37,4 @@
%TMPL:DEF{"updatenote"}%%MAKETEXT{"Checked topics will be updated to point to the new topic location."}% <span class="foswikiAlert" style="font-weight:bold;">%MAKETEXT{"Not recommended when deleting a topic."}%</span>%TMPL:END%


%TMPL:DEF{"topicactionbuttons"}%<input type="submit" class="foswikiSubmit" value='%MAKETEXT{"Delete"}%' /> %MAKETEXT{"or"}% %TMPL:P{"canceltopicaction"}%%TMPL:END%
%TMPL:DEF{"topicactionbuttons"}%<input type="submit" class="foswikiSubmit" value='%MAKETEXT{"Delete"}%' /> %MAKETEXT{"or"}% %TMPL:P{"canceltopicaction"}%%TMPL:END%%{ end }%

0 comments on commit 5f318c5

Please sign in to comment.