version 1.49, 2006/08/04 20:41:32
|
version 1.50, 2006/08/07 19:51:54
|
Line 485 sub parse_directory {
|
Line 485 sub parse_directory {
|
my %dirlist = map { |
my %dirlist = map { |
((split('&',$_,2))[0],1) |
((split('&',$_,2))[0],1) |
} &Apache::lonnet::dirlist($path,$cdom,$cnum,$portfolio_root); |
} &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 496 sub parse_directory {
|
Line 495 sub parse_directory {
|
$output .= &parse_directory($r,$depth,$currhash->{$item}, |
$output .= &parse_directory($r,$depth,$currhash->{$item}, |
$path.'/'.$item); |
$path.'/'.$item); |
} else { |
} else { |
my $showname; |
|
if ($currhash->{$item} =~ m|/([^/]+)$|) { |
|
$showname = $1; |
my $file_name; |
} else { |
if ($currhash->{$item} =~ m|/([^/]+)$|) { |
$showname = $currhash->{$item}; |
$file_name = $1; |
} |
} else { |
$showname=&HTML::Entities::encode($showname,'<>&"'); |
$file_name = $currhash->{$item}; |
|
} |
|
my $have_meta = exists($dirlist{$file_name.'.meta'}); |
my $url = '/uploaded/'.$cdom.'/'.$cnum.'/portfolio/'. |
my $url = '/uploaded/'.$cdom.'/'.$cnum.'/portfolio/'. |
$currhash->{$item}; |
$currhash->{$item}; |
|
|
|
my $showname; |
|
if ($have_meta) { |
|
$showname = &Apache::lonnet::metadata($url,'title'); |
|
} |
|
if ($showname eq '') { |
|
$showname = $file_name; |
|
} else { |
|
$showname = $file_name.' ('.$showname.')'; |
|
} |
|
|
|
$showname=&HTML::Entities::encode($showname,'<>&"'); |
$output .= '<a href="'.$url.'">'. |
$output .= '<a href="'.$url.'">'. |
'<img alt="" src="'.&Apache::loncommon::icon($currhash->{$item}).'" class="LC_icon" />'. |
'<img alt="" src="'.&Apache::loncommon::icon($currhash->{$item}).'" class="LC_icon" />'. |
' '.$showname.'</a>'; |
' '.$showname.'</a>'; |
$output.='</td><td>'; |
$output.='</td><td>'; |
&Apache::lonnet::logthis("sh $showname"); |
&Apache::lonnet::logthis("sh $showname"); |
if (exists($dirlist{$showname.'.meta'})) { |
if ($have_meta) { |
$output.= '<a href="'.$url.'.meta"><img alt="'.&mt('Catalog Information').'" src="'. |
$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'). |
'" class="LC_icon" /></a>'; |
'" class="LC_icon" /></a>'; |