[LON-CAPA-cvs] cvs: loncom /interface lonaboutme.pm loncommon.pm
bisitz
bisitz@source.lon-capa.org
Mon, 11 May 2009 14:13:51 -0000
bisitz Mon May 11 14:13:51 2009 EDT
Modified files:
/loncom/interface loncommon.pm lonaboutme.pm
Log:
Optimized portfolio table:
- Replaced hardcoded table by standard data_table
- Removed now unused sub routines "portfolio_table_start" and "portfolio_row_start"
- Removed now unused style "LC_aboutme_port"
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.808 loncom/interface/loncommon.pm:1.809
--- loncom/interface/loncommon.pm:1.808 Fri May 8 16:08:56 2009
+++ loncom/interface/loncommon.pm Mon May 11 14:13:51 2009
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common routines
#
-# $Id: loncommon.pm,v 1.808 2009/05/08 16:08:56 droeschl Exp $
+# $Id: loncommon.pm,v 1.809 2009/05/11 14:13:51 bisitz Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -4908,12 +4908,6 @@
font-weight: bold;
}
-table.LC_aboutme_port {
- border: none;
- border-collapse: collapse;
- border-spacing: 0;
-}
-
table.LC_data_table,
table.LC_mail_list {
border: 1px solid #000000;
@@ -4957,15 +4951,13 @@
}
table.LC_data_table tr.LC_odd_row > td,
-table.LC_pick_box tr > td.LC_odd_row,
-table.LC_aboutme_port tr td {
+table.LC_pick_box tr > td.LC_odd_row {
background-color: $data_table_light;
padding: 2px;
}
table.LC_data_table tr.LC_even_row > td,
-table.LC_pick_box tr > td.LC_even_row,
-table.LC_aboutme_port tr.LC_even_row td {
+table.LC_pick_box tr > td.LC_even_row {
background-color: $data_table_dark;
padding: 2px;
}
Index: loncom/interface/lonaboutme.pm
diff -u loncom/interface/lonaboutme.pm:1.128 loncom/interface/lonaboutme.pm:1.129
--- loncom/interface/lonaboutme.pm:1.128 Mon May 11 13:34:10 2009
+++ loncom/interface/lonaboutme.pm Mon May 11 14:13:51 2009
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Personal Information Page
#
-# $Id: lonaboutme.pm,v 1.128 2009/05/11 13:34:10 bisitz Exp $
+# $Id: lonaboutme.pm,v 1.129 2009/05/11 14:13:51 bisitz Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -688,20 +688,6 @@
return $filecounts;
}
-{
- my $count=0;
- sub portfolio_table_start {
- $count=0;
- return '<table class="LC_aboutme_port">';
- }
- sub portfolio_row_start {
- $count++;
- my $class = ($count%2)?'LC_odd_row'
- :'LC_even_row';
- return '<tr class="'.$class.'">';
- }
-}
-
sub build_hierarchy {
my ($r,$cdom,$cnum,$portaccess,$is_course,$filecounts,$mode,$access_info,
$allfileshash,$group) = @_;
@@ -746,10 +732,10 @@
my $output;
if ($mode eq 'listfiles') {
if ($filecounts->{'both'} > 0) {
- $output = &portfolio_table_start();
+ $output = &Apache::loncommon::start_data_table();
$output .= &parse_directory($r,0,$allfileshash,'',$is_course,
$group);
- $output .= '</table>';
+ $output .= &Apache::loncommon::end_data_table();
}
}
return $output;
@@ -768,12 +754,13 @@
((split('&',$_,2))[0],1)
} &Apache::lonnet::dirlist($portfolio_root.$path,$cdom,$cnum,$getpropath);
foreach my $item (sort(keys(%{$currhash}))) {
- $output .= &portfolio_row_start();
+ $output .= &Apache::loncommon::start_data_table_row();
$output .= '<td style="padding-left: '.($depth*25).'px">';
if (ref($currhash->{$item}) eq 'HASH') {
my $title=&HTML::Entities::encode($item,'<>&"');
$output .= '<img src="'.&Apache::loncommon::lonhttpdurl("/adm/lonIcons/navmap.folder.open.gif").'" alt="'.&mt('Folder').' '.$title.'" class="LC_icon" /> '.$title;
- $output .= '</td><td></td></tr>';
+ $output .= '</td><td> </td>'
+ .&Apache::loncommon::end_data_table_row();
$output .= &parse_directory($r,$depth,$currhash->{$item},
$path.'/'.$item,$is_course,$group);
} else {
@@ -812,7 +799,8 @@
&Apache::loncommon::lonhttpdurl('/res/adm/pages/catalog.gif').
'" class="LC_icon" /></a>';
}
- $output .= '</td></tr>';
+ $output .= '</td>'
+ .&Apache::loncommon::end_data_table_row();
}
}
return $output;