--- loncom/interface/lonindexer.pm 2007/06/27 23:27:23 1.163 +++ loncom/interface/lonindexer.pm 2007/07/06 08:34:37 1.169 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Directory Indexer # -# $Id: lonindexer.pm,v 1.163 2007/06/27 23:27:23 banghart Exp $ +# $Id: lonindexer.pm,v 1.169 2007/07/06 08:34:37 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -128,7 +128,6 @@ sub handler { if ($env{'form.launch'} eq '1') { &start_fresh_session(\%dbfile); } - while(my($key,$value)=each(%dbfile)) { $hash{$key}=$value; } @@ -358,6 +357,7 @@ function checkAll() { var fieldName = document.forms[i].elements[j].name; if (fieldName == 'filelink') { document.forms[i].elements[j].checked = true; + queue(document.forms[i].name); } } } @@ -370,6 +370,7 @@ function uncheckAll() { var fieldName = document.forms[i].elements[j].name; if (fieldName == 'filelink') { document.forms[i].elements[j].checked = false; + queue(document.forms[i].name); } } } @@ -409,11 +410,10 @@ ENDHEADER $ac++; } # sorting through the actions and changing the global database hash - foreach (sort {$achash{$a}<=>$achash{$b}} (keys %ahash)) { - my $key=$_; + foreach my $key (sort {$achash{$a}<=>$achash{$b}} (keys %ahash)) { if ($ahash{$key} eq '1') { $hash{'store_'.$hash{'pre_'.$key.'_link'}}= - $hash{'pre_'.$key.'_title'}; + $hash{'pre_'.$key.'_title'}; $hash{'storectr_'.$hash{'pre_'.$key.'_link'}}= $hash{'storectr'}+0; $hash{'storectr'}++; @@ -920,7 +920,11 @@ sub display_line { # display file if (($fnptr == 0 and $filecom[3] ne '') or $absolute) { + my $title; my $filelink = $pathprefix.$filecom[0]; + if ($hash{'display_attrs_0'} == 1) { + $title = &Apache::lonnet::gettitle($filelink); + } my @file_ext = split (/\./,$listname); my $curfext = $file_ext[-1]; if (@Omit) { @@ -953,6 +957,10 @@ sub display_line { $r->print(" />\n"); $r->print(""); $hash{"pre_${fnum}_link"}=$filelink; + $hash{"pre_${fnum}_title"}=$title; + if (!$hash{"pre_${fnum}_title"}) { + $hash{"pre_${fnum}_title"} = 'Not_retrieved'; + } $fnum++; } # Form to open or close sequences @@ -1006,7 +1014,6 @@ sub display_line { } $r->print("\n"); if ($hash{'display_attrs_0'} == 1) { - my $title = &Apache::lonnet::gettitle($filelink,'title'); $r->print(' '.($title eq '' ? ' ' : $title). ' '."\n"); } @@ -1130,7 +1137,7 @@ sub display_line { my $filelink = $startdir.$filecom[0].'/default'; if ($hash{'display_attrs_0'} == 1) { - my $title = &Apache::lonnet::gettitle($filelink,'title'); + my $title = &Apache::lonnet::gettitle($filelink); $r->print(' '.($title eq '' ? ' ' : $title). ' '."\n"); }