--- loncom/interface/lonfeedback.pm 2021/01/04 03:43:30 1.370.2.5
+++ loncom/interface/lonfeedback.pm 2021/12/31 20:34:24 1.387
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Feedback
#
-# $Id: lonfeedback.pm,v 1.370.2.5 2021/01/04 03:43:30 raeburn Exp $
+# $Id: lonfeedback.pm,v 1.387 2021/12/31 20:34:24 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -118,10 +118,16 @@ sub list_discussion {
$outputtarget = 'export';
}
}
+ my ($nofooter,$nodisclink,$nofdbklink);
if (not &discussion_visible($status)) {
if ($mode ne 'board') {
- &Apache::lonenc::check_encrypt(\$ressymb);
- return '
'.&send_message_link($ressymb)."
";
+ ($nofooter,$nodisclink,$nofdbklink) = &check_menucoll();
+ if ($nofooter || $nofdbklink) {
+ return '
';
+ } else {
+ &Apache::lonenc::check_encrypt(\$ressymb);
+ return '
'.&send_message_link($ressymb)."
";
+ }
}
}
if ($group ne '' && $mode eq 'board') {
@@ -130,17 +136,27 @@ sub list_discussion {
}
}
- my ($blocked,$blocktext) =
- &Apache::loncommon::blocking_status('boards');
- if ($blocked) {
- $blocktext = '
'.$blocktext."";
- &Apache::lonenc::check_encrypt(\$ressymb);
- if ($mode ne 'board') {
- $blocktext.=&send_message_link($ressymb).'
';
- }else{
- $blocktext.="";
+ unless ($outputtarget eq 'export') {
+ ($nofooter,$nodisclink,$nofdbklink) = &check_menucoll();
+ }
+
+ unless ($nofooter) {
+ my ($blocked,$blocktext) =
+ &Apache::loncommon::blocking_status('boards');
+ if ($blocked) {
+ my $footer = '
';
+ unless ($nodisclink) {
+ $footer .= ''.$blocktext.'';
+ }
+ &Apache::lonenc::check_encrypt(\$ressymb);
+ if ($mode ne 'board') {
+ unless ($nofdbklink) {
+ $footer.=&send_message_link($ressymb);
+ }
+ }
+ $footer.='
';
+ return $footer;
}
- return $blocktext;
}
my @bgcols = ("LC_disc_old_item","LC_disc_new_item");
@@ -674,7 +690,7 @@ END
$newpostsflag,$group,
$prevread,$markondisp,$seehidden);
$discussion .= "\n";
- }
+ }
if ($outputtarget eq 'export') {
if ($manifestok) {
while ($currdepth > 0) {
@@ -774,33 +790,60 @@ END
&mt('This discussion is closed.').'';
}
} elsif ($outputtarget ne 'tex') {
- $discussion.='';
- if (&discussion_open($status) &&
- &Apache::lonnet::allowed('pch',
- $env{'request.course.id'}.
- ($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:''))) {
- $discussion.= &send_feedback_link($ressymb);
- if ($env{'request.role.adv'}) {
- my $close = &Apache::lonnet::EXT('resource.0.discussend',$ressymb);
- my $canvote = &Apache::lonnet::EXT('resource.0.discussvote',$ressymb);
- if (defined($close) && $close ne '' && $close < time) {
- if ($canvote eq 'notended') {
- $discussion .= ' '.&mt('(Posting and voting closed for [_1] roles)',
- &Apache::lonnet::plaintext('st',$crstype));
- } else {
- $discussion .= ' '.&mt('(Closed for [_1] roles)',
- &Apache::lonnet::plaintext('st',$crstype));
+ unless ($nofooter) {
+ $discussion.='
';
+ unless ($nodisclink) {
+ if (&discussion_open($status) &&
+ &Apache::lonnet::allowed('pch',
+ $env{'request.course.id'}.
+ ($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:''))) {
+ $discussion.= &send_feedback_link($ressymb);
+ if ($env{'request.role.adv'}) {
+ my $close = &Apache::lonnet::EXT('resource.0.discussend',$ressymb);
+ my $canvote = &Apache::lonnet::EXT('resource.0.discussvote',$ressymb);
+ if (defined($close) && $close ne '' && $close < time) {
+ if ($canvote eq 'notended') {
+ $discussion .= ' '.&mt('(Posting and voting closed for [_1] roles)',
+ &Apache::lonnet::plaintext('st',$crstype));
+ } else {
+ $discussion .= ' '.&mt('(Closed for [_1] roles)',
+ &Apache::lonnet::plaintext('st',$crstype));
+ }
+ }
}
+ } else {
+ $discussion.= ''.&mt('This discussion is closed.').'';
}
}
- } else {
- $discussion.= ''.&mt('This discussion is closed.').'';
+ unless ($nofdbklink) {
+ $discussion.= &send_message_link($ressymb);
+ }
+ $discussion.='
';
}
- $discussion.= &send_message_link($ressymb).'
';
}
return $discussion;
}
+sub check_menucoll {
+ my ($nofooter,$nodisclink,$nofdbklink);
+ my ($menucoll,$deeplinkmenu,$menuref) = &Apache::loncommon::menucoll_in_effect();
+ if ($menucoll) {
+ if (ref($menuref) eq 'HASH') {
+ if ($menuref->{'foot'} eq 'n') {
+ $nofooter = 1;
+ } else {
+ unless ($menuref->{'disc'}) {
+ $nodisclink = 1;
+ }
+ unless ($menuref->{'fdbk'}) {
+ $nofdbklink = 1;
+ }
+ }
+ }
+ }
+ return ($nofooter,$nodisclink,$nofdbklink);
+}
+
sub can_see_hidden {
my ($mode,$ressymb,$feedurl,$group,$cdom,$cnum,$crs) = @_;
my $seehidden;
@@ -960,9 +1003,14 @@ sub postingform_display {
}
}
}
+ my $postanon;
+ if (&Apache::lonnet::allowed('pac',$env{'request.course.id'}.
+ ($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:''))) {
+ $postanon = '';
+ }
$postingform .= (<
-
+$postanon
@@ -2067,7 +2115,7 @@ END
$r->print('');
}
$r->print(<
+
END
@@ -2832,6 +2880,10 @@ sub redirect_back {
my $start_page=
&Apache::loncommon::start_page('Feedback sent',undef,\%parms);
my $end_page = &Apache::loncommon::end_page();
+ my $windowname = 'loncapaclient';
+ if ($env{'request.lti.login'}) {
+ $windowname .= 'lti';
+ }
$r->print(<
@@ -2840,7 +2892,7 @@ $typestyle
$blog
$toolarge
$status
-
$end_page
@@ -4540,6 +4600,8 @@ ENDREDIR
($env{'request.course.id'} && ($feedurl!~m:^/adm:))
||
($env{'request.course.id'} && ($symb=~/^bulletin\_\_\_/))
+ ||
+ (($env{'request.course.id'}) && ($feedurl =~ /ext\.tool$/))
) {
&Apache::loncommon::content_type($r,'text/html');
$r->send_http_header;
@@ -4641,7 +4703,11 @@ ENDREDIR
&& $env{'form.discuss'} !~ /^(?:author|question|course|policy)/)
|| $env{'form.anondiscuss'} ne '') {
my $subject = &clear_out_html($env{'form.subject'});
- my $anonmode=($env{'form.discuss'} eq 'anon' || $env{'form.anondiscuss'} );
+ my $anonmode;
+ if (&Apache::lonnet::allowed('pac',$env{'request.course.id'}.
+ ($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:''))) {
+ $anonmode=($env{'form.discuss'} eq 'anon' || $env{'form.anondiscuss'} );
+ }
$typestyle.=&adddiscuss($symb,$message,$anonmode,$attachmenturl,
$subject,$group);
$numpost++;