--- loncom/interface/portfolio.pm 2006/03/03 23:27:25 1.94 +++ loncom/interface/portfolio.pm 2006/05/18 20:29:00 1.100 @@ -30,6 +30,7 @@ use Apache::lontexconvert; use Apache::lonfeedback; use Apache::lonlocal; use Apache::lonnet; +use Apache::longroup; # receives a file name and path stub from username/userfiles/portfolio/ # returns an anchor tag consisting encoding filename and currentpath @@ -501,7 +502,6 @@ sub upload { } else { my $result=&Apache::lonnet::userfileupload('uploaddoc','', $port_path.$env{'form.currentpath'}); - print STDERR "result was $result for $port_path.$env{'form.currentpath'}\n"; if ($result !~ m|^/uploaded/|) { $r->print(' An errror occured ('.$result. ') while trying to upload '.&display_file().'
'); @@ -649,10 +649,10 @@ sub handler { $group = $env{'form.group'}; $group =~ s/\W//g; if ($group) { - my %curr_groups = (); ($uname,$udom) = &get_name_dom($group); - if (&Apache::loncommon::coursegroups(\%curr_groups,$udom,$uname, - $group)) { + my %curr_groups = &Apache::longroup::coursegroups($udom,$uname, + $group); + if (%curr_groups) { if (($view_permission) || (&Apache::lonnet::allowed('rgf', $env{'request.course.id'}.'/'.$group))) { $portfolio_root = &get_portfolio_root($group); @@ -680,12 +680,11 @@ sub handler { &Apache::loncommon::content_type($r,'text/html'); $r->send_http_header; # Give the LON-CAPA page header - my $html=&Apache::lonxml::xmlbegin(); - $r->print($html.''.$title."\n"); if ($env{"form.mode"} eq 'selectfile'){ - $r->print(&Apache::loncommon::bodytag($title,undef,undef,1)); + $r->print(&Apache::loncommon::start_page($title,undef, + {'only_body' => 1})); } else { - $r->print(&Apache::loncommon::bodytag($title)); + $r->print(&Apache::loncommon::start_page($title)); } $r->rflush(); if (($env{'form.storeupl'}) & (!$env{'form.uploaddoc.filename'})){ @@ -733,7 +732,8 @@ sub handler { # 1) never been here, so directory structure not created # 2) back-button navigation after deleting a directory if ($current_path eq '/'){ - &Apache::lonnet::mkdiruserfile($uname,$udom,'portfolio'); + &Apache::lonnet::mkdiruserfile($uname,$udom, + &get_port_path($group)); } else { # some directory that snuck in get rid of the directory # from the recent pulldown, just in case @@ -749,7 +749,7 @@ sub handler { my $is_empty=(@dir_list == 2); &display_common($r,$url,$current_path,$is_empty,\@dir_list,$group); &display_directory($r,$url,$current_path,$is_empty,\@dir_list,$group); - $r->print("\n\n"); + $r->print(&Apache::loncommon::end_page()); } return OK; }