--- loncom/interface/lonmeta.pm 2005/02/17 08:29:43 1.92
+++ loncom/interface/lonmeta.pm 2005/08/02 17:01:20 1.101
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Metadata display handler
#
-# $Id: lonmeta.pm,v 1.92 2005/02/17 08:29:43 albertel Exp $
+# $Id: lonmeta.pm,v 1.101 2005/08/02 17:01:20 banghart Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -17,7 +17,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
-# You should have received a copy of the GNU General Public License
+# You should have received a copy of the GNU General Public License
# along with LON-CAPA; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
@@ -31,9 +31,9 @@ package Apache::lonmeta;
use strict;
use LONCAPA::lonmetadata();
use Apache::Constants qw(:common);
-use Apache::lonnet();
+use Apache::lonnet;
use Apache::loncommon();
-use Apache::lonhtmlcommon();
+use Apache::lonhtmlcommon();
use Apache::lonmsg;
use Apache::lonpublisher;
use Apache::lonlocal;
@@ -237,10 +237,8 @@ sub diffgraph {
# The field names
sub fieldnames {
my $file_type=shift;
- if ($file_type eq 'portfolio') {
- return &Apache::lonlocal::texthash
- (
- 'title' => 'Title',
+ my %fields =
+ ('title' => 'Title',
'author' =>'Author(s)',
'authorspace' => 'Author Space',
'modifyinguser' => 'Last Modifying User',
@@ -250,19 +248,10 @@ sub fieldnames {
'abstract' => 'Abstract',
'lowestgradelevel' => 'Lowest Grade Level',
'highestgradelevel' => 'Highest Grade Level');
- } else {
- return &Apache::lonlocal::texthash
- (
- 'title' => 'Title',
- 'author' =>'Author(s)',
- 'authorspace' => 'Author Space',
- 'modifyinguser' => 'Last Modifying User',
- 'subject' => 'Subject',
- 'keywords' => 'Keyword(s)',
- 'notes' => 'Notes',
- 'abstract' => 'Abstract',
- 'lowestgradelevel' => 'Lowest Grade Level',
- 'highestgradelevel' => 'Highest Grade Level',
+ if (! defined($file_type) || $file_type ne 'portfolio') {
+ %fields =
+ (%fields,
+ 'domain' => 'Domain',
'standards' => 'Standards',
'mime' => 'MIME Type',
'language' => 'Language',
@@ -295,9 +284,34 @@ sub fieldnames {
'disc' => 'Degree of discrimination',
'dependencies' => 'Resources used by this resource',
);
- }
+ }
+ return &Apache::lonlocal::texthash(%fields);
}
+sub select_course {
+ my ($r)=@_;
+ $r->print('
Instructor Selected Meta-Data
');
+ $r->print('');
+
+ foreach my $key (keys %env) {
+
+ if ($key =~ /\.metadata\./) {
+ my $course_key = $key;
+ $course_key =~ s/\.metadata\..*//;
+ $r->print('');
+ }
+ }
+ $r->print(' ');
+ $r->print('');
+ $r->print('');
+ return 'ok';
+}
# Pretty printing of metadata field
sub prettyprint {
@@ -348,7 +362,7 @@ sub prettyprint {
return &Apache::loncommon::gradeleveldescription($value);
}
# Only for advance users below
- if (! $ENV{'user.adv'}) {
+ if (! $env{'user.adv'}) {
return '- '.&mt('not displayed').' -';
}
# File
@@ -558,6 +572,7 @@ sub handler {
$r->print(&Apache::loncommon::bodytag
('Edit Portfolio File Information','','','',$resdomain));
&present_editable_metadata($r,$uri,'portfolio');
+ &select_course($r);
} elsif ($uri=~/^\/\~/) {
# Construction space
@@ -588,6 +603,15 @@ sub report_bombs {
$r->print('
'.&Apache::lonnet::clutter($uri).'
');
my ($domain,$author)=($uri=~/^(\w+)\/(\w+)\//);
if (&Apache::loncacc::constructaccess('/~'.$author.'/',$domain)) {
+ if ($env{'form.clearbombs'}) {
+ &Apache::lonmsg::clear_author_res_msg($uri);
+ }
+ my $clear=&mt('Clear all Messages in Subdirectory');
+ $r->print(<
+
+
+ENDCLEAR
my %brokenurls =
&Apache::lonmsg::all_url_author_res_msg($author,$domain);
foreach (sort(keys(%brokenurls))) {
@@ -642,7 +666,7 @@ sub present_uneditable_metadata {
# obsolete
my $obsolete=$content{'obsolete'};
my $obsoletewarning='';
- if (($obsolete) && ($ENV{'user.adv'})) {
+ if (($obsolete) && ($env{'user.adv'})) {
$obsoletewarning='
'.
&mt('This resource has been marked obsolete by the author(s)').
'
';
@@ -691,7 +715,7 @@ $versiondisplay
$table
ENDHEAD
- if ($ENV{'user.adv'}) {
+ if ($env{'user.adv'}) {
&print_dynamic_metadata($r,$uri,\%content);
}
return;
@@ -832,8 +856,8 @@ sub print_dynamic_metadata {
$r->print('
'.&mt('No Evaluation Data is available for this resource.').'