@@ -2157,10 +2173,11 @@ $start_page
$role_types{'all'}
$role_types{'st'}
- $role_types{'cc'}
+ $role_types{$ccrole}
$role_types{'in'}
$role_types{'ta'}
$role_types{'ep'}
+ $role_types{'ad'}
$role_types{'cr'}
@@ -2477,7 +2494,8 @@ sub redirect_back {
}
my $grouptag;
if ($group ne '') {
- $grouptag = ' '; my $refarg;
+ $grouptag = ' ';
+ my $refarg;
if (exists($env{'form.ref'})) {
$refarg = '&ref='.$env{'form.ref'};
$grouptag .= ' ';
@@ -2559,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'})) {
@@ -2579,13 +2613,13 @@ sub screen_header {
if (&feedback_available(0,1)) {
$msgoptions.=
' '.
- ($optionhash{'comment'}?$optionhash{'comment'}:&mt('Question/Comment/Feedback about course content')).
+ ($optionhash{'comment'}?$optionhash{'comment'}:$crscontent).
'
';
}
if (&feedback_available(0,0,1)) {
$msgoptions.=
' '.
- ($optionhash{'policy'}?$optionhash{'policy'}:&mt('Question/Comment/Feedback about course policy')).
+ ($optionhash{'policy'}?$optionhash{'policy'}:$crspolicy).
'
';
}
}
@@ -2596,20 +2630,27 @@ sub screen_header {
$env{'request.course.id'}.
($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:''))) {
$discussoptions=' '.
- &mt('Contribution to course discussion of resource');
- $discussoptions.=' '.
- &mt('Anonymous contribution to course discussion of resource').
- ' ('.&mt('name only visible to course faculty').') '.
+ $contribdisc.
+ ' '.
+ $anoncontrib.
+ ' ('.$namevis.') '.
''.&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('Sending Messages').' '.$msgoptions; }
+ if ($msgoptions) {
+ $msgoptions=' '
+ .' '.&mt('Send Feedback').''.&Apache::lonhtmlcommon::coursepreflink(&mt('Feedback Settings'),'feedback').'
'
+ .$msgoptions;
+ }
if ($discussoptions) {
- $discussoptions=' '.&mt('Discussion Contributions').' '.$discussoptions; }
+ $discussoptions=' '
+ .' '.&mt('Discussion Contributions').''.&Apache::lonhtmlcommon::coursepreflink(&mt('Discussion Settings'),'discussion').'
'
+ .$discussoptions;
+ }
return $msgoptions.$discussoptions;
}
@@ -2659,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
@@ -2905,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;
@@ -2935,7 +2991,7 @@ sub generate_preview_button {
return(<
$end_page
END
@@ -3106,8 +3166,8 @@ this.form.submit();" />
-
-
+
+
ENDATTACH
if (defined($deloldattach)) {
@@ -3236,7 +3296,8 @@ sub construct_attachmenturl {
}
sub add_blog_checkbox {
- my ($checkstatus);
+ my ($crstype) = @_;
+ my $checkstatus;
if ($env{'form.blog'}) {
$checkstatus = 'checked="checked"';
}
@@ -3250,8 +3311,13 @@ function setblogvalue() {
}
}
- '.
-&mt('Add to my public course blog').' '."\n";
+ ';
+ if ($crstype eq 'Community') {
+ $output .= &mt('Add to my public community blog');
+ } else {
+ $output .= &mt('Add to my public course blog');
+ }
+ $output .= ' '."\n";
return $output;
}
@@ -3275,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',
@@ -3284,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 {
@@ -3361,7 +3434,13 @@ sub handler {
&Apache::loncommon::no_cache($r);
$r->send_http_header;
- $r->print(&Apache::loncommon::start_page('Discussion Post Versions'));
+ # Breadcrumbs
+ my $brcrum = [{'href' => '',
+ 'text' => 'Discussion Post Versions'}];
+
+ $r->print(&Apache::loncommon::start_page('Discussion Post Versions',undef,
+ {'bread_crumbs' => $brcrum,})
+ );
my $crs='/'.$env{'request.course.id'};
if ($env{'request.course.sec'}) {
@@ -3827,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