--- loncom/interface/portfolio.pm 2009/01/03 19:39:37 1.196.2.2
+++ loncom/interface/portfolio.pm 2009/02/17 10:10:21 1.209
@@ -1,7 +1,7 @@
# The LearningOnline Network
# portfolio browser
#
-# $Id: portfolio.pm,v 1.196.2.2 2009/01/03 19:39:37 raeburn Exp $
+# $Id: portfolio.pm,v 1.209 2009/02/17 10:10:21 weissno 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,'&<>"');
@@ -106,51 +105,51 @@ sub display_common {
$parse_check = <<"END";
- $text{'parse'}
+ $lt{'parse'}
END
}
- $r->print(<<"TABLE");
-$help_portfolio
-
'.$help_portfolio);
+ # 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,
@@ -218,11 +217,11 @@ sub display_usage {
$prog_width = 100;
}
my $disk_meter = '
- '.&mt('Currently using [_1] of the [_2] available.',$usage.' MB
('.$percent.'%) ',$quota.' MB')."\n".
-'
'."\n".
-'
'."\n".
+
'.&mt('Currently using [_1] of the [_2] available.',$usage.' MB
('.$percent.'%) ',$quota.' MB')."\n".
+'
'."\n".
-'
';
+'
';
return $disk_meter;
}
@@ -232,7 +231,7 @@ sub display_directory_line {
$href_location, $url, $current_path, $access_admin_text, $versions)=@_;
my $fullpath = &prepend_group($current_path.$filename);
- $r->print('
');
+ $r->print(&Apache::loncommon::start_data_table_row());
$r->print($line); # contains first two cells of table
my $lock_info;
if ($version_flag) { # versioned can't be versioned, so TRUE when root file
@@ -268,15 +267,19 @@ sub display_directory_line {
$r->print(''.$size.' ');
$r->print(''.&Apache::lonlocal::locallocaltime($mtime).' ');
if ($select_mode ne 'true') {
- $r->print(''.
- &mt($curr_access).' ');
+ $r->print(' '); # Display status
+ $r->print(''
+ .&mt($curr_access).' '
+ );
my %anchor_fields = (
'access' => $filename,
'currentpath' => $current_path
);
$r->print(&make_anchor($url, \%anchor_fields, $access_admin_text).' ');
+ } else {
+ $r->print(' '); # Display status
}
- $r->print(' '.$/);
+ $r->print(&Apache::loncommon::end_data_table_row().$/);
}
sub display_directory {
@@ -308,7 +311,9 @@ sub display_directory {
$display_out = '
';
@@ -318,21 +323,30 @@ sub display_directory {
}
if ($select_mode eq 'true') {
$r->print('
'
@@ -818,7 +843,8 @@ sub display_access {
$info .= ''.
&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:");
+ $info .= &mt("For logged in users a 'Display file listing' link will also appear (when there
+are viewable files) on your personal homepage:");
} 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:");
}
@@ -1547,7 +1573,7 @@ sub domains_row {
my ($r,$status,$item,$all_doms,$access_controls,$now,$then) = @_;
my ($num,$scope,$end,$start) = &set_identifiers($status,$item,$now,$then,
'domains');
- my $dom_select = '
'.
+ my $dom_select = ''.
' '.&mt('Please select').' ';
if ($status eq 'old') {
my $content = $$access_controls{$item};
@@ -1691,7 +1717,7 @@ sub role_selectors {
'group' => $groups,
);
foreach my $item ('role','access','section','group') {
- $output .= ''."\n";
+ $output .= ''."\n";
foreach my $entry (@{$allitems{$item}}) {
if ($caller eq 'display') {
if ((@{$$content{'roles'}{$role_id}{$item}} > 0) &&
@@ -1794,15 +1820,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:')
+ .'
'
+ );
}
@@ -2247,22 +2286,20 @@ 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}));
} elsif ($env{'form.action'} eq 'rolepicker') {
$r->print(&Apache::loncommon::start_page('New role-based condition',undef,
{'no_nav_bar' => 1, }));
- } else {
+ } elsif ($caller eq 'coursegrp_portfolio') {
$r->print(&Apache::loncommon::start_page($title));
- }
- $r->rflush();
- if ($caller ne 'coursegrp_portfolio') {
- &Apache::lonhtmlcommon::clear_breadcrumbs();
- &Apache::lonhtmlcommon::add_breadcrumb({href=>"/adm/portfolio",
- text=>"Portfolio Manager"});
+ } else {
+ $r->print(&Apache::loncommon::start_page($title,undef,
+ {'bread_crumbs' => $brcrum}));
if (!&Apache::lonnet::usertools_access($uname,$udom,'portfolio')) {
- $r->print(&Apache::lonhtmlcommon::breadcrumbs());
$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.').' '.
@@ -2270,10 +2307,9 @@ sub handler {
' ');
$r->print(&Apache::loncommon::end_page());
return OK;
- } else {
- $r->print(&Apache::lonhtmlcommon::breadcrumbs('Portfolio Manager'));
}
}
+ $r->rflush();
my ($blocked,$blocktext) =
&Apache::loncommon::blocking_status('port',$uname,$udom);
if ($blocked) {