--- loncom/interface/portfolio.pm 2008/11/28 16:10:20 1.197
+++ loncom/interface/portfolio.pm 2008/12/15 16:37:44 1.203
@@ -1,7 +1,7 @@
# The LearningOnline Network
# portfolio browser
#
-# $Id: portfolio.pm,v 1.197 2008/11/28 16:10:20 bisitz Exp $
+# $Id: portfolio.pm,v 1.203 2008/12/15 16:37:44 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -87,13 +87,12 @@ sub display_common {
my $groupitem = &group_form_data();
my $iconpath= $r->dir_config('lonIconsURL') . "/";
- my %text=&Apache::lonlocal::texthash(
+ my %lt=&Apache::lonlocal::texthash(
'upload' => 'Upload',
- 'upload_label' =>
- 'Upload file to current directory:',
+ 'upload_label' => 'Upload file to current directory',
'createdir' => 'Create Subdirectory',
'createdir_label' =>
- 'Create subdirectory in current directory:',
+ 'Create subdirectory in current directory',
'parse' => 'If HTML file, upload embedded images/multimedia/css/linked files'
);
my $escuri = &HTML::Entities::encode($r->uri,'&<>"');
@@ -108,50 +107,51 @@ sub display_common {
$parse_check = <<"END";
- $text{'parse'}
+ $lt{'parse'}
END
}
- $r->print(<<"TABLE");
-
-
-
- $text{'upload_label'}
-
-
-
-
-
-
-
- $text{'createdir_label'}
-
-
-
-
-
-
-TABLE
- }
+
+ $r->print('');
+ # Upload File
+ $r->print('
'
+ .''
+ .'
'
+ );
+ # Create Subdirectory
+ $r->print('
'
+ .''
+ .'
'
+ );
+ $r->print('
');
+ } # end "if can_upload"
+
my @tree = split (/\//,$current_path);
my %anchor_fields = (
'selectfile' => $port_path,
@@ -271,7 +271,9 @@ sub display_directory {
$display_out = '';
@@ -477,16 +479,20 @@ sub display_directory {
-
-
+
+
+
+
');
} else {
$r->print(&Apache::loncommon::end_data_table());
if ($can_delete) {
$r->print('
+
'.
&Apache::loncommon::help_open_topic('Portfolio DeleteFile').'
+
'
@@ -795,13 +801,13 @@ sub display_access {
$info .= ''.&mt('Passphrase-protected files do not require log-in, but will require the viewer to enter the passphrase you set.');
$info .= ' '.&explain_conditionals();
$info .= ' '.
- &mt('A listing of files viewable without log-in is available at: ')."http://$ENV{'SERVER_NAME'}/adm/$udom/$uname/aboutme/portfolio . ";
+ &mt('A listing of files viewable without log-in is available at: ')."".&Apache::lonnet::absolute_url($ENV{'SERVER_NAME'})."/adm/$udom/$uname/aboutme/portfolio . ";
if ($group eq '') {
$info .= &mt("For logged in users a 'Display file listing' link will also appear (when there are viewable files) on your personal information page:");
} else {
$info .= &mt("For logged in users a 'Display file listing' link will also appear (when there are viewable files) on the course information page:");
}
- $info .= "http://$ENV{'SERVER_NAME'}/adm/$udom/$uname/aboutme ";
+ $info .= "".&Apache::lonnet::absolute_url($ENV{'SERVER_NAME'})."/adm/$udom/$uname/aboutme ";
if ($group ne '') {
$info .= &mt("Users with privileges to edit course contents may add a course information page to a course using the 'Course Info' button in DOCS").' ';
}
@@ -1494,7 +1500,7 @@ sub course_row {
}
$max_id ++;
my $role_selects = &role_selectors($num,$role_id,$type,$content,'display');
- $r->print(' '.&mt('Delete').' '.$role_selects.' ');
+ $r->print(' '.&mt('Delete').' '.$role_selects.' ');
}
$r->print('');
}
@@ -1569,7 +1575,7 @@ sub additional_item {
sub actionbox {
my ($status,$num,$scope) = @_;
- my $output = '';
+ my $output = '';
if ($status eq 'new') {
my $checkstate;
if ($scope eq 'domains' || $scope eq 'users' || $scope eq 'course') {
@@ -1580,7 +1586,7 @@ sub actionbox {
&mt('Activate');
} else {
$output .= ' '.&mt('Delete').' '.
+ '" />'.&mt('Delete').' '.
' '.&mt('Update');
}
@@ -1599,7 +1605,7 @@ sub dateboxes {
undef,undef,1);
my $enddate = &Apache::lonhtmlcommon::date_setter('portform',
'enddate_'.$num,$end,undef,undef,undef,1,undef,
- undef,undef,1). ' '.
+ undef,undef,1). ' '.
' '.&mt('No end date').
' ';
@@ -1773,15 +1779,28 @@ ENDSMP
ENDSMP
$r->print($javascript);
- $r->print("".&mt('Select portfolio files')." ".
- &mt('Check as many as you wish in response to the problem.')." ");
+ $r->print("".&mt('Select portfolio files')." ");
my @otherfiles=&Apache::lonnet::files_not_in_path($env{'user.name'}, $env{'form.currentpath'});
if (@otherfiles) {
- $r->print("".&mt('Files selected from other directories:')." ");
+ $r->print(&Apache::loncommon::start_data_table()
+ .&Apache::loncommon::start_data_table_header_row()
+ .''.&mt('Files selected from other directories:')." "
+ .&Apache::loncommon::end_data_table_header_row()
+ );
foreach my $file (@otherfiles) {
- $r->print($file." ");
+ $r->print(&Apache::loncommon::start_data_table_row()
+ .''.$file." "
+ .&Apache::loncommon::end_data_table_row()
+ );
}
+ $r->print(&Apache::loncommon::end_data_table()
+ .' '
+ );
}
+ $r->print(''
+ .&mt('Check as many files as you wish in response to the problem:')
+ .'
'
+ );
}
@@ -2226,6 +2245,8 @@ sub handler {
&Apache::loncommon::content_type($r,'text/html');
$r->send_http_header;
# Give the LON-CAPA page header
+ my $brcrum = [{href=>"/adm/portfolio",text=>"Portfolio Manager"}];
+
if ($env{"form.mode"} eq 'selectfile'){
$r->print(&Apache::loncommon::start_page($title,undef,
{'only_body' => 1}));
@@ -2233,9 +2254,19 @@ sub handler {
$r->print(&Apache::loncommon::start_page('New role-based condition',undef,
{'no_nav_bar' => 1, }));
} else {
- $r->print(&Apache::loncommon::start_page($title));
+ $r->print(&Apache::loncommon::start_page($title,undef,
+ {'bread_crumbs' => $brcrum}));
}
$r->rflush();
+ if (!&Apache::lonnet::usertools_access($uname,$udom,'portfolio')) {
+ $r->print(''.&mt('No user portfolio available') .' '.
+ &mt('This is a result of one of the following:').''.
+ ''.&mt('The administrator of this domain has disabled portfolio functionality for this specific user.').' '.
+ ''.&mt('The domain has been configured to disable, by default, portfolio functionality for all users in the domain.').' '.
+ ' ');
+ $r->print(&Apache::loncommon::end_page());
+ return OK;
+ }
my ($blocked,$blocktext) =
&Apache::loncommon::blocking_status('port',$uname,$udom);
if ($blocked) {