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

1.1       banghart    1: package Apache::portfolio;
                      2: use strict;
                      3: use Apache::Constants qw(:common :http);
1.2     ! banghart    4: use Apache::loncommon;
1.1       banghart    5: use Apache::lonnet;
1.2     ! banghart    6: use Apache::lontexconvert;
        !             7: use Apache::lonfeedback;
        !             8: use Apache::lonlocal;
1.1       banghart    9: 
                     10: sub handler {
                     11: 	my $r=@_[0];
                     12: 	$r->content_type('text/html');
                     13: 	$r->send_http_header;
                     14: 	return OK if $r->header_only;
                     15: 	my $file=&Apache::lonnet::filelocation("",$r->uri);	
                     16: 	my $contents=&Apache::lonnet::getfile($file);
1.2     ! banghart   17: 	$r->print ('<br />Current contents of your portfolio directory: <br />');
        !            18: 	$r->print (&Apache::lonnet::portfoliolist($r->uri, $ENV{'user.domain'}, $ENV{'user.name'}, udef ));
        !            19: 	$r->print ('<br /> call to dirlist precedes <br />');
        !            20: 	if ($ENV{'form.uploaddoc.filename'}){
        !            21: 		$r->print ('<br /> call to userfileupload follows <br />');
        !            22: 		$r->print (&Apache::lonnet::userfileupload('uploaddoc',undef,'portfolio').'<br />');	
        !            23: 		$r->print ('<br /> call to userfileupload precedes <br />');
        !            24: 	}
        !            25: 
        !            26: 	$r->print ($ENV{'form.uploaddoc.filename'}.'<br />');
        !            27: 	$r->print ($ENV{'form.storeupl'}.'<br />');
        !            28: 	$r->print ($ENV{'form.saywhat'}.'<br />');
1.1       banghart   29: 
                     30: 	$r->print("here's the form<br />");
1.2     ! banghart   31: 	# file upload form 
        !            32: 	$r->print('<form method="post" enctype="multipart/form-data">');
        !            33: 	$r->print('<input name="uploaddoc" type="file">'.
        !            34: 	
        !            35: 		'<input type="submit" name="storeupl" value="Upload">'
        !            36: 		);
1.1       banghart   37: 	$r->print('</form>');
                     38: 	return OK;
                     39: 
1.2     ! banghart   40: }
1.1       banghart   41: 
                     42: 1;
                     43: __END__

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