From: Peter T. <pet...@us...> - 2001-12-01 07:10:14
|
Update of /cvsroot/twiki/twiki/lib/TWiki In directory usw-pr-cvs1:/tmp/cvs-serv15972/TWiki Modified Files: Attach.pm Log Message: Codev.DirectLinkToAttachedFiles Index: Attach.pm =================================================================== RCS file: /cvsroot/twiki/twiki/lib/TWiki/Attach.pm,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -r1.19 -r1.20 *** Attach.pm 2001/11/21 02:49:03 1.19 --- Attach.pm 2001/12/01 07:10:12 1.20 *************** *** 35,39 **** sub renderMetaData { ! my( $web, $topic, $meta, $args ) = @_; my $metaText = ""; --- 35,39 ---- sub renderMetaData { ! my( $web, $topic, $meta, $args, $isTopRev ) = @_; my $metaText = ""; *************** *** 57,61 **** my @attachments = $meta->find( "FILEATTACHMENT" ); foreach my $attachment ( @attachments ) { ! $metaText .= formatAttachments( $web, $topic, $showAttr, %$attachment ); } --- 57,61 ---- my @attachments = $meta->find( "FILEATTACHMENT" ); foreach my $attachment ( @attachments ) { ! $metaText .= formatAttachments( $web, $topic, $showAttr, $isTopRev, %$attachment ); } *************** *** 97,101 **** sub formatAttachments { ! my ( $theWeb, $theTopic, $showAttr, %attachment ) = @_; my $row = ""; --- 97,101 ---- sub formatAttachments { ! my ( $theWeb, $theTopic, $showAttr, $isTopRev, %attachment ) = @_; my $row = ""; *************** *** 108,113 **** $viewableAttachmentCount++; my $fileIcon = TWiki::Attach::filenameToIcon( $file ); $attrComment = $attrComment || " "; ! $row .= "| $fileIcon <a href=\"%SCRIPTURLPATH%/viewfile%SCRIPTSUFFIX%/$theWeb/$theTopic?rev=$attrVersion&filename=$file\">$file</a> \\\n"; $row .= " | <a href=\"%SCRIPTURL%/attach%SCRIPTSUFFIX%/$theWeb/$theTopic?filename=$file&revInfo=1\">action</a> \\\n"; $row .= " | $attrSize | $attrDate | $attrUser | $attrComment |"; --- 108,115 ---- $viewableAttachmentCount++; my $fileIcon = TWiki::Attach::filenameToIcon( $file ); + my $fileUrl = "%SCRIPTURLPATH%/viewfile%SCRIPTSUFFIX%/$theWeb/$theTopic?rev=$attrVersion&filename=$file"; + $fileUrl = "%PUBURLPATH%/$theWeb/$theTopic/$file" if( $isTopRev || $attrVersion eq "1.1" ); $attrComment = $attrComment || " "; ! $row .= "| $fileIcon <a href=\"$fileUrl\">$file</a> \\\n"; $row .= " | <a href=\"%SCRIPTURL%/attach%SCRIPTSUFFIX%/$theWeb/$theTopic?filename=$file&revInfo=1\">action</a> \\\n"; $row .= " | $attrSize | $attrDate | $attrUser | $attrComment |"; |