version 1.140, 2003/10/21 20:18:45
|
version 1.142, 2003/11/01 17:38:58
|
Line 214 sub metaeval {
|
Line 214 sub metaeval {
|
$newentry=~s/^\s*//; |
$newentry=~s/^\s*//; |
if ($newentry !~m|^/res|) { $newentry=$prefix.$newentry; } |
if ($newentry !~m|^/res|) { $newentry=$prefix.$newentry; } |
} |
} |
if ($metadatafields{$unikey}) { |
unless ($metadatafields{$unikey}=~/\w/) { |
unless (($metadatafields{$unikey}=~/\Q$newentry\E/) || |
|
($newentry eq '')) { |
|
$metadatafields{$unikey}.=', '.$newentry; |
|
} |
|
} else { |
|
$metadatafields{$unikey}=$newentry; |
$metadatafields{$unikey}=$newentry; |
} |
} |
} |
} |
Line 329 string which presents the form field (fo
|
Line 324 string which presents the form field (fo
|
######################################### |
######################################### |
sub textfield { |
sub textfield { |
my ($title,$name,$value)=@_; |
my ($title,$name,$value)=@_; |
|
$value=~s/^\s+//gs; |
|
$value=~s/\s+$//gs; |
|
$value=~s/\s+/ /gs; |
$title=&mt($title); |
$title=&mt($title); |
my $uctitle=uc($title); |
my $uctitle=uc($title); |
return "\n<p><font color=\"#800000\" face=\"helvetica\"><b>$uctitle:". |
return "\n<p><font color=\"#800000\" face=\"helvetica\"><b>$uctitle:". |
Line 812 sub store_metadata {
|
Line 810 sub store_metadata {
|
return (undef,$status); |
return (undef,$status); |
} |
} |
|
|
|
|
|
# ============================================== Parse file itself for metadata |
|
|
|
|
|
sub parseformeta { |
|
my ($source,$style)=@_; |
|
if (($style eq 'ssi') || ($style eq 'prv')) { |
|
my $dir=$source; |
|
$dir=~s-/[^/]*$--; |
|
my $file=$source; |
|
$file=(split('/',$file))[-1]; |
|
$source=&Apache::lonnet::hreflocation($dir,$file); |
|
my $allmeta=&Apache::lonnet::ssi_body($source,('grade_target' => 'meta')); |
|
&metaeval($allmeta); |
|
} |
|
} |
|
|
######################################### |
######################################### |
######################################### |
######################################### |
|
|
Line 949 sub publish {
|
Line 964 sub publish {
|
$ENV{'user.domain'}; |
$ENV{'user.domain'}; |
$metadatafields{'authorspace'}=$cuname.'@'.$cudom; |
$metadatafields{'authorspace'}=$cuname.'@'.$cudom; |
|
|
|
# ----------------------------------------------------------- Parse file itself |
|
|
|
&parseformeta($source,$style); |
# ------------------------------------------------ Check out directory hierachy |
# ------------------------------------------------ Check out directory hierachy |
|
|
my $thisdisfn=$source; |
my $thisdisfn=$source; |
Line 987 sub publish {
|
Line 1005 sub publish {
|
} |
} |
|
|
} |
} |
|
# ------------------------------------------ See if anything new in file itself |
|
|
|
&parseformeta($source,$style); |
|
|
# -------------------------------------------------- Parse content for metadata |
|
if (($style eq 'ssi') || ($style eq 'prv')) { |
|
my $dir=$source; |
|
$dir=~s-/[^/]*$--; |
|
my $file=$source; |
|
$file=(split('/',$file))[-1]; |
|
$source=&Apache::lonnet::hreflocation($dir,$file); |
|
$allmeta=&Apache::lonnet::ssi_body($source,('grade_target' => 'meta')); |
|
|
|
&metaeval($allmeta); |
|
} |
|
# ---------------- Find and document discrepancies in the parameters and stores |
# ---------------- Find and document discrepancies in the parameters and stores |
|
|
my $chparms=''; |
my $chparms=''; |