Index: lib/TWiki/Attach.pm =================================================================== RCS file: /cvsroot/twiki/twiki/lib/TWiki/Attach.pm,v retrieving revision 1.36 diff -u -r1.36 Attach.pm --- lib/TWiki/Attach.pm 14 Apr 2004 09:37:17 -0000 1.36 +++ lib/TWiki/Attach.pm 18 Apr 2004 17:11:50 -0000 @@ -58,22 +58,20 @@ $noviewableAttachmentCount = 0; $attachmentCount = 0; - my $header = "
\n"; - $header .= "

<\/p>\n"; # prefix empty line - $header .= "| *[[$TWiki::twikiWebname.FileAttachment][Attachment]]* | *Action* | *Size* | *Date* | *Who* | *Comment* |"; - if( $showAttr ) { - $header .= " *[[$TWiki::twikiWebname.FileAttribute][Attribute]]* |"; - } + my $tmpl = "ATTACH:header"; + $tmpl .= "_A" if ($showAttr); + + my $header = TWiki::Store::handleTmplP($tmpl); $header .= "\n"; - + my @attachments = $meta->find( "FILEATTACHMENT" ); foreach my $attachment ( @attachments ) { $metaText .= formatAttachments( $web, $topic, $showAttr, $isTopRev, %$attachment ); } - + my $text = ""; if( $showAll || $viewableAttachmentCount ) { - $text = "$header$metaText<\/div>"; + $text = "$header$metaText%TMPL:P{ATTACH:footer}%"; } $text = &TWiki::handleCommonTags( $text, $topic, $web ); # FIXME needed? @@ -147,14 +145,20 @@ $attrSize = 100 if( $attrSize < 100 ); $attrSize = sprintf( "%1.1f K", $attrSize / 1024 ); $attrComment = $attrComment || " "; - $row .= "| $fileIcon $file " - . "| manage " - . "| $attrSize | $attrDate | $attrUser | $attrComment |"; - if ( $showAttr ) { - $attrAttr = $attrAttr || "   "; - $row .= " $attrAttr |"; - } + $attrAttr = $attrAttr || " "; + + my $tmpl = "ATTACH:row"; + $tmpl .= "_A" if ($showAttr); + + $row = TWiki::Store::handleTmplP($tmpl); + $row =~ s/%A_URL%/$fileUrl/go; + $row =~ s/%A_ICON%/$fileIcon/go; + $row =~ s/%A_FILE%/$file/go; + $row =~ s/%A_SIZE%/$attrSize/go; + $row =~ s/%A_DATE%/$attrDate/go; + $row =~ s/%A_USER%/$attrUser/go; + $row =~ s/%A_COMMENT%/$attrComment/go; + $row =~ s/%A_ATTRS%/$attrAttr/go; $row .= "\n"; } else { $noviewableAttachmentCount++; Index: templates/twiki.tmpl =================================================================== RCS file: /cvsroot/twiki/twiki/templates/twiki.tmpl,v retrieving revision 1.17 diff -u -r1.17 twiki.tmpl --- templates/twiki.tmpl 14 Apr 2004 09:37:17 -0000 1.17 +++ templates/twiki.tmpl 18 Apr 2004 17:11:50 -0000 @@ -71,3 +71,10 @@ #PageBottom %TMPL:END% +%TMPL:DEF{ATTACH:header}%

+

+| *[[%TWIKIWEB%.FileAttachment][Attachment]]* | *Action* | *Size* | *Date* | *Who* | *Comment* |%TMPL:END% +%TMPL:DEF{ATTACH:row}%| %A_ICON% %A_FILE% | manage | %A_SIZE% | %A_DATE% | %A_USER% | %A_COMMENT% |%TMPL:END% +%TMPL:DEF{ATTACH:header_A}%%TMPL:P{ATTACH:header}% *[[%TWIKIWEB%.FileAttribute][Attribute]]* |%TMPL:END% +%TMPL:DEF{ATTACH:row_A}%%TMPL:P{ATTACH:row}% %A_ATTRS% |%TMPL:END% +%TMPL:DEF{ATTACH:footer}%
%TMPL:END%