[LON-CAPA-cvs] cvs: loncom /interface lonfeedback.pm

albertel lon-capa-cvs@mail.lon-capa.org
Tue, 18 Jul 2006 17:42:17 -0000


albertel		Tue Jul 18 13:42:17 2006 EDT

  Modified files:              
    /loncom/interface	lonfeedback.pm 
  Log:
  - grp_args -> group_args
  
  
Index: loncom/interface/lonfeedback.pm
diff -u loncom/interface/lonfeedback.pm:1.210 loncom/interface/lonfeedback.pm:1.211
--- loncom/interface/lonfeedback.pm:1.210	Tue Jul 18 13:31:50 2006
+++ loncom/interface/lonfeedback.pm	Tue Jul 18 13:42:15 2006
@@ -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 @@
     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 @@
     if ($newpostsflag) {
         $chglink .= '&previous='.$prevread;
     }
-    if ($group ne '') {
-        $chglink.='&'.$grp_arg;
-    }
+    $chglink.=&group_args($group);
 
     if ($visible) {
 # Print the discusssion
@@ -421,25 +414,19 @@
 		if ($newpostsflag) {
 		    $discussion .= '&previous='.$prevread;
 		}
-                if ($group ne '') {
-                    $discussion .= '&'.$grp_arg;
-                }
+		$discussion .= &group_args($group);
 		$discussion .='">'.&mt('Threaded View').'</a>&nbsp;&nbsp;'.
 		    '<a href="/adm/feedback?cmd=threadedoff&amp;symb='.$escsymb;
 		if ($newpostsflag) {
 		    $discussion .= '&previous='.$prevread;
 		}
-                if ($group ne '') {
-                    $discussion .= '&amp;'.$grp_arg;
-                }
+		$discussion .= &group_args($group);
 		$discussion .='">'.&mt('Chronological View').'</a>&nbsp;&nbsp;
                               <a href= "/adm/feedback?cmd=sortfilter&amp;symb='.$escsymb;
                 if ($newpostsflag) {
                     $discussion .= '&previous='.$prevread;
                 }
-                if ($group ne '') {
-                    $discussion .= '&amp;'.$grp_arg;
-                }
+		$discussion .= &group_args($group);
                 $discussion .='">'.&mt('Sorting/Filtering options').'</a>&nbsp;&nbsp';
             } else {
                 $discussion .= '<td align="left">';
@@ -448,22 +435,16 @@
             if ($newpostsflag) {
                 $discussion .= '&previous='.$prevread;
             }
-            if ($group ne '') {
-                $discussion .= '&amp;'.$grp_arg;
-            }
+	    $discussion .= &group_args($group);
             $discussion .= '">'.&mt('Export').'?</a>&nbsp;&nbsp;</td>';
 	    if ($newpostsflag) {
 		if (!$markondisp) {
 		    $discussion .='<td align="right"><a href="/adm/preferences?action=changediscussions';
-                    if ($group ne '') {
-                        $discussion .= '&amp;'.$grp_arg;
-                    }
+		    $discussion .= &group_args($group);
 		    $discussion .= '">'.
                         &mt('Preferences on what is marked as NEW').
 			'</a><br /><a href="/adm/feedback?markread=1&amp;symb='.$escsymb;
-                    if ($group ne '') {
-                        $discussion .= '&amp;'.$grp_arg;
-                    }
+		    $discussion .= &group_args($group);
                     $discussion .= '">'.&mt('Mark NEW posts no longer new').'</a>';
 		} else {
 		    $discussion .= '<td>&nbsp;</td>';
@@ -481,9 +462,7 @@
                 if ($newpostsflag) {
                     $discussion .= '&previous='.$prevread;
                 }
-                if ($group ne '') {
-                    $discussion .= '&amp;'.$grp_arg;
-                }
+		$discussion .= &group_args($group);
                 $discussion .= '">'.&mt('Show all posts').'</a> '.&mt('to display').' '.
                          $numhidden.' ';
                 if ($showunmark) {
@@ -999,9 +978,7 @@
                                     if ($$newpostsflag) {
                                         $sender .= '&previous='.$prevread;
                                     }
-                                    if ($group ne '') {
-                                        $sender.='&amp;'.&grp_args($group);
-                                    }
+				    $sender .= &group_args($group);
                                     $sender .= '" '.$target.'>'.&mt('Edit').'</a>';
                                     
                                     unless ($seeid) {
@@ -1026,9 +1003,7 @@
                                     if ($$newpostsflag) {
                                         $sender .= '&previous='.$prevread;
                                     }
-                                    if ($group ne '') {
-                                        $sender.='&amp;'.&grp_args($group);
-                                    }
+				    $sender .= &group_args($group);
                                     $sender .= '">'.&mt('Hide').'</a>';
 			        }                     
 			        $sender.=' <a href="/adm/feedback?deldisc='.
@@ -1036,9 +1011,7 @@
                                 if ($$newpostsflag) {
                                     $sender .= '&previous='.$prevread;
                                 }
-                                if ($group ne '') {
-                                    $sender .= '&amp;'.&grp_args($group);
-                                }
+				$sender .= &group_args($group);
                                 $sender .= '">'.&mt('Delete').'</a>';
                             }
 		        } else {
@@ -1074,7 +1047,7 @@
                                 if ($$newpostsflag) {
                                     $sender .= '&previous='.$prevread;
                                 }
-                                $sender .= '&amp;'.&grp_args($group);
+                                $sender .= &group_args($group);
                                 $sender .= '" '.$target.'>'.&mt('Reply').'</a>';
                             } elsif (&Apache::lonnet::allowed('pch', 
 				 $env{'request.course.id'}.
@@ -1216,9 +1189,7 @@
                                 $$discussionitems[$idx] .= &mt('This post has been edited by the author.');
                                 if ($seeid) {
                                     $$discussionitems[$idx] .= '&nbsp;&nbsp;<a href="/adm/feedback?allversions='.$escsymb.':::'.$idx;
-                                    if ($group ne '') {
-                                        $$discussionitems[$idx] .= '&amp;'.&grp_args($group);
-                                    }
+				    $$discussionitems[$idx] .= &group_args($group);
                                     $$discussionitems[$idx] .= '">'.&mt('Display all versions').'</a>';
                                 }
                                 $$discussionitems[$idx].='<br/>'.&mt('Earlier version(s) were posted on: ');
@@ -3794,11 +3765,12 @@
     return '';
 }
 
-sub grp_args { 
+sub group_args { 
     my ($group) = @_;
-    my $extra_args = 'group='.$group;
+    if ($group eq '') { return ''; }
+    my $extra_args = '&amp;group='.$group;
     if (exists($env{'form.ref'})) {
-        $extra_args .= '&ref='.$env{'form.ref'};
+        $extra_args .= '&amp;ref='.$env{'form.ref'};
     }
     return $extra_args;
 }