--- loncom/interface/portfolio.pm 2004/06/18 23:59:55 1.3 +++ loncom/interface/portfolio.pm 2004/06/19 00:54:21 1.4 @@ -38,29 +38,33 @@ sub handler { $r->content_type('text/html'); $r->send_http_header; return OK if $r->header_only; - my $file=&Apache::lonnet::filelocation("",$r->uri); - my $contents=&Apache::lonnet::getfile($file); - $r->print ('<br />Current contents of your portfolio directory: <br />'); - $r->print (&Apache::lonnet::portfoliolist($r->uri, $ENV{'user.domain'}, $ENV{'user.name'}, udef )); - $r->print ('<br /> call to dirlist precedes <br />'); +# my $file=&Apache::lonnet::filelocation("",$r->uri); +# my $contents=&Apache::lonnet::getfile($file); +# upload a file if we enter with a filename set + $r->print ('<body bgcolor="dogfood"> + <blockquote>'); + if ($ENV{'form.uploaddoc.filename'}){ - $r->print ('<br /> call to userfileupload follows <br />'); $r->print (&Apache::lonnet::userfileupload('uploaddoc',undef,'portfolio').'<br />'); - $r->print ('<br /> call to userfileupload precedes <br />'); } + $r->print ('<br />Current contents of your portfolio directory: <br /><hr />'); + $r->print (&Apache::lonnet::portfoliolist($r->uri, $ENV{'user.domain'}, $ENV{'user.name'}, udef )); + $r->print ('<hr />'); +# $r->print ($ENV{'form.uploaddoc.filename'}.'<br />'); +# $r->print ($ENV{'form.storeupl'}.'<br />'); +# $r->print ($ENV{'form.saywhat'}.'<br />'); - $r->print ($ENV{'form.uploaddoc.filename'}.'<br />'); - $r->print ($ENV{'form.storeupl'}.'<br />'); - $r->print ($ENV{'form.saywhat'}.'<br />'); - - $r->print("here's the form<br />"); + $r->print("Upload files to your portfolio<br />"); # file upload form $r->print('<form method="post" enctype="multipart/form-data">'); $r->print('<input name="uploaddoc" type="file">'. '<input type="submit" name="storeupl" value="Upload">' ); - $r->print('</form>'); + $r->print('</form> + </blockquote> + </body>'); + return OK; }