--- loncom/interface/portfolio.pm 2005/12/19 23:19:18 1.92
+++ loncom/interface/portfolio.pm 2006/03/15 19:41:26 1.95
@@ -34,14 +34,25 @@ use Apache::lonnet;
# receives a file name and path stub from username/userfiles/portfolio/
# returns an anchor tag consisting encoding filename and currentpath
sub make_anchor {
- my ($filename, $current_path, $current_mode, $field_name, $continue_select) = @_;
+ my ($url, $filename, $current_path, $current_mode, $field_name,
+ $continue_select,$group) = @_;
if ($continue_select ne 'true') {$continue_select = 'false'};
- my $anchor = ''.$filename.'';
+ my $anchor = ''.$filename.'';
return $anchor;
}
my $dirptr=16384;
sub display_common {
- my ($r,$current_path,$is_empty,$dir_list)=@_;
+ my ($r,$url,$current_path,$is_empty,$dir_list,$group)=@_;
+ my $groupitem;
+ my $namespace = &get_namespace($group);
+ my $port_path = &get_port_path($group);
+ if (defined($group)) {
+ $groupitem = '';
+ }
my $iconpath= $r->dir_config('lonIconsURL') . "/";
my %text=&Apache::lonlocal::texthash('upload' => 'Upload',
'upload_label' =>
@@ -56,7 +67,7 @@ sub display_common {
$text{'upload_label'}
|
-
+ | $groupitem
@@ -72,7 +83,7 @@ sub display_common {
$text{'createdir_label'}
|
-
+ $groupitem
@@ -84,35 +95,47 @@ sub display_common {
TABLE
my @tree = split (/\//,$current_path);
- $r->print(''.&make_anchor('portfolio','/',$env{"form.mode"},$env{"form.fieldname"},$env{"form.continue"}).'/');
+ $r->print(''.&make_anchor($url,$port_path,'/',$env{"form.mode"},$env{"form.fieldname"},$env{"form.continue"},$group).'/');
if (@tree > 1){
my $newCurrentPath = '';
for (my $i = 1; $i< @tree; $i++){
$newCurrentPath .= $tree[$i].'/';
- $r->print(&make_anchor($tree[$i],'/'.$newCurrentPath, $env{"form.mode"},$env{"form.fieldname"}, $env{"form.continue"}).'/');
+ $r->print(&make_anchor($url,$tree[$i],'/'.$newCurrentPath, $env{"form.mode"},$env{"form.fieldname"}, $env{"form.continue"},$group).'/');
}
}
$r->print('');
- &Apache::lonhtmlcommon::store_recent('portfolio',$current_path,$current_path);
- $r->print(' ");
}
sub display_directory {
- my ($r,$current_path,$is_empty,$dir_list)=@_;
+ my ($r,$url,$current_path,$is_empty,$dir_list,$group)=@_;
my $iconpath= $r->dir_config('lonIconsURL') . "/";
+ my ($groupitem,$groupecho);
my $display_out;
my $select_mode;
my $checked_files;
- my %locked_files = &Apache::lonnet::get_marked_as_readonly_hash ($env{'user.domain'},$env{'user.name'});
+ my $port_path = &get_port_path($group);
+ my ($uname,$udom) = &get_name_dom($group);
+ my $namespace = &get_namespace($group);
+ if (defined($group)) {
+ $groupitem = '';
+ $groupecho = '&group='.$group;
+ }
+ my %locked_files = &Apache::lonnet::get_marked_as_readonly_hash ($namespace,$udom,$uname);
if ($env{"form.mode"} eq 'selectfile'){
&select_files($r);
- $checked_files =&Apache::lonnet::files_in_path($env{'user.name'},$env{'form.currentpath'});
+ $checked_files =&Apache::lonnet::files_in_path($uname,$env{'form.currentpath'});
$select_mode = 'true';
}
if ($is_empty && ($current_path ne '/')) {
- $display_out = ' |