version 1.23, 2002/10/20 18:40:00
|
version 1.28, 2003/03/14 19:29:36
|
Line 98 sub dynamicmeta {
|
Line 98 sub dynamicmeta {
|
return %returnhash; |
return %returnhash; |
} |
} |
|
|
|
# ------------------------------------- Try to make an alt tag if there is none |
|
|
|
sub alttag { |
|
my ($base,$src)=@_; |
|
my $fullpath=&Apache::lonnet::hreflocation($base,$src); |
|
my $alttag=&Apache::lonnet::metadata($fullpath,'title').' '. |
|
&Apache::lonnet::metadata($fullpath,'subject').' '. |
|
&Apache::lonnet::metadata($fullpath,'abstract'); |
|
$alttag=~s/\s+/ /gs; |
|
$alttag=~s/\"//gs; |
|
$alttag=~s/\'//gs; |
|
$alttag=~s/\s+$//gs; |
|
$alttag=~s/^\s+//gs; |
|
if ($alttag) { return $alttag; } else |
|
{ return 'No information available'; } |
|
} |
|
|
# -------------------------------------------------------------- Pretty display |
# -------------------------------------------------------------- Pretty display |
|
|
sub evalgraph { |
sub evalgraph { |
Line 303 $dynmeta{$_}." </td></tr>\n");
|
Line 320 $dynmeta{$_}." </td></tr>\n");
|
'<h4>Error Messages (visible to author and co-authors only)</h4>'); |
'<h4>Error Messages (visible to author and co-authors only)</h4>'); |
my %errormsgs=&Apache::lonnet::dump('nohist_res_msgs',$1,$2); |
my %errormsgs=&Apache::lonnet::dump('nohist_res_msgs',$1,$2); |
foreach (keys %errormsgs) { |
foreach (keys %errormsgs) { |
if ($_=~/^$disuri\_\d+$/) { |
if ($_=~/^\Q$disuri\E\_\d+$/) { |
my %content=&Apache::lonmsg::unpackagemsg($errormsgs{$_}); |
my %content=&Apache::lonmsg::unpackagemsg($errormsgs{$_}); |
$r->print('<b>'.$content{'time'}.'</b>: '.$content{'message'}. |
$r->print('<b>'.$content{'time'}.'</b>: '.$content{'message'}. |
'<br />'); |
'<br />'); |
Line 360 $dynmeta{$_}." </td></tr>\n");
|
Line 377 $dynmeta{$_}." </td></tr>\n");
|
<html><head><title>Edit Catalog Information</title></head> |
<html><head><title>Edit Catalog Information</title></head> |
$bodytag |
$bodytag |
<h1>$displayfile</h1> |
<h1>$displayfile</h1> |
|
<form method="post"> |
ENDEDIT |
ENDEDIT |
foreach (keys %Apache::lonpublisher::metadatafields) { |
foreach ('author','title','subject','keywords','abstract','notes', |
$r->print('<br />'.$_.' '.$Apache::lonpublisher::metadatafields{$_}); |
'copyright','customdistributionfile','language') { |
|
if ($ENV{'form.new_'.$_}) { |
|
$Apache::lonpublisher::metadatafields{$_}=$ENV{'form.new_'.$_}; |
|
} |
|
$r->print( |
|
&Apache::lonpublisher::textfield($_,'new_'.$_, |
|
$Apache::lonpublisher::metadatafields{$_})); |
} |
} |
} |
if ($ENV{'form.store'}) { |
$r->print('</body></html>'); |
my $mfh; |
return OK; |
unless ($mfh=Apache::File->new('>'.$fn)) { |
|
$r->print( |
|
'<p><font color=red>Could not write metadata, FAIL</font>'); |
|
} else { |
|
foreach (sort keys %Apache::lonpublisher::metadatafields) { |
|
unless ($_=~/\./) { |
|
my $unikey=$_; |
|
$unikey=~/^([A-Za-z]+)/; |
|
my $tag=$1; |
|
$tag=~tr/A-Z/a-z/; |
|
print $mfh "\n\<$tag"; |
|
foreach |
|
(split(/\,/,$Apache::lonpublisher::metadatakeys{$unikey})) { |
|
my $value= |
|
$Apache::lonpublisher::metadatafields{$unikey.'.'.$_}; |
|
$value=~s/\"/\'\'/g; |
|
print $mfh ' '.$_.'="'.$value.'"'; |
|
} |
|
print $mfh '>'. |
|
&HTML::Entities::encode($Apache::lonpublisher::metadatafields{$unikey}) |
|
.'</'.$tag.'>'; |
|
} |
|
} |
|
$r->print('<p>Wrote Metadata'); |
|
} |
|
} |
|
$r->print( |
|
'<br /><input type="submit" name="store" value="Store Catalog Information"></form></body></html>'); |
|
return OK; |
|
} |
} |
} |
|
|
1; |
1; |