--- loncom/interface/lonfeedback.pm 2011/12/10 01:45:36 1.306
+++ loncom/interface/lonfeedback.pm 2011/12/11 19:17:54 1.309
@@ -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.309 2011/12/11 19:17:54 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,
' ',
- 600,400).
- '';
- return $output;
+ 'replydisc').
+ '';
}
sub send_message_link {
@@ -1096,14 +1104,8 @@ sub build_posting_display {
if ($outputtarget ne 'tex') {
if (&editing_allowed($escsymb.':::'.$idx,$group)) {
if (($env{'user.domain'} eq $contrib{$idx.':senderdomain'}) && ($env{'user.name'} eq $contrib{$idx.':sendername'})) {
- $sender.=' '.&mt('Edit').'';
-
+ $sender.=' '.
+ &discussion_link($symb,&mt('Edit'),'editdisc',$idx,$$newpostsflag,$prevread,&group_args($group));
unless ($seeid) {
my $grpargs = &group_args($group);
$sender.=" '.&mt('Make Visible').'';
+ $sender.=' '.
+ &discussion_link($symb,&mt('Make Visible'),'unhide',$idx,$$newpostsflag,$prevread,&group_args($group));
}
} else {
- $sender.=' '.&mt('Hide').'';
+ $sender.=' '.
+ &discussion_link($symb,&mt('Hide'),'hide',$idx,$$newpostsflag,$prevread,&group_args($group));
}
my $grpargs = &group_args($group);
$sender.=
@@ -1166,23 +1159,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) {
@@ -1313,9 +1297,8 @@ sub build_posting_display {
my @postversions = ();
$$discussionitems[$idx] .= &mt('This post has been edited by the author.');
if ($seeid) {
- $$discussionitems[$idx] .= ' '.&mt('Display all versions').'';
+ $$discussionitems[$idx] .= ' '.
+ &discussion_link($symb,&mt('Display all versions'),'allversions',$idx,$$newpostsflag,$prevread,&group_args($group));
}
$$discussionitems[$idx].='
'.&mt('Earlier version(s) were posted on: ');
if ($contrib{$idx.':history'} =~ m/:/) {
@@ -1741,10 +1724,13 @@ END
}
$quote='
'.&Apache::lontexconvert::msgtexconverted($quote).''; } - + my $header=''; + unless ($env{'form.modal'}) { + $header="