version 1.143, 2003/11/04 16:15:56
|
version 1.145, 2003/11/08 11:20:22
|
Line 143 use Apache::lonnet();
|
Line 143 use Apache::lonnet();
|
use Apache::loncommon(); |
use Apache::loncommon(); |
use Apache::lonmysql; |
use Apache::lonmysql; |
use Apache::lonlocal; |
use Apache::lonlocal; |
|
use Apache::loncfile; |
use vars qw(%metadatafields %metadatakeys); |
use vars qw(%metadatafields %metadatakeys); |
|
|
my %addid; |
my %addid; |
Line 180 nothing
|
Line 181 nothing
|
|
|
######################################### |
######################################### |
######################################### |
######################################### |
|
# |
|
# Modifies global %metadatafields %metadatakeys |
|
# |
|
|
sub metaeval { |
sub metaeval { |
my ($metastring,$prefix)=@_; |
my ($metastring,$prefix)=@_; |
|
|
Line 262 sub metaread {
|
Line 267 sub metaread {
|
my ($logfile,$fn,$prefix)=@_; |
my ($logfile,$fn,$prefix)=@_; |
unless (-e $fn) { |
unless (-e $fn) { |
print($logfile 'No file '.$fn."\n"); |
print($logfile 'No file '.$fn."\n"); |
return '<br /><b>No file:</b> <tt>'.$fn.'</tt>'; |
return '<br /><b>No file:</b> <tt>'. |
|
&Apache::loncfile::display($fn).'</tt>'; |
} |
} |
print($logfile 'Processing '.$fn."\n"); |
print($logfile 'Processing '.$fn."\n"); |
my $metastring; |
my $metastring; |
Line 271 sub metaread {
|
Line 277 sub metaread {
|
$metastring=join('',<$metafh>); |
$metastring=join('',<$metafh>); |
} |
} |
&metaeval($metastring,$prefix); |
&metaeval($metastring,$prefix); |
return '<br /><b>Processed file:</b> <tt>'.$fn.'</tt>'; |
return '<br /><b>Processed file:</b> <tt>'. |
|
&Apache::loncfile::display($fn).'</tt>'; |
} |
} |
|
|
######################################### |
######################################### |
Line 812 sub store_metadata {
|
Line 819 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)=@_; |
Line 941 sub publish {
|
Line 949 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 967 sub publish {
|
Line 976 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 1005 sub publish {
|
Line 1015 sub publish {
|
delete $metadatafields{$_}; |
delete $metadatafields{$_}; |
} |
} |
} |
} |
|
|
} |
|
# ------------------------------------------ See if anything new in file itself |
# ------------------------------------------ See if anything new in file itself |
|
|
$allmeta=&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 1041 sub publish {
|
Line 1051 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 |