--- loncom/interface/lonfeedback.pm 2011/12/10 01:45:36 1.306 +++ loncom/interface/lonfeedback.pm 2011/12/10 22:54:34 1.307 @@ -1,7 +1,7 @@ # The LearningOnline Network # Feedback # -# $Id: lonfeedback.pm,v 1.306 2011/12/10 01:45:36 www Exp $ +# $Id: lonfeedback.pm,v 1.307 2011/12/10 22:54:34 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -771,17 +771,25 @@ END return $discussion; } + +sub discussion_link { + my ($ressymb,$linktext,$cmd,$item,$flag,$prev,$adds)=@_; + my $link='/adm/feedback?inhibitmenu=yes&modal=yes&'.$cmd.'='.&escape($ressymb).':::'.$item; + if ($flag) { $link .= '&previous='.$prev; } + if ($adds) { $link .= $adds; } + return &Apache::loncommon::modal_link($link,$linktext,600,400); +} + + sub send_feedback_link { my ($ressymb) = @_; - my $output = ''. - &Apache::loncommon::modal_link( - '/adm/feedback?inhibitmenu=yes&modal=yes&replydisc='.&escape($ressymb).':::', + return ''. + &discussion_link($ressymb, ''.&mt('Post Discussion').'', - 600,400). - ''; - return $output; + 'replydisc'). + ''; } sub send_message_link { @@ -1166,23 +1174,14 @@ sub build_posting_display { if (&discussion_open($status)) { if (($group ne '') && (&check_group_priv($group,'pgd') eq 'ok')) { - $sender.=' '.&mt('Reply').''; + $sender.=' '. + &discussion_link($symb,&mt('Reply'),'replydisc',$idx,$$newpostsflag,$prevread,&group_args($group)); } elsif (&Apache::lonnet::allowed('pch', $env{'request.course.id'}. ($env{'request.course.sec'}?'/'. $env{'request.course.sec'}:''))) { - $sender.=' '.&mt('Reply').''; + $sender.=' '. + &discussion_link($symb,&mt('Reply'),'replydisc',$idx,$$newpostsflag,$prevread); } } if ($viewgrades) {