-
-
@@ -2201,12 +2204,16 @@ sub redirect_back {
}
$feedurl=&Apache::lonenc::check_encrypt($feedurl);
my $logo=&Apache::loncommon::lonhttpdurl('/adm/lonIcons/lonlogos.gif');
- my $onload = 'onLoad=\'if (window.name!="loncapaclient") { this.document.reldt.submit(); self.window.close(); }\'';
+ 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,
{'redirect' => [2,$feedurl],
'only_body' => 1,
- 'add_entries' => $onload});
+ 'add_entries' => \%onload});
my $end_page = &Apache::loncommon::end_page();
$r->print(< 1,
- 'add_entries' => 'onLoad=\'if (window.name!="loncapaclient") { self.window.close(); }\'');
+ 'bgcolor' => '#FFFFFF',
+ 'add_entries' => \%onload,);
if ($feedurl !~ m{^/adm/feedback}) {
$body_options{'rediect'} = [2,$feedurl];
@@ -2247,8 +2261,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,15 +2297,14 @@ 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'}.
($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:''))) {
- $discussoptions=' '.
+ $discussoptions=' '.
&mt('Contribution to course discussion of resource');
- $discussoptions.=' '.
+ $discussoptions.=' '.
&mt('Anonymous contribution to course discussion of resource').
' ('.&mt('name only visible to course faculty').') '.
''.&mt('Change Screenname').' ';
@@ -2320,8 +2332,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 +2350,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/(\\s*(\w+)[^\<\>]*)\>/
+ $message =~ s/(\\s*(\w*)[^\<\>]*)\>/
{($html{uc($2)}&&(length($1)<1000))?"$1\>":"$1\>"}/ge;
return $message;
}
@@ -2608,7 +2621,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 +2675,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'};
@@ -2690,6 +2703,7 @@ END
&Apache::loncommon::end_page();
$r->print(<
@@ -2729,7 +2743,6 @@ END
-
END
@@ -2795,7 +2808,6 @@ this.form.submit();" />
-
ENDATTACH
@@ -2975,7 +2987,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];
@@ -3107,12 +3119,17 @@ sub handler {
&Apache::loncommon::content_type($r,'text/html');
$r->send_http_header;
my $logo=&Apache::loncommon::lonhttpdurl('/adm/lonIcons/lonlogos.gif');
- my $onload = 'onLoad=\'if (window.name!="loncapaclient") { this.document.reldt.submit(); self.window.close(); }\'';
+ 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,
{'redirect' => [2,$feedurl],
'only_body' => 1,
- 'add_entries' => $onload});
+ 'add_entries' => \%onload});
my $end_page = &Apache::loncommon::end_page();
$r->print (<send_http_header;
- &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['subject','comment','addnewattach','delnewattach','timestamp','numoldver','idx','anondiscuss','discuss','blog']);
+ &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['subject','comment','addnewattach','delnewattach','timestamp','numoldver','idx','discuss','blog']);
my (@currnewattach,@currdelold,@keepold);
&process_attachments(\@currnewattach,\@currdelold,\@keepold);
if (exists($env{'form.addnewattach.filename'})) {
@@ -3280,8 +3297,11 @@ ENDREDIR
$status=$Apache::inputtags::status[-1];
}
my $discussion = &list_discussion($mode,$status,$symb);
- my $bodytag=&Apache::loncommon::bodytag('Resource Feedback and Discussion');
- $r->print($bodytag.$discussion);
+ my $start_page =
+ &Apache::loncommon::start_page('Resource Feedback and Discussion');
+ my $end_page =
+ &Apache::loncommon::end_page();
+ $r->print($start_page.$discussion.$end_page);
return OK;
} else {
# ------------------------------------------------------------- Normal feedback
@@ -3402,15 +3422,17 @@ 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 $anonmode=(defined($env{'form.anondiscuss'}));
+ if ($env{'form.discuss'}) {
+ my $subject = &clear_out_html($env{'form.subject'},undef,1);
+ my $anonmode=($env{'form.discuss'} eq 'anon');
$typestyle.=&adddiscuss($symb,$message,$anonmode,$attachmenturl,
$subject);
$numpost++;
@@ -3420,7 +3442,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'},