--- lib/TWiki/UI/Orig.Upload.pm 2008-09-11 23:41:58.000000000 -0400
+++ lib/TWiki/UI/Upload.pm      2010-06-28 17:40:30.000000000 -0400
@@ -104,10 +104,11 @@
     if( $fileName ) {
         $tmpl = $session->templates->readTemplate( 'attachagain', $skin );
         my $u = $args->{user};
         $fileWikiUser = $users->webDotWikiName($u) if $u;
     } else {
+       $session->enterContext( 'new_attachment', $meta );
         $tmpl = $session->templates->readTemplate( 'attachnew', $skin );
     }
     if ( $fileName ) {
         # must come after templates have been read
         $atext .= $session->attach->formatVersions( $webName, $topic, %$args );
--- templates/orig.attach.pattern.tmpl	2008-09-11 23:41:58.000000000 -0400
+++ templates/attach.pattern.tmpl	2010-06-28 17:37:17.000000000 -0400
@@ -38,27 +38,33 @@
 
 %TMPL:P{"previous"}%%IF{"$ATTACHFILESIZELIMIT > 0" then="%MAKETEXT{"Upload up to [_1] KB." args="%ATTACHFILESIZELIMIT%"}%"}%
 
 <input type="hidden" name="filename" value="%FILENAME%" /> 
 <input class="twikiInputField" type="file" name="filepath" value="%FILEPATH%" size="70" />
+     
 </div><!-- /twikiFormStep-->%TMPL:END%
 
 %TMPL:DEF{"comment"}%<div class="twikiFormStep">
 ---+++ %MAKETEXT{"Comment"}%
 <p>
 %MAKETEXT{"Describe the file so other people know what it is."}%
 </p>
 <input class="twikiInputField" type="text" name="filecomment" value="%FILECOMMENT%" size="70" />
 </div><!-- /twikiFormStep-->%TMPL:END%
 
+%TMPL:DEF{"newattach"}%<input type="checkbox" class="twikiCheckbox" id="createlink" name="createlink" %IF{"lc($ 'ATTACHLINKDEFAULT')='checked'" then="CHECKED=\"CHECKED\" " }%%ATTACHLINKBOX% /><label for="createlink">%MAKETEXT{"Create a link to the attached file"}%</label> <span class="twikiGrayText">%MAKETEXT{"Images will be displayed, for other attachments a link will be created."}%</span>
+
+<input type="checkbox" class="twikiCheckbox" id="hidefile" name="hidefile"  %IF{"lc($ 'ATTACHHIDEDEFAULT')='checked'" then="CHECKED=\"CHECKED\" " }%%HIDEFILE% /><label for="hidefile">%MAKETEXT{"Do not show attachment in table"}%</label> <span class="twikiGrayText">%MAKETEXT{"Attachments will not be shown in topic view page."}%</span>%TMPL:END%
+
+%TMPL:DEF{"reattach"}%<input type="checkbox" class="twikiCheckbox" id="createlink" name="createlink" %ATTACHLINKBOX% /><label for="createlink">%MAKETEXT{"Create a link to the attached file"}%</label> <span class="twikiGrayText">%MAKETEXT{"Images will be displayed, for other attachments a link will be created."}%</span>
+
+<input type="checkbox" class="twikiCheckbox" id="hidefile" name="hidefile" %HIDEFILE% /><label for="hidefile">%MAKETEXT{"Do not show attachment in table"}%</label> <span class="twikiGrayText">%MAKETEXT{"Attachments will not be shown in topic view page."}%</span>%TMPL:END%
 %TMPL:DEF{"properties"}%<div class="twikiFormStep twikiLast">
 ---+++ %MAKETEXT{"Properties"}%
 
-<input type="checkbox" class="twikiCheckbox" id="createlink" name="createlink" %ATTACHLINKBOX% /><label for="createlink">%MAKETEXT{"Create a link to the attached file"}%</label> <span class="twikiGrayText">%MAKETEXT{"Images will be displayed, for other attachments a link will be created."}%</span>
-
-<input type="checkbox" class="twikiCheckbox" id="hidefile" name="hidefile" %HIDEFILE% /><label for="hidefile">%MAKETEXT{"Do not show attachment in table"}%</label> <span class="twikiGrayText">%MAKETEXT{"Attachments will not be shown in topic view page."}%</span>
+%TMPL:P{context="new_attachment" then="newattach" else="reattach"}%
 </div><!-- /twikiFormStep-->%TMPL:P{"changepropertiesaction"}%%TMPL:END%
 
 
 %TMPL:DEF{"content"}%%TMPL:P{"toolbar"}%
 %TMPL:P{"pagehelp"}%
--- templates/orig.attach.classic.tmpl	2008-09-11 23:41:58.000000000 -0400
+++ templates/attach.classic.tmpl	2010-06-30 17:18:11.000000000 -0400
@@ -24,10 +24,16 @@
 
 %TMPL:DEF{"existingattachments"}%---++ Existing attachments for <nop>%TOPIC%
 %META{"attachments" all="on"}%
 %TMPL:END%
 
+%TMPL:DEF{"newcreatelink"}%<input type="checkbox" name="createlink" %IF{"lc($ 'ATTACHLINKDEFAULT')='checked'" then="CHECKED=\"CHECKED\" " }%%ATTACHLINKBOX% /> Create a link to the attached file at the end of the topic.%TMPL:END%
+%TMPL:DEF{"recreatelink"}%<input type="checkbox" name="createlink" %ATTACHLINKBOX% /> Create a link to the attached file at the end of the topic.%TMPL:END%
+
+%TMPL:DEF{"newhidefile"}%<input type="checkbox" name="hidefile" %IF{"lc($ 'ATTACHHIDEDEFAULT')='checked'" then="CHECKED=\"CHECKED\" " }%%HIDEFILE% /> Hide attachment in normal topic view.%TMPL:END%
+%TMPL:DEF{"rehidefile"}%<input type="checkbox" name="hidefile" %HIDEFILE% /> Hide attachment in normal topic view.%TMPL:END%
+
 %TMPL:DEF{"content"}%<form name="main" enctype="multipart/form-data" action="%SCRIPTURLPATH{"upload"}%/%WEB%/%TOPIC%" method="post">
 %TMPL:P{"existingattachments"}%
 %TMPL:P{"previousdetails"}%
 <table width="100%">
    %TMPL:P{"previous"}%
@@ -48,18 +54,18 @@
  </tr>
  <tr>
   <td align="right">
    Link:
   </td><td>
-   <input type="checkbox" name="createlink" %ATTACHLINKBOX% /> Create a link to the attached file at the end of the topic.
+   %TMPL:P{context="new_attachment" then="newcreatelink" else="recreatelink"}%
   </td>
  </tr>
  <tr>
   <td align="right">
    Hide file:
   </td><td>
-   <input type="checkbox" name="hidefile" %HIDEFILE% /> Hide attachment in normal topic view.
+   %TMPL:P{context="new_attachment" then="newhidefile" else="rehidefile"}%
   </td>
  </tr>
 </table>
 %TMPL:P{"notes"}%
 %TMPL:P{"extranotes"}%
--- templates/orig.attach.tmpl	2008-09-11 23:41:58.000000000 -0400
+++ templates/attach.tmpl	2010-06-30 17:07:28.000000000 -0400
@@ -30,23 +30,28 @@
  </tr>%TMPL:END%
 
 %TMPL:DEF{"properties"}%%TMPL:P{"createlink"}%
 %TMPL:P{"hidefile"}%%TMPL:END%
 
+%TMPL:DEF{"newcreatelink"}%<input type="checkbox" class="twikiCheckbox" id="createlink" name="createlink" %IF{"lc($ 'ATTACHLINKDEFAULT')='checked'" then="CHECKED=\"CHECKED\" " }%%ATTACHLINKBOX% /><label for="createlink">%MAKETEXT{"Create a link to the attached file"}%</label> <span class="twikiGrayText">%MAKETEXT{"Images will be displayed, for other attachments a link will be created."}%</span>%TMPL:END%
+%TMPL:DEF{"recreatelink"}%<input type="checkbox" class="twikiCheckbox" id="createlink" name="createlink" %ATTACHLINKBOX% /><label for="createlink">%MAKETEXT{"Create a link to the attached file"}%</label> <span class="twikiGrayText">%MAKETEXT{"Images will be displayed, for other attachments a link will be created."}%</span>%TMPL:END%
 %TMPL:DEF{"createlink"}%<tr>
   <td align="right">
    %MAKETEXT{"Link"}%
   </td><td>
-   <input type="checkbox" class="twikiCheckbox" id="createlink" name="createlink" %ATTACHLINKBOX% /><label for="createlink">%MAKETEXT{"Create a link to the attached file"}%</label> <span class="twikiGrayText">%MAKETEXT{"Images will be displayed, for other attachments a link will be created."}%</span>
+   %TMPL:P{context="new_attachment" then="newcreatelink" else="recreatelink"}%
   </td>
  </tr>%TMPL:END%
 
+%TMPL:DEF{"newhidefile"}%<input type="checkbox" class="twikiCheckbox" id="hidefile" name="hidefile" %IF{"lc($ 'ATTACHHIDEDEFAULT')='checked'" then="CHECKED=\"CHECKED\" " }%%HIDEFILE% /><label for="hidefile">%MAKETEXT{"Do not show attachment in table"}%</label> <span class="twikiGrayText">%MAKETEXT{"Attachments will not be shown in topic view page."}%</span>%TMPL:END%
+%TMPL:DEF{"rehidefile"}%<input type="checkbox" class="twikiCheckbox" id="hidefile" name="hidefile" %HIDEFILE% /><label for="hidefile">%MAKETEXT{"Do not show attachment in table"}%</label> <span class="twikiGrayText">%MAKETEXT{"Attachments will not be shown in topic view page."}%</span>%TMPL:END%
+
 %TMPL:DEF{"hidefile"}%<tr>
   <td align="right">
    %MAKETEXT{"Hide file"}%
   </td><td>
-   <input type="checkbox" class="twikiCheckbox" id="hidefile" name="hidefile" %HIDEFILE% /><label for="hidefile">%MAKETEXT{"Do not show attachment in table"}%</label> <span class="twikiGrayText">%MAKETEXT{"Attachments will not be shown in topic view page."}%</span>
+   %TMPL:P{context="new_attachment" then="newhidefile" else="rehidefile"}%
   </td>
  </tr>%TMPL:END%
 
 %TMPL:DEF{"hiddenfields"}%%{"space to put extra hidden form fields"}%%TMPL:END%
 
