--- loncom/interface/lonfeedback.pm 2006/12/08 00:28:59 1.231
+++ loncom/interface/lonfeedback.pm 2006/12/08 20:09:29 1.232
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Feedback
#
-# $Id: lonfeedback.pm,v 1.231 2006/12/08 00:28:59 raeburn Exp $
+# $Id: lonfeedback.pm,v 1.232 2006/12/08 20:09:29 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -74,6 +74,9 @@ sub discussion_visible {
sub list_discussion {
my ($mode,$status,$ressymb,$imsextras,$group)=@_;
+ unless ($ressymb) { $ressymb=&Apache::lonnet::symbread(); }
+ unless ($ressymb) { return ''; }
+ $ressymb=&wrap_symb($ressymb);
my $outputtarget=$env{'form.grade_target'};
if (defined($env{'form.export'})) {
if($env{'form.export'}) {
@@ -85,7 +88,12 @@ sub list_discussion {
$outputtarget = 'export';
}
}
- if (not &discussion_visible($status)) { return ''; }
+ if (not &discussion_visible($status)) {
+ if ($mode ne 'board') {
+ my $encsymb=&Apache::lonenc::check_encrypt($ressymb);
+ return &send_message_link($encsymb);
+ }
+ }
if ($group ne '' && $mode eq 'board') {
if (&check_group_priv($group,'vgb') ne 'ok') {
return '';
@@ -94,7 +102,10 @@ sub list_discussion {
my ($blocked,$blocktext) = &blocking_posts('boards',1);
if ($blocked) {
- return $blocktext;
+ if ($mode ne 'board') {
+ my $encsymb=&Apache::lonenc::check_encrypt($ressymb);
+ return $blocktext.'
'.&send_message_link($encsymb);
+ }
}
my @bgcols = ("#cccccc","#eeeeee");
@@ -107,9 +118,6 @@ sub list_discussion {
$crs.='_'.$env{'request.course.sec'};
}
$crs=~s/\_/\//g;
- unless ($ressymb) { $ressymb=&Apache::lonnet::symbread(); }
- unless ($ressymb) { return ''; }
- $ressymb=&wrap_symb($ressymb);
my $encsymb=&Apache::lonenc::check_encrypt($ressymb);
my $viewgrades=(&Apache::lonnet::allowed('vgr',$crs)
&& ($ressymb=~/\.(problem|exam|quiz|assess|survey|form|task)$/));
@@ -722,26 +730,45 @@ END
}
}
} else {
- $discussion.='
';
+ $discussion.='';
if (&discussion_open($status) &&
&Apache::lonnet::allowed('pch',
$env{'request.course.id'}.
($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:''))) {
if ($outputtarget ne 'tex') {
- $discussion.=''.
- ' '.
- &mt('Post Discussion').' ';
+ $discussion.= &send_feedback_link($ressymb,$target).
+ ' ';
}
}
- $discussion.=' '.
- &mt('Send Message').' | ';
+ if ($outputtarget ne 'tex') {
+ $discussion.= &send_message_link($ressymb);
+ }
+ $discussion.=' |
';
}
return $discussion;
}
+sub send_feedback_link {
+ my ($ressymb,$target) = @_;
+ my $output = ''.
+ ' '.
+ '
'.&mt('Post Discussion').'';
+ return $output;
+}
+
+sub send_message_link {
+ my ($ressymb) = @_;
+ my $output = ''.
+ '
'.&mt('Send Message').'';
+ return $output;
+}
+
sub action_links_bar {
my ($colspan,$ressymb,$visible,$newpostsflag,$group,$prevread,$markondisp) = @_;
my $discussion = ''.
|