--- loncom/interface/lonfeedback.pm 2010/01/21 23:13:50 1.284 +++ loncom/interface/lonfeedback.pm 2010/05/27 14:34:41 1.290.2.1 @@ -1,7 +1,7 @@ # The LearningOnline Network # Feedback # -# $Id: lonfeedback.pm,v 1.284 2010/01/21 23:13:50 raeburn Exp $ +# $Id: lonfeedback.pm,v 1.290.2.1 2010/05/27 14:34:41 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -769,7 +769,7 @@ sub send_message_link { my $output = ''. ' '.&mt('Send Feedback').''; return $output; } @@ -1015,6 +1015,7 @@ sub build_posting_display { $contrib{$idx.':senderdomain'}).' ('. $contrib{$idx.':sendername'}.':'. $contrib{$idx.':senderdomain'}.')'; + $sender = ''.$sender.''; if ($contrib{$idx.':anonymous'}) { $sender.=' ['.$$anonhash{$key}.'] '. $screenname; @@ -1098,6 +1099,7 @@ sub build_posting_display { } else { $sender=''.$$anonhash{$key}.''; } + $sender = ''.$sender.''; # Set up for sorting by domain, then username for anonymous unless (defined($$usernamesort{'__anon'})) { %{$$usernamesort{'__anon'}} = (); @@ -1140,7 +1142,7 @@ sub build_posting_display { } } if ($viewgrades) { - $vgrlink=&Apache::loncommon::submlink('Submissions', + $vgrlink=&Apache::loncommon::submlink(&mt('Submissions'), $contrib{$idx.':sendername'},$contrib{$idx.':senderdomain'},$ressymb); } if ($$dischash{$readkey}=~/\.$idx\./) { @@ -1254,7 +1256,7 @@ sub build_posting_display { } $$discussionitems[$idx] .= '  '. ''.$subject.'  '. - ''.$sender.' '.$vgrlink.' ('. + $sender.' '.$vgrlink.' ('. &Apache::lonlocal::locallocaltime($posttime).')'; if ($$dischash{$toggkey}) { $$discussionitems[$idx].='  '. @@ -1396,7 +1398,9 @@ sub get_post_contents { my ($timesent,$attachmsg); my %currattach = (); $timesent = &Apache::lonlocal::locallocaltime($postversions[$i]); - &newline_to_br(\$messages->{$i}); + unless (&contains_block_html($messages->{$i})) { + &newline_to_br(\$messages->{$i}); + } $$messages{$i}=&Apache::lontexconvert::msgtexconverted($$messages{$i}); $$subjects{$i}=~s/\n/\
/g; $$subjects{$i}=&Apache::lontexconvert::msgtexconverted($$subjects{$i}); @@ -1675,7 +1679,10 @@ END 'bread_crumbs' => $brcrum,}); if ($quote ne '') { - &newline_to_br(\$quote); + $quote = &HTML::Entities::decode($quote); + unless (&contains_block_html($quote)) { + &newline_to_br(\$quote); + } $quote='
'.&Apache::lontexconvert::msgtexconverted($quote).'
'; } @@ -1709,7 +1716,6 @@ $lt{'title'}: $comment

-

END if ( ($env{'form.editdisc'}) || ($env{'form.replydisc'}) ) { if ($env{'form.origpage'}) { @@ -1731,6 +1737,7 @@ END } } else { $r->print(< $lt{'atta'} $attachmaxtext:

END @@ -2395,7 +2402,7 @@ sub fail_redirect { my ($r,$feedurl) = @_; if ($feedurl=~/^\/adm\//) { $feedurl.='?register=1' }; my %lt = &Apache::lonlocal::texthash( - 'sorr' => 'Sorry, no recipients ...', + 'sorr' => 'Sorry, no recipients ...', ); my $logo=&Apache::loncommon::lonhttpdurl('/adm/lonIcons/lonlogos.gif'); $r->print(&Apache::loncommon::start_page('Feedback not sent',undef, @@ -2542,7 +2549,7 @@ ENDREDIR sub no_redirect_back { my ($r,$feedurl) = @_; - my $nofeed=&mt('Sorry, no feedback possible on this resource ...'); + my $nofeed=&mt('Sorry, no feedback possible on this resource ...'); my %onload; if ($env{'environment.remote'} ne 'off') { @@ -2641,12 +2648,12 @@ sub screen_header { } } if ($msgoptions) { - $msgoptions='

' + $msgoptions='

' .' '.&mt('Send Feedback').'

'.&Apache::lonhtmlcommon::coursepreflink(&mt('Feedback Settings'),'feedback').'

' .$msgoptions; } if ($discussoptions) { - $discussoptions='

' + $discussoptions='

' .' '.&mt('Discussion Contributions').'

'.&Apache::lonhtmlcommon::coursepreflink(&mt('Discussion Settings'),'discussion').'

' .$discussoptions; } @@ -2950,16 +2957,17 @@ sub show_preview { } sub contains_block_html { - my ($message)=@_; - return ($message =~ m/ - <(br|h1|h2|h3|h4|h5|h6|p|ol|ul|table|pre|address|blockquote|center|div) - [\s]* - ([\w]+\=['"][\w]+['"])* - [\s]* - ( - [\s]*[\/]>| - >.*<\/\1[\s]*> - )/xs ); + my ($message)=@_; + return ($message =~ m{ + <(br|h1|h2|h3|h4|h5|h6|p|ol|ul|table|pre|address|blockquote|center|div) + \s* + (\w+\=['"]\w+['"])* + \s* + ( + \s*/>| + >.* + )}xs + ); } sub tidy_html {