--- loncom/interface/lonaboutme.pm 2006/08/04 20:41:32 1.49 +++ loncom/interface/lonaboutme.pm 2006/08/16 19:40:46 1.52 @@ -1,7 +1,7 @@ # The LearningOnline Network # "About Me" Personal Information # -# $Id: lonaboutme.pm,v 1.49 2006/08/04 20:41:32 albertel Exp $ +# $Id: lonaboutme.pm,v 1.52 2006/08/16 19:40:46 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -37,6 +37,7 @@ use Apache::lonfeedback; use Apache::lonrss(); use Apache::lonlocal; use Apache::lonmsgdisplay(); +use HTML::Entities(); sub handler { my $r = shift; @@ -206,7 +207,7 @@ sub handler { } if ($allowed) { $r->print('
'); } @@ -485,7 +486,6 @@ sub parse_directory { 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}))) { $output .= &portfolio_row_start(); $output .= ''; @@ -496,21 +496,34 @@ sub parse_directory { $output .= &parse_directory($r,$depth,$currhash->{$item}, $path.'/'.$item); } else { - my $showname; - if ($currhash->{$item} =~ m|/([^/]+)$|) { - $showname = $1; - } else { - $showname = $currhash->{$item}; - } - $showname=&HTML::Entities::encode($showname,'<>&"'); + + + my $file_name; + if ($currhash->{$item} =~ m|/([^/]+)$|) { + $file_name = $1; + } else { + $file_name = $currhash->{$item}; + } + my $have_meta = exists($dirlist{$file_name.'.meta'}); my $url = '/uploaded/'.$cdom.'/'.$cnum.'/portfolio/'. $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 .= ''. ''. ' '.$showname.''; $output.=''; - &Apache::lonnet::logthis("sh $showname"); - if (exists($dirlist{$showname.'.meta'})) { + if ($have_meta) { $output.= ''.&mt('Catalog Information').'';