--- loncom/interface/lonhelper.pm 2003/09/05 16:15:54 1.45 +++ loncom/interface/lonhelper.pm 2003/09/25 20:39:32 1.47 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # .helper XML handler to implement the LON-CAPA helper # -# $Id: lonhelper.pm,v 1.45 2003/09/05 16:15:54 bowersj2 Exp $ +# $Id: lonhelper.pm,v 1.47 2003/09/25 20:39:32 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1667,7 +1667,8 @@ resources in that sequence, or recurses to false. The "suppressEmptySequences" attribute reflects the suppressEmptySequences argument to the render routine, which will cause folders that have all of their contained resources filtered out to also -be filtered out. +be filtered out. The 'addstatus' attribute, if true, will add the icon +and long status display columns to the display. =head3 SUB-TAGS @@ -1730,6 +1731,7 @@ sub start_resource { $paramHash->{'multichoice'} = $token->[2]{'multichoice'}; $paramHash->{'suppressEmptySequences'} = $token->[2]{'suppressEmptySequences'}; $paramHash->{'toponly'} = $token->[2]{'toponly'}; + $paramHash->{'addstatus'} = $token->[2]{'addstatus'}; return ''; } @@ -1895,9 +1897,13 @@ BUTTONS }; $ENV{'form.condition'} = !$self->{'toponly'}; + my $cols = [$renderColFunc, Apache::lonnavmaps::resource()]; + if ($self->{'addstatus'}) { + push @$cols, (Apache::lonnavmaps::part_status_summary()); + + } $result .= - &Apache::lonnavmaps::render( { 'cols' => [$renderColFunc, - Apache::lonnavmaps::resource()], + &Apache::lonnavmaps::render( { 'cols' => $cols, 'showParts' => 0, 'filterFunc' => $filterFunc, 'resource_no_folder_link' => 1, @@ -2302,9 +2308,17 @@ BUTTONS my @fileList; # If the subdirectory is in local CSTR space - if ($subdir =~ m|/home/([^/]+)/public_html|) { + my $metadir; + if ($subdir =~ m|/home/([^/]+)/public_html/(.*)|) { + my $user = $1; + my $domain = $Apache::lonnet::perlvar{'lonDefDomain'}; + $metadir='/res/'.$domain.'/'.$user.'/'.$2; + @fileList = &Apache::lonnet::dirlist($subdir, $domain, $user, ''); + } elsif ($subdir =~ m|^~([^/]+)/(.*)$|) { + $subdir='/home/'.$1.'/public_html/'.$2; my $user = $1; my $domain = $Apache::lonnet::perlvar{'lonDefDomain'}; + $metadir='/res/'.$domain.'/'.$user.'/'.$2; @fileList = &Apache::lonnet::dirlist($subdir, $domain, $user, ''); } else { # local library server resource space @@ -2343,7 +2357,7 @@ BUTTONS } # Get the title - my $title = Apache::lonpubdir::getTitleString($fileName); + my $title = Apache::lonpubdir::getTitleString(($metadir?$metadir:$subdir) .'/'. $file); # Netscape 4 is stupid and there's nowhere to put the # information on the input tag that the file is Published, @@ -2381,7 +2395,7 @@ BUTTONS $result .= "\n"; if (!$choices) { - $result .= 'There are no files available to select in this directory. Please go back and select another option.

'; + $result .= 'There are no files available to select in this directory ('.$subdir.'). Please go back and select another option.

'; } $result .= $buttons;