version 1.384, 2020/12/18 15:23:02
|
version 1.385, 2021/10/18 22:29:20
|
Line 118 sub list_discussion {
|
Line 118 sub list_discussion {
|
$outputtarget = 'export'; |
$outputtarget = 'export'; |
} |
} |
} |
} |
|
my ($nofooter,$nodisclink,$nofdbklink); |
if (not &discussion_visible($status)) { |
if (not &discussion_visible($status)) { |
if ($mode ne 'board') { |
if ($mode ne 'board') { |
&Apache::lonenc::check_encrypt(\$ressymb); |
($nofooter,$nodisclink,$nofdbklink) = &check_menucoll(); |
return '<br /><div class="LC_feedback_link">'.&send_message_link($ressymb)."</div>"; |
if ($nofooter || $nofdbklink) { |
|
return '<br />'; |
|
} else { |
|
&Apache::lonenc::check_encrypt(\$ressymb); |
|
return '<br /><div class="LC_feedback_link">'.&send_message_link($ressymb)."</div>"; |
|
} |
} |
} |
} |
} |
if ($group ne '' && $mode eq 'board') { |
if ($group ne '' && $mode eq 'board') { |
Line 136 sub list_discussion {
|
Line 142 sub list_discussion {
|
$blocktext = '<br /><div class="LC_feedback_link"><span class="LC_feedback_link">'.$blocktext."</span>"; |
$blocktext = '<br /><div class="LC_feedback_link"><span class="LC_feedback_link">'.$blocktext."</span>"; |
&Apache::lonenc::check_encrypt(\$ressymb); |
&Apache::lonenc::check_encrypt(\$ressymb); |
if ($mode ne 'board') { |
if ($mode ne 'board') { |
$blocktext.=&send_message_link($ressymb).'</div>'; |
($nofooter,$nodisclink,$nofdbklink) = &check_menucoll(); |
|
unless ($nofooter || $nofdbklink) { |
|
$blocktext.=&send_message_link($ressymb); |
|
} |
|
$blocktext.='</div>'; |
}else{ |
}else{ |
$blocktext.="</div>"; |
$blocktext.="</div>"; |
} |
} |
return $blocktext; |
return $blocktext; |
} |
} |
|
|
|
unless ($outputtarget eq 'export') { |
|
($nofooter,$nodisclink,$nofdbklink) = &check_menucoll(); |
|
} |
|
|
my @bgcols = ("LC_disc_old_item","LC_disc_new_item"); |
my @bgcols = ("LC_disc_old_item","LC_disc_new_item"); |
my $discussiononly=0; |
my $discussiononly=0; |
if ($mode eq 'board') { $discussiononly=1; } |
if ($mode eq 'board') { $discussiononly=1; } |
Line 774 END
|
Line 788 END
|
&mt('This discussion is closed.').'</span>'; |
&mt('This discussion is closed.').'</span>'; |
} |
} |
} elsif ($outputtarget ne 'tex') { |
} elsif ($outputtarget ne 'tex') { |
$discussion.='<div class="LC_feedback_link">'; |
unless ($nofooter) { |
if (&discussion_open($status) && |
$discussion.='<div class="LC_feedback_link">'; |
&Apache::lonnet::allowed('pch', |
unless ($nodisclink) { |
$env{'request.course.id'}. |
if (&discussion_open($status) && |
($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:''))) { |
&Apache::lonnet::allowed('pch', |
$discussion.= &send_feedback_link($ressymb); |
$env{'request.course.id'}. |
if ($env{'request.role.adv'}) { |
($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:''))) { |
my $close = &Apache::lonnet::EXT('resource.0.discussend',$ressymb); |
$discussion.= &send_feedback_link($ressymb); |
my $canvote = &Apache::lonnet::EXT('resource.0.discussvote',$ressymb); |
if ($env{'request.role.adv'}) { |
if (defined($close) && $close ne '' && $close < time) { |
my $close = &Apache::lonnet::EXT('resource.0.discussend',$ressymb); |
if ($canvote eq 'notended') { |
my $canvote = &Apache::lonnet::EXT('resource.0.discussvote',$ressymb); |
$discussion .= ' '.&mt('(Posting and voting closed for [_1] roles)', |
if (defined($close) && $close ne '' && $close < time) { |
&Apache::lonnet::plaintext('st',$crstype)); |
if ($canvote eq 'notended') { |
} else { |
$discussion .= ' '.&mt('(Posting and voting closed for [_1] roles)', |
$discussion .= ' '.&mt('(Closed for [_1] roles)', |
&Apache::lonnet::plaintext('st',$crstype)); |
&Apache::lonnet::plaintext('st',$crstype)); |
} else { |
|
$discussion .= ' '.&mt('(Closed for [_1] roles)', |
|
&Apache::lonnet::plaintext('st',$crstype)); |
|
} |
|
} |
} |
} |
|
} else { |
|
$discussion.= '<span class="LC_feedback_link">'.&mt('This discussion is closed.').'</span>'; |
} |
} |
} |
} |
} else { |
unless ($nofdbklink) { |
$discussion.= '<span class="LC_feedback_link">'.&mt('This discussion is closed.').'</span>'; |
$discussion.= &send_message_link($ressymb); |
|
} |
|
$discussion.='</div>'; |
} |
} |
$discussion.= &send_message_link($ressymb).'</div>'; |
|
} |
} |
return $discussion; |
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 { |
sub can_see_hidden { |
my ($mode,$ressymb,$feedurl,$group,$cdom,$cnum,$crs) = @_; |
my ($mode,$ressymb,$feedurl,$group,$cdom,$cnum,$crs) = @_; |
my $seehidden; |
my $seehidden; |