version 1.122, 2003/06/24 23:24:48
|
version 1.126.2.1, 2003/08/21 17:12:32
|
Line 304 string which presents the form field (fo
|
Line 304 string which presents the form field (fo
|
######################################### |
######################################### |
sub textfield { |
sub textfield { |
my ($title,$name,$value)=@_; |
my ($title,$name,$value)=@_; |
return "\n<p><b>$title:</b></p><br />". |
my $uctitle=uc($title); |
|
return "\n<p><font color=\"#800000\" face=\"helvetica\"><b>$uctitle:". |
|
"</b></font></p><br />". |
'<input type="text" name="'.$name.'" size=80 value="'.$value.'" />'; |
'<input type="text" name="'.$name.'" size=80 value="'.$value.'" />'; |
} |
} |
|
|
Line 316 sub hiddenfield {
|
Line 318 sub hiddenfield {
|
sub selectbox { |
sub selectbox { |
my ($title,$name,$value,$functionref,@idlist)=@_; |
my ($title,$name,$value,$functionref,@idlist)=@_; |
my $uctitle=uc($title); |
my $uctitle=uc($title); |
|
$value=(split(/\s*,\s*/,$value))[-1]; |
my $selout="\n<p><font color=\"#800000\" face=\"helvetica\"><b>$uctitle:". |
my $selout="\n<p><font color=\"#800000\" face=\"helvetica\"><b>$uctitle:". |
"</b></font></p><br />".'<select name="'.$name.'">'; |
'</b></font></p><br /><select name="'.$name.'">'; |
foreach (@idlist) { |
foreach (@idlist) { |
$selout.='<option value=\''.$_.'\''; |
$selout.='<option value=\''.$_.'\''; |
if ($_ eq $value) { |
if ($_ eq $value) { |
Line 695 sub fix_ids_and_indices {
|
Line 698 sub fix_ids_and_indices {
|
} |
} |
if (!$endtag) { if ($token->[4]=~m:/>$:) { $endtag=' /'; }; } |
if (!$endtag) { if ($token->[4]=~m:/>$:) { $endtag=' /'; }; } |
$outstring.='<'.$tag.$newparmstring.$endtag.'>'; |
$outstring.='<'.$tag.$newparmstring.$endtag.'>'; |
if ($lctag eq 'm') { |
if ($lctag eq 'm' || $lctag eq 'script' |
$outstring.=&get_all_text_unbalanced('/m',\@parser); |
|| $lctag eq 'display' || $lctag eq 'tex') { |
|
$outstring.=&get_all_text_unbalanced('/'.$lctag,\@parser); |
} |
} |
} elsif ($token->[0] eq 'E') { |
} elsif ($token->[0] eq 'E') { |
if ($token->[2]) { |
if ($token->[2]) { |
Line 812 sub publish {
|
Line 816 sub publish {
|
return ('<font color="red">No write permission to user directory, FAIL</font>',1); |
return ('<font color="red">No write permission to user directory, FAIL</font>',1); |
} |
} |
print $logfile |
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')) { |
if (($style eq 'ssi') || ($style eq 'rat') || ($style eq 'prv')) { |
# ------------------------------------------------------- This needs processing |
# ------------------------------------------------------- This needs processing |
Line 907 sub publish {
|
Line 911 sub publish {
|
$metadatafields{'author'}=~s/\s+/ /g; |
$metadatafields{'author'}=~s/\s+/ /g; |
$metadatafields{'author'}=~s/\s+$//; |
$metadatafields{'author'}=~s/\s+$//; |
$metadatafields{'owner'}=$cuname.'@'.$cudom; |
$metadatafields{'owner'}=$cuname.'@'.$cudom; |
|
$metadatafields{'modifyinguser'}=$ENV{'user.name'}.'@'. |
|
$ENV{'user.domain'}; |
|
$metadatafields{'authorspace'}=$cuname.'@'.$cudom; |
|
|
# ------------------------------------------------ Check out directory hierachy |
# ------------------------------------------------ Check out directory hierachy |
|
|
Line 1042 function uncheckAll(field) {
|
Line 1049 function uncheckAll(field) {
|
field[i].checked = false ; |
field[i].checked = false ; |
} |
} |
</script> |
</script> |
<p><b>Keywords: $keywords_help</b> |
<p><font color="#800000" face="helvetica"><b>KEYWORDS:</b></font> |
|
$keywords_help</b> |
<input type="button" value="check all" onclick="javascript:checkAll(document.pubform.keywords)" /> |
<input type="button" value="check all" onclick="javascript:checkAll(document.pubform.keywords)" /> |
<input type="button" value="uncheck all" onclick="javascript:uncheckAll(document.pubform.keywords)" /> |
<input type="button" value="uncheck all" onclick="javascript:uncheckAll(document.pubform.keywords)" /> |
</p> |
</p> |
Line 1077 END
|
Line 1085 END
|
$scrout.=&textfield('Notes','notes',$metadatafields{'notes'}); |
$scrout.=&textfield('Notes','notes',$metadatafields{'notes'}); |
|
|
$scrout.= |
$scrout.= |
'<p><b>Abstract:</b><br /><textarea cols="80" rows="5" name="abstract">'. |
"\n<p><font color=\"#800000\" face=\"helvetica\"><b>ABSTRACT:". |
|
"</b></font></p><br />". |
|
'<textarea cols="80" rows="5" name="abstract">'. |
$metadatafields{'abstract'}.'</textarea></p>'; |
$metadatafields{'abstract'}.'</textarea></p>'; |
|
|
$source=~/\.(\w+)$/; |
$source=~/\.(\w+)$/; |
|
|
$scrout.=&hiddenfield('mime',$1); |
$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', |
$scrout.=&selectbox('Language','language', |
$metadatafields{'language'}, |
$defaultlanguage, |
\&Apache::loncommon::languagedescription, |
\&Apache::loncommon::languagedescription, |
(&Apache::loncommon::languageids), |
(&Apache::loncommon::languageids), |
); |
); |
Line 1220 sub phasetwo {
|
Line 1235 sub phasetwo {
|
return 0; |
return 0; |
} |
} |
print $logfile |
print $logfile |
"\n================= Publish ".localtime()." Phase Two ================\n"; |
"\n================= Publish ".localtime()." Phase Two ================\n".$ENV{'user.name'}.'@'.$ENV{'user.domain'}."\n"; |
|
|
%metadatafields=(); |
%metadatafields=(); |
%metadatakeys=(); |
%metadatakeys=(); |
Line 1327 sub phasetwo {
|
Line 1342 sub phasetwo {
|
closedir(DIR); |
closedir(DIR); |
$maxversion++; |
$maxversion++; |
$r->print('<p>Creating old version '.$maxversion.'</p>'); |
$r->print('<p>Creating old version '.$maxversion.'</p>'); |
print $logfile "\nCreating old version ".$maxversion; |
print $logfile "\nCreating old version ".$maxversion."\n"; |
|
|
my $copyfile=$srcd.'/'.$srcf.'.'.$maxversion.'.'.$srct; |
my $copyfile=$srcd.'/'.$srcf.'.'.$maxversion.'.'.$srct; |
|
|
Line 1532 sub publishdirectory {
|
Line 1547 sub publishdirectory {
|
$ruid,$rgid,$rrdev,$rsize, |
$ruid,$rgid,$rrdev,$rsize, |
$ratime,$rmtime,$rctime, |
$ratime,$rmtime,$rctime, |
$rblksize,$rblocks)=stat($resdir.'/'.$filename); |
$rblksize,$rblocks)=stat($resdir.'/'.$filename); |
if ($rmtime<$cmtime) { |
if (($rmtime<$cmtime) || ($ENV{'form.forcerepub'})) { |
# previously published, modified now |
# previously published, modified now |
$publishthis=1; |
$publishthis=1; |
} |
} |
Line 1755 __END__
|
Line 1770 __END__
|
|
|
=back |
=back |
|
|
|
=back |
|
|
=cut |
=cut |
|
|