--- loncom/interface/lonmeta.pm 2003/02/18 21:17:00 1.25 +++ 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.25 2003/02/18 21:17:00 www Exp $ +# $Id: lonmeta.pm,v 1.28 2003/03/14 19:29:36 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -101,8 +101,18 @@ sub dynamicmeta { # ------------------------------------- Try to make an alt tag if there is none sub alttag { - my $src=shift; - return 'None'; + 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 @@ -310,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'}. '
'); @@ -370,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_'.$_}; }