version 1.101, 2002/10/08 13:24:36
|
version 1.105, 2002/10/20 18:39:36
|
Line 127 use DBI;
|
Line 127 use DBI;
|
use Apache::lonnet(); |
use Apache::lonnet(); |
use Apache::loncommon(); |
use Apache::loncommon(); |
use Apache::lonmysql; |
use Apache::lonmysql; |
|
use vars qw(%metadatafields %metadatakeys); |
|
|
my %addid; |
my %addid; |
my %nokey; |
my %nokey; |
|
|
my %metadatafields; |
|
my %metadatakeys; |
|
|
|
my $docroot; |
my $docroot; |
|
|
my $cuname; |
my $cuname; |
my $cudom; |
my $cudom; |
|
|
######################################### |
|
######################################### |
|
|
|
=pod |
=pod |
|
|
=item B<metaeval> |
=item B<metaeval> |
Line 267 sub metaread {
|
Line 262 sub metaread {
|
######################################### |
######################################### |
######################################### |
######################################### |
|
|
=pod |
|
|
|
=item B<sqltime> |
|
|
|
Convert 'time' format into a datetime sql format |
|
|
|
Parameters: |
|
|
|
=over 4 |
|
|
|
=item I<$timef> |
|
|
|
Seconds since 00:00:00 UTC, January 1, 1970. |
|
|
|
=back |
|
|
|
Returns: |
|
|
|
=over 4 |
|
|
|
=item Scalar string |
|
|
|
MySQL-compatible datetime string. |
|
|
|
=back |
|
|
|
=cut |
|
|
|
######################################### |
|
######################################### |
|
sub sqltime { |
|
my $timef=shift @_; |
|
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = |
|
localtime($timef); |
|
$mon++; $year+=1900; |
|
return "$year-$mon-$mday $hour:$min:$sec"; |
|
} |
|
|
|
|
|
######################################### |
|
######################################### |
|
|
|
sub coursedependencies { |
sub coursedependencies { |
my $url=&Apache::lonnet::declutter(shift); |
my $url=&Apache::lonnet::declutter(shift); |
$url=~s/\.meta$//; |
$url=~s/\.meta$//; |
Line 1124 END
|
Line 1077 END
|
unless ($metadatafields{'creationdate'}) { |
unless ($metadatafields{'creationdate'}) { |
$metadatafields{'creationdate'}=time; |
$metadatafields{'creationdate'}=time; |
} |
} |
$scrout.=&hiddenfield('creationdate',$metadatafields{'creationdate'}); |
$scrout.=&hiddenfield('creationdate', |
|
&Apache::loncommon::unsqltime($metadatafields{'creationdate'})); |
|
|
$scrout.=&hiddenfield('lastrevisiondate',time); |
$scrout.=&hiddenfield('lastrevisiondate',time); |
|
|
Line 1226 the server's attempts at publication.
|
Line 1180 the server's attempts at publication.
|
sub phasetwo { |
sub phasetwo { |
|
|
my ($r,$source,$target,$style,$distarget,$batch)=@_; |
my ($r,$source,$target,$style,$distarget,$batch)=@_; |
|
$source=~s/\/+/\//g; |
|
$target=~s/\/+/\//g; |
|
$distarget=~s/\/+/\//g; |
my $logfile; |
my $logfile; |
unless ($logfile=Apache::File->new('>>'.$source.'.log')) { |
unless ($logfile=Apache::File->new('>>'.$source.'.log')) { |
return |
return |
Line 1246 sub phasetwo {
|
Line 1203 sub phasetwo {
|
$metadatafields{'abstract'}=$ENV{'form.abstract'}; |
$metadatafields{'abstract'}=$ENV{'form.abstract'}; |
$metadatafields{'mime'}=$ENV{'form.mime'}; |
$metadatafields{'mime'}=$ENV{'form.mime'}; |
$metadatafields{'language'}=$ENV{'form.language'}; |
$metadatafields{'language'}=$ENV{'form.language'}; |
$metadatafields{'creationdate'}= |
$metadatafields{'creationdate'}=$ENV{'form.creationdate'}; |
&sqltime($ENV{'form.creationdate'}); |
$metadatafields{'lastrevisiondate'}=$ENV{'form.lastrevisiondate'}; |
$metadatafields{'lastrevisiondate'}= |
|
&sqltime($ENV{'form.lastrevisiondate'}); |
|
$metadatafields{'owner'}=$ENV{'form.owner'}; |
$metadatafields{'owner'}=$ENV{'form.owner'}; |
$metadatafields{'copyright'}=$ENV{'form.copyright'}; |
$metadatafields{'copyright'}=$ENV{'form.copyright'}; |
$metadatafields{'dependencies'}=$ENV{'form.dependencies'}; |
$metadatafields{'dependencies'}=$ENV{'form.dependencies'}; |
Line 1469 sub phasetwo {
|
Line 1424 sub phasetwo {
|
|
|
sub batchpublish { |
sub batchpublish { |
my ($r,$srcfile,$targetfile)=@_; |
my ($r,$srcfile,$targetfile)=@_; |
|
$srcfile=~s/\/+/\//g; |
|
$targetfile=~s/\/+/\//g; |
my $thisdisfn=$srcfile; |
my $thisdisfn=$srcfile; |
$thisdisfn=~s/\/home\/korte\/public_html\///; |
$thisdisfn=~s/\/home\/korte\/public_html\///; |
$srcfile=~s/\/+/\//g; |
$srcfile=~s/\/+/\//g; |
Line 1506 sub batchpublish {
|
Line 1463 sub batchpublish {
|
|
|
sub publishdirectory { |
sub publishdirectory { |
my ($r,$fn,$thisdisfn)=@_; |
my ($r,$fn,$thisdisfn)=@_; |
|
$fn=~s/\/+/\//g; |
|
$thisdisfn=~s/\/+/\//g; |
my $resdir= |
my $resdir= |
$Apache::lonnet::perlvar{'lonDocRoot'}.'/res/'.$cudom.'/'.$cuname.'/'. |
$Apache::lonnet::perlvar{'lonDocRoot'}.'/res/'.$cudom.'/'.$cuname.'/'. |
$thisdisfn; |
$thisdisfn; |
Line 1735 unless ($ENV{'form.phase'} eq 'two') {
|
Line 1694 unless ($ENV{'form.phase'} eq 'two') {
|
if (&Apache::loncommon::fileembstyle($thistype) eq 'ssi') { |
if (&Apache::loncommon::fileembstyle($thistype) eq 'ssi') { |
$r->print('<br /><a href="/adm/diff?filename=/~'.$cuname.'/'. |
$r->print('<br /><a href="/adm/diff?filename=/~'.$cuname.'/'. |
$thisdisfn. |
$thisdisfn. |
'&versionone=priv" target="cat">Diffs with Current Version</a><p>'); |
'&versiontwo=priv" target="cat">Diffs with Current Version</a><p>'); |
} |
} |
|
|
# ------------------ Publishing from $thisfn to $thistarget with $thisembstyle. |
# ------------------ Publishing from $thisfn to $thistarget with $thisembstyle. |