Diff for /loncom/interface/lonaboutme.pm between versions 1.47 and 1.52

version 1.47, 2006/08/04 19:06:12 version 1.52, 2006/08/16 19:40:46
Line 37  use Apache::lonfeedback; Line 37  use Apache::lonfeedback;
 use Apache::lonrss();  use Apache::lonrss();
 use Apache::lonlocal;  use Apache::lonlocal;
 use Apache::lonmsgdisplay();  use Apache::lonmsgdisplay();
   use HTML::Entities();
   
 sub handler {  sub handler {
     my $r = shift;      my $r = shift;
Line 206  sub handler { Line 207  sub handler {
       }        }
               if ($allowed) {                if ($allowed) {
                  $r->print('<br /><textarea cols="80" rows="6" name="'.$_.'">'.                   $r->print('<br /><textarea cols="80" rows="6" name="'.$_.'">'.
    $syllabus{$_}.     &HTML::Entities::encode($syllabus{$_},'"&<>').
            '</textarea><input type="submit" name="storesyl" value="'.             '</textarea><input type="submit" name="storesyl" value="'.
    &mt('Store').'" />');     &mt('Store').'" />');
       }        }
Line 447  sub portfolio_files { Line 448  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 477  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);
     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" />&nbsp;'.$title;              $output .= '<img src="'.&Apache::loncommon::lonhttpdurl("/adm/lonIcons/navmap.folder.open.gif").'" alt="'.&mt('Folder').' '.$title.'" class="LC_icon" />&nbsp;'.$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 $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;              my $showname;
             if ($currhash->{$item} =~ m|/([^/]+)$|) {      if ($have_meta) {
                 $showname = $1;   $showname = &Apache::lonnet::metadata($url,'title');
             } else {      }
                 $showname = $currhash->{$item};      if ($showname eq '') {
             }   $showname = $file_name;
       } else {
    $showname = $file_name.' ('.$showname.')';
       }
   
             $showname=&HTML::Entities::encode($showname,'<>&"');              $showname=&HTML::Entities::encode($showname,'<>&"');
             $output .= '<img alt="" src="'.&Apache::loncommon::icon($currhash->{$item}).'" class="LC_icon" />&nbsp;<a href="/uploaded/'.$cdom.'/'.$cnum.'/portfolio/'.$currhash->{$item}.'">'.$showname.'</a>';              $output .= '<a href="'.$url.'">'.
     $output.='</td><td><a href=""><img align="right" alt="'.&mt('Catalog Information').'" src="'.   '<img alt="" src="'.&Apache::loncommon::icon($currhash->{$item}).'" class="LC_icon" />'.
    '&nbsp;'.$showname.'</a>';
       $output.='</td><td>';
       if ($have_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>';
         }          }
     }      }

Removed from v.1.47  
changed lines
  Added in v.1.52


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>