--- loncom/publisher/lonpublisher.pm 2003/06/24 23:24:48 1.122
+++ loncom/publisher/lonpublisher.pm 2003/08/21 17:12:32 1.126.2.1
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Publication Handler
#
-# $Id: lonpublisher.pm,v 1.122 2003/06/24 23:24:48 albertel Exp $
+# $Id: lonpublisher.pm,v 1.126.2.1 2003/08/21 17:12:32 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -304,7 +304,9 @@ string which presents the form field (fo
#########################################
sub textfield {
my ($title,$name,$value)=@_;
- return "\n
$title:
".
+ my $uctitle=uc($title);
+ return "\n$uctitle:".
+ "
".
' ';
}
@@ -316,8 +318,9 @@ sub hiddenfield {
sub selectbox {
my ($title,$name,$value,$functionref,@idlist)=@_;
my $uctitle=uc($title);
+ $value=(split(/\s*,\s*/,$value))[-1];
my $selout="\n$uctitle:".
- "
".'';
+ '';
foreach (@idlist) {
$selout.='[4]=~m:/>$:) { $endtag=' /'; }; }
$outstring.='<'.$tag.$newparmstring.$endtag.'>';
- if ($lctag eq 'm') {
- $outstring.=&get_all_text_unbalanced('/m',\@parser);
+ if ($lctag eq 'm' || $lctag eq 'script'
+ || $lctag eq 'display' || $lctag eq 'tex') {
+ $outstring.=&get_all_text_unbalanced('/'.$lctag,\@parser);
}
} elsif ($token->[0] eq 'E') {
if ($token->[2]) {
@@ -812,7 +816,7 @@ sub publish {
return ('No write permission to user directory, FAIL ',1);
}
print $logfile
-"\n\n================= Publish ".localtime()." Phase One ================\n";
+"\n\n================= Publish ".localtime()." Phase One ================\n".$ENV{'user.name'}.'@'.$ENV{'user.domain'}."\n";
if (($style eq 'ssi') || ($style eq 'rat') || ($style eq 'prv')) {
# ------------------------------------------------------- This needs processing
@@ -907,6 +911,9 @@ sub publish {
$metadatafields{'author'}=~s/\s+/ /g;
$metadatafields{'author'}=~s/\s+$//;
$metadatafields{'owner'}=$cuname.'@'.$cudom;
+ $metadatafields{'modifyinguser'}=$ENV{'user.name'}.'@'.
+ $ENV{'user.domain'};
+ $metadatafields{'authorspace'}=$cuname.'@'.$cudom;
# ------------------------------------------------ Check out directory hierachy
@@ -1042,7 +1049,8 @@ function uncheckAll(field) {
field[i].checked = false ;
}
-Keywords: $keywords_help
+
KEYWORDS:
+ $keywords_help
@@ -1077,15 +1085,22 @@ END
$scrout.=&textfield('Notes','notes',$metadatafields{'notes'});
$scrout.=
- 'Abstract:
';
$source=~/\.(\w+)$/;
$scrout.=&hiddenfield('mime',$1);
+ my $defaultlanguage=$metadatafields{'language'};
+ $defaultlanguage =~ s/\s*notset\s*//g;
+ $defaultlanguage =~ s/^,\s*//g;
+ $defaultlanguage =~ s/,\s*$//g;
+
$scrout.=&selectbox('Language','language',
- $metadatafields{'language'},
+ $defaultlanguage,
\&Apache::loncommon::languagedescription,
(&Apache::loncommon::languageids),
);
@@ -1220,7 +1235,7 @@ sub phasetwo {
return 0;
}
print $logfile
- "\n================= Publish ".localtime()." Phase Two ================\n";
+ "\n================= Publish ".localtime()." Phase Two ================\n".$ENV{'user.name'}.'@'.$ENV{'user.domain'}."\n";
%metadatafields=();
%metadatakeys=();
@@ -1327,7 +1342,7 @@ sub phasetwo {
closedir(DIR);
$maxversion++;
$r->print('Creating old version '.$maxversion.'
');
- print $logfile "\nCreating old version ".$maxversion;
+ print $logfile "\nCreating old version ".$maxversion."\n";
my $copyfile=$srcd.'/'.$srcf.'.'.$maxversion.'.'.$srct;
@@ -1532,7 +1547,7 @@ sub publishdirectory {
$ruid,$rgid,$rrdev,$rsize,
$ratime,$rmtime,$rctime,
$rblksize,$rblocks)=stat($resdir.'/'.$filename);
- if ($rmtime<$cmtime) {
+ if (($rmtime<$cmtime) || ($ENV{'form.forcerepub'})) {
# previously published, modified now
$publishthis=1;
}
@@ -1755,5 +1770,7 @@ __END__
=back
+=back
+
=cut