--- loncom/interface/lonfeedback.pm 2006/04/10 19:59:53 1.189 +++ loncom/interface/lonfeedback.pm 2006/05/08 22:07:31 1.195 @@ -1,7 +1,7 @@ # The LearningOnline Network # Feedback # -# $Id: lonfeedback.pm,v 1.189 2006/04/10 19:59:53 albertel Exp $ +# $Id: lonfeedback.pm,v 1.195 2006/05/08 22:07:31 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -744,17 +744,22 @@ ENDDISCUSS } } } else { + $discussion.='
'; if (&discussion_open($status) && &Apache::lonnet::allowed('pch', $env{'request.course.id'}. ($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:''))) { if ($outputtarget ne 'tex') { - $discussion.='
'. ''. - &mt('Post Discussion').'
'; - } + &mt('Post Discussion').'
'; + } } + $discussion.=''. + &mt('Send Message').'
'; } return $discussion; } @@ -1749,44 +1754,45 @@ END my $end_page = &Apache::loncommon::end_page(); $r->print(< +$start_page +
$lt{'sdpf'}
$lt{'prca'}
  1. $lt{'whpo'}
  2. $lt{'unwh'}
  3. $lt{'wipa'}

- - - - -
- - - - -
- - - - - +END + $r->print(&Apache::loncommon::start_data_table()); + $r->print(< + - +END + $r->print(&Apache::loncommon::start_data_table_row()); + $r->print(<$lt{'disa'} - +END + $r->print(&Apache::loncommon::end_data_table_row()); + $r->print(&Apache::loncommon::start_data_table_row()); + $r->print(<$lt{'npmr'} - +END + $r->print(&Apache::loncommon::end_data_table_row()); + $r->print(&Apache::loncommon::start_data_table_row()); + $r->print(<$lt{'dotm'} - -
$lt{'pref'}$lt{'curr'}$lt{'actn'}?$lt{'pref'} + $lt{'curr'} + $lt{'actn'}?
$lt{$discdisp}
$lt{$discmark}
$lt{$disctogg}
-
-
+END + $r->print(&Apache::loncommon::end_data_table_row()); + $r->print(&Apache::loncommon::end_data_table()); + $r->print(<
@@ -2233,6 +2239,7 @@ sub no_redirect_back { my $nofeed=&mt('Sorry, no feedback possible on this resource ...'); my %body_options = ('only_body' => 1, + 'bgcolor' => '#FFFFFF', 'add_entries' => {'onload' => "if (window.name!='loncapaclient') { self.window.close(); }"}); if ($feedurl !~ m{^/adm/feedback}) { @@ -2247,8 +2254,7 @@ sub no_redirect_back { $feedurl=&Apache::lonenc::check_encrypt($feedurl); my $logo=&Apache::loncommon::lonhttpdurl('/adm/lonIcons/lonlogos.gif'); $r->print (< - +$start_page $nofeed
@@ -2284,7 +2290,7 @@ sub screen_header { '

'; } } - if ($env{'request.course.id'}) { + if (($env{'request.course.id'}) && (!$env{'form.sendmessageonly'})) { if (&discussion_open(undef,$symb) && &Apache::lonnet::allowed('pch', $env{'request.course.id'}. @@ -2320,8 +2326,9 @@ sub resource_output { } sub clear_out_html { - my ($message,$override)=@_; - unless (&Apache::lonhtmlcommon::htmlareablocked()) { return $message; } + my ($message,$override,$ignore_htmlarea)=@_; + if (!$ignore_htmlarea + && !&Apache::lonhtmlcommon::htmlareablocked()) { return $message; } # Always allow the -tag my %html=(M=>1); # Check if more is allowed @@ -2337,9 +2344,9 @@ sub clear_out_html { H1=>1, H2=>1, H3=>1, H4=>1, H5=>1); } # Do the substitution of everything that is not explicitly allowed - $message =~ s/\<(\/?\s*(\w+)[^\>\<]*)/ + $message =~ s/\<(\/?\s*(\w*)[^\>\<]*)/ {($html{uc($2)}&&(length($1)<1000))?"\<$1":"\<$1"}/ge; - $message =~ s/(\]*)\>/ + $message =~ s/(\]*)\>/ {($html{uc($2)}&&(length($1)<1000))?"$1\>":"$1\>"}/ge; return $message; } @@ -2608,7 +2615,7 @@ sub show_preview { &newline_to_br(\$message); $message=&Apache::lonspeller::markeduptext($message); $message=&Apache::lontexconvert::msgtexconverted($message); - my $subject=&clear_out_html($env{'form.subject'}); + my $subject=&clear_out_html($env{'form.subject'},undef,1); $subject=~s/\n/\
/g; $subject=&Apache::lontexconvert::msgtexconverted($subject); my $start_page= @@ -2662,7 +2669,7 @@ ENDPREVIEW sub modify_attachments { my ($r,$currnewattach,$currdelold,$symb,$idx,$attachmenturls)=@_; my $orig_subject = &Apache::lonnet::unescape($env{'form.subject'}); - my $subject=&clear_out_html($orig_subject); + my $subject=&clear_out_html($orig_subject,undef,1); $subject=~s/\n/\
/g; $subject=&Apache::lontexconvert::msgtexconverted($subject); my $timestamp=$env{'form.timestamp'}; @@ -2975,7 +2982,7 @@ sub handler { # --------------------------- Get query string for limited number of parameters &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, - ['hide','unhide','deldisc','postdata','preview','replydisc','editdisc','cmd','symb','onlyunread','allposts','onlyunmark','previous','markread','markonread','markondisp','toggoff','toggon','modifydisp','changes','navtime','navmaps','navurl','sortposts','applysort','rolefilter','statusfilter','sectionpick','posterlist','userpick','attach','origpage','currnewattach','deloldattach','keepold','allversions','export']); + ['hide','unhide','deldisc','postdata','preview','replydisc','editdisc','cmd','symb','onlyunread','allposts','onlyunmark','previous','markread','markonread','markondisp','toggoff','toggon','modifydisp','changes','navtime','navmaps','navurl','sortposts','applysort','rolefilter','statusfilter','sectionpick','posterlist','userpick','attach','origpage','currnewattach','deloldattach','keepold','allversions','export','sendmessageonly']); if ($env{'form.editdisc'}) { if (!(&editing_allowed())) { my $symb=(split(/\:\:\:/,$env{'form.editdisc'}))[0]; @@ -3405,14 +3412,16 @@ ENDREDIR my ($typestyle,%to) = &decide_receiver($feedurl); # Actually send mail - my ($status,$numsent)=&send_msg(&clear_out_html($env{'form.subject'}),$feedurl,$email,$citations, + my ($status,$numsent)=&send_msg(&clear_out_html($env{'form.subject'}, + undef,1), + $feedurl,$email,$citations, $attachmenturl,%to); # Discussion? Store that. my $numpost=0; if ($env{'form.discuss'} || $env{'form.anondiscuss'}) { - my $subject = &clear_out_html($env{'form.subject'}); + my $subject = &clear_out_html($env{'form.subject'},undef,1); my $anonmode=(defined($env{'form.anondiscuss'})); $typestyle.=&adddiscuss($symb,$message,$anonmode,$attachmenturl, $subject); @@ -3423,7 +3432,7 @@ ENDREDIR my $blog=''; if ($env{'form.blog'}) { - my $subject = &clear_out_html($env{'form.subject'}); + my $subject = &clear_out_html($env{'form.subject'},undef,1); $status.=&Apache::lonrss::addentry($env{'user.name'}, $env{'user.domain'}, 'CourseBlog_'.$env{'request.course.id'},