'Note: in anonymous discussion, your name is visible only to course faculty',
@@ -838,6 +837,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 = (<
@@ -865,7 +867,7 @@ ENDDISCUSS
}
my $blockblog = &Apache::loncommon::blocking_status('blogs');
if (!$blockblog) {
- $postingform .= &add_blog_checkbox();
+ $postingform .= &add_blog_checkbox($crstype);
}
$postingform .= "\n";
if ($outputtarget ne 'tex') {
@@ -1482,7 +1484,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 +1699,6 @@ END
END
}
$r->print(<
$quote
$lt{'myqu'}
@@ -2014,7 +2014,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 +2084,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 = <
@@ -2166,10 +2173,11 @@ $start_page
@@ -2569,6 +2577,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 +2613,13 @@ sub screen_header {
if (&feedback_available(0,1)) {
$msgoptions.=
'';
}
if (&feedback_available(0,0,1)) {
$msgoptions.=
'';
}
}
@@ -2606,25 +2630,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='
'
.$discussoptions;
}
return $msgoptions.$discussoptions;
@@ -2676,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
@@ -2922,7 +2949,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;
@@ -3257,7 +3296,8 @@ sub construct_attachmenturl {
}
sub add_blog_checkbox {
- my ($checkstatus);
+ my ($crstype) = @_;
+ my $checkstatus;
if ($env{'form.blog'}) {
$checkstatus = 'checked="checked"';
}
@@ -3271,8 +3311,13 @@ function setblogvalue() {
}
}
- '."\n";
+ '."\n";
return $output;
}
@@ -3296,8 +3341,9 @@ sub has_discussion {
}
sub sort_filter_names {
- my ($sort_types,$role_types,$status_types) = @_;
- %{$sort_types} = (
+ my ($sort_types,$role_types,$status_types,$crstype) = @_;
+ if (ref($sort_types) eq 'HASH') {
+ %{$sort_types} = (
ascdate => 'Date order - oldest first',
descdate => 'Date order - newest first',
thread => 'Threaded',
@@ -3305,22 +3351,28 @@ sub sort_filter_names {
username => 'By domain and username',
lastfirst => 'By last name, first name'
);
- %{$role_types} = (
- all => 'All roles',
- st => 'Students',
- cc => 'Course Coordinators',
- in => 'Instructors',
- ta => 'TAs',
- ep => 'Exam proctors',
- ad => 'Administrators',
- cr => 'Custom roles'
- );
- %{$status_types} = (
+ }
+ my @courseroles = qw(st in ta ep ad);
+ if ($crstype eq 'Community') {
+ push(@courseroles,'co');
+ } else {
+ push(@courseroles,'cc');
+ }
+ if (ref($role_types) eq 'HASH') {
+ foreach my $role (@courseroles) {
+ $role_types->{$role} = &Apache::lonnet::plaintext($role,$crstype);
+ }
+ $role_types->{'all'} = 'All roles';
+ $role_types->{'cr'} = 'Custom role';
+ }
+ if (ref($status_types) eq 'HASH') {
+ %{$status_types} = (
all => 'Roles of any status',
Active => 'Only active roles',
Expired => 'Only past roles',
Future => 'Only future roles',
);
+ }
}
sub handler {
@@ -3854,7 +3906,11 @@ ENDREDIR
$env{'user.domain'},
'CourseBlog_'.$env{'request.course.id'},
$subject,$message,$feedurl,'public');
- $blog=' '.&mt('Added to my course blog').' ';
+ if (&Apache::loncommon::course_type() eq 'Community') {
+ $blog=' '.&mt('Added to my community blog').' ';
+ } else {
+ $blog=' '.&mt('Added to my course blog').' ';
+ }
}
# Receipt screen and redirect back to where came from
500 Internal Server Error
Internal Server Error
The server encountered an internal error or
misconfiguration and was unable to complete
your request.
Please contact the server administrator at
root@localhost to inform them of the time this error occurred,
and the actions you performed just before this error.
More information about this error may be available
in the server error log.