'.
'';
my $escsymb=&escape($ressymb);
- if ($visible>2) {
+ if ($visible) {
$discussion .= '
@@ -847,7 +885,7 @@ sub postingform_display {
$lt{'note'}
$lt{'title'}:
-
+
ENDDISCUSS
if ($env{'form.origpage'}) {
$postingform .= ' \n";
- if ($outputtarget ne 'tex') {
- $postingform .= &generate_attachments_button('',$attachnum,$ressymb,
+ $postingform .= &generate_attachments_button('',$attachnum,$ressymb,
$now,$currnewattach,
$currdelold,'',$mode,
$blockblog);
- if ((ref($currnewattach) eq 'ARRAY') && (@{$currnewattach} > 0)) {
- $newattachmsg = ''.$lt{'newa'}.' ';
- if (@{$currnewattach} > 1) {
- $newattachmsg .= '';
- foreach my $item (@{$currnewattach}) {
- $item =~ m#.*/([^/]+)$#;
- $newattachmsg .= ''.$1.' '."\n";
- }
- $newattachmsg .= ' '."\n";
- } else {
- $$currnewattach[0] =~ m#.*/([^/]+)$#;
- $newattachmsg .= ''.$1.' '."\n";
- }
- }
- $postingform .= $newattachmsg;
- $postingform .= &generate_preview_button();
+ if ((ref($currnewattach) eq 'ARRAY') && (@{$currnewattach} > 0)) {
+ $newattachmsg = ''.$lt{'newa'}.' ';
+ if (@{$currnewattach} > 1) {
+ $newattachmsg .= '';
+ foreach my $item (@{$currnewattach}) {
+ $item =~ m#.*/([^/]+)$#;
+ $newattachmsg .= ''.$1.' '."\n";
+ }
+ $newattachmsg .= ' '."\n";
+ } else {
+ $$currnewattach[0] =~ m#.*/([^/]+)$#;
+ $newattachmsg .= ''.$1.' '."\n";
+ }
}
+ $postingform .= $newattachmsg;
+ $postingform .= &generate_preview_button();
return $postingform;
}
sub build_posting_display {
- my ($usernamesort,$subjectsort,$namesort,$notshown,$newitem,$dischash,$shown,$alldiscussion,$imsitems,$imsfiles,$roleinfo,$discussionitems,$replies,$depth,$posters,$maxdepth,$visible,$newpostsflag,$current,$status,$viewgrades,$seeid,$prevread,$sortposts,$ressymb,$target,$readkey,$showunmark,$showonlyunread,$totposters,$rolefilter,$sectionpick,$grouppick,$classgroups,$statusfilter,$toggkey,$outputtarget,$anonhash,$anoncnt,$group) = @_;
+ my ($usernamesort,$subjectsort,$namesort,$notshown,$newitem,$dischash,$shown,$alldiscussion,$imsitems,$imsfiles,$roleinfo,$discussionitems,$replies,$depth,$posters,$maxdepth,$visible,$newpostsflag,$current,$status,$viewgrades,$seeid,$prevread,$sortposts,$ressymb,$readkey,$showunmark,$showonlyunread,$totposters,$rolefilter,$sectionpick,$grouppick,$classgroups,$statusfilter,$toggkey,$outputtarget,$anonhash,$anoncnt,$group) = @_;
my @original=();
my @index=();
my $skip_group_check = 0;
@@ -911,6 +947,19 @@ sub build_posting_display {
if ((@{$grouppick} == 0) || (grep(/^all$/,@{$grouppick}))) {
$skip_group_check = 1;
}
+ my (%deletions,%hiddens);
+ if ($contrib{'deleted'}) {
+ my $deleted = $contrib{'deleted'};
+ $deleted =~ s/^\.//;
+ $deleted =~ s/\.$//;
+ %deletions = map { $_ => 1 } (split(/\.\./,$deleted));
+ }
+ if ($contrib{'hidden'}) {
+ my $hidden = $contrib{'hidden'};
+ $hidden =~ s/^\.//;
+ $hidden =~ s/\.$//;
+ %hiddens = map { $_ => 1 } (split(/\.\./,$hidden));
+ }
if ($contrib{'version'}) {
my $oldest = $contrib{'1:timestamp'};
if ($prevread eq '0') {
@@ -924,13 +973,13 @@ sub build_posting_display {
}
for (my $id=1;$id<=$contrib{'version'};$id++) {
my $idx=$id;
+ next if ($contrib{$idx.':deleted'});
+ next if ($contrib{$idx.':hidden'});
my $posttime = $contrib{$idx.':timestamp'};
if ($prevread <= $posttime) {
$$newpostsflag = 1;
}
- my $hidden=($contrib{'hidden'}=~/\.$idx\./);
my $studenthidden=($contrib{'studenthidden'}=~/\.$idx\./);
- my $deleted=($contrib{'deleted'}=~/\.$idx\./);
my $origindex='0.';
my $numoldver=0;
if ($contrib{$idx.':replyto'}) {
@@ -954,7 +1003,7 @@ sub build_posting_display {
} else {
$$replies[$$depth[$idx]]=1;
}
- unless ((($hidden) && (!$seeid)) || ($deleted)) {
+ unless ((($hiddens{$idx}) && (!$seeid)) || ($deletions{$idx})) {
$$visible++;
if ($contrib{$idx.':history'}) {
if ($contrib{$idx.':history'} =~ /:/) {
@@ -988,7 +1037,7 @@ sub build_posting_display {
$message.=$attachtxt{$numoldver};
$subject=$subjects{$numoldver};
if ($message) {
- if ($hidden) {
+ if ($hiddens{$idx}) {
$message=''.$message.' ';
if ($studenthidden) {
$message .=' Deleted by poster (student).';
@@ -1015,6 +1064,7 @@ sub build_posting_display {
$contrib{$idx.':senderdomain'}).' ('.
$contrib{$idx.':sendername'}.':'.
$contrib{$idx.':senderdomain'}.')';
+ $sender = ''.$sender.' ';
if ($contrib{$idx.':anonymous'}) {
$sender.=' ['.$$anonhash{$key}.'] '.
$screenname;
@@ -1051,53 +1101,56 @@ sub build_posting_display {
} else {
@{$$namesort{$lastname}{$firstname}} = ("$idx");
}
- if (&editing_allowed($escsymb.':::'.$idx,$group)) {
- if (($env{'user.domain'} eq $contrib{$idx.':senderdomain'}) && ($env{'user.name'} eq $contrib{$idx.':sendername'})) {
- $sender.=' '.&mt('Edit').' ';
+ if ($outputtarget ne 'tex') {
+ if (&editing_allowed($escsymb.':::'.$idx,$group)) {
+ if (($env{'user.domain'} eq $contrib{$idx.':senderdomain'}) && ($env{'user.name'} eq $contrib{$idx.':sendername'})) {
+ $sender.=' '.&mt('Edit').' ';
- unless ($seeid) {
- my $grpargs = &group_args($group);
- $sender.=" ';
+ unless ($seeid) {
+ my $grpargs = &group_args($group);
+ $sender.=" ';
+ }
}
}
- }
- if ($seeid) {
- if ($hidden) {
- unless ($studenthidden) {
- $sender.=' ';
+ }
+ } else {
+ $sender.=' '.&mt('Make Visible').' ';
- }
- } else {
- $sender.=' '.&mt('Hide').' ';
- }
- my $grpargs = &group_args($group);
- $sender.=
- " ";
- $sender .= &mt('Delete').' ';
+ $sender .= &group_args($group);
+ $sender .= '">'.&mt('Hide').'';
+ }
+ my $grpargs = &group_args($group);
+ $sender.=
+ " ";
+ $sender .= &mt('Delete').' ';
+ }
}
- } else {
+ } else {
if ($screenname) {
$sender=''.$screenname.' ';
} else {
$sender=''.$$anonhash{$key}.' ';
}
+ $sender = ''.$sender.' ';
# Set up for sorting by domain, then username for anonymous
unless (defined($$usernamesort{'__anon'})) {
%{$$usernamesort{'__anon'}} = ();
@@ -1117,36 +1170,29 @@ sub build_posting_display {
@{$$namesort{'__anon'}{'__anon'}} = ("$idx");
}
}
- if (&discussion_open($status)) {
- if (($group ne '') &&
- (&check_group_priv($group,'pgd') eq 'ok')) {
- $sender.=' '.&mt('Reply').' ';
- } elsif (&Apache::lonnet::allowed('pch',
- $env{'request.course.id'}.
- ($env{'request.course.sec'}?'/'.
- $env{'request.course.sec'}:''))) {
- $sender.=' '.&mt('Reply').' ';
}
- }
- if ($viewgrades) {
- $vgrlink=&Apache::loncommon::submlink('Submissions',
- $contrib{$idx.':sendername'},$contrib{$idx.':senderdomain'},$ressymb);
- }
- if ($$dischash{$readkey}=~/\.$idx\./) {
- $ctlink = ''.&mt('Mark unread').'? ';
- } else {
- $ctlink = ''.&mt('Mark read').'? ';
+ if ($viewgrades) {
+ $vgrlink=&Apache::loncommon::submlink(&mt('Submissions'),
+ $contrib{$idx.':sendername'},$contrib{$idx.':senderdomain'},$ressymb);
+ }
+ if ($$dischash{$readkey}=~/\.$idx\./) {
+ $ctlink = ''.&mt('Mark unread').'? ';
+ } else {
+ $ctlink = ''.&mt('Mark read').'? ';
+ }
}
}
#figure out at what position this needs to print
@@ -1163,7 +1209,7 @@ sub build_posting_display {
if ($outputtarget eq 'export') {
%{$$imsitems{$idx}} = ();
$$imsitems{$idx}{'isvisible'}='true';
- if ($hidden) {
+ if ($hiddens{$idx}) {
$$imsitems{$idx}{'isvisible'}='false';
}
$$imsitems{$idx}{'title'}=$subjects{$numoldver};
@@ -1245,7 +1291,7 @@ sub build_posting_display {
$$newitem{$idx} = 1;
$$discussionitems[$idx] .= '
- '.&mt('NEW').' ';
+ '.&mt('NEW').' ';
} else {
$$newitem{$idx} = 0;
$$discussionitems[$idx] .= '
@@ -1254,7 +1300,7 @@ sub build_posting_display {
}
$$discussionitems[$idx] .= ' '.
''.$subject.' '.
- ''.$sender.' '.$vgrlink.' ('.
+ $sender.' '.$vgrlink.' ('.
&Apache::lonlocal::locallocaltime($posttime).') ';
if ($$dischash{$toggkey}) {
$$discussionitems[$idx].=' '.
@@ -1396,7 +1442,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});
@@ -1664,18 +1712,32 @@ END
END
+ my ($textareaheader,$textareaclass);
+ if (&Apache::lonhtmlcommon::htmlareabrowser()) {
+ $textareaheader = &Apache::lonhtmlcommon::htmlareaselectactive();
+ $textareaclass = 'class="LC_richDefaultOff"';
+ if ($env{'request.course.id'}) {
+ unless (($env{'course.'.$env{'request.course.id'}.'.allow_limited_html_in_feedback'} =~ /^\s*yes\s*$/i) || ($env{'form.sendmessageonly'})) {
+ undef($textareaclass);
+ }
+ }
+ }
+
# Breadcrumbs
my $brcrum = [{'href' => '',
'text' => 'Resource Feedback and Discussion'}];
my %onload = ('onload' => 'window.focus();setposttype();');
+ my %parms=('add_entries' => \%onload);
+ if ($env{'form.modal'} ne 'yes') { 'bread_crumbs' => $brcrum }
my $start_page=
- &Apache::loncommon::start_page('Resource Feedback and Discussion',$js,
- {'add_entries' => \%onload,
- 'bread_crumbs' => $brcrum,});
+ &Apache::loncommon::start_page('Resource Feedback and Discussion',$js,\%parms);
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).' ';
}
@@ -1686,6 +1748,7 @@ $start_page
enctype="multipart/form-data">
$prevtag
+
END
if ($env{'form.replydisc'}) {
$r->print(<print(<
$quote
-$lt{'myqu'}
+$lt{'myqu'}
+$textareaheader
+
$latexHelp
$lt{'title'}:
-
-
END
if ( ($env{'form.editdisc'}) || ($env{'form.replydisc'}) ) {
if ($env{'form.origpage'}) {
@@ -1731,6 +1795,7 @@ END
}
} else {
$r->print(<
$lt{'atta'} $attachmaxtext:
END
@@ -1785,7 +1850,6 @@ END
}
}
$r->print(&generate_preview_button().
- &Apache::lonhtmlcommon::htmlareaselectactive('comment').
&Apache::loncommon::end_page());
}
@@ -2234,7 +2298,7 @@ sub print_showposters {
my $group = $env{'form.group'};
my $ressymb = &wrap_symb($symb);
if (($group ne '') &&
- ($ressymb =~ m|^bulletin___ \d+___adm/wrapper/adm/\Q$cdom\E/\Q$cnum\E/\d+/bulletinboard$|)) {
+ ($ressymb =~ m|^bulletin___\d+___adm/wrapper/adm/\Q$cdom\E/\Q$cnum\E/\d+/bulletinboard$|)) {
if (&check_group_priv($group,'dgp') eq 'ok') {
$seeid = 1;
}
@@ -2395,7 +2459,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,
@@ -2507,16 +2571,14 @@ sub redirect_back {
}
&Apache::lonenc::check_encrypt(\$feedurl);
my $logo=&Apache::loncommon::lonhttpdurl('/adm/lonIcons/lonlogos.gif');
- my %onload;
- if ($env{'environment.remote'} ne 'off') {
- $onload{'onload'} =
- "if (window.name!='loncapaclient') { this.document.reldt.submit(); self.window.close(); }";
+ my %parms=('only_body' => 1);
+ if ($env{'form.modal'}) {
+ $parms{'add_entries'}={'onLoad' => 'document.forms.reldt.submit()'};
+ } else {
+ $parms{'redirect'}=[0,$feedurl];
}
my $start_page=
- &Apache::loncommon::start_page('Feedback sent',undef,
- {'redirect' => [0,$feedurl],
- 'only_body' => 1,
- 'add_entries' => \%onload});
+ &Apache::loncommon::start_page('Feedback sent',undef,\%parms);
my $end_page = &Apache::loncommon::end_page();
$r->print(< 1,
'bgcolor' => '#FFFFFF',
@@ -2575,7 +2633,7 @@ ENDNOREDIRTWO
}
sub screen_header {
- my ($feedurl,$symb) = @_;
+ my ($feedurl,$symb,$group) = @_;
my $crscontent = &mt('Question/Comment/Feedback about course content');
my $crspolicy = &mt('Question/Comment/Feedback about course policy');
my $contribdisc = &mt('Contribution to course discussion of resource');
@@ -2624,10 +2682,19 @@ sub screen_header {
}
if (($env{'request.course.id'}) && (!$env{'form.sendmessageonly'})) {
my ($blocked,$blocktext) = &Apache::loncommon::blocking_status('boards');
- if (!$blocked && &discussion_open(undef,$symb) &&
- &Apache::lonnet::allowed('pch',
- $env{'request.course.id'}.
- ($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:''))) {
+ my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};
+ my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'};
+ my $realsymb = $symb;
+ if ($symb=~/^bulletin___/) {
+ my $filename=(&Apache::lonnet::decode_symb($symb))[2];
+ $filename=~s|^adm/wrapper/||;
+ $realsymb=&Apache::lonnet::symbread($filename);
+ }
+ if (!$blocked && &discussion_open(undef,$realsymb) &&
+ (&Apache::lonnet::allowed('pch',
+ $env{'request.course.id'}.
+ ($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:'')) ||
+ (($group ne '') && ($symb =~ m{^bulletin___\d+___adm/wrapper/adm/\Q$cdom\E/\Q$cnum\E/\d+/bulletinboard$}) && (&check_group_priv($group,'pgd') eq 'ok')))) {
$discussoptions=' '.
$contribdisc.
' '.
@@ -2641,12 +2708,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;
}
@@ -2667,9 +2734,7 @@ sub resource_output {
}
sub clear_out_html {
- my ($message,$override,$ignore_htmlarea)=@_;
- if (!$ignore_htmlarea
- && !&Apache::lonhtmlcommon::htmlareablocked()) { return $message; }
+ my ($message,$override)=@_;
# Always allow the -tag
my %html=(M=>1);
# Check if more is allowed
@@ -2680,8 +2745,8 @@ sub clear_out_html {
#
#
%html=(B=>1, I=>1, P=>1, A=>1, LI=>1, OL=>1, UL=>1, EM=>1,
- BR=>1, TT=>1, STRONG=>1, BLOCKQUOTE=>1, DIV=>1, IMG=>1,
- M=>1, ALGEBRA=>1, SUB=>1, SUP=>1, SPAN=>1,
+ BR=>1, TT=>1, STRONG=>1, BLOCKQUOTE=>1, PRE=>1, DIV=>1, IMG=>1,
+ M=>1, CHEM=>1, ALGEBRA=>1, SUB=>1, SUP=>1, SPAN=>1,
H1=>1, H2=>1, H3=>1, H4=>1, H5=>1, H6=>1,
TABLE=>1, TR=>1, TD=>1, TH=>1, TBODY=>1);
}
@@ -2768,7 +2833,7 @@ sub send_msg {
}
sub adddiscuss {
- my ($symb,$email,$anon,$attachmenturl,$subject)=@_;
+ my ($symb,$email,$anon,$attachmenturl,$subject,$group)=@_;
my $status='';
my $realsymb;
if ($symb=~/^bulletin___/) {
@@ -2776,9 +2841,16 @@ sub adddiscuss {
$filename=~s|^adm/wrapper/||;
$realsymb=&Apache::lonnet::symbread($filename);
}
+ my ($cnum,$cdom);
+ if ($env{'request.course.id'}) {
+ $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};
+ $cnum = $env{'course.'.$env{'request.course.id'}.'.num'};
+ }
if (&discussion_open(undef,$realsymb) &&
- &Apache::lonnet::allowed('pch',$env{'request.course.id'}.
- ($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:''))) {
+ (&Apache::lonnet::allowed('pch',$env{'request.course.id'}.
+ ($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:'')) ||
+ (($group ne '') && (&check_group_priv($group,'pgd') eq 'ok') &&
+ ($symb =~ m{^bulletin___\d+___adm/wrapper/adm/\Q$cdom\E/\Q$cnum\E/\d+/bulletinboard$})))) {
my %contrib=('message' => $email,
'sendername' => $env{'user.name'},
@@ -2929,7 +3001,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'},undef,1);
+ my $subject=&clear_out_html($env{'form.subject'});
$subject=~s/\n/\ /g;
$subject=&Apache::lontexconvert::msgtexconverted($subject);
@@ -2950,16 +3022,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*/>|
+ >.*\1\s*>
+ )}xs
+ );
}
sub tidy_html {
@@ -3035,12 +3108,14 @@ END
# Breadcrumbs
my $brcrum = [{'href' => '',
'text' => 'Discussion Post Attachments'}];
+ my %parms=();
+ if ($env{'form.modal'} ne 'yes') { 'bread_crumbs' => $brcrum }
+
my $start_page =
- &Apache::loncommon::start_page('Discussion Post Attachments',$js,
- {'bread_crumbs' => $brcrum,});
+ &Apache::loncommon::start_page('Discussion Post Attachments',$js,\%parms);
my $orig_subject = &unescape($env{'form.subject'});
- my $subject=&clear_out_html($orig_subject,undef,1);
+ my $subject=&clear_out_html($orig_subject);
$subject=~s/\n/\ /g;
$subject=&Apache::lontexconvert::msgtexconverted($subject);
my $timestamp=$env{'form.timestamp'};
@@ -3398,7 +3473,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','groupick','posterlist','userpick','attach','origpage','currnewattach','deloldattach','keepold','allversions','export','sendmessageonly','group','ref']);
+ ['modal','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','groupick','posterlist','userpick','attach','origpage','currnewattach','deloldattach','keepold','allversions','export','sendmessageonly','group','ref']);
my $group = $env{'form.group'};
my %attachmax = (
text => &mt('(128 KB max size)'),
@@ -3449,10 +3524,11 @@ sub handler {
# Breadcrumbs
my $brcrum = [{'href' => '',
'text' => 'Discussion Post Versions'}];
+
+ my %parms=();
+ if ($env{'form.modal'} ne 'yes') { 'bread_crumbs' => $brcrum }
- $r->print(&Apache::loncommon::start_page('Discussion Post Versions',undef,
- {'bread_crumbs' => $brcrum,})
- );
+ $r->print(&Apache::loncommon::start_page('Discussion Post Versions',undef,\%parms));
my $crs='/'.$env{'request.course.id'};
if ($env{'request.course.sec'}) {
@@ -3556,10 +3632,6 @@ sub handler {
$r->send_http_header;
my $logo=&Apache::loncommon::lonhttpdurl('/adm/lonIcons/lonlogos.gif');
my %onload;
- if ($env{'environment.remote'} ne 'off') {
- $onload{'onload'} =
- "if (window.name!='loncapaclient') { this.document.reldt.submit(); self.window.close(); }";
- }
my $start_page=
&Apache::loncommon::start_page('New posts marked as read',undef,
@@ -3748,7 +3820,7 @@ ENDREDIR
my $mode='board';
my $status='OPEN';
my $previous=$env{'form.previous'};
- if ($feedurl =~ /\.(problem|exam|quiz|assess|survey|form|library|task)$/) {
+ if ($feedurl =~ /$LONCAPA::assess_re/) {
$mode='problem';
$status=$Apache::inputtags::status[-1];
}
@@ -3788,7 +3860,7 @@ ENDREDIR
&dewrapper(\$feedurl);
}
my $goahead=1;
- if ($feedurl=~/\.(problem|exam|quiz|assess|survey|form|task)$/) {
+ if ($feedurl=~/$LONCAPA::assess_re/) {
unless ($symb) { $goahead=0; }
}
if (!$goahead) {
@@ -3826,7 +3898,7 @@ ENDREDIR
return OK;
}
}
- my $options=&screen_header($feedurl,$symb);
+ my $options=&screen_header($feedurl,$symb,$group);
if ($options) {
&mail_screen($r,$feedurl,$options,$symb,$attachmax{'text'});
} else {
@@ -3882,7 +3954,11 @@ ENDREDIR
}
}
# Filter HTML out of message (could be nasty)
- my $message=&clear_out_html($env{'form.comment'});
+ my $override;
+ if ($env{'form.discuss'} =~ /^(?:author|question|course|policy)$/) {
+ $override = 1;
+ }
+ my $message=&clear_out_html($env{'form.comment'},$override);
# Assemble email
my ($email,$citations)=&assemble_email($message,$prevattempts,
@@ -3892,8 +3968,7 @@ ENDREDIR
my ($typestyle,%to) = &Apache::lonmsg::decide_receiver($feedurl);
# Actually send mail
- my ($status,$numsent)=&send_msg(&clear_out_html($env{'form.subject'},
- undef,1),
+ my ($status,$numsent)=&send_msg(&clear_out_html($env{'form.subject'}),
$feedurl,$email,$citations,
$attachmenturl,$usersymb,%to);
@@ -3902,10 +3977,10 @@ ENDREDIR
if ( ($env{'form.discuss'} ne ''
&& $env{'form.discuss'} !~ /^(?:author|question|course|policy)/)
|| $env{'form.anondiscuss'} ne '') {
- my $subject = &clear_out_html($env{'form.subject'},undef,1);
+ my $subject = &clear_out_html($env{'form.subject'});
my $anonmode=($env{'form.discuss'} eq 'anon' || $env{'form.anondiscuss'} );
$typestyle.=&adddiscuss($symb,$message,$anonmode,$attachmenturl,
- $subject);
+ $subject,$group);
$numpost++;
}
@@ -3913,7 +3988,7 @@ ENDREDIR
my $blog='';
if ($env{'form.blog'}) {
- my $subject = &clear_out_html($env{'form.subject'},undef,1);
+ my $subject = &clear_out_html($env{'form.subject'});
$status.=&Apache::lonrss::addentry($env{'user.name'},
$env{'user.domain'},
'CourseBlog_'.$env{'request.course.id'},