--- loncom/interface/portfolio.pm 2006/06/22 18:33:58 1.115
+++ loncom/interface/portfolio.pm 2006/07/19 21:59:10 1.121.2.8
@@ -1,3 +1,8 @@
+# The LearningOnline Network
+# portfolio browser
+#
+# $Id: portfolio.pm,v 1.121.2.8 2006/07/19 21:59:10 albertel Exp $
+#
# Copyright Michigan State University Board of Trustees
#
# This file is part of the LearningOnline Network with CAPA (LON-CAPA).
@@ -31,47 +36,71 @@ use Apache::lonfeedback;
use Apache::lonlocal;
use Apache::lonnet;
use Apache::longroup;
+use Apache::lonhtmlcommon;
use HTML::Entities;
use LONCAPA;
+sub group_args {
+ my $output;
+ if (defined($env{'form.group'})) {
+ $output .= '&group='.$env{'form.group'};
+ if (defined($env{'form.ref'})) {
+ $output .= '&ref='.$env{'form.ref'};
+ }
+ }
+ return $output;
+}
+
+sub group_form_data {
+ my $output;
+ if (defined($env{'form.group'})) {
+ $output = '';
+ if (exists($env{'form.ref'})) {
+ $output .= '';
+ }
+ }
+ return $output;
+}
+
# receives a file name and path stub from username/userfiles/portfolio/
# returns an anchor tag consisting encoding filename and currentpath
sub make_anchor {
my ($url, $filename, $current_path, $current_mode, $field_name,
- $continue_select,$group) = @_;
+ $continue_select) = @_;
if ($continue_select ne 'true') {$continue_select = 'false'};
my $anchor = ''.$filename.'';
return $anchor;
}
+
my $dirptr=16384;
sub display_common {
- 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',
+ my ($r,$url,$current_path,$is_empty,$dir_list,$can_upload)=@_;
+ my $namespace = &get_namespace();
+ my $port_path = &get_port_path();
+ if ($can_upload) {
+ my $groupitem = &group_form_data();
+
+ my $iconpath= $r->dir_config('lonIconsURL') . "/";
+ my %text=&Apache::lonlocal::texthash(
+ 'upload' => 'Upload',
'upload_label' =>
'Upload file to current directory:',
'createdir' => 'Create Subdirectory',
'createdir_label' =>
'Create subdirectory in current directory:');
- my $escuri = &HTML::Entities::encode($r->uri,'&<>"');
- $r->print(<<"TABLE");
+ my $escuri = &HTML::Entities::encode($r->uri,'&<>"');
+ $r->print(<<"TABLE");