--- loncom/interface/lonfeedback.pm 2006/07/18 17:31:50 1.210
+++ loncom/interface/lonfeedback.pm 2006/07/18 17:42:15 1.211
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Feedback
#
-# $Id: lonfeedback.pm,v 1.210 2006/07/18 17:31:50 albertel Exp $
+# $Id: lonfeedback.pm,v 1.211 2006/07/18 17:42:15 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -271,11 +271,6 @@ sub list_discussion {
my $imsresources;
my $copyresult;
- my $grp_arg;
- if ($group ne '') {
- $grp_arg = &grp_args($group);
- }
-
my $function = &Apache::loncommon::get_users_function();
my $color = &Apache::loncommon::designparm($function.'.tabbg',
$env{'user.domain'});
@@ -340,9 +335,7 @@ sub list_discussion {
if ($newpostsflag) {
$chglink .= '&previous='.$prevread;
}
- if ($group ne '') {
- $chglink.='&'.$grp_arg;
- }
+ $chglink.=&group_args($group);
if ($visible) {
# Print the discusssion
@@ -421,25 +414,19 @@ imscp_v1p1.xsd http://www.imsglobal.org/
if ($newpostsflag) {
$discussion .= '&previous='.$prevread;
}
- if ($group ne '') {
- $discussion .= '&'.$grp_arg;
- }
+ $discussion .= &group_args($group);
$discussion .='">'.&mt('Threaded View').' '.
''.&mt('Chronological View').'
'.&mt('Sorting/Filtering options').'  ';
} else {
$discussion .= '
';
@@ -448,22 +435,16 @@ imscp_v1p1.xsd http://www.imsglobal.org/
if ($newpostsflag) {
$discussion .= '&previous='.$prevread;
}
- if ($group ne '') {
- $discussion .= '&'.$grp_arg;
- }
+ $discussion .= &group_args($group);
$discussion .= '">'.&mt('Export').'? | ';
if ($newpostsflag) {
if (!$markondisp) {
$discussion .=''.
&mt('Preferences on what is marked as NEW').
' '.&mt('Mark NEW posts no longer new').'';
} else {
$discussion .= ' | | ';
@@ -481,9 +462,7 @@ imscp_v1p1.xsd http://www.imsglobal.org/
if ($newpostsflag) {
$discussion .= '&previous='.$prevread;
}
- if ($group ne '') {
- $discussion .= '&'.$grp_arg;
- }
+ $discussion .= &group_args($group);
$discussion .= '">'.&mt('Show all posts').' '.&mt('to display').' '.
$numhidden.' ';
if ($showunmark) {
@@ -999,9 +978,7 @@ sub build_posting_display {
if ($$newpostsflag) {
$sender .= '&previous='.$prevread;
}
- if ($group ne '') {
- $sender.='&'.&grp_args($group);
- }
+ $sender .= &group_args($group);
$sender .= '" '.$target.'>'.&mt('Edit').'';
unless ($seeid) {
@@ -1026,9 +1003,7 @@ sub build_posting_display {
if ($$newpostsflag) {
$sender .= '&previous='.$prevread;
}
- if ($group ne '') {
- $sender.='&'.&grp_args($group);
- }
+ $sender .= &group_args($group);
$sender .= '">'.&mt('Hide').'';
}
$sender.=' '.&mt('Delete').'';
}
} else {
@@ -1074,7 +1047,7 @@ sub build_posting_display {
if ($$newpostsflag) {
$sender .= '&previous='.$prevread;
}
- $sender .= '&'.&grp_args($group);
+ $sender .= &group_args($group);
$sender .= '" '.$target.'>'.&mt('Reply').'';
} elsif (&Apache::lonnet::allowed('pch',
$env{'request.course.id'}.
@@ -1216,9 +1189,7 @@ sub build_posting_display {
$$discussionitems[$idx] .= &mt('This post has been edited by the author.');
if ($seeid) {
$$discussionitems[$idx] .= ' '.&mt('Display all versions').'';
}
$$discussionitems[$idx].='
'.&mt('Earlier version(s) were posted on: ');
@@ -3794,11 +3765,12 @@ sub check_group_priv {
return '';
}
-sub grp_args {
+sub group_args {
my ($group) = @_;
- my $extra_args = 'group='.$group;
+ if ($group eq '') { return ''; }
+ my $extra_args = '&group='.$group;
if (exists($env{'form.ref'})) {
- $extra_args .= '&ref='.$env{'form.ref'};
+ $extra_args .= '&ref='.$env{'form.ref'};
}
return $extra_args;
}