version 1.115, 2004/06/18 01:09:24
|
version 1.117, 2004/06/22 13:27:51
|
Line 60 my %hash; # global user-specific gdbm fi
|
Line 60 my %hash; # global user-specific gdbm fi
|
my %dirs; # keys are directories, values are the open/close status |
my %dirs; # keys are directories, values are the open/close status |
my %language; # has the reference information present in language.tab |
my %language; # has the reference information present in language.tab |
my %dynhash; # hash of hashes for dynamic metadata |
my %dynhash; # hash of hashes for dynamic metadata |
|
my %dynread; # hash of directories already read for dynamic metadata |
my %fieldnames; # Metadata fieldnames |
my %fieldnames; # Metadata fieldnames |
# ----- Values which are set by the handler subroutine and are accessible to |
# ----- Values which are set by the handler subroutine and are accessible to |
# ----- other methods. |
# ----- other methods. |
Line 679 sub get_list {
|
Line 680 sub get_list {
|
# is really a directory |
# is really a directory |
@list = &Apache::lonnet::dirlist($uri); |
@list = &Apache::lonnet::dirlist($uri); |
$hash{'dirlist_files_'.$luri} = join("\n",@list); |
$hash{'dirlist_files_'.$luri} = join("\n",@list); |
&dynmetaread($uri); |
|
} |
} |
return @list=&match_ext($r,@list); |
return @list=&match_ext($r,@list); |
} |
} |
Line 687 sub get_list {
|
Line 687 sub get_list {
|
sub dynmetaread { |
sub dynmetaread { |
my $uri=shift; |
my $uri=shift; |
if (($hash{'display_attrs_8'}==1) || ($hash{'display_attrs_11'}==1)) { |
if (($hash{'display_attrs_8'}==1) || ($hash{'display_attrs_11'}==1)) { |
|
# We don't want the filename |
|
$uri=~s/\/[^\/]+$//; |
|
# Did we already see this? |
|
my $builddir=$uri; |
|
while ($builddir) { |
|
if ($dynread{$builddir}) { |
|
return 0; |
|
} |
|
$builddir=~s/\/[^\/]+$//; |
|
} |
|
# Actually get the data |
%dynhash= |
%dynhash= |
(%dynhash,&Apache::lonmeta::get_dynamic_metadata_from_sql($uri)); |
(%dynhash,&Apache::lonmeta::get_dynamic_metadata_from_sql($uri)); |
|
# Remember that we got it |
|
$dynread{$uri}=1; |
} |
} |
} |
} |
|
|
Line 880 sub display_line {
|
Line 893 sub display_line {
|
my $iconname = &Apache::loncommon::icon($listname); |
my $iconname = &Apache::loncommon::icon($listname); |
$r->print("<tr valign='$valign' bgcolor=$fileclr><td nowrap='1' align='top'>"); |
$r->print("<tr valign='$valign' bgcolor=$fileclr><td nowrap='1' align='top'>"); |
|
|
my $metafile = $Apache::lonnet::perlvar{'lonDocRoot'}.$pathprefix. |
|
$filecom[0].'.meta'; |
|
if (-e $metafile) { |
|
$metafile=1; |
|
} else { |
|
$metafile=0; |
|
} |
|
if ($ENV{'form.catalogmode'} eq 'interactive') { |
if ($ENV{'form.catalogmode'} eq 'interactive') { |
$r->print("<a href=\"javascript:select_data(\'", |
$r->print("<a href=\"javascript:select_data(\'", |
$filelink,"')\">"); |
$filelink,"')\">"); |
Line 992 sub display_line {
|
Line 998 sub display_line {
|
} |
} |
if ($hash{'display_attrs_8'} == 1) { |
if ($hash{'display_attrs_8'} == 1) { |
# statistics |
# statistics |
|
&dynmetaread($filelink); |
$r->print("<td>"); |
$r->print("<td>"); |
&dynmetaprint($r,$filelink,'count'); |
&dynmetaprint($r,$filelink,'count'); |
&dynmetaprint($r,$filelink,'course'); |
&dynmetaprint($r,$filelink,'course'); |
Line 1020 sub display_line {
|
Line 1027 sub display_line {
|
} |
} |
if ($hash{'display_attrs_11'} == 1) { |
if ($hash{'display_attrs_11'} == 1) { |
# links |
# links |
|
&dynmetaread($filelink); |
$r->print('<td>'); |
$r->print('<td>'); |
&dynmetaprint($r,$filelink,'goto_list'); |
&dynmetaprint($r,$filelink,'goto_list'); |
&dynmetaprint($r,$filelink,'comefrom_list'); |
&dynmetaprint($r,$filelink,'comefrom_list'); |