Diff for /loncom/interface/lonindexer.pm between versions 1.76 and 1.77

version 1.76, 2003/09/23 00:26:10 version 1.77, 2003/09/26 00:23:09
Line 64  use Apache::loncommon(); Line 64  use Apache::loncommon();
 use Apache::Constants qw(:common);  use Apache::Constants qw(:common);
 use Apache::lonmeta;  use Apache::lonmeta;
 use Apache::File;  use Apache::File;
   use Apache::lonlocal;
 use GDBM_File;  use GDBM_File;
   
 # ---------------------------------------- variables used throughout the module  # ---------------------------------------- variables used throughout the module
Line 149  sub handler { Line 150  sub handler {
  '<a name="$anchor"><img src="'.$iconpath.'whitespace1.gif"'.   '<a name="$anchor"><img src="'.$iconpath.'whitespace1.gif"'.
  ' border="0" /></td>';   ' border="0" /></td>';
     $colspan=" colspan='2' ";      $colspan=" colspan='2' ";
               my $cl=&mt('Close');
             $closebutton=<<END;              $closebutton=<<END;
 <input type="button" name="close" value='CLOSE' onClick="self.close()">  <input type="button" name="close" value='$cl' onClick="self.close()">
 END  END
         }          }
  elsif ($ENV{'form.catalogmode'} eq 'groupimport') {   elsif ($ENV{'form.catalogmode'} eq 'groupimport') {
Line 158  END Line 160  END
  '<a name="$anchor"><img src="'.$iconpath.'whitespace1.gif"'.   '<a name="$anchor"><img src="'.$iconpath.'whitespace1.gif"'.
  ' border="0" /></td>';   ' border="0" /></td>';
     $colspan=" colspan='2' ";      $colspan=" colspan='2' ";
       my $cl=&mt('Close');
               my $gi=&mt('Group Import');
             $closebutton=<<END;              $closebutton=<<END;
 <input type="button" name="close" value='CLOSE' onClick="self.close()">  <input type="button" name="close" value='$cl' onClick="self.close()">
 END  END
             $groupimportbutton=<<END;              $groupimportbutton=<<END;
 <input type="button" name="groupimport" value='GROUP IMPORT'  <input type="button" name="groupimport" value='$gi'
 onClick="javascript:select_group()">  onClick="javascript:select_group()">
 END  END
         }          }
Line 399  $r->print(&Apache::loncommon::bodytag('B Line 403  $r->print(&Apache::loncommon::bodytag('B
 # ------------------------------- output state of file attributes to be showing  # ------------------------------- output state of file attributes to be showing
 #                                 All versions has to the last item  #                                 All versions has to the last item
 #                                 since it does not take an extra col  #                                 since it does not take an extra col
    my %lt=&Apache::lonlocal::texthash(
      'ti' => 'Title',
      'si' => 'Size',
      'la' => 'Last access',
      'lm' => 'Last modified',
      'st' => 'Statistics',
      'au' => 'Author',
      'kw' => 'Keywords',
      'la' => 'Language',
      'sr' => 'Show resource',
      'av' => 'All versions',
      'ud' => 'Update Display'
      );
  $r->print(<<END);   $r->print(<<END);
 <form method="post" name="fileattr" action="$uri"  <form method="post" name="fileattr" action="$uri"
  enctype="application/x-www-form-urlencoded">   enctype="application/x-www-form-urlencoded">
 <b><font color="#666666">Display file attributes</font></b><br />  <b><font color="#666666">Display file attributes</font></b><br />
 <table border=0><tr>  <table border=0><tr>
 <td><input type="checkbox" name="attr0" value="1" $attrchk[0] /> Title</td>  <td><input type="checkbox" name="attr0" value="1" $attrchk[0] /> $lt{'ti'}</td>
 <td><input type="checkbox" name="attr1" value="1" $attrchk[1] /> Size</td>  <td><input type="checkbox" name="attr1" value="1" $attrchk[1] /> $lt{'si'}</td>
 <td><input type="checkbox" name="attr2" value="1" $attrchk[2] /> Last access</td>  <td><input type="checkbox" name="attr2" value="1" $attrchk[2] /> $lt{'la'}</td>
 <td><input type="checkbox" name="attr3" value="1" $attrchk[3] /> Last modified</td>  <td><input type="checkbox" name="attr3" value="1" $attrchk[3] /> $lt{'lm'}</td>
 <td><input type="checkbox" name="attr8" value="1" $attrchk[8] /> Statistics</td></tr><tr>  <td><input type="checkbox" name="attr8" value="1" $attrchk[8] /> $lt{'st'}</td>
 <td><input type="checkbox" name="attr4" value="1" $attrchk[4] /> Author</td>  </tr><tr>
 <td><input type="checkbox" name="attr5" value="1" $attrchk[5] /> Keywords</td>  <td><input type="checkbox" name="attr4" value="1" $attrchk[4] /> $lt{'au'}</td>
 <td><input type="checkbox" name="attr6" value="1" $attrchk[6] /> Language</td>  <td><input type="checkbox" name="attr5" value="1" $attrchk[5] /> $lt{'kw'}</td>
 <td><input type="checkbox" name="attr7" value="1" $attrchk[7] /> Show Resource</td>  <td><input type="checkbox" name="attr6" value="1" $attrchk[6] /> $lt{'la'}</td>
 <td><input type="checkbox" name="attr9" value="1" $attrchk[9] /> All versions</td>  <td><input type="checkbox" name="attr7" value="1" $attrchk[7] /> $lt{'sr'}</td>
   <td><input type="checkbox" name="attr9" value="1" $attrchk[9] /> $lt{'av'}</td>
 <td>&nbsp;</td>  <td>&nbsp;</td>
 </tr></table>  </tr></table>
 <input type="hidden" name="dirPointer" value="on" />  <input type="hidden" name="dirPointer" value="on" />
 <input type="hidden" name="acts" value="" />  <input type="hidden" name="acts" value="" />
 <input type="submit" name="attrs" value="Update Display" />  <input type="submit" name="attrs" value="$lt{'ud'}" />
 $closebutton  $closebutton
 $groupimportbutton  $groupimportbutton
 </form>  </form>
Line 431  END Line 449  END
 #        $r->print(&writedebug("Only:@Only")) if (@Only);  #        $r->print(&writedebug("Only:@Only")) if (@Only);
         $r->print("<table width='100\%' border=0><tr><td bgcolor=#777777>\n");          $r->print("<table width='100\%' border=0><tr><td bgcolor=#777777>\n");
  $r->print("<table width='100\%' border=0><tr bgcolor=$titleclr>\n");   $r->print("<table width='100\%' border=0><tr bgcolor=$titleclr>\n");
  $r->print("<td $colspan><b>Name</b></td>\n");   $r->print("<td $colspan><b>".&mt('Name')."</b></td>\n");
  $r->print("<td><b>Title</b></td>\n")    $r->print("<td><b>".&mt('Title')."</b></td>\n") 
     if ($hash{'display_attrs_0'} == 1);      if ($hash{'display_attrs_0'} == 1);
  $r->print("<td align=right><b>Size (bytes) ".   $r->print("<td align=right><b>".&mt("Size")." (".&mt("bytes").") ".
   "</b></td>\n") if ($hash{'display_attrs_1'} == 1);    "</b></td>\n") if ($hash{'display_attrs_1'} == 1);
  $r->print("<td><b>Last accessed</b></td>\n")    $r->print("<td><b>".&mt("Last accessed")."</b></td>\n") 
     if ($hash{'display_attrs_2'} == 1);      if ($hash{'display_attrs_2'} == 1);
  $r->print("<td><b>Last modified</b></td>\n")   $r->print("<td><b>".&mt("Last modified")."</b></td>\n")
     if ($hash{'display_attrs_3'} == 1);      if ($hash{'display_attrs_3'} == 1);
  $r->print("<td><b>Author(s)</b></td>\n")   $r->print("<td><b>".&mt("Author(s)")."</b></td>\n")
     if ($hash{'display_attrs_4'} == 1);      if ($hash{'display_attrs_4'} == 1);
  $r->print("<td><b>Keywords</b></td>\n")   $r->print("<td><b>".&mt("Keywords")."</b></td>\n")
     if ($hash{'display_attrs_5'} == 1);      if ($hash{'display_attrs_5'} == 1);
  $r->print("<td><b>Language</b></td>\n")   $r->print("<td><b>".&mt("Language")."</b></td>\n")
     if ($hash{'display_attrs_6'} == 1);      if ($hash{'display_attrs_6'} == 1);
  $r->print("<td><b>Resource</b></td>\n")   $r->print("<td><b>".&mt("Resource")."</b></td>\n")
     if ($hash{'display_attrs_7'} == 1);      if ($hash{'display_attrs_7'} == 1);
  $r->print("<td><b>Usage Statistics <br />(Courses/Network Hits)</b></td>\n")   $r->print("<td><b>".&mt("Usage Statistics")." <br />(".
     &mt("Courses/Network Hits").")</b></td>\n")
     if ($hash{'display_attrs_8'} == 1);      if ($hash{'display_attrs_8'} == 1);
  $r->print('</tr>');   $r->print('</tr>');
   
Line 586  sub get_list { Line 605  sub get_list {
     my @list;      my @list;
     (my $luri = $uri) =~ s/\//_/g;      (my $luri = $uri) =~ s/\//_/g;
   
     if ($ENV{'form.attrs'} eq 'Update Display') {      if ($ENV{'form.attrs'} eq &mt('Update Display')) {
  foreach (keys %hash) {   foreach (keys %hash) {
     delete $hash{$_} if ($_ =~ /^dirlist_files_/);      delete $hash{$_} if ($_ =~ /^dirlist_files_/);
     }      }
Line 665  sub display_line { Line 684  sub display_line {
     my @pathcom = split (/\//,$filecom[0]);      my @pathcom = split (/\//,$filecom[0]);
     my $listname = $pathcom[scalar(@pathcom)-1];      my $listname = $pathcom[scalar(@pathcom)-1];
     my $fnptr = $filecom[3]&$dirptr;      my $fnptr = $filecom[3]&$dirptr;
     my $msg = 'View '.$filecom[0].' resources';      my $msg = &mt('View').' '.$filecom[0].' '.&mt('resources');
     $msg = 'Close '.$filecom[0].' directory' if $diropen eq 'opened';      $msg = &mt('Close').' '.$filecom[0].' '.&mt('directory') if $diropen eq 'opened';
   
     my $tabtag='</td>';      my $tabtag='</td>';
     my $i=0;      my $i=0;
Line 695  sub display_line { Line 714  sub display_line {
  $r->print ('<input src="'.$iconpath.'arrow_up.gif"');   $r->print ('<input src="'.$iconpath.'arrow_up.gif"');
  $r->print (' name="'.$msg.'" height="22" type="image" border="0">'.   $r->print (' name="'.$msg.'" height="22" type="image" border="0">'.
    "\n");     "\n");
  $r->print("Up $tabtag</tr></form>\n");   $r->print(&mt("Up")." $tabtag</tr></form>\n");
  return OK;   return OK;
     }      }
 # Do we have permission to look at this?  # Do we have permission to look at this?
Line 720  sub display_line { Line 739  sub display_line {
  $r->print ('<a href="javascript:gothere(\''.$filecom[0].   $r->print ('<a href="javascript:gothere(\''.$filecom[0].
    '\')"><img src="'.$iconpath.'server.gif"');     '\')"><img src="'.$iconpath.'server.gif"');
  $r->print (' border="0" /></a>'."\n");   $r->print (' border="0" /></a>'."\n");
  $r->print ("Domain - $listname ");   $r->print (&mt("Domain")." - $listname ");
  if ($Apache::lonnet::domaindescription{$listname}) {   if ($Apache::lonnet::domaindescription{$listname}) {
     $r->print("(".$Apache::lonnet::domaindescription{$listname}.      $r->print("(".$Apache::lonnet::domaindescription{$listname}.
       ")");        ")");
Line 758  sub display_line { Line 777  sub display_line {
 # display file  # display file
     if ($fnptr == 0 and $filecom[3] ne '') {      if ($fnptr == 0 and $filecom[3] ne '') {
  my $filelink = $startdir.$filecom[0];   my $filelink = $startdir.$filecom[0];
    next if &Apache::lonnet::metadata($filelink,'obsolete');
  my @file_ext = split (/\./,$listname);   my @file_ext = split (/\./,$listname);
  my $curfext = $file_ext[-1];   my $curfext = $file_ext[-1];
         if (@Omit) {          if (@Omit) {

Removed from v.1.76  
changed lines
  Added in v.1.77


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>