Annotation of loncom/interface/portfolio.pm, revision 1.4

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;
1.4     ! banghart   41: #	my $file=&Apache::lonnet::filelocation("",$r->uri);	
        !            42: #	my $contents=&Apache::lonnet::getfile($file);
        !            43: #	upload a file if we enter with a filename set
        !            44: 	$r->print ('<body bgcolor="dogfood">
        !            45: 		<blockquote>');
        !            46: 	
1.2       banghart   47: 	if ($ENV{'form.uploaddoc.filename'}){
                     48: 		$r->print (&Apache::lonnet::userfileupload('uploaddoc',undef,'portfolio').'<br />');	
                     49: 	}
1.4     ! banghart   50: 	$r->print ('<br />Current contents of your portfolio directory: <br /><hr />');
        !            51: 	$r->print (&Apache::lonnet::portfoliolist($r->uri, $ENV{'user.domain'}, $ENV{'user.name'}, udef ));
        !            52: 	$r->print ('<hr />');
        !            53: #	$r->print ($ENV{'form.uploaddoc.filename'}.'<br />');
        !            54: #	$r->print ($ENV{'form.storeupl'}.'<br />');
        !            55: #	$r->print ($ENV{'form.saywhat'}.'<br />');
1.2       banghart   56: 
1.4     ! banghart   57: 	$r->print("Upload files to your portfolio<br />");
1.2       banghart   58: 	# file upload form 
                     59: 	$r->print('<form method="post" enctype="multipart/form-data">');
                     60: 	$r->print('<input name="uploaddoc" type="file">'.
                     61: 	
                     62: 		'<input type="submit" name="storeupl" value="Upload">'
                     63: 		);
1.4     ! banghart   64: 	$r->print('</form>
        !            65: 	</blockquote>
        !            66: 	</body>');
        !            67: 	
1.1       banghart   68: 	return OK;
                     69: 
1.2       banghart   70: }
1.1       banghart   71: 
                     72: 1;
                     73: __END__

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>