@@ -2156,10 +2172,11 @@ $start_page
|
@@ -2183,7 +2200,7 @@ $start_page
-
+
END
if (exists($env{'form.group'})) {
$r->print('');
@@ -2306,7 +2323,7 @@ END
-
+
$end_page
END
@@ -2409,7 +2426,7 @@ sub redirect_back {
if ($previous > 0) {
$qrystr = 'previous='.$previous;
if ($feedurl =~ /\?register=1/) {
- $feedurl .= '&'.$qrystr;
+ $feedurl .= '&'.$qrystr;
} else {
$feedurl .= '?'.$qrystr;
}
@@ -2418,18 +2435,18 @@ sub redirect_back {
if (defined($sort)) {
my $sortqry = 'sortposts='.$sort;
if (($feedurl =~ /\?register=1/) || ($feedurl =~ /\?previous=/)) {
- $feedurl .= '&'.$sortqry;
+ $feedurl .= '&'.$sortqry;
} else {
$feedurl .= '?'.$sortqry;
}
$sorttag = '';
if (defined($numpicks)) {
my $userpickqry = 'totposters='.$numpicks;
- $feedurl .= '&'.$userpickqry;
+ $feedurl .= '&'.$userpickqry;
$userpicktag = '';
} else {
if (ref($sectionpick) eq 'ARRAY') {
- $feedurl .= '§ionpick=';
+ $feedurl .= '§ionpick=';
$sectag .= '';
} else {
- $feedurl .= '§ionpick='.$sectionpick;
+ $feedurl .= '§ionpick='.$sectionpick;
$sectag = '';
}
if (ref($grouppick) eq 'ARRAY') {
- $feedurl .= '&grouppick=';
+ $feedurl .= '&grouppick=';
$sectag .= '';
} else {
- $feedurl .= '&grouppick='.$grouppick;
+ $feedurl .= '&grouppick='.$grouppick;
$grptag = '';
}
if (ref($rolefilter) eq 'ARRAY') {
- $feedurl .= '&rolefilter=';
+ $feedurl .= '&rolefilter=';
$roletag .= '';
} else {
- $feedurl .= '&rolefilter='.$rolefilter;
+ $feedurl .= '&rolefilter='.$rolefilter;
$roletag = '';
}
- $feedurl .= '&statusfilter='.$statusfilter;
+ $feedurl .= '&statusfilter='.$statusfilter;
$statustag ='';
}
}
@@ -2559,6 +2576,22 @@ ENDNOREDIRTWO
sub screen_header {
my ($feedurl,$symb) = @_;
+ 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');
+ my $anoncontrib = &mt('Anonymous contribution to course discussion of resource');
+ my $namevis = &mt('name only visible to course faculty');
+ my $crstype;
+ if ($env{'request.course.id'}) {
+ $crstype = &Apache::loncommon::course_type();
+ if ($crstype eq 'Community') {
+ $crscontent = &mt('Question/Comment/Feedback about community content');
+ $crspolicy = &mt('Question/Comment/Feedback about community policy');
+ $contribdisc = &mt('Contribution to community discussion of resource');
+ $anoncontrib = &mt('Anonymous contribution to community discussion of resource');
+ $namevis = &mt('name only visible to community facilitators');
+ }
+ }
my $msgoptions='';
my $discussoptions='';
unless (($env{'form.replydisc'}) || ($env{'form.editdisc'})) {
@@ -2579,13 +2612,13 @@ sub screen_header {
if (&feedback_available(0,1)) {
$msgoptions.=
'';
}
if (&feedback_available(0,0,1)) {
$msgoptions.=
'';
}
}
@@ -2596,25 +2629,25 @@ sub screen_header {
$env{'request.course.id'}.
($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:''))) {
$discussoptions='
'.
+ $contribdisc.
+ '
'.
''.&mt('Change Screenname').'';
my $blockblog = &Apache::loncommon::blocking_status('blogs');
if (!$blockblog) {
- $discussoptions.= &add_blog_checkbox();
+ $discussoptions.= &add_blog_checkbox($crstype);
}
}
}
if ($msgoptions) {
$msgoptions=''
- .' '.&mt('Send Feedback').'
'
+ .' '.&mt('Send Feedback').''.&Apache::lonhtmlcommon::coursepreflink(&mt('Feedback Settings'),'feedback').'
'
.$msgoptions;
}
if ($discussoptions) {
$discussoptions=''
- .' '.&mt('Discussion Contributions').'
'
+ .' '.&mt('Discussion Contributions').''.&Apache::lonhtmlcommon::coursepreflink(&mt('Discussion Settings'),'discussion').'
'
.$discussoptions;
}
return $msgoptions.$discussoptions;
@@ -2645,11 +2678,12 @@ sub clear_out_html {
($override)) {
# allows
#
- #
+ # | |
%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,
- H1=>1, H2=>1, H3=>1, H4=>1, H5=>1);
+ H1=>1, H2=>1, H3=>1, H4=>1, H5=>1, H6=>1,
+ TABLE=>1, TR=>1, TD=>1, TH=>1, TBODY=>1);
}
# Do the substitution of everything that is not explicitly allowed
$message =~ s/\<(\/?\s*(\w+)[^\>\<]*)/
@@ -2666,6 +2700,9 @@ sub assemble_email {
'orig' => 'Original screen output (if applicable)',
'corr' => 'Correct Answer(s) (if applicable)',
);
+ if (&Apache::loncommon::course_type() eq 'Community') {
+ $lt{'prev'} = &mt('Previous attempts of member (if applicable)');
+ }
my $email=<<"ENDEMAIL";
$message
ENDEMAIL
@@ -2912,6 +2949,30 @@ 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 );
+}
+
+sub tidy_html {
+ my ($message)=@_;
+# my $tidy = HTML::Tidy::libXML->new();
+# my $xhtml = $tidy->clean($message, 'utf-8', 1);
+# $xhtml =~ m/(.*)<\/body>/is;
+# my $clean = $1;
+# # remove any empty block-level tags
+# $clean =~ s/<(table|p|div|tbody|blockquote|m|pre|algebra|center|ol|ul|span|h1|h2|h3|h4|h5|h6)\s*\/>//i;
+# $message=$clean;
+ return $message;
+}
sub newline_to_br {
my ($message)=@_;
@@ -2945,7 +3006,7 @@ sub generate_preview_button {
+onclick="if (typeof(document.$formname.onsubmit)=='function') {document.$formname.onsubmit();};this.form.comment.value=document.$formname.$fieldname.value;this.form.subject.value=document.$formname.subject.value;this.form.submit();" />
ENDPREVIEW
}
@@ -2971,8 +3032,12 @@ sub modify_attachments {
END
+ # Breadcrumbs
+ my $brcrum = [{'href' => '',
+ 'text' => 'Discussion Post Attachments'}];
my $start_page =
- &Apache::loncommon::start_page('Discussion Post Attachments',$js);
+ &Apache::loncommon::start_page('Discussion Post Attachments',$js,
+ {'bread_crumbs' => $brcrum,});
my $orig_subject = &unescape($env{'form.subject'});
my $subject=&clear_out_html($orig_subject,undef,1);
@@ -3000,7 +3065,7 @@ $toolarge