Permalink
Browse files

Item10681: rework try/catch

git-svn-id: http://svn.foswiki.org/trunk@11564 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information...
GeorgeClark GeorgeClark
GeorgeClark authored and GeorgeClark committed Apr 26, 2011
1 parent 76b7104 commit 5a412a6f26d679072319e6159ffa7ab1bc8846b5
Showing with 27 additions and 32 deletions.
  1. +27 −32 core/lib/Foswiki/UI/Changes.pm
@@ -62,39 +62,34 @@ sub changes {
next if $done{ $change->{topic} };
next
unless $session->topicExists( $webObject->web, $change->{topic} );
try {
my $topicObject =
Foswiki::Meta->new( $session, $webObject->web, $change->{topic} );
my $summary =
$topicObject->summariseChanges( undef, $change->{revision}, 1 );
my $thisChange = $eachChange;
$thisChange =~ s/%TOPICNAME%/$change->{topic}/go;
my $wikiuser =
$change->{user}
? $session->{users}->webDotWikiName( $change->{user} )
: '';
my $wikiname =
$change->{user}
? $session->{users}->getWikiName( $change->{user} )
: '';
$thisChange =~ s/%AUTHOR%/$wikiuser/go;
$thisChange =~ s/\$wikiname/<nop>$wikiname/go;
my $time = Foswiki::Time::formatTime( $change->{time} );
$change->{revision} = 1 unless $change->{revision};
my $srev = 'r' . $change->{revision};
if ( $change->{revision} == 1 ) {
$srev = CGI::span( { class => 'foswikiNew' }, 'NEW' );
}
$thisChange =~ s/%TIME%/$time/g;
$thisChange =~ s/%REVISION%/$srev/go;
$thisChange =~ s/%TEXTHEAD%/$summary/go;
$page .= $thisChange;
my $topicObject =
Foswiki::Meta->new( $session, $webObject->web, $change->{topic} );
next unless $topicObject->haveAccess('VIEW');
my $summary =
$topicObject->summariseChanges( undef, $change->{revision}, 1 );
my $thisChange = $eachChange;
$thisChange =~ s/%TOPICNAME%/$change->{topic}/go;
my $wikiuser =
$change->{user}
? $session->{users}->webDotWikiName( $change->{user} )
: '';
my $wikiname =
$change->{user}
? $session->{users}->getWikiName( $change->{user} )
: '';
$thisChange =~ s/%AUTHOR%/$wikiuser/go;
$thisChange =~ s/\$wikiname/<nop>$wikiname/go;
my $time = Foswiki::Time::formatTime( $change->{time} );
$change->{revision} = 1 unless $change->{revision};
my $srev = 'r' . $change->{revision};
if ( $change->{revision} == 1 ) {
$srev = CGI::span( { class => 'foswikiNew' }, 'NEW' );
}
catch Foswiki::AccessControlException with {
# ignore changes we can't see
};
$thisChange =~ s/%TIME%/$time/g;
$thisChange =~ s/%REVISION%/$srev/go;
$thisChange =~ s/%TEXTHEAD%/$summary/go;
$page .= $thisChange;
$done{ $change->{topic} } = 1;
}

0 comments on commit 5a412a6

Please sign in to comment.