version 1.25, 2004/08/24 06:43:21
|
version 1.26, 2004/08/24 06:51:11
|
Line 197 sub display_directory {
|
Line 197 sub display_directory {
|
$r->print('<table border="0" cellspacing="2" cellpadding="2">'. |
$r->print('<table border="0" cellspacing="2" cellpadding="2">'. |
'<tr><th>Actions</th><th> </th><th>Name</th><th>Size</th><th>Last Modified</th></tr>'); |
'<tr><th>Actions</th><th> </th><th>Name</th><th>Size</th><th>Last Modified</th></tr>'); |
my $href_location="/uploaded/$ENV{'user.domain'}/$ENV{'user.name'}/portfolio/$current_path/"; |
my $href_location="/uploaded/$ENV{'user.domain'}/$ENV{'user.name'}/portfolio/$current_path/"; |
foreach my $line (@$dir_list) { |
foreach my $line (sort |
|
{ |
|
my ($afile)=split('&',$a,2); |
|
my ($bfile)=split('&',$b,2); |
|
return (lc($afile) cmp lc($bfile)); |
|
} (@$dir_list)) { |
#$strip holds directory/file name |
#$strip holds directory/file name |
#$dom |
#$dom |
my ($filename,$dom,undef,$testdir,undef,undef,undef,undef,$size,undef,$mtime,undef,undef,undef,$obs,undef)=split(/\&/,$line,16); |
my ($filename,$dom,undef,$testdir,undef,undef,undef,undef,$size,undef,$mtime,undef,undef,undef,$obs,undef)=split(/\&/,$line,16); |
Line 319 sub upload {
|
Line 324 sub upload {
|
|
|
sub createdir { |
sub createdir { |
my ($r)=@_; |
my ($r)=@_; |
#FIXME 1) bad dirnames |
#FIXME 1) bad dirnames ( '/' etc) |
# 2) file exists in place of dir |
# 2) file exists in place of dir (errormessage needs improvement) |
my $result=&Apache::lonnet::mkdiruserfile($ENV{'user.name'}, |
my $result=&Apache::lonnet::mkdiruserfile($ENV{'user.name'}, |
$ENV{'user.domain'},'portfolio'.$ENV{'form.currentpath'}.$ENV{'form.newdir'}); |
$ENV{'user.domain'},'portfolio'.$ENV{'form.currentpath'}.$ENV{'form.newdir'}); |
if ($result ne 'ok') { |
if ($result ne 'ok') { |