--- loncom/interface/lonmeta.pm 2006/08/04 22:16:38 1.164 +++ loncom/interface/lonmeta.pm 2006/08/16 18:02:01 1.169 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Metadata display handler # -# $Id: lonmeta.pm,v 1.164 2006/08/04 22:16:38 albertel Exp $ +# $Id: lonmeta.pm,v 1.169 2006/08/16 18:02:01 banghart Exp $ # # Copyright Michigan State University Board of Trustees # @@ -287,15 +287,22 @@ sub portfolio_linked_path { if ($group) { $start = "groups/$group/".$start; } - my $result = &Apache::portfolio::make_anchor($port_path,$start,'/'); - + 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); + my %anchor_fields = ( + 'selectfile' => $dir, + 'currentpath' => $fullpath + ); + $result .= &Apache::portfolio::make_anchor($port_path,\%anchor_fields,$dir); } $result .= "/$filename"; return $result; @@ -358,14 +365,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; @@ -707,6 +720,8 @@ sub prettyinput { sub handler { my $r=shift; # + &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, + ['currentpath']); my $uri=$r->uri; # # Set document type @@ -1132,7 +1147,7 @@ sub present_editable_metadata { my $goback=&mt('Back to Source File'); $r->print(<$disuri -
+ ENDBOMBS if ($showdel) { $r->print(<print(<$displayfile - + ENDEDIT - $r->print(''); my %lt=&fieldnames($file_type); @@ -1271,10 +1286,18 @@ ENDEDIT if ($fn =~ m|^$Apache::lonnet::perlvar{'lonDocRoot'}/userfiles/portfolio/|) { my ($path, $new_fn) = ($fn =~ m|/(portfolio.*)/([^/]*)$|); $r->print(&store_portfolio_metadata($formname,$file_content,$path, - $new_fn)); + $new_fn)); + unless ($env{'form.associate'}) { + $r->print(&Apache::portfolio::done("return",'/adm/portfolio')); + return; + } } elsif ($fn =~ m|^$Apache::lonnet::perlvar{'lonDocRoot'}/userfiles/groups/\w+/portfolio/|) { my ($path, $new_fn) = ($fn =~ m|/(groups/\w+/portfolio.*)/([^/]*)$|); $r->print(&store_portfolio_metadata($formname,$file_content,$path,$new_fn)); + unless ($env{'form.associate'}) { + $r->print(&Apache::portfolio::done("return",'/adm/portfolio')); + return; + } } else { if (! ($mfh=Apache::File->new('>'.$fn))) { $r->print('

'. @@ -1286,22 +1309,27 @@ ENDEDIT ' '.&Apache::lonlocal::locallocaltime(time). '

'); } + unless ($env{'form.associate'}) { + $r->print(&Apache::portfolio::done("return",'/adm/portfolio')); + return; + } } } $r->print($output.'
'); + &mt('Store Catalog Information').'" />'); if ($file_type eq 'portfolio') { my ($port_path,$group) = &get_port_path_and_group($uri); if ($group) { $r->print(''); } + $r->print(''); $r->print(' -

'. +

'. ''. ''. - ''); + ''); } }