Diff for /loncom/interface/londocs.pm between versions 1.150 and 1.153

version 1.150, 2004/12/10 19:21:21 version 1.153, 2004/12/10 20:47:33
Line 1152  END Line 1152  END
  } elsif ($url=~m|^/ext/|) {    } elsif ($url=~m|^/ext/|) { 
     $url='/adm/wrapper'.$url;      $url='/adm/wrapper'.$url;
  }   }
         unless ($container eq 'page') {   $url.=(($url=~/\?/)?'&':'?').'symb='.&Apache::lonnet::escape($symb);
    if ($container eq 'page') {
       my $symb=$ENV{'form.pagesymb'};
           
       $url=&Apache::lonnet::clutter((&Apache::lonnet::decode_symb($symb))[2]);
     $url.=(($url=~/\?/)?'&':'?').'symb='.&Apache::lonnet::escape($symb);      $url.=(($url=~/\?/)?'&':'?').'symb='.&Apache::lonnet::escape($symb);
         }   }
     }      }
     my $parameterset=' ';      my $parameterset=' ';
     if ($isfolder) {      if ($isfolder) {
Line 1176  END Line 1180  END
         my $folderpath=$ENV{'form.folderpath'};          my $folderpath=$ENV{'form.folderpath'};
         if ($folderpath) { $pagepath = $folderpath.'&' };          if ($folderpath) { $pagepath = $folderpath.'&' };
         $pagepath.=$pagearg.'&'.$pagename;          $pagepath.=$pagearg.'&'.$pagename;
         $url.='pagepath='.&Apache::lonnet::escape($pagepath);   my $symb=$ENV{'form.pagesymb'};
    if (!$symb) {
       my $path='uploaded/'.
    $ENV{'course.'.$ENV{'request.course.id'}.'.domain'}.'/'.
    $ENV{'course.'.$ENV{'request.course.id'}.'.num'}.'/';
       $symb=&Apache::lonnet::encode_symb($path.$folder.'.sequence',
          $residx,
          $path.$pagearg.'.page');
    }
    $url.='pagepath='.&Apache::lonnet::escape($pagepath).
       '&pagesymb='.&Apache::lonnet::escape($symb);
     }      }
       &Apache::lonnet::logthis(" link \n$url");
     $line.='<td bgcolor="#FFFFBB"><a href="'.$url.'"><img src="'.$icon.      $line.='<td bgcolor="#FFFFBB"><a href="'.$url.'"><img src="'.$icon.
  '" border="0"></a></td>'.   '" border="0"></a></td>'.
         "<td bgcolor='#FFFFBB'><a href='$url'>$title</a></td>";          "<td bgcolor='#FFFFBB'><a href='$url'>$title</a></td>";
Line 1210  ENDPARMS Line 1225  ENDPARMS
 sub tiehash {  sub tiehash {
     my ($mode)=@_;      my ($mode)=@_;
     $hashtied=0;      $hashtied=0;
     &Apache::lonnet::logthis(" tiehash1 -- $hashtied ");  
     if ($ENV{'request.course.fn'}) {      if ($ENV{'request.course.fn'}) {
  &Apache::lonnet::logthis(" tiehash2 -- $hashtied ");  
  if ($mode eq 'write') {   if ($mode eq 'write') {
     &Apache::lonnet::logthis(" tiehash3 -- $hashtied ");  
     if (tie(%hash,'GDBM_File',$ENV{'request.course.fn'}.".db",      if (tie(%hash,'GDBM_File',$ENV{'request.course.fn'}.".db",
     &GDBM_WRCREAT(),0640)) {      &GDBM_WRCREAT(),0640)) {
                 $hashtied=2;                  $hashtied=2;
  &Apache::lonnet::logthis(" tiehash4 -- $hashtied ");  
     }      }
  } else {   } else {
     &Apache::lonnet::logthis(" tiehash5 -- $hashtied ");  
     if (tie(%hash,'GDBM_File',$ENV{'request.course.fn'}.".db",      if (tie(%hash,'GDBM_File',$ENV{'request.course.fn'}.".db",
     &GDBM_READER(),0640)) {      &GDBM_READER(),0640)) {
                 $hashtied=1;                  $hashtied=1;
  &Apache::lonnet::logthis(" tiehash6 -- $hashtied ");  
     }      }
  }   }
     }          }    
     &Apache::lonnet::logthis(" tiehash7 -- $hashtied ");  
 }  }
   
 sub untiehash {  sub untiehash {
     &Apache::lonnet::logthis(" untiehash1 -- $hashtied ");  
     if ($hashtied) { untie %hash; }      if ($hashtied) { untie %hash; }
     $hashtied=0;      $hashtied=0;
     &Apache::lonnet::logthis(" untiehash2 -- $hashtied ");  
 }  }
   
 # --------------------------------------------------------------- check on this  # --------------------------------------------------------------- check on this
Line 1592  ENDHEADERS Line 1598  ENDHEADERS
   
 sub mark_hash_old {  sub mark_hash_old {
     my $retie_hash=0;      my $retie_hash=0;
     &Apache::lonnet::logthis(" markold1 -- $hashtied $retie_hash ");  
     if ($hashtied) {      if ($hashtied) {
  $retie_hash=1;   $retie_hash=1;
  &Apache::lonnet::logthis(" markold2 -- $hashtied $retie_hash ");  
  &untiehash();   &untiehash();
  &Apache::lonnet::logthis(" markold3 -- $hashtied $retie_hash ");  
     }      }
     &tiehash('write');      &tiehash('write');
     &Apache::lonnet::logthis(" markold4 -- $hashtied $retie_hash ");  
     $hash{'old'}=1;      $hash{'old'}=1;
     &Apache::lonnet::logthis(" markold5 -- $hashtied $retie_hash ");      
     &untiehash();      &untiehash();
     &Apache::lonnet::logthis(" markold6 -- $hashtied $retie_hash ");  
     if ($retie_hash) { &tiehash(); }      if ($retie_hash) { &tiehash(); }
     &Apache::lonnet::logthis(" markold7 -- $hashtied $retie_hash ");  
 }  }
   
 sub is_hash_old {  sub is_hash_old {
Line 1692  sub handler { Line 1691  sub handler {
     my $containertag;      my $containertag;
     my $uploadtag;      my $uploadtag;
     &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},      &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
     ['folderpath','pagepath']);      ['folderpath','pagepath','pagesymb']);
     if ($ENV{'form.folderpath'}) {      if ($ENV{'form.folderpath'}) {
  my (@folderpath)=split('&',$ENV{'form.folderpath'});   my (@folderpath)=split('&',$ENV{'form.folderpath'});
  $ENV{'form.foldername'}=&Apache::lonnet::unescape(pop(@folderpath));   $ENV{'form.foldername'}=&Apache::lonnet::unescape(pop(@folderpath));

Removed from v.1.150  
changed lines
  Added in v.1.153


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