[LON-CAPA-cvs] cvs: loncom /publisher lonpublisher.pm
albertel
lon-capa-cvs@mail.lon-capa.org
Sat, 29 Mar 2003 05:58:12 -0000
This is a MIME encoded message
--albertel1048917492
Content-Type: text/plain
albertel Sat Mar 29 00:58:12 2003 EDT
Modified files:
/loncom/publisher lonpublisher.pm
Log:
- XHTMLizeing
--albertel1048917492
Content-Type: text/plain
Content-Disposition: attachment; filename="albertel-20030329005812.txt"
Index: loncom/publisher/lonpublisher.pm
diff -u loncom/publisher/lonpublisher.pm:1.119 loncom/publisher/lonpublisher.pm:1.120
--- loncom/publisher/lonpublisher.pm:1.119 Mon Mar 17 11:58:09 2003
+++ loncom/publisher/lonpublisher.pm Sat Mar 29 00:58:12 2003
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Publication Handler
#
-# $Id: lonpublisher.pm,v 1.119 2003/03/17 16:58:09 www Exp $
+# $Id: lonpublisher.pm,v 1.120 2003/03/29 05:58:12 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -242,7 +242,7 @@
my ($logfile,$fn)=@_;
unless (-e $fn) {
print($logfile 'No file '.$fn."\n");
- return '<br><b>No file:</b> <tt>'.$fn.'</tt>';
+ return '<br /><b>No file:</b> <tt>'.$fn.'</tt>';
}
print($logfile 'Processing '.$fn."\n");
my $metastring;
@@ -251,7 +251,7 @@
$metastring=join('',<$metafh>);
}
&metaeval($metastring);
- return '<br><b>Processed file:</b> <tt>'.$fn.'</tt>';
+ return '<br /><b>Processed file:</b> <tt>'.$fn.'</tt>';
}
#########################################
@@ -304,7 +304,7 @@
#########################################
sub textfield {
my ($title,$name,$value)=@_;
- return "\n<p><b>$title:</b><br>".
+ return "\n<p><b>$title:</b></p><br />".
'<input type="text" name="'.$name.'" size=80 value="'.$value.'" />';
}
@@ -317,7 +317,7 @@
my ($title,$name,$value,$functionref,@idlist)=@_;
my $uctitle=uc($title);
my $selout="\n<p><font color=\"#800000\" face=\"helvetica\"><b>$uctitle:".
- "</b></font><br />".'<select name="'.$name.'">';
+ "</b></font></p><br />".'<select name="'.$name.'">';
foreach (@idlist) {
$selout.='<option value=\''.$_.'\'';
if ($_ eq $value) {
@@ -841,7 +841,7 @@
unless ($style eq 'rat') {
$allowstr.="\n".'<allow src="'.$thisdep.'" />';
}
- $scrout.='<br>';
+ $scrout.='<br />';
unless ($thisdep=~/\*/) {
$scrout.='<a href="'.$thisdep.'">';
}
@@ -969,7 +969,7 @@
}
}
if ($chparms) {
- $scrout.='<p><b>New parameters or stored values:</b> '.$chparms;
+ $scrout.='<p><b>New parameters or stored values:</b> '.$chparms.'</p>';
}
$chparms='';
@@ -984,7 +984,7 @@
}
if ($chparms) {
$scrout.='<p><b>Obsolete parameters or stored values:</b> '.
- $chparms;
+ $chparms.'</p>';
}
# ------------------------------------------------------- Now have all metadata
@@ -1043,23 +1043,24 @@
}
</script>
<p><b>Keywords: $keywords_help</b>
-<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="check all" onclick="javascript:checkAll(document.pubform.keywords)" />
+<input type="button" value="uncheck all" onclick="javascript:uncheckAll(document.pubform.keywords)" />
+</p>
<br />
END
- $keywordout.='<table border=2><tr>';
+ $keywordout.='<table border="2"><tr>';
my $colcount=0;
foreach (sort keys %keywords) {
- $keywordout.='<td><input type=checkbox name="keywords" value="'.$_.'"';
+ $keywordout.='<td><input type="checkbox" name="keywords" value="'.$_.'"';
if ($metadatafields{'keywords'}) {
if ($metadatafields{'keywords'}=~/$_/) {
- $keywordout.=' checked';
+ $keywordout.=' checked="on"';
}
} elsif (&Apache::loncommon::keyword($_)) {
- $keywordout.=' checked';
+ $keywordout.=' checked="on"';
}
- $keywordout.='>'.$_.'</td>';
+ $keywordout.=' />'.$_.'</td>';
if ($colcount>10) {
$keywordout.="</tr><tr>\n";
$colcount=0;
@@ -1076,8 +1077,8 @@
$scrout.=&textfield('Notes','notes',$metadatafields{'notes'});
$scrout.=
- '<p><b>Abstract:</b><br><textarea cols=80 rows=5 name=abstract>'.
- $metadatafields{'abstract'}.'</textarea>';
+ '<p><b>Abstract:</b><br /><textarea cols="80" rows="5" name="abstract">'.
+ $metadatafields{'abstract'}.'</textarea></p>';
$source=~/\.(\w+)$/;
@@ -1274,7 +1275,7 @@
.'</'.$tag.'>';
}
}
- $r->print('<p>Wrote Metadata');
+ $r->print('<p>Wrote Metadata</p>');
print $logfile "\nWrote metadata";
}
@@ -1285,14 +1286,14 @@
unless ($metadatafields{'copyright'} eq 'priv') {
my ($error,$success) = &store_metadata(\%metadatafields);
if ($success) {
- $r->print('<p>Synchronized SQL metadata database');
+ $r->print('<p>Synchronized SQL metadata database</p>');
print $logfile "\nSynchronized SQL metadata database";
} else {
$r->print($error);
print $logfile "\n".$error;
}
} else {
- $r->print('<p>Private Publication - did not synchronize database');
+ $r->print('<p>Private Publication - did not synchronize database</p>');
print $logfile "\nPrivate: Did not synchronize data into ".
"SQL metadata database";
}
@@ -1322,14 +1323,14 @@
}
closedir(DIR);
$maxversion++;
- $r->print('<p>Creating old version '.$maxversion);
+ $r->print('<p>Creating old version '.$maxversion.'</p>');
print $logfile "\nCreating old version ".$maxversion;
my $copyfile=$srcd.'/'.$srcf.'.'.$maxversion.'.'.$srct;
if (copy($target,$copyfile)) {
print $logfile "Copied old target to ".$copyfile."\n";
- $r->print('<p>Copied old target file');
+ $r->print('<p>Copied old target file</p>');
} else {
print $logfile "Unable to write ".$copyfile.':'.$!."\n";
return "<font color=\"red\">Failed to copy old target, $!, FAIL</font>";
@@ -1341,7 +1342,7 @@
if (copy($target.'.meta',$copyfile)) {
print $logfile "Copied old target metadata to ".$copyfile."\n";
- $r->print('<p>Copied old metadata')
+ $r->print('<p>Copied old metadata</p>')
} else {
print $logfile "Unable to write metadata ".$copyfile.':'.$!."\n";
if (-e $target.'.meta') {
@@ -1352,7 +1353,7 @@
} else {
- $r->print('<p>Initial version');
+ $r->print('<p>Initial version</p>');
print $logfile "\nInitial version";
}
@@ -1367,14 +1368,14 @@
$path.="/$parts[$count]";
if ((-e $path)!=1) {
print $logfile "\nCreating directory ".$path;
- $r->print('<p>Created directory '.$parts[$count]);
+ $r->print('<p>Created directory '.$parts[$count].'</p>');
mkdir($path,0777);
}
}
if (copy($source,$copyfile)) {
print $logfile "\nCopied original source to ".$copyfile."\n";
- $r->print('<p>Copied source file');
+ $r->print('<p>Copied source file</p>');
} else {
print $logfile "\nUnable to write ".$copyfile.':'.$!."\n";
return "<font color=\"red\">Failed to copy source, $!, FAIL</font>";
@@ -1386,7 +1387,7 @@
if (copy($source.'.meta',$copyfile)) {
print $logfile "\nCopied original metadata to ".$copyfile."\n";
- $r->print('<p>Copied metadata');
+ $r->print('<p>Copied metadata</p>');
} else {
print $logfile "\nUnable to write metadata ".$copyfile.':'.$!."\n";
return
@@ -1400,7 +1401,7 @@
$r->print('<p>Notifying host '.$subhost.':');$r->rflush;
print $logfile "\nNotifying host ".$subhost.':';
my $reply=&Apache::lonnet::critical('update:'.$target,$subhost);
- $r->print($reply.'<br />');$r->rflush;
+ $r->print($reply.'</p><br />');$r->rflush;
print $logfile $reply;
}
@@ -1412,7 +1413,7 @@
print $logfile "\nNotifying host for metadata only ".$subhost.':';
my $reply=&Apache::lonnet::critical('update:'.$target.'.meta',
$subhost);
- $r->print($reply.'<br />');$r->rflush;
+ $r->print($reply.'</p><br />');$r->rflush;
print $logfile $reply;
}
@@ -1425,7 +1426,7 @@
my ($cdom,$cname)=split(/\_/,$_);
my $reply=&Apache::lonnet::cput
('versionupdate',{$target => $now},$cdom,$cname);
- $r->print($reply.'<br />');$r->rflush;
+ $r->print($reply.'</p><br />');$r->rflush;
print $logfile $reply;
}
# ------------------------------------------------ Provide link to new resource
@@ -1441,11 +1442,11 @@
$r->print(
- '<hr><a href="'.$thisdistarget.'"><font size="+2">'.
+ '<hr /><a href="'.$thisdistarget.'"><font size="+2">'.
'View Published Version</font></a>'.
- '<p><a href="'.$thissrc.'"><font size=+2>Back to Source</font></a>'.
+ '<p><a href="'.$thissrc.'"><font size=+2>Back to Source</font></a></p>'.
'<p><a href="'.$thissrcdir.
- '"><font size="+2">Back to Source Directory</font></a>');
+ '"><font size="+2">Back to Source Directory</font></a></p>');
}
}
@@ -1716,7 +1717,7 @@
$r->print('<h2>Publishing '.
&Apache::loncommon::filedescription($thistype).' <tt>'.
'<a href="/~'.$cuname.'/'.$thisdisfn.'" target="cat">'.$thisdisfn.
- '</a></tt></h2><b>Target:</b> <tt>'.$thisdistarget.'</tt><p>');
+ '</a></tt></h2><b>Target:</b> <tt>'.$thisdistarget.'</tt><br />');
if (($cuname ne $ENV{'user.name'}) || ($cudom ne $ENV{'user.domain'})) {
$r->print('<h3><font color="red">Co-Author: '.$cuname.' at '.$cudom.
@@ -1726,7 +1727,7 @@
if (&Apache::loncommon::fileembstyle($thistype) eq 'ssi') {
$r->print('<br /><a href="/adm/diff?filename=/~'.$cuname.'/'.
$thisdisfn.
- '&versiontwo=priv" target="cat">Diffs with Current Version</a><p>');
+ '&versiontwo=priv" target="cat">Diffs with Current Version</a><br />');
}
# ------------------ Publishing from $thisfn to $thistarget with $thisembstyle.
--albertel1048917492--