version 1.81, 2004/06/17 15:05:59
|
version 1.88, 2005/01/18 01:44:12
|
Line 71 sub get_dynamic_metadata_from_sql {
|
Line 71 sub get_dynamic_metadata_from_sql {
|
if (! defined($authordom) || ! defined($author)) { |
if (! defined($authordom) || ! defined($author)) { |
return (); |
return (); |
} |
} |
my @Fields = ('url', |
my @Fields = ('url','count','course', |
'goto','goto_list', |
'goto','goto_list', |
'comefrom','comefrom_list', |
'comefrom','comefrom_list', |
'sequsage','sequsage_list', |
'sequsage','sequsage_list', |
'stdno','stdno_list', |
'stdno','stdno_list', |
|
'dependencies', |
'avetries','avetries_list', |
'avetries','avetries_list', |
'difficulty','difficulty_list', |
'difficulty','difficulty_list', |
'disc','disc_list', |
'disc','disc_list', |
Line 255 sub fieldnames {
|
Line 256 sub fieldnames {
|
'owner' => 'Publisher/Owner', |
'owner' => 'Publisher/Owner', |
'copyright' => 'Copyright/Distribution', |
'copyright' => 'Copyright/Distribution', |
'customdistributionfile' => 'Custom Distribution File', |
'customdistributionfile' => 'Custom Distribution File', |
'sourceavail' => 'Source Availible', |
'sourceavail' => 'Source Available', |
'sourcerights' => 'Source Custom Distribution File', |
'sourcerights' => 'Source Custom Distribution File', |
'obsolete' => 'Obsolete', |
'obsolete' => 'Obsolete', |
'obsoletereplacement' => 'Suggested Replacement for Obsolete File', |
'obsoletereplacement' => 'Suggested Replacement for Obsolete File', |
Line 277 sub fieldnames {
|
Line 278 sub fieldnames {
|
'stdno' => 'Total number of students who have worked on this problem', |
'stdno' => 'Total number of students who have worked on this problem', |
'difficulty' => 'Degree of difficulty', |
'difficulty' => 'Degree of difficulty', |
'disc' => 'Degree of discrimination', |
'disc' => 'Degree of discrimination', |
|
'dependencies' => 'Resources used by this resource', |
); |
); |
} |
} |
|
|
# Pretty printing of metadata field |
# Pretty printing of metadata field |
|
|
sub prettyprint { |
sub prettyprint { |
my ($type,$value)=@_; |
my ($type,$value,$target,$prefix,$form,$noformat)=@_; |
|
# $target,$prefix,$form are optional and for filecrumbs only |
if (! defined($value)) { |
if (! defined($value)) { |
return ' '; |
return ' '; |
} |
} |
Line 337 sub prettyprint {
|
Line 340 sub prettyprint {
|
($type eq 'obsoletereplacement') || |
($type eq 'obsoletereplacement') || |
($type eq 'goto_list') || |
($type eq 'goto_list') || |
($type eq 'comefrom_list') || |
($type eq 'comefrom_list') || |
($type eq 'sequsage_list')) { |
($type eq 'sequsage_list') || |
return join('<br />',map { |
($type eq 'dependencies')) { |
|
return '<ul><font size="-1">'.join("\n",map { |
my $url = &Apache::lonnet::clutter($_); |
my $url = &Apache::lonnet::clutter($_); |
my $title = &Apache::lonnet::gettitle($url); |
my $title = &Apache::lonnet::gettitle($url); |
if ($title eq '') { |
if ($title eq '') { |
Line 355 sub prettyprint {
|
Line 359 sub prettyprint {
|
$title .= ' Syllabus'; |
$title .= ' Syllabus'; |
} |
} |
} |
} |
$_ = '<b>'.$title.'</b> '. |
$_ = '<li>'.$title.' '. |
'<a href="'.$url.'" target="preview">'. |
&Apache::lonhtmlcommon::crumbs($url,$target,$prefix,$form,'-1',$noformat). |
'<font size="-1">'.$url.'</font>'. |
'</li>' |
'</a>' |
} split(/\s*\,\s*/,$value)).'</ul></font>'; |
} split(/\s*\,\s*/,$value)); |
|
} |
} |
# Evaluations |
# Evaluations |
if (($type eq 'clear') || |
if (($type eq 'clear') || |
Line 541 sub handler {
|
Line 544 sub handler {
|
&present_editable_metadata($r,$uri); |
&present_editable_metadata($r,$uri); |
} else { |
} else { |
$r->print(&Apache::loncommon::bodytag |
$r->print(&Apache::loncommon::bodytag |
('Catalog Information','','','',$resdomain)); |
('Catalog Information','','','',$resdomain)); |
&present_uneditable_metadata($r,$uri); |
&present_uneditable_metadata($r,$uri); |
} |
} |
$r->print('</body></html>'); |
$r->print('</body></html>'); |
Line 662 $disuri<br />
|
Line 665 $disuri<br />
|
$obsoletewarning |
$obsoletewarning |
$versiondisplay |
$versiondisplay |
</p> |
</p> |
<table cellspacing=2 border=0> |
<table cellspacing="2" border="0"> |
$table |
$table |
</table> |
</table> |
ENDHEAD |
ENDHEAD |
Line 692 sub print_dynamic_metadata {
|
Line 695 sub print_dynamic_metadata {
|
exists($dynmeta{'goto'}) || |
exists($dynmeta{'goto'}) || |
exists($dynmeta{'course'})) { |
exists($dynmeta{'course'})) { |
$r->print('<h4>'.&mt('Access and Usage Statistics').'</h4>'. |
$r->print('<h4>'.&mt('Access and Usage Statistics').'</h4>'. |
'<table cellspacing=2 border=0>'); |
'<table cellspacing="2" border="0">'); |
foreach ('count', |
foreach ('count', |
'sequsage','sequsage_list', |
'sequsage','sequsage_list', |
'comefrom','comefrom_list', |
'comefrom','comefrom_list', |
Line 717 sub print_dynamic_metadata {
|
Line 720 sub print_dynamic_metadata {
|
$r->print('<h4>'. |
$r->print('<h4>'. |
&mt('Overall Assessment Statistical Data'). |
&mt('Overall Assessment Statistical Data'). |
'</h4>'. |
'</h4>'. |
'<table cellspacing=2 border=0>'); |
'<table cellspacing="2" border="0">'); |
$r->print('<tr><td bgcolor="#AAAAAA">'.$lt{'stdno'}.'</td>'. |
$r->print('<tr><td bgcolor="#AAAAAA">'.$lt{'stdno'}.'</td>'. |
'<td bgcolor="#CCCCCC">'. |
'<td bgcolor="#CCCCCC">'. |
&prettyprint('stdno',$dynmeta{'stdno'}). |
&prettyprint('stdno',$dynmeta{'stdno'}). |
Line 736 sub print_dynamic_metadata {
|
Line 739 sub print_dynamic_metadata {
|
$r->print('<h4>'. |
$r->print('<h4>'. |
&mt('Detailed Assessment Statistical Data'). |
&mt('Detailed Assessment Statistical Data'). |
'</h4>'); |
'</h4>'); |
my $table = '<table cellspacing=2 border=0>'. |
my $table = '<table cellspacing="2" border="0">'. |
'<tr>'. |
'<tr>'. |
'<th>Course</th>'. |
'<th>Course</th>'. |
'<th>Section(s)</th>'. |
'<th>Section(s)</th>'. |
Line 796 sub print_dynamic_metadata {
|
Line 799 sub print_dynamic_metadata {
|
exists($dynmeta{'correct'}) || |
exists($dynmeta{'correct'}) || |
exists($dynmeta{'technical'})){ |
exists($dynmeta{'technical'})){ |
$r->print('<h4>'.&mt('Evaluation Data').'</h4>'. |
$r->print('<h4>'.&mt('Evaluation Data').'</h4>'. |
'<table cellspacing=2 border=0>'); |
'<table cellspacing="2" border="0">'); |
foreach ('clear','depth','helpful','correct','technical') { |
foreach ('clear','depth','helpful','correct','technical') { |
$r->print('<tr><td bgcolor="#AAAAAA">'.$lt{$_}.'</td>'. |
$r->print('<tr><td bgcolor="#AAAAAA">'.$lt{$_}.'</td>'. |
'<td bgcolor="#CCCCCC">'. |
'<td bgcolor="#CCCCCC">'. |
Line 902 ENDBOMBS
|
Line 905 ENDBOMBS
|
&mt('Default Cataloging Information for Directory').' '. |
&mt('Default Cataloging Information for Directory').' '. |
$dir; |
$dir; |
} |
} |
my $bodytag= |
|
&Apache::loncommon::bodytag('Edit Catalog Information'); |
|
%Apache::lonpublisher::metadatafields=(); |
%Apache::lonpublisher::metadatafields=(); |
%Apache::lonpublisher::metadatakeys=(); |
%Apache::lonpublisher::metadatakeys=(); |
&Apache::lonpublisher::metaeval(&Apache::lonnet::getfile($fn)); |
&Apache::lonpublisher::metaeval(&Apache::lonnet::getfile($fn)); |
$r->print(<<ENDEDIT); |
$r->print(<<ENDEDIT); |
<html><head><title>Edit Catalog Information</title></head> |
|
$bodytag |
|
<h1>$displayfile</h1> |
<h1>$displayfile</h1> |
<form method="post" name="defaultmeta"> |
<form method="post" name="defaultmeta"> |
ENDEDIT |
ENDEDIT |
$r->print('<script language="JavaScript">'. |
$r->print('<script language="JavaScript">'. |
&Apache::loncommon::browser_and_searcher_javascript. |
&Apache::loncommon::browser_and_searcher_javascript(). |
'</script>'); |
'</script>'); |
my %lt=&fieldnames(); |
my %lt=&fieldnames(); |
|
my $output; |
foreach ('author','title','subject','keywords','abstract','notes', |
foreach ('author','title','subject','keywords','abstract','notes', |
'copyright','customdistributionfile','language', |
'copyright','customdistributionfile','language', |
'standards', |
'standards', |
Line 930 ENDEDIT
|
Line 930 ENDEDIT
|
$Apache::lonpublisher::metadatafields{'copyright'}= |
$Apache::lonpublisher::metadatafields{'copyright'}= |
'default'; |
'default'; |
} |
} |
$r->print('<p>'.$lt{$_}.': '. |
$output.=('<p>'.$lt{$_}.': '. |
&prettyinput |
&prettyinput($_, |
($_,$Apache::lonpublisher::metadatafields{$_}, |
$Apache::lonpublisher::metadatafields{$_}, |
'new_'.$_,'defaultmeta').'</p>'); |
'new_'.$_,'defaultmeta').'</p>'); |
} |
} |
if ($ENV{'form.store'}) { |
if ($ENV{'form.store'}) { |
my $mfh; |
my $mfh; |
if (! ($mfh=Apache::File->new('>'.$fn))) { |
if (! ($mfh=Apache::File->new('>'.$fn))) { |
$r->print('<p><font color=red>'. |
$r->print('<p><font color="red">'. |
&mt('Could not write metadata').', '. |
&mt('Could not write metadata').', '. |
&mt('FAIL').'</font>'); |
&mt('FAIL').'</font></p>'); |
} else { |
} else { |
foreach (sort keys %Apache::lonpublisher::metadatafields) { |
foreach (sort keys %Apache::lonpublisher::metadatafields) { |
next if ($_ =~ /\./); |
next if ($_ =~ /\./); |
Line 963 ENDEDIT
|
Line 963 ENDEDIT
|
'<>&"'). |
'<>&"'). |
'</'.$tag.'>'; |
'</'.$tag.'>'; |
} |
} |
$r->print('<p>'.&mt('Wrote Metadata')); |
$r->print('<p><font color="blue">'.&mt('Wrote Metadata'). |
|
' '.&Apache::lonlocal::locallocaltime(time). |
|
'</font></p>'); |
} |
} |
} |
} |
$r->print('<br /><input type="submit" name="store" value="'. |
$r->print($output.'<br /><input type="submit" name="store" value="'. |
&mt('Store Catalog Information').'">'); |
&mt('Store Catalog Information').'">'); |
} |
} |
$r->print('</form>'); |
$r->print('</form>'); |