--- loncom/publisher/lonpublisher.pm 2008/08/19 10:43:59 1.246
+++ loncom/publisher/lonpublisher.pm 2009/08/13 05:35:33 1.258.2.1
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Publication Handler
#
-# $Id: lonpublisher.pm,v 1.246 2008/08/19 10:43:59 bisitz Exp $
+# $Id: lonpublisher.pm,v 1.258.2.1 2009/08/13 05:35:33 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -384,11 +384,11 @@ sub selectbox {
my $selout="\n".&Apache::lonhtmlcommon::row_title($title)
.''.&Apache::lonhtmlcommon::row_closure();
return $selout;
@@ -695,6 +695,7 @@ sub fix_ids_and_indices {
$responsecounter=0;
}
if ($lctag=~/response$/) { $responsecounter++; }
+ if ($lctag eq 'import') { $responsecounter++; }
my %parms=%{$token->[2]};
$counter=$addid{$tag};
if (!$counter) { $counter=$addid{$lctag}; }
@@ -873,7 +874,7 @@ sub store_metadata {
}
if (defined($status) && $status ne '') {
$error=''
- .&mt('Error occured saving new values in metadata table in LON-CAPA database!')
+ .&mt('Error occurred saving new values in metadata table in LON-CAPA database!')
.'';
&Apache::lonnet::logthis($error);
&Apache::lonnet::logthis($status);
@@ -947,7 +948,7 @@ backup copies, performs any automatic pr
especially for rat and ssi files),
Returns a 2 element array, the first is the string to be shown to the
-user, the second is an error code, either 1 (an error occured) or 0
+user, the second is an error code, either 1 (an error occurred) or 0
(no error occurred)
I '.&mt('Obsolete parameters or saved values').': '.
- $chparms.' '.
- &mt('If this resource is in active use, student performance data from the previous version may become inaccessible.').' '.&mt('Obsolete parameters or saved values').': '
+ .$chparms.' '.&mt('Warning!').''.&mt('Metadata Information').' ' .
+ $scrout.='
'.&mt('Metadata').' ' .
&Apache::loncommon::help_open_topic("Metadata_Description")
. '
';
}
@@ -1165,15 +1166,16 @@ sub publish {
}
}
if ($chparms) {
- $scrout.=''.&mt('Warning!').
- '
';
+ $scrout.='
'
+ .&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('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.').'
'.&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.')
+ .'
Creating old version '.$maxversion.'
'); + $r->print(''.&mt('Creating old version [_1]',$maxversion).'
'); print $logfile "\nCreating old version ".$maxversion."\n"; my $copyfile=$srcd.'/'.$srcf.'.'.$maxversion.'.'.$srct; @@ -1701,8 +1710,12 @@ sub phasetwo { $path.="/$parts[$count]"; if ((-e $path)!=1) { print $logfile "\nCreating directory ".$path; - $r->print(''.&mt('Created directory').' '.$parts[$count].'
'); mkdir($path,0777); + $r->print('' + .&mt('Created directory [_1]' + ,''.$parts[$count].'') + .'
' + ); } } @@ -1745,27 +1758,29 @@ sub phasetwo { &Apache::lonnet::devalidate_cache_new('meta', &Apache::lonnet::declutter($thisdistarget)); +# ------------------------------------------------------------- Everything done + $logfile->close(); + $r->print(''.&mt('Done').'
'); + # ------------------------------------------------ Provide link to new resource unless ($batch) { - my $thissrc=$source; $thissrc=~s{^/home/($match_username)/public_html}{/priv/$1}; my $thissrcdir=$thissrc; $thissrcdir=~s/\/[^\/]+$/\//; - - $r->print( - ''.
+ unless ($env{'request.role'} =~ /^aa/) {
+ $r->print(
+ ' '.
+ ' '.
&mt('Back to Source Directory').' '.&mt('Done').' '.&mt('Created directory').' '.$parts[$count].' '
+ .&mt('Created directory [_1]'
+ ,''.$parts[$count].'')
+ .'
'.
+ $&mt('View Published Version').'');
+ }
+ $r->print(''.
- ''.&mt('Publishing').' '.$thisdisfn.'
');
+ $r->print(''
+ .&mt('Publishing [_1]'
+ ,''.$thisdisfn.'')
+ .'
'
+ );
# phase one takes
# my ($source,$target,$style,$batch)=@_;
@@ -1859,22 +1878,36 @@ 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);
@@ -1942,7 +1975,7 @@ sub defaultmetapublish {
&Apache::loncommon::content_type($r,'text/html');
$r->send_http_header;
- $r->print(&Apache::loncommon::start_page('Catalog Information Publication'));
+ $r->print(&Apache::loncommon::start_page('Metadata Publication'));
# ---------------------------------------------------------------- Write Source
my $copyfile=$target;
@@ -1954,8 +1987,12 @@ sub defaultmetapublish {
for ($count=5;$count<$#parts;$count++) {
$path.="/$parts[$count]";
if ((-e $path)!=1) {
- $r->print(''.&mt('Publishing [_1]',''.$thisdisfn.'').'
');
+ $r->print(''
+ .&mt('Publishing [_1]'
+ ,''.$thisdisfn.'')
+ .'
'
+ );
$r->print(''.&mt('Resource Details').'
');
@@ -2191,7 +2232,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.')'
.''
);
}