';
}
@@ -1701,16 +1750,17 @@ END
$r->print(<
$quote
-
$lt{'myqu'}
+
$lt{'myqu'}
+$textareaheader
+
$latexHelp
$lt{'title'}:
-
-
END
if ( ($env{'form.editdisc'}) || ($env{'form.replydisc'}) ) {
if ($env{'form.origpage'}) {
@@ -1732,6 +1782,7 @@ END
}
} else {
$r->print(<
$lt{'atta'} $attachmaxtext:
END
@@ -1786,7 +1837,6 @@ END
}
}
$r->print(&generate_preview_button().
- &Apache::lonhtmlcommon::htmlareaselectactive('comment').
&Apache::loncommon::end_page());
}
@@ -2396,7 +2446,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,
@@ -2509,10 +2559,6 @@ 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 $start_page=
&Apache::loncommon::start_page('Feedback sent',undef,
{'redirect' => [0,$feedurl],
@@ -2543,13 +2589,9 @@ 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') {
- $onload{'onload'} =
- "if (window.name!='loncapaclient') { self.window.close(); }";
- }
my %body_options = ('only_body' => 1,
'bgcolor' => '#FFFFFF',
@@ -2642,12 +2684,12 @@ sub screen_header {
}
}
if ($msgoptions) {
- $msgoptions='
'
.$discussoptions;
}
@@ -2668,9 +2710,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
@@ -2681,8 +2721,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);
}
@@ -2930,7 +2970,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);
@@ -2951,16 +2991,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 {
@@ -3041,7 +3082,7 @@ END
{'bread_crumbs' => $brcrum,});
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'};
@@ -3557,10 +3598,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,
@@ -3883,7 +3920,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,
@@ -3893,8 +3934,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);
@@ -3903,7 +3943,7 @@ 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);
@@ -3914,7 +3954,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'},