Diff for /loncom/publisher/loncleanup.pm between versions 1.4 and 1.10

version 1.4, 2005/05/29 01:46:16 version 1.10, 2008/12/24 07:58:34
Line 38  use Apache::loncacc; Line 38  use Apache::loncacc;
 use Apache::loncommon();  use Apache::loncommon();
 use Apache::lonlocal;  use Apache::lonlocal;
 use Apache::lonnet;  use Apache::lonnet;
   use lib '/home/httpd/lib/perl/';
   use LONCAPA;
    
   
 sub latextrans {  sub latextrans {
     my $symbolfont=shift;      my $symbolfont=shift;
Line 218  sub htmlclean { Line 221  sub htmlclean {
     }      }
 # Generate empty tags, remove wrong end tags  # Generate empty tags, remove wrong end tags
     unless ($blockemptytags) {      unless ($blockemptytags) {
  $raw=~s/\<(br|hr|img|meta|allow|basefont)([^\>\/]*?)\>/\<$1$2 \/\>/gis;   $raw=~s/\<(br|hr|img|meta|embed|allow|basefont)([^\>]*?)\>/\<$1$2 \/\>/gis;
  $raw=~s/\<\/(br|hr|img|meta|allow|basefont)\>//gis;   $raw=~s/\<\/(br|hr|img|meta|embed|allow|basefont)\>//gis;
    $raw=~s/\/ \/\>/\/\>/gs;
  unless ($full) {   unless ($full) {
     $raw=~s/\<[\/]*(body|head|html)\>//gis;      $raw=~s/\<[\/]*(body|head|html)\>//gis;
  }   }
Line 293  sub phasetwo { Line 297  sub phasetwo {
       $warningcount.' '.&mt('warning(s)').        $warningcount.' '.&mt('warning(s)').
               '<br /><a href="'.$newuri.'" target="prev">'.                '<br /><a href="'.$newuri.'" target="prev">'.
       &mt('Open (and edit) cleaned up file in new window').'</a>'.        &mt('Open (and edit) cleaned up file in new window').'</a>'.
               '<br /><a href="/adm/diff?filename='.&Apache::lonnet::escape($uri).                '<br /><a href="/adm/diff?filename='.&escape($uri).
       '&versionone=priv&filetwo='.        '&versionone=priv&filetwo='.
       &Apache::lonnet::escape($newuri).'" target="prev">'.        &escape($newuri).'" target="prev">'.
       &mt('Show diffs in new window').'</a><br />'.        &mt('Show diffs in new window').'</a><br />'.
       '<input type="hidden" name="phase" value="three" />'.        '<input type="hidden" name="phase" value="three" />'.
       '<input type="submit" name="accept" value="'.&mt('Accept Result').'" />'.        '<input type="submit" name="accept" value="'.&mt('Accept Result').'" />'.
Line 331  sub handler { Line 335  sub handler {
   
     if ($env{'form.filename'}) {      if ($env{'form.filename'}) {
  $fn=$env{'form.filename'};   $fn=$env{'form.filename'};
  $fn=~s/^http\:\/\/[^\/]+//;   $fn=~s/^https?\:\/\/[^\/]+//;
     } else {      } else {
  $r->log_reason($env{'user.name'}.' at '.$env{'user.domain'}.   $r->log_reason($env{'user.name'}.' at '.$env{'user.domain'}.
        ' unspecified filename for cleanup', $r->filename);          ' unspecified filename for cleanup', $r->filename); 
Line 358  sub handler { Line 362  sub handler {
  return HTTP_NOT_ACCEPTABLE;   return HTTP_NOT_ACCEPTABLE;
     }      }
   
     $fn=~s/\/\~(\w+)//;      $fn=~s{/~($LONCAPA::username_re)}{};
   
     &Apache::loncommon::content_type($r,'text/html');      &Apache::loncommon::content_type($r,'text/html');
     $r->send_http_header;      $r->send_http_header;
   
     $r->print('<html><head><title>LON-CAPA Construction Space</title></head>');      $r->print(&Apache::loncommon::start_page('Cleanup XML Document'));
   
     $r->print(&Apache::loncommon::bodytag('Cleanup XML Document'));  
     $r->print('<h2>'.$fn.'</h2>'.      $r->print('<h2>'.$fn.'</h2>'.
               '<form action="/adm/cleanup" method="post">'.                '<form action="/adm/cleanup" method="post">'.
               '<input type="hidden" name="filename" value="'.$env{'form.filename'}.'" />');                '<input type="hidden" name="filename" value="'.$env{'form.filename'}.'" />');
Line 385  sub handler { Line 387  sub handler {
     $r->print('</form>'.      $r->print('</form>'.
       '<br /><a href="/priv/'.$uname.'/'.$fn.'">'.&mt('Back to Source File').'</a>'.        '<br /><a href="/priv/'.$uname.'/'.$fn.'">'.&mt('Back to Source File').'</a>'.
               '<br /><a href="/priv/'.$uname.'/'.$dir.'">'.&mt('Back to Source Directory').'</a>'.                '<br /><a href="/priv/'.$uname.'/'.$dir.'">'.&mt('Back to Source Directory').'</a>'.
       '</body></html>');        &Apache::loncommon::end_page());
     return OK;        return OK;  
 }  }
   

Removed from v.1.4  
changed lines
  Added in v.1.10


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