@@ -2194,7 +2200,7 @@ $start_page
-
+
END
if (exists($env{'form.group'})) {
$r->print('');
@@ -2317,7 +2323,7 @@ END
-
+
$end_page
END
@@ -2420,7 +2426,7 @@ sub redirect_back {
if ($previous > 0) {
$qrystr = 'previous='.$previous;
if ($feedurl =~ /\?register=1/) {
- $feedurl .= '&'.$qrystr;
+ $feedurl .= '&'.$qrystr;
} else {
$feedurl .= '?'.$qrystr;
}
@@ -2429,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 ='';
}
}
@@ -2623,11 +2629,10 @@ 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) {
@@ -2673,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+)[^\>\<]*)/
@@ -2694,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
@@ -2940,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)=@_;
@@ -2973,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
}
@@ -2999,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);
@@ -3028,7 +3065,7 @@ $toolarge
|