version 1.142, 2003/11/01 17:38:58
|
version 1.144, 2003/11/05 20:27:20
|
Line 180 nothing
|
Line 180 nothing
|
|
|
######################################### |
######################################### |
######################################### |
######################################### |
|
# |
|
# Modifies global %metadatafields %metadatakeys |
|
# |
|
|
sub metaeval { |
sub metaeval { |
my ($metastring,$prefix)=@_; |
my ($metastring,$prefix)=@_; |
|
|
Line 812 sub store_metadata {
|
Line 816 sub store_metadata {
|
|
|
|
|
# ============================================== Parse file itself for metadata |
# ============================================== Parse file itself for metadata |
|
# |
|
# parses a file with target meta, sets global %metadatafields %metadatakeys |
|
|
sub parseformeta { |
sub parseformeta { |
my ($source,$style)=@_; |
my ($source,$style)=@_; |
|
my $allmeta=''; |
if (($style eq 'ssi') || ($style eq 'prv')) { |
if (($style eq 'ssi') || ($style eq 'prv')) { |
my $dir=$source; |
my $dir=$source; |
$dir=~s-/[^/]*$--; |
$dir=~s-/[^/]*$--; |
my $file=$source; |
my $file=$source; |
$file=(split('/',$file))[-1]; |
$file=(split('/',$file))[-1]; |
$source=&Apache::lonnet::hreflocation($dir,$file); |
$source=&Apache::lonnet::hreflocation($dir,$file); |
my $allmeta=&Apache::lonnet::ssi_body($source,('grade_target' => 'meta')); |
$allmeta=&Apache::lonnet::ssi_body($source,('grade_target' => 'meta')); |
&metaeval($allmeta); |
&metaeval($allmeta); |
} |
} |
|
return $allmeta; |
} |
} |
|
|
######################################### |
######################################### |
Line 939 sub publish {
|
Line 946 sub publish {
|
# -------------------------------------------- Initial step done, now metadata. |
# -------------------------------------------- Initial step done, now metadata. |
|
|
# --------------------------------------- Storage for metadata keys and fields. |
# --------------------------------------- Storage for metadata keys and fields. |
|
# these are globals |
|
# |
%metadatafields=(); |
%metadatafields=(); |
%metadatakeys=(); |
%metadatakeys=(); |
|
|
Line 965 sub publish {
|
Line 973 sub publish {
|
$metadatafields{'authorspace'}=$cuname.'@'.$cudom; |
$metadatafields{'authorspace'}=$cuname.'@'.$cudom; |
|
|
# ----------------------------------------------------------- Parse file itself |
# ----------------------------------------------------------- Parse file itself |
|
# read %metadatafields from file itself |
&parseformeta($source,$style); |
|
|
$allmeta=&parseformeta($source,$style); |
# ------------------------------------------------ Check out directory hierachy |
# ------------------------------------------------ Check out directory hierachy |
|
|
my $thisdisfn=$source; |
my $thisdisfn=$source; |
Line 1003 sub publish {
|
Line 1012 sub publish {
|
delete $metadatafields{$_}; |
delete $metadatafields{$_}; |
} |
} |
} |
} |
|
|
} |
|
# ------------------------------------------ See if anything new in file itself |
# ------------------------------------------ See if anything new in file itself |
|
|
&parseformeta($source,$style); |
$allmeta=&parseformeta($source,$style); |
|
} |
|
|
|
|
# ---------------- Find and document discrepancies in the parameters and stores |
# ---------------- Find and document discrepancies in the parameters and stores |
|
|
my $chparms=''; |
my $chparms=''; |
Line 1039 sub publish {
|
Line 1048 sub publish {
|
} |
} |
if ($chparms) { |
if ($chparms) { |
$scrout.='<p><b>'.&mt('Obsolete parameters or stored values').':</b> '. |
$scrout.='<p><b>'.&mt('Obsolete parameters or stored values').':</b> '. |
$chparms.'</p>'; |
$chparms.'</p><h1><font color="red">'.&mt('Warning!'). |
|
'</font></h1><p><font color="red" size="+1">'. |
|
&mt('If this resource is in active use, student performance data from the previous version may become inaccessible.').'</font></p><hr />'; |
} |
} |
|
|
# ------------------------------------------------------- Now have all metadata |
# ------------------------------------------------------- Now have all metadata |