--- loncom/interface/lonaboutme.pm 2006/08/08 17:24:07 1.51
+++ loncom/interface/lonaboutme.pm 2006/08/18 13:49:34 1.53
@@ -1,7 +1,7 @@
# The LearningOnline Network
# "About Me" Personal Information
#
-# $Id: lonaboutme.pm,v 1.51 2006/08/08 17:24:07 albertel Exp $
+# $Id: lonaboutme.pm,v 1.53 2006/08/18 13:49:34 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -37,6 +37,7 @@ use Apache::lonfeedback;
use Apache::lonrss();
use Apache::lonlocal;
use Apache::lonmsgdisplay();
+use HTML::Entities();
sub handler {
my $r = shift;
@@ -206,7 +207,7 @@ sub handler {
}
if ($allowed) {
$r->print('
');
}
@@ -277,12 +278,24 @@ sub print_portfiles_link {
$output .= ''.&mt('Display file listing').
'
';
- $output .= &mt('A total of [quant,_1,portfolio file] owned by [_2] are available.',$filecounts->{'both'},$name).'
';
+ if ($filecounts->{'both'} == 1) {
+ $output .= &mt('One portfolio file owned by [_2] is available.',$filecounts->{'both'},$name).'';
+ } else {
+ $output .= &mt('A total of [quant,_1,portfolio file] owned by [_2] are available.',$filecounts->{'both'},$name).'';
+ }
if ($filecounts->{'withoutpass'}) {
- $output .= '- '.&mt('[quant,_1,file] are publicly accessible.',$filecounts->{'withoutpass'}).'
';
+ if ($filecounts->{'withoutpass'} == 1) {
+ $output .= '- '.&mt('[quant,_1,file] is publicly accessible.',$filecounts->{'withoutpass'}).'
';
+ } else {
+ $output .= '- '.&mt('[quant,_1,file] are publicly accessible.',$filecounts->{'withoutpass'}).'
';
+ }
}
if ($filecounts->{'withpass'}) {
- $output .= '- '.&mt('[quant,_1,file] require a passphrase for access.',$filecounts->{'withpass'}).'
';
+ if ($filecounts->{'withpass'} == 1) {
+ $output .= '- '.&mt('[quant,_1,file] requires a passphrase for access.',$filecounts->{'withpass'}).'
';
+ } else {
+ $output .= '- '.&mt('[quant,_1,file] require a passphrase for access.',$filecounts->{'withpass'}).'
';
+ }
}
$output .= '
';
}
@@ -327,19 +340,21 @@ sub display_portfolio_header {
&Apache::lonhtmlcommon::clear_breadcrumbs();
my $forcestudent='';
if ($env{'form.forcestudent'}) { $forcestudent='student'; };
- my $output =
+ my $output =
&Apache::loncommon::start_page('Viewable portfolio files',undef,
{'function' => $forcestudent,
'domain' => $cdom,});
- &Apache::lonhtmlcommon::add_breadcrumb
- ({href=>"/adm/$cdom/$cnum/aboutme".$query_string,
- text=>"Personal information - $name",
- title=>"Go to personal information page for $name"},
- {href=>"/adm/$cdom/$cnum/aboutme/portfolio",
- text=>"Viewable files - $name",
- title=>"Viewable portfolio files for $name"}
-);
- $output .= &Apache::lonhtmlcommon::breadcrumbs(&mt('Viewable portfolio files.'));
+ if (!($env{'user.name'} eq 'public' && $env{'user.domain'} eq 'public')) {
+ &Apache::lonhtmlcommon::add_breadcrumb
+ ({href=>"/adm/$cdom/$cnum/aboutme".$query_string,
+ text=>"Personal information - $name",
+ title=>"Go to personal information page for $name"},
+ {href=>"/adm/$cdom/$cnum/aboutme/portfolio",
+ text=>"Viewable files - $name",
+ title=>"Viewable portfolio files for $name"}
+ );
+ $output .= &Apache::lonhtmlcommon::breadcrumbs(&mt('Viewable portfolio files.'));
+ }
$output .= ''.&mt('Portfolio files for [_1]',$name).'
';
$r->print($output);
return;
@@ -366,7 +381,7 @@ sub display_portfolio_files {
if ($portaccess eq $type) {
$output .= 'selected="selected"';
}
- $output .= '>'.&mt($type).'';
+ $output .= '>'.$lt{$type}.'';
}
$output .= ''."\n".
''.
- &mt('Information about [_1]',$name).'');
+ if (!($env{'user.name'} eq 'public' && $env{'user.domain'} eq 'public')) {
+ my $query_string = &build_query_string();
+ $r->print('
'.
+ &mt('Information about [_1]',$name).'');
+ }
return;
}
@@ -481,7 +498,7 @@ sub parse_directory {
$depth++;
my $output;
- my $portfolio_root = &Apache::portfolio::get_portfolio_root($cdom,$cnum);
+ my $portfolio_root = &Apache::portfolio::get_portfolio_root($cdom,$cnum);
my %dirlist = map {
((split('&',$_,2))[0],1)
} &Apache::lonnet::dirlist($path,$cdom,$cnum,$portfolio_root);