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

bisitz lon-capa-cvs-allow@mail.lon-capa.org
Mon, 15 Sep 2008 13:22:48 -0000


bisitz		Mon Sep 15 09:22:48 2008 EDT

  Modified files:              
    /loncom/interface	groupsort.pm 
  Log:
  - Replaced existing table with LON-CAPA standard table
  - Removed hardcoded styles
  - Added proper headline style and line break for nicer output
  
  
Index: loncom/interface/groupsort.pm
diff -u loncom/interface/groupsort.pm:1.61 loncom/interface/groupsort.pm:1.62
--- loncom/interface/groupsort.pm:1.61	Fri Nov  2 17:08:45 2007
+++ loncom/interface/groupsort.pm	Mon Sep 15 09:22:48 2008
@@ -2,7 +2,7 @@
 # The LON-CAPA group sort handler
 # Allows for sorting prior to import into RAT.
 #
-# $Id: groupsort.pm,v 1.61 2007/11/02 21:08:45 albertel Exp $
+# $Id: groupsort.pm,v 1.62 2008/09/15 13:22:48 bisitz Exp $
 # 
 # Copyright Michigan State University Board of Trustees
 #
@@ -206,9 +206,6 @@
  
    &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
 			     ['acts','mode','readfile','recover','bookmarks']);
-    # color scheme
-    my $fileclr = '#ffffe6';
-    my $titleclr = '#ddffff';
 
     &Apache::loncommon::content_type($r,'text/html');
     $r->send_http_header;
@@ -353,7 +350,8 @@
 	    my $resurl = 
 		&Apache::loncommon::escape_single(&Apache::loncommon::lastresurl());
 	    $r->print(<<END);
-<b><font color="#888888">$lt{'fin'}</font></b>
+<h2>$lt{'fin'}</h2>
+<div>
 <input type="button" name="alter" value="$lt{'ci'}"
  onClick="window.location='$resurl?inhibitmenu=yes&amp;catalogmode=import'" />&nbsp;
 <input type="button" name="altersearch" value="$lt{'cs'}"
@@ -361,17 +359,21 @@
 <input type="button" name="alter" value="$lt{'fi'}"
  onClick="finish_import()" />&nbsp;
 <input type="button" name="alter" value="$lt{'ca'}" onClick="self.close()" />
+</div>
+<br />
 END
         }
-        $r->print("<table border='0'><tr><td bgcolor='#eeeeee'>");
-	$r->print("<table border=0><tr>\n");
+        $r->print(&Apache::loncommon::start_data_table()
+                 .&Apache::loncommon::start_data_table_header_row());
 	if (($env{'form.readfile'}) || ($env{'form.bookmarks'})) { 
-	    $r->print("<td bgcolor='$titleclr'><b>$lt{'in'}</b></td>\n");
+	    $r->print("<th>$lt{'in'}</th>\n");
 	} else { 
-	    $r->print("<td colspan='2' bgcolor='$titleclr'><b>$lt{'co'}</b></td>\n"); 
+	    $r->print("<th colspan='2'>$lt{'co'}</th>\n"); 
 	}
-	$r->print("<td colspan='2' bgcolor='$titleclr'><b>$lt{'ti'}</b></td>\n");
-	$r->print("<td bgcolor='$titleclr'><b>$lt{'pa'}</b></td></tr>\n");
+	$r->print("<th colspan='2'>$lt{'ti'}</th>\n");
+	$r->print("<th>$lt{'pa'}</th>");
+        $r->print(&Apache::loncommon::end_data_table_header_row()
+                 ."\n");
     } else {
 	$r->print(&Apache::loncommon::start_page(undef,$js,
 						 {'only_body' => 1}));
@@ -390,7 +392,8 @@
 	$ctr++;
 	my $iconname=&Apache::loncommon::icon($resource->{'url'});
 	if (($clen > 1) || ($env{'form.readfile'}) || ($env{'form.bookmarks'})) {
-	    $r->print("<tr><td bgcolor='$fileclr'>");
+	    $r->print(&Apache::loncommon::start_data_table_row()
+                     ."<td>");
             if (($env{'form.readfile'}) || ($env{'form.bookmarks'})) {
 		$r->print(&checkbox($ctr-1));
 	    } else {
@@ -402,19 +405,22 @@
 	if (($clen > 1)  || ($env{'form.readfile'}) || ($env{'form.bookmarks'})) {
 	    $r->print("</td>");
             unless (($env{'form.readfile'}) || ($env{'form.bookmarks'})) {
-		$r->print("<td bgcolor='$fileclr'>".
+		$r->print("<td>".
 			  &select_box($clen,$ctr).
 			  "</td>");
 	    }
-	    $r->print("<td bgcolor='$fileclr'>");
+	    $r->print("<td>");
 	    $r->print("<img src='$iconname' />");
-	    $r->print("</td><td bgcolor='$fileclr'>");
-	    $r->print($resource->{'title'}.$resource->{'notes'}."</td><td bgcolor='$fileclr'>\n");
-	    $r->print($resource->{'url'}."</td></tr>\n");
+	    $r->print("</td><td>");
+	    $r->print($resource->{'title'}.$resource->{'notes'}."</td><td>\n");
+	    $r->print($resource->{'url'}."</td>"
+                     .&Apache::loncommon::end_data_table_row()
+                     ."\n");
 	} 
     }
     if (($clen > 1) || ($env{'form.readfile'}) || ($env{'form.bookmarks'})) {
-	$r->print("</table></td></tr></table></form>");
+        $r->print(&Apache::loncommon::end_data_table()
+                 ."</form>");
     } else {
 	$r->print(<<END);
 <script type="text/javascript">