Annotation of loncom/interface/portfolio.pm, revision 1.3
1.3 ! banghart 1: # Copyright Michigan State University Board of Trustees
! 2: #
! 3: # This file is part of the LearningOnline Network with CAPA (LON-CAPA).
! 4: #
! 5: # LON-CAPA is free software; you can redistribute it and/or modify
! 6: # it under the terms of the GNU General Public License as published by
! 7: # the Free Software Foundation; either version 2 of the License, or
! 8: # (at your option) any later version.
! 9: #
! 10: # LON-CAPA is distributed in the hope that it will be useful,
! 11: # but WITHOUT ANY WARRANTY; without even the implied warranty of
! 12: # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! 13: # GNU General Public License for more details.
! 14: #
! 15: # You should have received a copy of the GNU General Public License
! 16: # along with LON-CAPA; if not, write to the Free Software
! 17: # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
! 18: #
! 19: # /home/httpd/html/adm/gpl.txt
! 20: #
! 21:
! 22:
! 23: # http://www.lon-capa.org/
! 24: #
! 25:
! 26:
1.1 banghart 27: package Apache::portfolio;
28: use strict;
29: use Apache::Constants qw(:common :http);
1.2 banghart 30: use Apache::loncommon;
1.1 banghart 31: use Apache::lonnet;
1.2 banghart 32: use Apache::lontexconvert;
33: use Apache::lonfeedback;
34: use Apache::lonlocal;
1.1 banghart 35:
36: sub handler {
37: my $r=@_[0];
38: $r->content_type('text/html');
39: $r->send_http_header;
40: return OK if $r->header_only;
41: my $file=&Apache::lonnet::filelocation("",$r->uri);
42: my $contents=&Apache::lonnet::getfile($file);
1.2 banghart 43: $r->print ('<br />Current contents of your portfolio directory: <br />');
44: $r->print (&Apache::lonnet::portfoliolist($r->uri, $ENV{'user.domain'}, $ENV{'user.name'}, udef ));
45: $r->print ('<br /> call to dirlist precedes <br />');
46: if ($ENV{'form.uploaddoc.filename'}){
47: $r->print ('<br /> call to userfileupload follows <br />');
48: $r->print (&Apache::lonnet::userfileupload('uploaddoc',undef,'portfolio').'<br />');
49: $r->print ('<br /> call to userfileupload precedes <br />');
50: }
51:
52: $r->print ($ENV{'form.uploaddoc.filename'}.'<br />');
53: $r->print ($ENV{'form.storeupl'}.'<br />');
54: $r->print ($ENV{'form.saywhat'}.'<br />');
1.1 banghart 55:
56: $r->print("here's the form<br />");
1.2 banghart 57: # file upload form
58: $r->print('<form method="post" enctype="multipart/form-data">');
59: $r->print('<input name="uploaddoc" type="file">'.
60:
61: '<input type="submit" name="storeupl" value="Upload">'
62: );
1.1 banghart 63: $r->print('</form>');
64: return OK;
65:
1.2 banghart 66: }
1.1 banghart 67:
68: 1;
69: __END__
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>