--- loncom/publisher/lonpublisher.pm 2009/05/06 16:19:50 1.257
+++ loncom/publisher/lonpublisher.pm 2009/11/19 05:18:08 1.263
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Publication Handler
#
-# $Id: lonpublisher.pm,v 1.257 2009/05/06 16:19:50 bisitz Exp $
+# $Id: lonpublisher.pm,v 1.263 2009/11/19 05:18:08 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1166,15 +1166,16 @@ sub publish {
}
}
if ($chparms) {
- $scrout.='
'.&mt('Obsolete parameters or saved values').': '.
- $chparms.'
'.&mt('Warning!').
- '
'.
- &mt('If this resource is in active use, student performance data from the previous version may become inaccessible.').'
';
+ $scrout.=''.&mt('Obsolete parameters or saved values').': '
+ .$chparms.'
'
+ .''.&mt('Warning!').'
'
+ .&mt('If this resource is in active use, student performance data from the previous version may become inaccessible.')
+ .'
';
}
if ($metadatafields{'copyright'} eq 'priv') {
- $scrout.=''.&mt('Warning!').
- '
'.
- &mt('Copyright/distribution option "Private" is no longer supported. Select another option from below. Consider "Custom Rights" for maximum control over the usage of your resource.').'
';
+ $scrout.=''.&mt('Warning!').'
'
+ .&mt('Copyright/distribution option "Private" is no longer supported. Select another option from below. Consider "Custom Rights" for maximum control over the usage of your resource.')
+ .'
';
}
# ------------------------------------------------------- Now have all metadata
@@ -1640,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')."");
@@ -1745,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;
}
@@ -1768,15 +1771,26 @@ sub phasetwo {
my $thissrcdir=$thissrc;
$thissrcdir=~s/\/[^\/]+$/\//;
-
+ $r->print(&Apache::lonhtmlcommon::start_funclist());
+ unless ($env{'request.role'}=~/^(aa)/) {
+ $r->print(
+ &Apache::lonhtmlcommon::add_item_funclist(
+ ''
+ .&mt('View Published Version')
+ .'')
+ );
+ }
$r->print(
- '
'.
- &mt('View Published Version').''.
- ''.
- &mt('Back to Source').'
'.
- ''.
- &mt('Back to Source Directory').'
');
+ &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;
}
@@ -1875,12 +1889,20 @@ sub publishdirectory {
my $resdir=
$Apache::lonnet::perlvar{'lonDocRoot'}.'/res/'.$cudom.'/'.$cuname.'/'.
$thisdisfn;
- $r->print(''.&mt('Directory').' '.$thisdisfn.'
'.
- &mt('Target').': '.$resdir.'
');
+ $r->print(&Apache::lonhtmlcommon::start_pick_box()
+ .&Apache::lonhtmlcommon::row_title(&mt('Directory'))
+ .''.$thisdisfn.''
+ .&Apache::lonhtmlcommon::row_closure()
+ .&Apache::lonhtmlcommon::row_title(&mt('Target'))
+ .''.$resdir.''
+ );
my $dirptr=16384; # Mask indicating a directory in stat.cmode.
unless ($env{'form.phase'} eq 'two') {
# ask user what they want
+ $r->print(&Apache::lonhtmlcommon::row_closure()
+ .&Apache::lonhtmlcommon::row_title(&mt('Options'))
+ );
$r->print('');
+ $r->print(&Apache::lonhtmlcommon::row_closure(1)
+ .&Apache::lonhtmlcommon::end_pick_box()
+ );
$lock=0;
} else {
+ $r->print(&Apache::lonhtmlcommon::row_closure(1)
+ .&Apache::lonhtmlcommon::end_pick_box()
+ );
unless ($lock) { $lock=&Apache::lonnet::set_lock(&mt('Publishing [_1]',$fn)); }
# actually publish things
opendir(DIR,$fn);
@@ -2148,10 +2176,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' => &Apache::loncommon::authorspace(),
+ });
+ &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;
@@ -2215,7 +2258,7 @@ ENDCAPTION
$r->print(&Apache::lonhtmlcommon::row_closure()
.&Apache::lonhtmlcommon::row_title(&mt('Co-Author'))
.''
- .&mt('[_1] at [_2]',$cuname,$cudom)
+ .&Apache::loncommon::plainname($cuname,$cudom) .' ('.$cuname.':'.$cudom.')'
.''
);
}
@@ -2252,7 +2295,6 @@ ENDDIFF
}
} else {
&phasetwo($r,$thisfn,$thistarget,$thisembstyle,$thisdistarget);
- $r->print('
');
}
}
$r->print(&Apache::loncommon::end_page());