');
+ $r->print('
'.$topic.'
');
}
sub print_end_template {
@@ -130,9 +127,9 @@ sub print_end_template {
sub print_editbox_template {
my ($r,$content,$field) = @_;
$r->print('
');
+ &HTML::Entities::encode($content,'"&<>').
+ '
'."\n");
+ &print_saveall_template($r);
}
sub print_textarea_template {
@@ -156,20 +153,20 @@ sub print_template_fields {
foreach my $field (sort(keys(%fields))) {
my $message = $data{$field} if (($data{$field}=~/\w/) || ($allowed));
- if ((%custom_handlers) && ($custom_handlers{$field})) {
+ if ((%custom_handlers) && ($custom_handlers{$field})) {
$custom_handlers{$field}->($r, $field, $message, $group, $data_ref, $fields_ref, $target, $allowed);
} else {
if (($data{$field}=~/\w/) || ($allowed)) {
- if (!&Apache::lonfeedback::contains_block_html($message)) {
- &Apache::lonfeedback::newline_to_br(\$message);
- } else {
- $message = &Apache::lonfeedback::tidy_html($message);
- }
- $message=&Apache::lonhtmlcommon::raw_href_to_link($message);
- if ($allowed) {
- $message=&Apache::lonspeller::markeduptext($message);
- }
- $message=&Apache::lontexconvert::msgtexconverted($message);
+ if (!&Apache::lonfeedback::contains_block_html($message)) {
+ &Apache::lonfeedback::newline_to_br(\$message);
+ } else {
+ $message = &Apache::lonfeedback::tidy_html($message);
+ }
+ $message=&Apache::lonhtmlcommon::raw_href_to_link($message);
+ if ($allowed) {
+ $message=&Apache::lonspeller::markeduptext($message);
+ }
+ $message=&Apache::lontexconvert::msgtexconverted($message);
if ($target ne 'tex') {
#output of syllabusfields will be generated here.
&Apache::lontemplate::print_start_template($r,$fields{$field},'LC_Box');
@@ -178,14 +175,18 @@ sub print_template_fields {
$r->print("
");
&Apache::lontemplate::print_textarea_template($r, $data{$field},
$field, $default_rich_text);
- &Apache::lontemplate::print_saveall_template($r);
+ &print_saveall_template($r);
$r->print("
");
}
&Apache::lontemplate::print_end_template($r);
} else {
my $safeinit;
- $r->print(&Apache::lonxml::xmlparse($r,'tex','
'.$fields{$field}.'
'));
- $r->print(&Apache::lonxml::xmlparse($r,'tex',$message));
+ if ($fields{$field}=~/\w/) {
+ $r->print(&Apache::lonxml::xmlparse($r,'tex','
'.$fields{$field}.'
'));
+ } else {
+ $r->print(&Apache::lonxml::xmlparse($r,'tex','
'));
+ }
+ $r->print(&Apache::lonxml::xmlparse($r,'tex',$message));
}
push(@html_ids,$field);
}