From: Rob H. <for...@us...> - 2001-11-22 09:35:43
|
Update of /cvsroot/sandweb/sandweb/lib/SandWeb In directory usw-pr-cvs1:/tmp/cvs-serv31478/lib/SandWeb Modified Files: UI.pm Log Message: added templates for create_file, create_folder and upload for these to work, there need to be 1) methods in File class to carry out these actions and 2) more "if" statements in the file subroutine of sandweb.cgi to catch the create command Index: UI.pm =================================================================== RCS file: /cvsroot/sandweb/sandweb/lib/SandWeb/UI.pm,v retrieving revision 1.20 retrieving revision 1.21 diff -U2 -r1.20 -r1.21 --- UI.pm 2001/11/22 00:57:16 1.20 +++ UI.pm 2001/11/22 09:35:38 1.21 @@ -251,5 +251,51 @@ } -sub get_upload { +sub create_file { + my $self = shift; + my %args = @_; + + my $template_dir = $self->_get_template_dir(); + my $filename = $args{'filename'}; + my $location = $args{'location'}; + my $log = $self->_logobj(); + + # this will eventually be $conf->defaults() + my %defaults = ( + # CGI_PATH => $self->_get_cgi_path(), + # CGI_EXEC => $self->_get_cgi_exec(), + LOCATION => $location, + ); + + # generate content data + my $tmp = HTML::Template->new(filename => "$template_dir/create_file.html"); + $tmp->param( %defaults, %args ); + my @contents = $tmp->output; + return join('', @contents); +} + +sub create_folder{ + my $self = shift; + my %args = @_; + + my $template_dir = $self->_get_template_dir(); + my $filename = $args{'filename'}; + my $location = $args{'location'}; + my $log = $self->_logobj(); + + # this will eventually be $conf->defaults() + my %defaults = ( + # CGI_PATH => $self->_get_cgi_path(), + # CGI_EXEC => $self->_get_cgi_exec(), + LOCATION => $location, + ); + + # generate content data + my $tmp = HTML::Template->new(filename => "$template_dir/create_folder.html"); + $tmp->param( %defaults, %args ); + my @contents = $tmp->output; + return join('', @contents); +} + +sub upload_file { my $self = shift; my %args = @_; |