--- loncom/interface/lonindexer.pm 2004/09/07 20:38:20 1.123 +++ loncom/interface/lonindexer.pm 2005/03/03 07:53:55 1.132 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Directory Indexer # -# $Id: lonindexer.pm,v 1.123 2004/09/07 20:38:20 matthew Exp $ +# $Id: lonindexer.pm,v 1.132 2005/03/03 07:53:55 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -73,6 +73,8 @@ my @Only = (); my @Omit = (); + + # ----------------------------- Handling routine called via Apache and mod_perl sub handler { my $r = shift; @@ -134,7 +136,7 @@ sub handler { } #Hijack lonindexer to verify a title and be close down. if ($ENV{'form.launch'} eq '2') { - $r->content_type('text/html'); + &Apache::loncommon::content_type($r,'text/html'); my $extra=''; if (defined($ENV{'form.titleelement'}) && $ENV{'form.titleelement'} ne '') { @@ -143,16 +145,22 @@ sub handler { $verify_title=~s/'/\\'/g; $extra='window.opener.document.forms["'.$ENV{'form.form'}.'"].elements["'.$ENV{'form.titleelement'}.'"].value=\''.$verify_title.'\';'; } + my $html=&Apache::lonxml::xmlbegin(); $r->print(< - - + + + ENDSUBM @@ -170,7 +178,7 @@ ENDSUBM $colspan=" colspan='2' "; my $cl=&mt('Close'); $closebutton=< + END } elsif ($ENV{'form.catalogmode'} eq 'groupimport') { @@ -181,11 +189,11 @@ END my $cl=&mt('Close'); my $gi=&mt('Import'); $closebutton=< + END $groupimportbutton=< +onClick="javascript:select_group()" /> END } # Additions made by Matthew to make the browser a little easier to deal @@ -339,11 +347,14 @@ END } # ---------------------------------------------------------------- Print Header + my $html='';#&Apache::lonxml::xmlbegin(); $r->print(< +$html The LearningOnline Network With CAPA Directory Browser + + ENDJS } @@ -812,12 +824,12 @@ sub display_line { 'enctype="application/x-www-form-urlencoded"'. '>'."\n"); $r->print (''."\n"); - $r->print (''."\n"); + $startdir.'" />'."\n"); + $r->print (''."\n"); $r->print ('print (' name="'.$msg.'" height="22" type="image" border="0">'. + $r->print (' name="'.$msg.'" height="22" type="image" border="0" />'. "\n"); - $r->print(&mt("Up")." $tabtag\n"); + $r->print(&mt("Up")." $tabtag\n"); return OK; } # Do we have permission to look at this? @@ -829,7 +841,7 @@ sub display_line { # display domain if ($filecom[1] eq 'domain') { - $r->print (''."\n") + $r->print (''."\n") if ($ENV{'form.dirPointer'} eq "on"); $r->print("$extrafield"); $r->print(""); @@ -837,12 +849,13 @@ sub display_line { my $anchor = $filecom[0]; $anchor =~ s/\///g; $r->print (''); - $r->print (''); + $r->print (''); $r->print ('print (' name="'.$msg.'" height="22" type="image" border="0">'. + $r->print (' name="'.$msg.'" height="22" type="image" border="0" />'. "\n"); - $r->print ('print (' border="0" />'."\n"); $r->print (&mt("Domain")." - $listname "); @@ -850,7 +863,7 @@ sub display_line { $r->print("(".$Apache::lonnet::domaindescription{$listname}. ")"); } - $r->print (" $tabtag\n"); + $r->print (" $tabtag\n"); return OK; # display user directory @@ -864,19 +877,21 @@ sub display_line { &begin_form ($r,$curdir); $r->print (''."\n"); - $r->print (''); + $r->print (''); $r->print ('print (' name="'.$msg.'" height="22" type="image" border="0">'. + $r->print (' name="'.$msg.'" height="22" type="image" border="0" />'. "\n"); - $r->print (''); my $domain=(split(m|/|,$startdir))[2]; my $plainname=&Apache::loncommon::plainname($listname,$domain); $r->print ($listname); if (defined($plainname) && $plainname) { $r->print(" ($plainname) "); } - $r->print ($tabtag.''."\n"); + $r->print (''.$tabtag.''."\n"); return OK; } @@ -895,11 +910,12 @@ sub display_line { } # Set the icon for the file my $iconname = &Apache::loncommon::icon($listname); - $r->print(""); + $r->print(""); if ($ENV{'form.catalogmode'} eq 'interactive') { + my $quotable_filelink = &Apache::loncommon::escape_single($filelink); $r->print(""); + $quotable_filelink,"')\">"); $r->print("". "\n"); $r->print(""); @@ -911,7 +927,7 @@ sub display_line { if ($hash{'store_'.$filelink}) { $r->print("checked"); } - $r->print(">\n"); + $r->print(" />\n"); $r->print("\n"); $r->print(""); $hash{"pre_${fnum}_link"}=$filelink; @@ -946,10 +962,10 @@ sub display_line { my $curdir = $startdir.$filecom[0].'/'; my $anchor = $curdir; $anchor =~ s/\///g; - $r->print (''); + $r->print (''); $r->print ('print (' name="'.$msg.'" height="22" type="image" border="0">'. + $r->print (' name="'.$msg.'" height="22" type="image" border="0" />'. "\n"); } # Filetype icons @@ -958,11 +974,14 @@ sub display_line { if ($filelink=~/\.(page|sequence)$/) { $r->print(''); } - $r->print (" print (" $listname "); - $r->print (" (print (" (metadata) "); $r->print("\n"); @@ -1022,7 +1041,9 @@ sub display_line { my $source = &Apache::lonnet::metadata($filelink,'sourceavail'); if($source eq 'open') { my $sourcelink = &Apache::lonsource::make_link($filelink,$listname); - $r->print(''."print(''."Yes "."\n"); } else { #A cuddled else. :P @@ -1094,12 +1115,14 @@ sub display_line { $r->print ("\n") if $rem > 0; } - $r->print (''); + $r->print (''); $r->print ('print (' name="'.$msg.'" height="22" type="image" border="0">'. + $r->print (' name="'.$msg.'" height="22" type="image" border="0" />'. "\n"); - $r->print (''. "\n"); $r->print ("$listname\n"); @@ -1177,9 +1200,9 @@ sub begin_form { '" onSubmit="return rep_dirpath(\''.$dnum.'\''. ',document.forms.fileattr.acts.value)" '. 'enctype="application/x-www-form-urlencoded">'."\n"); - $r->print (''. + $r->print (''. "\n"); - $r->print (''."\n"); + $r->print (''."\n"); $dnum++; } @@ -1217,6 +1240,10 @@ sub cleanup { } } + + + + =head1 NAME Apache::lonindexer - mod_perl module for cross server filesystem browsing