--- loncom/interface/lonindexer.pm 2010/03/31 13:20:46 1.206 +++ loncom/interface/lonindexer.pm 2011/10/14 16:58:32 1.210 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Directory Indexer # -# $Id: lonindexer.pm,v 1.206 2010/03/31 13:20:46 raeburn Exp $ +# $Id: lonindexer.pm,v 1.210 2011/10/14 16:58:32 dseaton Exp $ # # Copyright Michigan State University Board of Trustees # @@ -120,8 +120,8 @@ sub handler { my $colspan=''; $extrafield=''; - my $diropendb = - "/home/httpd/perl/tmp/$env{'user.domain'}_$env{'user.name'}_sel_res.db"; + my $diropendb = LONCAPA::tempdir() . + "$env{'user.domain'}_$env{'user.name'}_sel_res.db"; %hash = (); { my %dbfile; @@ -460,11 +460,12 @@ ENDHEADER push(@select_form_order,$types); } $select_file_categories{'select_form_order'} = \@select_form_order; + my $onchange = 'this.form.submit();'; my $type_element= &Apache::loncommon::select_form( $typeselect, 'only', - %select_file_categories); + \%select_file_categories,$onchange); my $type_selector = ''; @@ -587,6 +588,7 @@ END $r->print(&Apache::loncommon::start_data_table("LC_tableBrowseRes") .&Apache::loncommon::start_data_table_header_row()); $r->print("".&mt('Name')."\n"); + $r->print("\n"); $r->print("".&mt('Title')."\n") if ($hash{'display_attrs_0'} == 1); $r->print(''.&mt("Size")." (".&mt("bytes").") ". @@ -753,6 +755,7 @@ sub scanDir { sub get_list { my ($r,$uri)=@_; my @list=(); + (my $luri = $uri) =~ s/\//_/g; if ($env{'form.updatedisplay'}) { foreach (keys %hash) { @@ -780,6 +783,14 @@ sub get_list { $hash{'dirlist_files_'.$luri} = join("\n",@list); $hash{'dirlist_timestamp_files_'.$luri} = time; } +#Checking for error messages associated with empty directories or inaccessible servers (See Bug 4984) + if($list[0] eq 'no_such_dir' || $list[0] eq 'no_such_host') { + $r->print("

" . &mt("Directory does not exist."). "

"); + } + elsif($list[0] eq 'con_lost') { + $r->print("

" . &mt("Directory temporarily not accessible."). "

"); + } + return @list=&match_ext($r,@list); } @@ -921,7 +932,7 @@ sub display_line { $r->print ('print (' alt="'.$msg.'" class="LC_fileicon" />'. "\n"); - $r->print(&mt("Up")."$tabtag"); + $r->print(&mt("Up")."$tabtag"); $r->print(&Apache::loncommon::end_data_table_row()); return OK; } @@ -956,7 +967,7 @@ $r->print ('(".&Apache::lonnet::domain($listname,'description'). ")"); } - $r->print("$tabtag"); + $r->print("$tabtag"); $r->print(&Apache::loncommon::end_data_table_row()); return OK; @@ -988,7 +999,12 @@ $r->print ('print(''.$tabtag); +# Wishlistlink + $r->print(''. + ''.$tabtag); $r->print(&Apache::loncommon::end_data_table_row()); return OK; } @@ -1083,6 +1099,12 @@ $r->print ('\n"); +# Wishlistlink + $r->print(''. + ''); if ($hash{'display_attrs_0'} == 1) { $r->print(' '.($title eq '' ? ' ' : $title). ' '."\n"); @@ -1230,7 +1252,13 @@ $r->print ('' ."\n"); - $r->print ("$listname\n"); + $r->print ("$listname"); +# Wishlistlink + $r->print(''. + ''); # Attributes my $filelink = $startdir.$filecom[0].'/default';