version 1.128, 2009/05/11 13:34:10
|
version 1.129, 2009/05/11 14:13:51
|
Line 688 sub portfolio_files {
|
Line 688 sub portfolio_files {
|
return $filecounts; |
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 { |
sub build_hierarchy { |
my ($r,$cdom,$cnum,$portaccess,$is_course,$filecounts,$mode,$access_info, |
my ($r,$cdom,$cnum,$portaccess,$is_course,$filecounts,$mode,$access_info, |
$allfileshash,$group) = @_; |
$allfileshash,$group) = @_; |
Line 746 sub build_hierarchy {
|
Line 732 sub build_hierarchy {
|
my $output; |
my $output; |
if ($mode eq 'listfiles') { |
if ($mode eq 'listfiles') { |
if ($filecounts->{'both'} > 0) { |
if ($filecounts->{'both'} > 0) { |
$output = &portfolio_table_start(); |
$output = &Apache::loncommon::start_data_table(); |
$output .= &parse_directory($r,0,$allfileshash,'',$is_course, |
$output .= &parse_directory($r,0,$allfileshash,'',$is_course, |
$group); |
$group); |
$output .= '</table>'; |
$output .= &Apache::loncommon::end_data_table(); |
} |
} |
} |
} |
return $output; |
return $output; |
Line 768 sub parse_directory {
|
Line 754 sub parse_directory {
|
((split('&',$_,2))[0],1) |
((split('&',$_,2))[0],1) |
} &Apache::lonnet::dirlist($portfolio_root.$path,$cdom,$cnum,$getpropath); |
} &Apache::lonnet::dirlist($portfolio_root.$path,$cdom,$cnum,$getpropath); |
foreach my $item (sort(keys(%{$currhash}))) { |
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">'; |
$output .= '<td style="padding-left: '.($depth*25).'px">'; |
if (ref($currhash->{$item}) eq 'HASH') { |
if (ref($currhash->{$item}) eq 'HASH') { |
my $title=&HTML::Entities::encode($item,'<>&"'); |
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 .= '<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}, |
$output .= &parse_directory($r,$depth,$currhash->{$item}, |
$path.'/'.$item,$is_course,$group); |
$path.'/'.$item,$is_course,$group); |
} else { |
} else { |
Line 812 sub parse_directory {
|
Line 799 sub parse_directory {
|
&Apache::loncommon::lonhttpdurl('/res/adm/pages/catalog.gif'). |
&Apache::loncommon::lonhttpdurl('/res/adm/pages/catalog.gif'). |
'" class="LC_icon" /></a>'; |
'" class="LC_icon" /></a>'; |
} |
} |
$output .= '</td></tr>'; |
$output .= '</td>' |
|
.&Apache::loncommon::end_data_table_row(); |
} |
} |
} |
} |
return $output; |
return $output; |