version 1.48, 2006/08/04 19:42:55
|
version 1.49, 2006/08/04 20:41:32
|
Line 447 sub portfolio_files {
|
Line 447 sub portfolio_files {
|
my $output; |
my $output; |
if (keys(%allfileshash) > 0) { |
if (keys(%allfileshash) > 0) { |
$output = &portfolio_table_start(); |
$output = &portfolio_table_start(); |
$output .= &parse_directory($r,0,\%allfileshash); |
$output .= &parse_directory($r,0,\%allfileshash,''); |
$output .= '</table>'; |
$output .= '</table>'; |
} else { |
} else { |
my $access_text; |
my $access_text; |
Line 476 sub portfolio_files {
|
Line 476 sub portfolio_files {
|
} |
} |
|
|
sub parse_directory { |
sub parse_directory { |
my ($r,$depth,$currhash) = @_; |
my ($r,$depth,$currhash,$path) = @_; |
my ($cdom,$cnum,$name) = &aboutme_info($r); |
my ($cdom,$cnum,$name) = &aboutme_info($r); |
$depth++; |
$depth++; |
my $output; |
my $output; |
|
|
|
my $portfolio_root = &Apache::portfolio::get_portfolio_root($cdom,$cnum); |
|
my %dirlist = map { |
|
((split('&',$_,2))[0],1) |
|
} &Apache::lonnet::dirlist($path,$cdom,$cnum,$portfolio_root); |
|
&Apache::lonnet::logthis("$path -- $portfolio_root"); |
foreach my $item (sort(keys(%{$currhash}))) { |
foreach my $item (sort(keys(%{$currhash}))) { |
$output .= &portfolio_row_start(); |
$output .= &portfolio_row_start(); |
$output .= '<td style="padding-left: '.($depth*25).'px">'; |
$output .= '<td style="padding-left: '.($depth*25).'px">'; |
Line 487 sub parse_directory {
|
Line 493 sub parse_directory {
|
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></tr>'; |
$output .= &parse_directory($r,$depth,$currhash->{$item}); |
$output .= &parse_directory($r,$depth,$currhash->{$item}, |
|
$path.'/'.$item); |
} else { |
} else { |
my $showname; |
my $showname; |
if ($currhash->{$item} =~ m|/([^/]+)$|) { |
if ($currhash->{$item} =~ m|/([^/]+)$|) { |
Line 498 sub parse_directory {
|
Line 505 sub parse_directory {
|
$showname=&HTML::Entities::encode($showname,'<>&"'); |
$showname=&HTML::Entities::encode($showname,'<>&"'); |
my $url = '/uploaded/'.$cdom.'/'.$cnum.'/portfolio/'. |
my $url = '/uploaded/'.$cdom.'/'.$cnum.'/portfolio/'. |
$currhash->{$item}; |
$currhash->{$item}; |
$output .= '<img alt="" src="'.&Apache::loncommon::icon($currhash->{$item}).'" class="LC_icon" /> <a href="'.$url.'">'.$showname.'</a>'; |
$output .= '<a href="'.$url.'">'. |
$output.='</td><td><a href="'.$url.'.meta"><img align="right" alt="'.&mt('Catalog Information').'" src="'. |
'<img alt="" src="'.&Apache::loncommon::icon($currhash->{$item}).'" class="LC_icon" />'. |
|
' '.$showname.'</a>'; |
|
$output.='</td><td>'; |
|
&Apache::lonnet::logthis("sh $showname"); |
|
if (exists($dirlist{$showname.'.meta'})) { |
|
$output.= '<a href="'.$url.'.meta"><img alt="'.&mt('Catalog Information').'" src="'. |
&Apache::loncommon::lonhttpdurl('/res/adm/pages/catalog.gif'). |
&Apache::loncommon::lonhttpdurl('/res/adm/pages/catalog.gif'). |
'" /></a>'; |
'" class="LC_icon" /></a>'; |
|
} |
$output .= '</td></tr>'; |
$output .= '</td></tr>'; |
} |
} |
} |
} |