--- loncom/interface/lonindexer.pm 2009/07/17 15:42:07 1.199 +++ loncom/interface/lonindexer.pm 2009/12/07 02:27:25 1.203.2.1 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Directory Indexer # -# $Id: lonindexer.pm,v 1.199 2009/07/17 15:42:07 droeschl Exp $ +# $Id: lonindexer.pm,v 1.203.2.1 2009/12/07 02:27:25 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -518,13 +518,15 @@ END $select_file_categories{''} = &mt('All file types'); foreach my $cat (@file_categories) { my $types = join(",",&Apache::loncommon::filecategorytypes($cat)); - $select_file_categories{$types} = $cat; + $select_file_categories{$types} = &mt($cat); push(@select_form_order,$types); } $select_file_categories{'select_form_order'} = \@select_form_order; my $type_element= - &Apache::loncommon::select_form($typeselect,'only', - %select_file_categories); + &Apache::loncommon::select_form( + $typeselect, + 'only', + %select_file_categories); $type_element = ''; $r->print($type_element @@ -541,11 +543,21 @@ END $storeuri='/'.(split(/\.(page|sequence)\/\//,$uri))[-1]; $storeuri=~s/\/+/\//g; # ---------------------------------------------------------------- Bread crumbs - $r->print(&Apache::lonhtmlcommon::crumbs($storeuri,'','', - (($env{'form.catalogmode'} eq 'import')? - 'document.forms.fileattr':'')). - &Apache::lonhtmlcommon::select_recent('residx','resrecent', -'window.status=this.form.resrecent.options[this.form.resrecent.selectedIndex].value;this.form.action=this.form.resrecent.options[this.form.resrecent.selectedIndex].value;this.form.submit();')); + $r->print( + '

' + .&Apache::lonhtmlcommon::crumbs( + $storeuri, + '', + '', + (($env{'form.catalogmode'} eq 'import')? + 'document.forms.fileattr':'')) + .'
' + .&Apache::lonhtmlcommon::select_recent( + 'residx', + 'resrecent', + 'window.status=this.form.resrecent.options[this.form.resrecent.selectedIndex].value;this.form.action=this.form.resrecent.options[this.form.resrecent.selectedIndex].value;this.form.submit();') + .'

' + ); # -------------------------------------------------------- Resource Home Button my $reshome=$env{'course.'.$env{'request.course.id'}.'.reshome'}; if ($reshome) { @@ -563,14 +575,13 @@ END &Apache::lonhtmlcommon::store_recent('residx',$storeuri,$storeuri); # -------------------------------------------------- Check All and Uncheck all if ($env{'form.catalogmode'} eq 'import') { - $r->print('
'); - $r->print(''); + $r->print('

'); + $r->print('

'); } # ----------------- output starting row to the indexed file/directory hierarchy #$r->print(&initdebug()); #$r->print(&writedebug("Omit:@Omit")) if (@Omit); #$r->print(&writedebug("Only:@Only")) if (@Only); - $r->print('

'); $r->print(&Apache::loncommon::start_data_table("LC_tableBrowseRes") .&Apache::loncommon::start_data_table_header_row()); $r->print("".&mt('Name')."\n"); @@ -913,8 +924,7 @@ sub display_line { return OK; } # Do we have permission to look at this? - - if($filecom[15] ne '1') { return OK if (!&Apache::lonnet::allowed('bre',$pathprefix.$filecom[0])); } + if($filecom[15] ne '1') { return OK if ((!&Apache::lonnet::allowed('bre',$pathprefix.$filecom[0])) && (!&Apache::lonnet::allowed('bro',$pathprefix.$filecom[0]))); } # make absolute links appear on different background #SB if ($absolute) { $fileclr='#ccdd99'; } @@ -1147,7 +1157,7 @@ $r->print (''.($output eq '' ? ' ':$output). + $r->print(''.($output eq '' ? ' ':$output). " \n"); } @@ -1322,8 +1332,12 @@ sub showpreview { my $output=''; my $embstyle=&Apache::loncommon::fileembstyle($curfext); if ($embstyle eq 'ssi') { - my $cache=$Apache::lonnet::perlvar{'lonDocRoot'}.$filelink. - '.tmp'; + my $cache = $Apache::lonnet::perlvar{'lonDocRoot'}.$filelink; + if ($env{'request.gcicontext'} eq 'buildtest') { + $cache .= '.tn'; + } else { + $cache .= '.tmp'; + } if ((!$env{'form.updatedisplay'}) && (-e $cache)) { open(FH,$cache);