'.
- '';
+ ''.
+ '';
my $escsymb=&escape($ressymb);
if ($visible>2) {
- $discussion .= ' | '.
- ' '.
''.&mt('Chronological View').'
'.&mt('Sorting/Filtering options').''.(' ' x2);
- } else {
- $discussion .= ' | | ';
@@ -816,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 .= ' | ';
}
@@ -829,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',
@@ -838,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 = (<
@@ -846,7 +847,7 @@ sub postingform_display {
$lt{'note'}
$lt{'title'}:
-
+
ENDDISCUSS
if ($env{'form.origpage'}) {
$postingform .= '\n";
if ($outputtarget ne 'tex') {
@@ -1055,7 +1056,7 @@ sub build_posting_display {
$sender.=' '.&mt('Edit').'';
@@ -1073,7 +1074,7 @@ sub build_posting_display {
$sender.=' '.&mt('Make Visible').'';
}
@@ -1081,7 +1082,7 @@ sub build_posting_display {
$sender.=' '.&mt('Hide').'';
@@ -1122,7 +1123,7 @@ sub build_posting_display {
$sender.=' '.&mt('Reply').'';
@@ -1133,7 +1134,7 @@ sub build_posting_display {
$sender.=' '.&mt('Reply').'';
}
@@ -1243,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.');
@@ -1482,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',
@@ -1698,7 +1698,6 @@ END
END
}
$r->print(<
$quote
$lt{'myqu'}
@@ -1708,7 +1707,7 @@ $latexHelp
$lt{'title'}:
-
END
@@ -1745,7 +1744,7 @@ END
$r->print(<
-
+
END
@@ -1952,9 +1951,9 @@ END
$r->print(<$lt{'disa'}
$lt{$discdisp} |
-
+ |
-
+
|
END
$r->print(&Apache::loncommon::end_data_table_row());
@@ -1969,7 +1968,7 @@ END
$r->print(<$lt{'dotm'}
$lt{$disctogg} |
- |
+ |
END
my $save = &mt('Save');
$r->print(&Apache::loncommon::end_data_table_row());
@@ -1983,7 +1982,7 @@ END
-
+
END
if (exists($env{'form.group'})) {
$r->print('');
@@ -2014,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;
@@ -2077,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 = <
@@ -2129,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'} |
@@ -2166,10 +2172,11 @@ $start_page
|
@@ -2193,7 +2200,7 @@ $start_page
-
+
END
if (exists($env{'form.group'})) {
$r->print('');
@@ -2316,7 +2323,7 @@ END
-
+
$end_page
END
@@ -2419,7 +2426,7 @@ sub redirect_back {
if ($previous > 0) {
$qrystr = 'previous='.$previous;
if ($feedurl =~ /\?register=1/) {
- $feedurl .= '&'.$qrystr;
+ $feedurl .= '&'.$qrystr;
} else {
$feedurl .= '?'.$qrystr;
}
@@ -2428,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 ='';
}
}
@@ -2569,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'})) {
@@ -2589,13 +2612,13 @@ sub screen_header {
if (&feedback_available(0,1)) {
$msgoptions.=
'';
}
if (&feedback_available(0,0,1)) {
$msgoptions.=
'';
}
}
@@ -2606,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;
@@ -2676,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
@@ -2922,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;
@@ -2955,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
}
@@ -3014,7 +3052,7 @@ $toolarge
|