--- loncom/publisher/lonpublisher.pm 2009/11/24 01:11:53 1.258.2.3 +++ loncom/publisher/lonpublisher.pm 2009/05/26 16:08:00 1.259 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Publication Handler # -# $Id: lonpublisher.pm,v 1.258.2.3 2009/11/24 01:11:53 raeburn Exp $ +# $Id: lonpublisher.pm,v 1.259 2009/05/26 16:08:00 bisitz Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1641,8 +1641,7 @@ sub phasetwo { my $srcf=$2; my $srct=$3; my $srcd=$1; - my $docroot = $Apache::lonnet::perlvar{'lonDocRoot'}; - unless ($srcd=~/^\Q$docroot\E\/res/) { + unless ($srcd=~/^\/home\/httpd\/html\/res/) { print $logfile "\nPANIC: Target dir is ".$srcd; $r->print( "".&mt('Invalid target directory, FAIL').""); @@ -1747,8 +1746,7 @@ sub phasetwo { # ------------------------------------------------------------- Trigger updates push(@{$modified_urls},[$target,$source]); unless ($registered_cleanup) { - my $handlers = $r->get_handlers('PerlCleanupHandler'); - $r->set_handlers('PerlCleanupHandler' => [\¬ify,@{$handlers}]); + $r->register_cleanup(\¬ify); $registered_cleanup=1; } @@ -1771,15 +1769,14 @@ sub phasetwo { my $thissrcdir=$thissrc; $thissrcdir=~s/\/[^\/]+$/\//; - unless ($env{'request.role'} =~ /^aa/) { - $r->print( - '
'. - &mt('View Published Version').''); - } - $r->print('

'. + + $r->print( + '


'. + &mt('View Published Version').''. + '

'. &mt('Back to Source').'

'. - '

'. + '

'. &mt('Back to Source Directory').'

'); } return 1; @@ -2166,10 +2163,25 @@ sub handler { &Apache::loncommon::content_type($r,'text/html'); $r->send_http_header; + # Breadcrumbs + &Apache::lonhtmlcommon::clear_breadcrumbs(); + &Apache::lonhtmlcommon::add_breadcrumb({ + 'text' => 'Construction Space', + 'href' => '', # FIXME Add link to /priv/[user] + }); + &Apache::lonhtmlcommon::add_breadcrumb({ + 'text' => 'Resource Publication', + 'href' => '', + }); + my $js=''; - $r->print(&Apache::loncommon::start_page('Resource Publication',$js)); + $r->print(&Apache::loncommon::start_page('Resource Publication',$js) + .&Apache::lonhtmlcommon::breadcrumbs() + .&Apache::loncommon::head_subbox( + &Apache::loncommon::CSTR_pageheader()) # FIXME crumbs broken? + ); my $thisfn=$fn;