');
- $r->print(&mt('Last updated').': '.$lastmod . '');
+ $r->print(&mt('Last updated').': '.$lastmod . '');
$r->print('
');
}
}
-#Print Help Text
- if ($target ne 'tex') {
- if($allowed){
- $r->print(&Apache::loncommon::help_open_topic('Uploaded_Templates_TextBoxes',&mt('Help with filling in text boxes')));
- }
- }
#------Print Headtitle
if ($target ne 'tex') {
- $r->print('');
- $r->print('
'.&Apache::loncommon::plainname($cnum,$cdom).' ');
- if ($courseenv{'nickname'}) {
- $r->print('
"'.$courseenv{'nickname'}.'" ');
- }
- $r->print('
'.&Apache::lonnet::domain($cdom,'description').' ');
+ $r->print('
'.
+ '
'.&Apache::loncommon::plainname($cnum,$cdom).' ');
+ if ($allowed) {
+ $r->print('
');
+ if ($courseenv{'nickname'}) {
+ $r->print('
"'.$courseenv{'nickname'}.'" ');
+ }
+ $r->print(''.&Apache::lonnet::domain($cdom,'description').' ');
+ #Print Help Text
+ $r->print('
'.
+ &Apache::loncommon::help_open_topic('Uploaded_Templates_TextBoxes',&mt('Help with filling in text boxes')).
+ '
');
+ } else {
+ if ($courseenv{'nickname'}) {
+ $r->print('
"'.$courseenv{'nickname'}.'" ');
+ }
+ $r->print('
'.&Apache::lonnet::domain($cdom,'description').' ');
+ }
} else {
$r->print('\noindent{\large\textbf{'.&Apache::loncommon::plainname($cnum,$cdom).'}}\\\\\\\\');
$r->print('\textbf{'.&Apache::lonnet::domain($cdom,'description').'}\\\\');
@@ -320,7 +283,8 @@ sub handler {
&Apache::lonnet::removeuploadedurl($syllabus{'uploaded.photourl'});
}
$syllabus{'uploaded.photourl'}=
- &Apache::lonnet::userphotoupload('uploaddoc','aboutme');
+ &Apache::lonnet::userfileupload('uploaddoc',undef,'aboutme',
+ undef,undef,undef,undef,undef,undef,undef,'400','500');
}
$syllabus{'uploaded.lastmodified'}=time;
&Apache::lonnet::put('aboutme',\%syllabus,$cdom,$cnum);
@@ -349,38 +313,35 @@ sub handler {
if ($syllabus{'uploaded.photourl'}) {
&Apache::lonnet::allowuploaded('/adm/aboutme',$syllabus{'uploaded.photourl'});
- #This call is to resize all "Personal Information" images in the LonCapa System. When its done, you can remove this line.
- &Apache::lonnet::resizeImage(&Apache::lonnet::filelocation('',$syllabus{'uploaded.photourl'}));
- #---End Resize---
-
- $image=qq{
};
+ $image=qq|
|;
if ($target eq 'tex') {
$image=&Apache::lonxml::xmlparse($r,'tex',$image);
}
-
}
if ($allowed) {
$r->print(
- '
');
if ($syllabus{'uploaded.photourl'}) {
- $r->print('
')
+ $r->print('
')
}
- $r->print('
');
+ $r->print('
');
}
if($allowed) {
- $r->print('
';
+ } elsif ($is_course) {
+ $output .= '
'.&mt('There are currently no publicly accessible or password protected group portfolio files.').'
';
}
$r->print($output);
return;
@@ -561,34 +496,47 @@ sub display_portfolio_header {
my ($r,$is_course) = @_;
my ($cdom,$cnum,$name) = &aboutme_info($r,$is_course);
my $query_string = &build_query_string();
- &Apache::lonhtmlcommon::clear_breadcrumbs();
- my $forcestudent='';
- if ($env{'form.forcestudent'}) { $forcestudent='student'; };
-
+ my $args = {'domain' => $cdom};
+ if ($env{'form.forcestudent'}) {
+ $args->{'function'} = 'student';
+ }
my $output;
if ($is_course) {
- $output =
- &Apache::loncommon::start_page('Viewable group portfolio files',undef,
- {'function' => $forcestudent,
- 'domain' => $cdom,});
- $output .= '
'.&mt('Group Portfolio files').' ';
- } else {
- $output =
- &Apache::loncommon::start_page('Viewable portfolio files',undef,
- {'function' => $forcestudent,
- 'domain' => $cdom,});
- if (!($env{'user.name'} eq 'public' && $env{'user.domain'} eq 'public')) {
- &Apache::lonhtmlcommon::add_breadcrumb
- ({href=>"/adm/$cdom/$cnum/aboutme".$query_string,
- text=>&mt('Personal Information Page - [_1]',$name),
- title=>&mt('Go to personal information page for [_1]', $name)},
- {href=>"/adm/$cdom/$cnum/aboutme/portfolio",
- text=>&mt('Viewable files - [_1]', $name),
- title=>&mt('Viewable portfolio files for [_1]', $name)}
- );
- $output .= &Apache::lonhtmlcommon::breadcrumbs(&mt('Viewable portfolio files.'));
+ if (($env{'request.course.id'} eq $cdom.'_'.$cnum) &&
+ ($env{'form.register'})) {
+ $args->{force_register} = $env{'form.register'};
+ } else {
+ my %coursedescription = &Apache::lonnet::coursedescription($cdom.'_'.$cnum);
+ my $cdescr = $coursedescription{'description'};
+ my $brcrum = [{href=>"/adm/$cdom/$cnum/aboutme".$query_string,
+ text=>&mt('Course Information - [_1]',$cdescr),
+ no_mt=>1},
+ {href=>"/adm/$cdom/$cnum/aboutme/portfolio".$query_string,
+ text=>'Viewable group portfolio files'}
+ ];
+ $args->{bread_crumbs} = $brcrum;
}
- $output .= '
'.&mt('Portfolio files for [_1]',$name).' ';
+ $output = &Apache::loncommon::start_page('Viewable group portfolio files',undef,$args).
+ '
'.&mt('Group Portfolio files').' ';
+ } else {
+ if ($env{'request.course.id'} && $env{'form.register'}) {
+ $args->{force_register} = $env{'form.register'};
+ } else {
+ my $brcrum = [{href => "/adm/$cdom/$cnum/aboutme".$query_string,
+ text => &mt('Personal Information Page - [_1]',$name),
+ title => &mt('Go to personal information page for [_1]',$name),
+ no_mt => 1},
+ {href => "/adm/$cdom/$cnum/aboutme/portfolio".$query_string,
+ text => 'Viewable files',
+ title => &mt('Viewable portfolio files for [_1]',$name),
+ no_mt => 1}
+ ];
+ $args->{bread_crumbs} = $brcrum;
+ }
+ $output =
+ &Apache::loncommon::start_page('Viewable portfolio files',
+ undef,$args).
+ '
'.&mt('Portfolio files for [_1]',$name).' ';
}
$r->print($output);
return;
@@ -618,23 +566,28 @@ sub display_portfolio_files {
}
$output .= '>'.$lt{$type}.'';
}
- $output .= ''."\n".
- '
';
- $output .= '
';
+ $output .= ''."\n";
+ if ($env{'form.register'}) {
+ $output .= '
'."\n";
+ }
+ $output .= '
'.
+ '
';
$r->print($output);
my $filecounts = &portfolio_files($r,'listfiles',\%lt,$is_course,
$cdom,$cnum,$name);
if (!($env{'user.name'} eq 'public' && $env{'user.domain'} eq 'public')) {
- my $query_string = &build_query_string();
- $r->print('
');
- if ($is_course) {
- $r->print(&mt('Course Information page'));
- } else {
- $r->print(&mt('Information about [_1]',$name));
+ if ($env{'request.course.id'} && $env{'form.register'}) {
+ my $query_string = &build_query_string();
+ $r->print(' ');
+ if ($is_course) {
+ $r->print(&mt('Course Information page'));
+ } else {
+ $r->print(&mt('Information about [_1]',$name));
+ }
+ $r->print(' ');
}
- $r->print('');
}
return;
}
@@ -759,9 +712,12 @@ sub parse_directory {
my $portfolio_root = &Apache::portfolio::get_portfolio_root($cdom,$cnum,
$group);
my $getpropath = 1;
- my %dirlist = map {
- ((split('&',$_,2))[0],1)
- } &Apache::lonnet::dirlist($portfolio_root.$path,$cdom,$cnum,$getpropath);
+ my ($listref,$listerror) =
+ &Apache::lonnet::dirlist($portfolio_root.$path,$cdom,$cnum,$getpropath);
+ my %dirlist;
+ if (ref($listref) eq 'ARRAY') {
+ %dirlist = map { ((split('&',$_,2))[0],1) } @{$listref};
+ }
foreach my $item (sort(keys(%{$currhash}))) {
$output .= &Apache::loncommon::start_data_table_row();
$output .= '
';
@@ -804,7 +760,7 @@ sub parse_directory {
$output.=' ';
if ($have_meta) {
$output.= ' ';
}
$output .= ' '
@@ -825,13 +781,13 @@ sub aboutme_access {
my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};
my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'};
if (($cdom eq '') || ($cnum eq '')) {
- my %coursehash = &coursedescription($env{'request.course.id'});
+ my %coursehash = &Apache::lonnet::coursedescription($env{'request.course.id'});
$cdom = $coursehash{'domain'};
$cnum = $coursehash{'cnum'};
}
if ((&Apache::lonnet::allowed('srm',$privcheck)) ||
(&Apache::lonnet::allowed('dff',$privcheck))) {
- if (&in_course($uname,$udom,$cnum,$cdom)) {
+ if (&Apache::lonnet::in_course($uname,$udom,$cnum,$cdom)) {
return 1;
}
}