Diff for /loncom/publisher/loncfile.pm between versions 1.87 and 1.92

version 1.87, 2007/10/18 21:58:21 version 1.92, 2009/01/15 18:31:19
Line 109  sub Debug { Line 109  sub Debug {
     }      }
 }  }
   
   sub done {
      my ($url)=@_;
      my $done=&mt("Done");
      return(<<ENDDONE);
   <a href="$url">$done</a>
   <script type="text/javascript">
   location.href="$url";
   </script>
   ENDDONE
   }
   
 =pod  =pod
   
 =item URLToPath($url)  =item URLToPath($url)
Line 148  sub URLToPath { Line 159  sub URLToPath {
     my $Url = shift;      my $Url = shift;
     &Debug($r, "UrlToPath got: $Url");      &Debug($r, "UrlToPath got: $Url");
     $Url=~ s/\/+/\//g;      $Url=~ s/\/+/\//g;
     $Url=~ s/^http\:\/\/[^\/]+//;      $Url=~ s/^https?\:\/\/[^\/]+//;
     $Url=~ s/^\///;      $Url=~ s/^\///;
     $Url=~ s/(\~|priv\/)($match_username)\//\/home\/$2\/public_html\//;      $Url=~ s/(\~|priv\/)($match_username)\//\/home\/$2\/public_html\//;
     &Debug($r, "Returning $Url \n");      &Debug($r, "Returning $Url \n");
Line 350  sub cleanDest { Line 361  sub cleanDest {
  my ($newpath)=($dest=~m|(.*)/|);   my ($newpath)=($dest=~m|(.*)/|);
  $newpath=&relativeDest($fn,$newpath,$uname);   $newpath=&relativeDest($fn,$newpath,$uname);
  if (! -d "$newpath") {   if (! -d "$newpath") {
     $request->print("<p><span class=\"LC_error\">".&mt('You have requested to create file in directory [_1] which doesn\'t exist. The requested directory path has been removed from the requested file name.','"'.&display($newpath).'"')."</span></p>");      $request->print("<p><span class=\"LC_error\">"
                              .&mt("You have requested to create file in directory [_1] which doesn't exist. The requested directory path has been removed from the requested file name."
                                  ,'"'.&display($newpath).'"')
                              ."</span></p>");
     $dest=~s|.*/||;      $dest=~s|.*/||;
  }   }
     }      }
Line 435  Parameters: Line 449  Parameters:
   
 sub CloseForm2 {  sub CloseForm2 {
     my ($request, $user, $fn) = @_;      my ($request, $user, $fn) = @_;
     $request->print('<h3><a href="'.&url($fn).'/">'.&mt('Done').'</a></h3>');      $request->print(&done(&url($fn)));
 }  }
   
 =pod  =pod
Line 1128  sub NewDir2 { Line 1142  sub NewDir2 {
   
 sub decompress2 {  sub decompress2 {
     my ($r, $user, $dir, $file) = @_;      my ($r, $user, $dir, $file) = @_;
     &Apache::lonnet::appenv('cgi.file' => $file);      &Apache::lonnet::appenv({'cgi.file' => $file});
     &Apache::lonnet::appenv('cgi.dir' => $dir);      &Apache::lonnet::appenv({'cgi.dir' => $dir});
     my $result=&Apache::lonnet::ssi_body('/cgi-bin/decompress.pl');      my $result=&Apache::lonnet::ssi_body('/cgi-bin/decompress.pl');
     $r->print($result);      $r->print($result);
     &Apache::lonnet::delenv('cgi.file');      &Apache::lonnet::delenv('cgi.file');
Line 1256  sub phasetwo { Line 1270  sub phasetwo {
             $r->print('<h3><a href="'.&url($dest).'">'.&mt('Return to Directory').'</a></h3>');              $r->print('<h3><a href="'.&url($dest).'">'.&mt('Return to Directory').'</a></h3>');
             $r->print('<h3><a href="'.&url($dest_newname).'">'.$disp_newname.'</a></h3>');              $r->print('<h3><a href="'.&url($dest_newname).'">'.$disp_newname.'</a></h3>');
         } else {          } else {
     $r->print('<h3><a href="'.&url($dest).'">'.&mt('Done').'</a></h3>');      $r->print(&done(&url($dest)));
  }   }
     }      }
 }  }
Line 1330  sub handler { Line 1344  sub handler {
  $js = qq|   $js = qq|
 <script type="text/javascript">  <script type="text/javascript">
 function writeDone() {  function writeDone() {
     var winName = window.opener  
     window.focus();      window.focus();
     winName.document.dataForm.newdir.value = "$newdirname"      opener.document.info.newdir.value = "$newdirname";
     setTimeout("self.close()",10000)      setTimeout("self.close()",10000);
 }  }
   </script>    </script>
 |;  |;

Removed from v.1.87  
changed lines
  Added in v.1.92


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