'.
''.&mt('Show all posts').' '.&mt('to display').' '.
@@ -568,7 +568,7 @@ imscp_v1p1.xsd http://www.imsglobal.org/
@@ -600,7 +600,7 @@ END
my %sort_types = ();
my %role_types = ();
my %status_types = ();
- &sort_filter_names(\%sort_types,\%role_types,\%status_types);
+ &sort_filter_names(\%sort_types,\%role_types,\%status_types,$crstype);
$discussion .= ' | '.&mt('Sorted by').': '.$sort_types{$sortposts}.' ';
if (defined($env{'form.totposters'})) {
@@ -645,7 +645,7 @@ END
$discussion.=' | '.
''."\n".
''."\n".
+ ' onclick="this.form.submit();" />'."\n".
' | ';
}
$discussion .= (<2) {
$discussion .= ''.&mt('Threaded View').' '.
''.&mt('Chronological View').'
'.&mt('Sorting/Filtering options').''.(' ' x2);
}
$discussion .=''.&mt('Export').'? ';
@@ -814,7 +814,7 @@ sub action_links_bar {
&mt('Preferences on what is marked as NEW').
'
'.&mt('Mark NEW posts no longer new').'';
+ $discussion .= '">'.&mt('Mark NEW posts no longer new').'';
} else {
$discussion .= ' | ';
}
@@ -827,7 +827,7 @@ sub action_links_bar {
sub postingform_display {
my ($mode,$ressymb,$now,$subject,$comment,$outputtarget,$attachnum,
- $currnewattach,$currdelold,$group) = @_;
+ $currnewattach,$currdelold,$group,$crstype) = @_;
my $newattachmsg;
my %lt = &Apache::lonlocal::texthash(
'note' => 'Note: in anonymous discussion, your name is visible only to course faculty',
@@ -836,6 +836,9 @@ sub postingform_display {
'poan' => 'Post Anonymous Discussion',
'newa' => 'New attachments',
);
+ if ($crstype eq 'Community') {
+ $lt{'note'} = &mt('Note: in anonymous discussion, your name is visible only to community facilitators');
+ }
my $postingform = (<
@@ -844,7 +847,7 @@ sub postingform_display {
$lt{'note'}
$lt{'title'}:
-
+
ENDDISCUSS
if ($env{'form.origpage'}) {
$postingform .= '\n";
if ($outputtarget ne 'tex') {
@@ -1053,7 +1056,7 @@ sub build_posting_display {
$sender.=' '.&mt('Edit').'';
@@ -1071,7 +1074,7 @@ sub build_posting_display {
$sender.=' '.&mt('Make Visible').'';
}
@@ -1079,7 +1082,7 @@ sub build_posting_display {
$sender.=' '.&mt('Hide').'';
@@ -1120,7 +1123,7 @@ sub build_posting_display {
$sender.=' '.&mt('Reply').'';
@@ -1131,7 +1134,7 @@ sub build_posting_display {
$sender.=' '.&mt('Reply').'';
}
@@ -1241,24 +1244,24 @@ sub build_posting_display {
if ($prevread > 0 && $prevread <= $posttime) {
$$newitem{$idx} = 1;
$$discussionitems[$idx] .= '
-
+
'.&mt('NEW').' | ';
} else {
$$newitem{$idx} = 0;
$$discussionitems[$idx] .= '
-
+
| ';
}
$$discussionitems[$idx] .= ' '.
''.$subject.' '.
- $sender.' '.$vgrlink.' ('.
+ ''.$sender.' '.$vgrlink.' ('.
&Apache::lonlocal::locallocaltime($posttime).') | ';
if ($$dischash{$toggkey}) {
$$discussionitems[$idx].=' '.
$ctlink.' | ';
}
$$discussionitems[$idx].= '
'.
- $message.'
';
+ $message.'';
if ($contrib{$idx.':history'}) {
my @postversions = ();
$$discussionitems[$idx] .= &mt('This post has been edited by the author.');
@@ -1480,7 +1483,6 @@ sub mail_screen {
}
my %lt = &Apache::lonlocal::texthash(
- 'plch' => 'Please check at least one of the following feedback types:',
'myqu' => 'My question/comment/feedback:',
'title' => 'Title',
'reta' => 'Retained attachments',
@@ -1696,7 +1698,6 @@ END
END
}
$r->print(<
$quote
$lt{'myqu'}
@@ -1706,7 +1707,7 @@ $latexHelp
$lt{'title'}:
-
END
@@ -1743,7 +1744,7 @@ END
$r->print(<
-
+
END
@@ -1950,9 +1951,9 @@ END
$r->print(<$lt{'disa'}
$lt{$discdisp} |
-
+ |
-
+
|
END
$r->print(&Apache::loncommon::end_data_table_row());
@@ -1967,7 +1968,7 @@ END
$r->print(<$lt{'dotm'}
$lt{$disctogg} |
- |
+ |
END
my $save = &mt('Save');
$r->print(&Apache::loncommon::end_data_table_row());
@@ -1981,7 +1982,7 @@ END
-
+
END
if (exists($env{'form.group'})) {
$r->print('');
@@ -2012,7 +2013,14 @@ sub print_sortfilter_options {
my $group_sel = '';
my $numgroupvis = 5;
my %sectioncount = &Apache::loncommon::get_sections();
-
+ my @courseroles = qw(st ad ep ta in);
+ my $crstype = &Apache::loncommon::course_type();
+ my $ccrole = 'cc';
+ if ($crstype eq 'Community') {
+ $ccrole = 'co';
+ }
+ push(@courseroles,$ccrole);
+
if ($env{'request.course.sec'} !~ /^\s*$/) { #Restrict section choice to current section
@sections = ('all',$env{'request.course.sec'});
$numvisible = 2;
@@ -2075,7 +2083,7 @@ sub print_sortfilter_options {
my %sort_types = ();
my %role_types = ();
my %status_types = ();
- &sort_filter_names(\%sort_types,\%role_types,\%status_types);
+ &sort_filter_names(\%sort_types,\%role_types,\%status_types,$crstype);
my $js = <
@@ -2127,17 +2135,17 @@ $start_page
- $lt{'soor'} |
- |
- $lt{'sprs'} |
- |
- $lt{'spur'} |
- |
- $lt{'spse'} |
- |
- $lt{'spgr'} |
- |
- $lt{'psub'} |
+ $lt{'soor'} |
+ |
+ $lt{'sprs'} |
+ |
+ $lt{'spur'} |
+ |
+ $lt{'spse'} |
+ |
+ $lt{'spgr'} |
+ |
+ $lt{'psub'} |
@@ -2164,10 +2172,11 @@ $start_page
|
@@ -2191,7 +2200,7 @@ $start_page
-
+
END
if (exists($env{'form.group'})) {
$r->print('');
@@ -2314,7 +2323,7 @@ END
-
+
$end_page
END
@@ -2417,7 +2426,7 @@ sub redirect_back {
if ($previous > 0) {
$qrystr = 'previous='.$previous;
if ($feedurl =~ /\?register=1/) {
- $feedurl .= '&'.$qrystr;
+ $feedurl .= '&'.$qrystr;
} else {
$feedurl .= '?'.$qrystr;
}
@@ -2426,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 ='';
}
}
@@ -2567,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'})) {
@@ -2587,13 +2612,13 @@ sub screen_header {
if (&feedback_available(0,1)) {
$msgoptions.=
'';
}
if (&feedback_available(0,0,1)) {
$msgoptions.=
'';
}
}
@@ -2604,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;
@@ -2674,6 +2699,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
@@ -2920,7 +2948,19 @@ 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]*>
+ )/x );
+}
+
sub newline_to_br {
my ($message)=@_;
my $newmessage;
@@ -2953,7 +2993,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
}
@@ -3012,7 +3052,7 @@ $toolarge