'.&make_anchor('portfolio','/').'/');
+ $r->print(''.&make_anchor('portfolio','/',$ENV{"form.mode"},$ENV{"form.fieldname"}).'/');
if (@tree > 1){
my $newCurrentPath = '';
for (my $i = 1; $i< @tree; $i++){
$newCurrentPath .= $tree[$i].'/';
- $r->print(&make_anchor($tree[$i],'/'.$newCurrentPath).'/');
+ $r->print(&make_anchor($tree[$i],'/'.$newCurrentPath, $ENV{"form.mode"},$ENV{"form.fieldname"}).'/');
}
}
$r->print('');
&Apache::lonhtmlcommon::store_recent('portfolio',$current_path,$current_path);
- #Fixme -- remove from recent those paths that are deleted
- $r->print('
");
@@ -122,7 +123,7 @@ sub display_directory {
if ($dirptr&$testdir) {
$r->print(' | ');
$r->print('Go to ... | ');
- $r->print(''.&make_anchor($filename.'/',$current_path.$filename.'/').' | ');
+ $r->print(''.&make_anchor($filename.'/',$current_path.$filename.'/',$ENV{'form.mode'},$ENV{"form.fieldname"}).' | ');
$r->print('
');
} else {
$r->print('');
@@ -187,7 +188,7 @@ sub display_file_select {
if ($dirptr&$testdir) {
$r->print('
| ');
$r->print('Go to ... | ');
- $r->print(''.&make_anchor($filename.'/',$current_path.$filename.'/').' | ');
+ $r->print(''.&make_anchor($filename.'/',$current_path.$filename.'/',$ENV{'form.mode'},$ENV{"form.fieldname"}).' | ');
$r->print('
');
} else {
$r->print('');
@@ -245,14 +246,22 @@ sub done {
return ('');
}
sub delete {
my ($r)=@_;
- &open_form($r);
- $r->print(''.&mt('Delete').' '.&display_file().'?
');
- &close_form($r);
+ my @check;
+ my $file_name = $ENV{'form.currentpath'}.$ENV{'form.selectfile'};
+ if (&Apache::lonnet::is_locked($file_name,$ENV{'user.domain'},$ENV{'user.name'} ) eq 'true') {
+ $r->print ("The file is locked and cannot be deleted.
");
+ $r->print(&done());
+ } else {
+ &open_form($r);
+ $r->print(''.&mt('Delete').' '.&display_file().'?
');
+ &close_form($r);
+ }
}
sub delete_confirmed {
@@ -305,10 +314,16 @@ sub delete_dir_confirmed {
sub rename {
my ($r)=@_;
- &open_form($r);
- $r->print(''.&mt('Rename').' '.&display_file().' to
- ?
');
- &close_form($r);
+ my $file_name = $ENV{'form.currentpath'}.$ENV{'form.selectfile'};
+ if (&Apache::lonnet::is_locked($file_name,$ENV{'user.domain'},$ENV{'user.name'}) eq 'true') {
+ $r->print ("The file is locked and cannot be renamed.
");
+ $r->print(&done());
+ } else {
+ &open_form($r);
+ $r->print(''.&mt('Rename').' '.&display_file().' to
+ ?
');
+ &close_form($r);
+ }
}
sub rename_confirmed {
@@ -340,7 +355,7 @@ sub select_files {
fileList = "";
for (i=0;i