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

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

'. - '

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

'); + $r->print(&Apache::loncommon::head_subbox( + &Apache::lonhtmlcommon::start_funclist(). + &Apache::lonhtmlcommon::add_item_funclist( + ''. + &mt('View Published Version'). + ''). + &Apache::lonhtmlcommon::add_item_funclist( + ''. + &mt('Back to Source'). + ''). + &Apache::lonhtmlcommon::add_item_funclist( + ''. + &mt('Back to Source Directory'). + ''). + &Apache::lonhtmlcommon::end_funclist()) + ); } return 1; } @@ -2167,7 +2176,7 @@ sub handler { &Apache::lonhtmlcommon::clear_breadcrumbs(); &Apache::lonhtmlcommon::add_breadcrumb({ 'text' => 'Construction Space', - 'href' => '', # FIXME Add link to /priv/[user] + 'href' => &Apache::loncommon::authorspace(), }); &Apache::lonhtmlcommon::add_breadcrumb({ 'text' => 'Resource Publication', @@ -2282,7 +2291,6 @@ ENDDIFF } } else { &phasetwo($r,$thisfn,$thistarget,$thisembstyle,$thisdistarget); - $r->print('
'); } } $r->print(&Apache::loncommon::end_page());