--- loncom/interface/lonmeta.pm 2002/10/25 13:50:48 1.24 +++ loncom/interface/lonmeta.pm 2003/03/14 19:29:36 1.28 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Metadata display handler # -# $Id: lonmeta.pm,v 1.24 2002/10/25 13:50:48 www Exp $ +# $Id: lonmeta.pm,v 1.28 2003/03/14 19:29:36 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -98,6 +98,23 @@ sub dynamicmeta { 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 sub evalgraph { @@ -303,7 +320,7 @@ $dynmeta{$_}." \n"); '

Error Messages (visible to author and co-authors only)

'); my %errormsgs=&Apache::lonnet::dump('nohist_res_msgs',$1,$2); foreach (keys %errormsgs) { - if ($_=~/^$disuri\_\d+$/) { + if ($_=~/^\Q$disuri\E\_\d+$/) { my %content=&Apache::lonmsg::unpackagemsg($errormsgs{$_}); $r->print(''.$content{'time'}.': '.$content{'message'}. '
'); @@ -363,7 +380,7 @@ $bodytag
ENDEDIT foreach ('author','title','subject','keywords','abstract','notes', - 'copyright','language') { + 'copyright','customdistributionfile','language') { if ($ENV{'form.new_'.$_}) { $Apache::lonpublisher::metadatafields{$_}=$ENV{'form.new_'.$_}; }