Diff for /loncom/publisher/lonpublisher.pm between versions 1.269 and 1.270

version 1.269, 2011/10/22 21:25:37 version 1.270, 2011/10/22 22:05:23
Line 1223  sub publish { Line 1223  sub publish {
     my $intr_scrout.='<br />'      my $intr_scrout.='<br />'
                     .'<form name="pubform" action="/adm/publish" method="post">';                      .'<form name="pubform" action="/adm/publish" method="post">';
     unless ($env{'form.makeobsolete'}) {      unless ($env{'form.makeobsolete'}) {
        my $thissrc=$source;  
        $thissrc=~s{^/home/($match_username)/public_html}{/priv/$1};  
        $intr_scrout.='<p class="LC_warning">'         $intr_scrout.='<p class="LC_warning">'
                     .&mt('Searching for your resource will be based on the following metadata. Please provide as much data as possible.')                      .&mt('Searching for your resource will be based on the following metadata. Please provide as much data as possible.')
                     .'</p>'                      .'</p>'
                     .'<p><input type="submit" value="'                      .'<p><input type="submit" value="'
                     .&mt('Finalize Publication')                      .&mt('Finalize Publication')
                     .'" /> <a href="'.$thissrc.'">'.&mt('Cancel').'</a></p>';                      .'" /> <a href="'.&Apache::loncfile::display($source).'">'.&mt('Cancel').'</a></p>';
     }      }
     $intr_scrout.=&Apache::lonhtmlcommon::start_pick_box();      $intr_scrout.=&Apache::lonhtmlcommon::start_pick_box();
     $intr_scrout.=      $intr_scrout.=
Line 1767  sub phasetwo { Line 1765  sub phasetwo {
   
 # ------------------------------------------------ Provide link to new resource  # ------------------------------------------------ Provide link to new resource
     unless ($batch) {      unless ($batch) {
         my $thissrc=$source;  
         $thissrc=~s{^/home/($match_username)/public_html}{/priv/$1};  
                   
           my $thissrc=&Apache::loncfile::display($source);
         my $thissrcdir=$thissrc;          my $thissrcdir=$thissrc;
         $thissrcdir=~s/\/[^\/]+$/\//;          $thissrcdir=~s/\/[^\/]+$/\//;
                   
Line 1839  sub batchpublish { Line 1836  sub batchpublish {
     my %oldenv=%env;      my %oldenv=%env;
     $srcfile=~s/\/+/\//g;      $srcfile=~s/\/+/\//g;
     $targetfile=~s/\/+/\//g;      $targetfile=~s/\/+/\//g;
     my $thisdisfn=$srcfile;  
     $thisdisfn=~s/\/home\/korte\/public_html\///;  
     $srcfile=~s/\/+/\//g;      $srcfile=~s/\/+/\//g;
   
     my $docroot=$r->dir_config('lonDocRoot');      my $docroot=$r->dir_config('lonDocRoot');
Line 1858  sub batchpublish { Line 1853  sub batchpublish {
             
     $r->print('<h2>'      $r->print('<h2>'
              .&mt('Publishing [_1]'               .&mt('Publishing [_1]'
                  ,'<span class="LC_filename">'.$thisdisfn.'</span>')                   ,'<span class="LC_filename">'.&Apache::loncfile::display($srcfile).'</span>')
              .'</h2>'               .'</h2>'
     );      );
   
Line 1973  sub publishdirectory { Line 1968  sub publishdirectory {
   
 sub defaultmetapublish {  sub defaultmetapublish {
     my ($r,$fn,$cuname,$cudom)=@_;      my ($r,$fn,$cuname,$cudom)=@_;
     $fn=~s/^\/\~$cuname\//\/home\/$cuname\/public_html\//;  
     unless (-e $fn) {      unless (-e $fn) {
        return HTTP_NOT_FOUND;         return HTTP_NOT_FOUND;
     }      }
     my $target=$fn;      my $target=$fn;
     $target=~s/^\/home\/$cuname\/public_html\//$Apache::lonnet::perlvar{'lonDocRoot'}\/res\/$cudom\/$cuname\//;      $target=~s/^\Q$Apache::lonnet::perlvar{'lonDocRoot'}\E\/priv\//\Q$Apache::lonnet::perlvar{'lonDocRoot'}\E\/res\//;
   
   
     &Apache::loncommon::content_type($r,'text/html');      &Apache::loncommon::content_type($r,'text/html');
Line 2021  sub defaultmetapublish { Line 2015  sub defaultmetapublish {
  $r->print($reply.'</p><br />');$r->rflush;   $r->print($reply.'</p><br />');$r->rflush;
     }      }
 # ------------------------------------------------------------------- Link back  # ------------------------------------------------------------------- Link back
     my $link=$fn;      $r->print("<a href='".&Apache::lonnet::display($fn)."'>".&mt('Back to Metadata').'</a>');
     $link=~s/^\/home\/$cuname\/public_html\//\/priv\/$cuname\//;  
     $r->print("<a href='$link'>".&mt('Back to Metadata').'</a>');  
     $r->print(&Apache::loncommon::end_page());      $r->print(&Apache::loncommon::end_page());
     return OK;      return OK;
 }  }

Removed from v.1.269  
changed lines
  Added in v.1.270


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