--- loncom/interface/lonmeta.pm 2006/06/23 00:28:43 1.159 +++ loncom/interface/lonmeta.pm 2006/11/04 01:50:31 1.186 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Metadata display handler # -# $Id: lonmeta.pm,v 1.159 2006/06/23 00:28:43 raeburn Exp $ +# $Id: lonmeta.pm,v 1.186 2006/11/04 01:50:31 banghart Exp $ # # Copyright Michigan State University Board of Trustees # @@ -95,7 +95,8 @@ sub get_dynamic_metadata_from_sql { while (my $result = <$fh>) { chomp($result); next if (! $result); - my %hash=&LONCAPA::lonmetadata::metadata_col_to_hash(map { &unescape($_) } split(/\,/,$result)); + my %hash=&LONCAPA::lonmetadata::metadata_col_to_hash('metadata', + map { &unescape($_) } split(/\,/,$result)); foreach my $key (keys(%hash)) { $ReturnHash{$hash{'url'}}->{$key}=$hash{$key}; } @@ -170,7 +171,7 @@ sub authordisplay { my ($aname,$adom)=@_; return &Apache::loncommon::aboutmewrapper (&Apache::loncommon::plainname($aname,$adom), - $aname,$adom,'preview').' ['.$aname.'@'.$adom.']'; + $aname,$adom,'preview').' ['.$aname.':'.$adom.']'; } # Pretty display @@ -237,12 +238,6 @@ sub fieldnames { if (! defined($file_type) || $file_type ne 'portfolio') { %fields = - (%fields, - 'courserestricted' => 'Course Restricting Metadata'); - } - - if (! defined($file_type) || $file_type ne 'portfolio') { - %fields = (%fields, 'domain' => 'Domain', 'mime' => 'MIME Type', @@ -287,17 +282,22 @@ sub portfolio_linked_path { if ($group) { $start = "groups/$group/".$start; } - my $result = &Apache::portfolio::make_anchor($port_path,$start,'/', - undef,undef,undef,$group); - + my %anchor_fields = ( + 'selectfile' => $start, + 'currentpath' => '/' + ); + my $result = &Apache::portfolio::make_anchor($port_path,\%anchor_fields,$start); my $fullpath = '/'; my (undef,@tree) = split('/',$path); my $filename = pop(@tree); foreach my $dir (@tree) { $fullpath .= $dir.'/'; $result .= '/'; - $result .= &Apache::portfolio::make_anchor($port_path,$dir,$fullpath, - undef,undef,undef,$group); + my %anchor_fields = ( + 'selectfile' => $dir, + 'currentpath' => $fullpath + ); + $result .= &Apache::portfolio::make_anchor($port_path,\%anchor_fields,$dir); } $result .= "/$filename"; return $result; @@ -316,6 +316,9 @@ sub get_port_path_and_group { } else { $port_path = '/adm/portfolio'; } + if ($env{'form.group'} ne $group) { + $env{'form.group'} = $group; + } return ($port_path,$group); } @@ -357,14 +360,20 @@ sub pre_select_course { $r->print('

'.&mt('If you would like to associate this resource ([_1]) with a current or previous course, please select one from the list below, otherwise select, \'None\'',''.$res_uri.'').'

'); $output = &select_course(); $r->print($output.'
'); + &mt('Associate Resource With Selected Course').'" />'); + $r->print(''); + $r->print(''); $r->print(''); my ($port_path,$group) = &get_port_path_and_group($uri); - $r->print('

'. + my $group_input; + if ($group) { + $group_input = ''; + } + $r->print('

'. ''. - ''. - ''. + $group_input. + ''. '
'); return; @@ -460,7 +469,7 @@ sub prettyprint { ($type eq 'sequsage_list') || ($type eq 'dependencies')) { return '