--- loncom/interface/lonfeedback.pm 2006/11/29 04:25:23 1.222
+++ loncom/interface/lonfeedback.pm 2006/11/29 19:31:48 1.223
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Feedback
#
-# $Id: lonfeedback.pm,v 1.222 2006/11/29 04:25:23 raeburn Exp $
+# $Id: lonfeedback.pm,v 1.223 2006/11/29 19:31:48 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -93,6 +93,11 @@ sub list_discussion {
}
}
+ my ($blocked,$blocktext) = &blocking_posts('boards',1);
+ if ($blocked) {
+ return $blocktext;
+ }
+
my @bgcols = ("#cccccc","#eeeeee");
my $discussiononly=0;
if ($mode eq 'board') { $discussiononly=1; }
@@ -791,6 +796,25 @@ sub action_links_bar {
return $discussion;
}
+sub blocking_posts {
+ my ($type,$showstatus) = @_;
+ my %setters;
+ my ($blocked,$output);
+ my ($startblock,$endblock) =
+ &Apache::loncommon::blockcheck(\%setters,$type);
+ if ($startblock && $endblock) {
+ $blocked = 1;
+ if ($showstatus) {
+ my $showstart = &Apache::lonlocal::locallocaltime($startblock);
+ my $showend = &Apache::lonlocal::locallocaltime($endblock);
+ $output = &mt('Discussion postings will not be viewable for resources in this course between [_1] and [_2] because communication is being blocked.',$showstart, $showend).'
'.
+ &Apache::loncommon::build_block_table($startblock,$endblock,
+ \%setters);
+ }
+ }
+ return ($blocked,$output);
+}
+
sub postingform_display {
my ($mode,$ressymb,$now,$subject,$comment,$outputtarget,$attachnum,
$currnewattach,$currdelold,$group) = @_;
@@ -2543,15 +2567,21 @@ sub screen_header {
&Apache::lonnet::allowed('pch',
$env{'request.course.id'}.
($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:''))) {
- $discussoptions='
'.
- ''.&mt('Change Screenname').'';
+ my ($blocked) = &blocking_posts('boards');
+ if (!$blocked) {
+ $discussoptions='
'.
+ ''.&mt('Change Screenname').'';
+ }
+ }
+ my ($blockblog) = &blocking_posts('blogs');
+ if (!$blockblog) {
+ $discussoptions.='
';
}
- $discussoptions.='
';
}
if ($msgoptions) { $msgoptions='