Diff for /loncom/interface/londocs.pm between versions 1.26 and 1.27

version 1.26, 2002/10/11 18:06:32 version 1.27, 2002/10/15 20:50:19
Line 35  use Apache::loncommon; Line 35  use Apache::loncommon;
 use Apache::lonratedt;  use Apache::lonratedt;
 use Apache::lonratsrv;  use Apache::lonratsrv;
 use Apache::lonxml;  use Apache::lonxml;
   use GDBM_File;
   
 my $iconpath;  my $iconpath;
   
   my %hash;
   
   my $hashtied;
   
 # Mapread read maps into lonratedt::global arrays   # Mapread read maps into lonratedt::global arrays 
 # @order and @resources, determines status  # @order and @resources, determines status
 # sets @order - pointer to resources in right order  # sets @order - pointer to resources in right order
Line 218  END Line 223  END
     return $line;      return $line;
 }  }
   
   # ---------------------------------------------------------------- tie the hash
   
   sub tiehash {
       $hashtied=0;
       if ($ENV{'request.course.fn'}) {
           if (tie(%hash,'GDBM_File',$ENV{'request.course.fn'}.".db",
               &GDBM_READER(),0640)) {
                   $hashtied=1;
           }
       }    
   }
   
   sub untiehash {
       if ($hashtied) { untie %hash; }
       $hashtied=0;
   }
   
 # ================================================================ Main Handler  # ================================================================ Main Handler
 sub handler {  sub handler {
     my $r = shift;      my $r = shift;
Line 225  sub handler { Line 247  sub handler {
     $r->send_http_header;      $r->send_http_header;
     return OK if $r->header_only;      return OK if $r->header_only;
   
     
   if ($ENV{'form.verify'}) {    if ($ENV{'form.verify'}) {
     
    my $loaderror=&Apache::lonnet::overloaderror($r);     my $loaderror=&Apache::lonnet::overloaderror($r);
Line 232  sub handler { Line 255  sub handler {
   
    $r->print('<html><head><title>Verify Content</title></head>'.     $r->print('<html><head><title>Verify Content</title></head>'.
               &Apache::loncommon::bodytag('Verify Course Documents'));                &Apache::loncommon::bodytag('Verify Course Documents'));
      $hashtied=0;
      &tiehash();
      foreach (keys %hash) {
          if ($_=~/^src\_(.+)$/) {
              my $resid=$1;
              $r->rflush();
      if ($hash{$_}) {
                  my $fn=$hash{$_};
                  $r->print('<br /><a href="'.$fn.'" target="cat">'.
    ($hash{'title_'.$resid}?$hash{'title_'.$resid}:$fn).'</a> ');
           if ($fn=~/^\/res\//) {
      my $result=&Apache::lonnet::repcopy($fn);
                      if ($result eq OK) {
                          $r->print('<font color="green">ok</font>');
                          $r->rflush();
          my $dependencies=
                             &Apache::lonnet::metadata($_,'dependencies');
                          $r->print('Dependencies: '.$dependencies.'<br>');
                      } elsif ($result eq HTTP_SERVICE_UNAVAILABLE) {
                          $r->print(
                            '<font color="red"><b>connection down</b></font>');
                      } elsif ($result eq HTTP_NOT_FOUND) {
                          $r->print('<font color="red"><b>not found</b></font>');
                      } else {
                          $r->print(
                                '<font color="red"><b>access denied</b></font>');
                      }
                  }
              }
          }
      }
      &untiehash();
   } elsif ($ENV{'form.versions'}) {    } elsif ($ENV{'form.versions'}) {
     $r->print('<html><head><title>Check Versions</title></head>'.      $r->print('<html><head><title>Check Versions</title></head>'.
               &Apache::loncommon::bodytag('Check Course Document Versions'));                &Apache::loncommon::bodytag('Check Course Document Versions'));
      $hashtied=0;
      &tiehash();
   
      &untiehash();
   } else {    } else {
 # is this a standard course?  # is this a standard course?
   

Removed from v.1.26  
changed lines
  Added in v.1.27


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