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

raeburn lon-capa-cvs@mail.lon-capa.org
Wed, 29 Nov 2006 04:25:23 -0000


raeburn		Tue Nov 28 23:25:23 2006 EDT

  Modified files:              
    /loncom/interface	lonfeedback.pm 
  Log:
  bug 4772. Duplicate discussion control bar at the end of the display of discussions to reduce scrolling. 
  
  
Index: loncom/interface/lonfeedback.pm
diff -u loncom/interface/lonfeedback.pm:1.221 loncom/interface/lonfeedback.pm:1.222
--- loncom/interface/lonfeedback.pm:1.221	Tue Nov 28 22:55:15 2006
+++ loncom/interface/lonfeedback.pm	Tue Nov 28 23:25:23 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Feedback
 #
-# $Id: lonfeedback.pm,v 1.221 2006/11/29 03:55:15 raeburn Exp $
+# $Id: lonfeedback.pm,v 1.222 2006/11/29 04:25:23 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -421,55 +421,10 @@
 </script>
             |;
 	    $discussion.='<form name="readchoices" method="post" action="/adm/feedback?chgreads='.$ressymb.'" ><table bgcolor="#AAAAAA" cellpadding="2" cellspacing="2" border="0">';
-	    $discussion .='<tr><td bgcolor="#DDDDBB" colspan="'.$colspan.'">'.
-		'<table border="0" width="100%" bgcolor="#DDDDBB"><tr>';
-	    my $escsymb=&escape($ressymb);
-	    if ($visible>2) {
-		$discussion.='<td align="left">'.
-		    '<a href="/adm/feedback?cmd=threadedon&amp;symb='.$escsymb;
-		if ($newpostsflag) {
-		    $discussion .= '&previous='.$prevread;
-		}
-		$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;
-		}
-		$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;
-                }
-		$discussion .= &group_args($group);
-                $discussion .='">'.&mt('Sorting/Filtering options').'</a>&nbsp;&nbsp';
-            } else {
-                $discussion .= '<td align="left">';
-            }
-            $discussion .='<a href= "/adm/feedback?export='.$escsymb;
-            if ($newpostsflag) {
-                $discussion .= '&previous='.$prevread;
-            }
-	    $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';
-		    $discussion .= &group_args($group);
-		    $discussion .= '">'.
-                        &mt('Preferences on what is marked as NEW').
-			'</a><br /><a href="/adm/feedback?markread=1&amp;symb='.$escsymb;
-		    $discussion .= &group_args($group);
-                    $discussion .= '">'.&mt('Mark NEW posts no longer new').'</a>';
-		} else {
-		    $discussion .= '<td>&nbsp;</td>';
-		}
-	    } else {
-		$discussion .= '<td>&nbsp;</td>';
-	    }
-	    $discussion .= '</tr></table></td></tr>';
-
+            $discussion .= &action_links_bar($colspan,$ressymb,$visible,
+                                             $newpostsflag,$group,
+                                             $prevread,$markondisp);
+            my $escsymb=&escape($ressymb);
             my $numhidden = keys(%notshown);
             if ($numhidden > 0) {
                 my $colspan = $maxdepth+1;
@@ -680,9 +635,13 @@
               </table>
              </td>
             </tr>
-           </table>
-           <br /><br /></form>
 END
+            $discussion .= &action_links_bar($colspan,$ressymb,$visible,
+                                             $newpostsflag,$group,
+                                             $prevread,$markondisp);
+            $discussion .= "
+           </table>
+           <br /><br /></form>\n";
         } 
         if ($outputtarget eq 'export') {
             if ($manifestok) {
@@ -779,6 +738,59 @@
     return $discussion;
 }
 
+sub action_links_bar {
+    my ($colspan,$ressymb,$visible,$newpostsflag,$group,$prevread,$markondisp) = @_;
+    my $discussion = '<tr><td bgcolor="#DDDDBB" colspan="'.$colspan.'">'.
+                     '<table border="0" width="100%" bgcolor="#DDDDBB"><tr>';
+    my $escsymb=&escape($ressymb);
+    if ($visible>2) {
+        $discussion .= '<td align="left">'.
+                       '<a href="/adm/feedback?cmd=threadedon&amp;symb='.$escsymb;
+        if ($newpostsflag) {
+            $discussion .= '&previous='.$prevread;
+        }
+        $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;
+        }
+        $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;
+        }
+        $discussion .= &group_args($group);
+        $discussion .='">'.&mt('Sorting/Filtering options').'</a>&nbsp;&nbsp';
+    } else {
+        $discussion .= '<td align="left">';
+    }
+    $discussion .='<a href= "/adm/feedback?export='.$escsymb;
+    if ($newpostsflag) {
+        $discussion .= '&previous='.$prevread;
+    }
+    $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';
+            $discussion .= &group_args($group);
+            $discussion .= '">'.
+                           &mt('Preferences on what is marked as NEW').
+                           '</a><br /><a href="/adm/feedback?markread=1&amp;symb='.$escsymb;
+            $discussion .= &group_args($group);
+            $discussion .= '">'.&mt('Mark NEW posts no longer new').'</a>';
+        } else {
+            $discussion .= '<td>&nbsp;</td>';
+        }
+    } else {
+        $discussion .= '<td>&nbsp;</td>';
+    }
+    $discussion .= '</tr></table></td></tr>';
+    return $discussion;
+}
+
 sub postingform_display {
     my ($mode,$ressymb,$now,$subject,$comment,$outputtarget,$attachnum,
         $currnewattach,$currdelold,$group) = @_;