--- loncom/interface/lonaboutme.pm 2009/06/11 16:48:33 1.138
+++ loncom/interface/lonaboutme.pm 2010/03/29 12:21:38 1.146
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Personal Information Page
#
-# $Id: lonaboutme.pm,v 1.138 2009/06/11 16:48:33 bisitz Exp $
+# $Id: lonaboutme.pm,v 1.146 2010/03/29 12:21:38 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -168,16 +168,22 @@ sub handler {
if ($is_course) {
if ($target ne 'tex') {
- my $brcrum = [{href=>"/adm/navmaps",text=>"Navigate Course Contents"},
- {href=>"/adm/aboutme",text=>"Course Information"}];
- my $start_page =
- &Apache::loncommon::start_page(
- "Course Information",
- undef,
- {'function' => $env{'forcestudent'},
- 'domain' => $cdom,
- 'force_register' => $env{'forceregister'},
- 'bread_crumbs' => $brcrum});
+ my $args = {'function' => $env{'forcestudent'},
+ 'domain' => $cdom};
+ if ($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",
+ text=>&mt('Course Information - [_1]',$cdescr),
+ no_mt=>1}
+ ];
+ $args->{'bread_crumbs'} = $brcrum;
+ }
+ my $start_page = &Apache::loncommon::start_page(
+ "Course Information",undef,$args);
$r->print($start_page);
$r->print('
'.&mt('Group Portfolio').'
');
&print_portfiles_link($r,$is_course);
@@ -190,11 +196,6 @@ sub handler {
my $forcestudent='';
if ($env{'form.forcestudent'}) { $forcestudent='student'; };
- my $forceregister = '';
- if ($forcestudent eq '') {
- $forceregister = $env{'form.register'};
- }
-
#------------Get rights
my %courseenv=&Apache::lonnet::dump('environment',$cdom,$cnum);
my %syllabus=&Apache::lonnet::dump('aboutme',$cdom,$cnum);
@@ -207,13 +208,15 @@ sub handler {
if ($target ne 'tex') {
my $rss_link = &Apache::lonrss::rss_link($cnum,$cdom);
- my $args = {'function' => $forcestudent,
+ my $args = {'function' => undef,
'domain' => $cdom,
- 'force_register' => $forceregister};
- if ($env{'form.popup'}) {
+ 'force_register' => $env{'form.register'},
+ };
+ if ($env{'form.popup'}) { # Don't show breadcrumbs in popup window
$args->{'no_nav_bar'} = 1;
- } else { # Don't show breadcrumbs in popup window
- $args->{'bread_crumbs'} = [{href=>"/adm/$cdom/$cnum/aboutme",text=>"Personal Information Page"}];
+ } elsif (!$env{'form.register'}) { #Don't show breadcrumbs twice, when this page is part of course content and you call it
+ $args->{'bread_crumbs'} = [{href=>"/adm/$cdom/$cnum/aboutme",
+ text=>"Personal Information Page"}];
}
my $start_page = &Apache::loncommon::start_page('Personal Information Page',$rss_link,$args);
$r->print($start_page);
@@ -320,7 +323,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 +353,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('