--- loncom/interface/lonaboutme.pm 2006/04/08 06:59:34 1.41
+++ loncom/interface/lonaboutme.pm 2006/12/11 03:46:31 1.60
@@ -1,7 +1,7 @@
# The LearningOnline Network
# "About Me" Personal Information
#
-# $Id: lonaboutme.pm,v 1.41 2006/04/08 06:59:34 albertel Exp $
+# $Id: lonaboutme.pm,v 1.60 2006/12/11 03:46:31 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;
@@ -48,13 +49,17 @@ sub handler {
if ($target eq 'tex') {
$r->print(&Apache::lonprintout::print_latex_header($env{'form.latex_type'}));
}
- my (undef,undef,$cdom,$cnum)=split(/\//,$r->uri);
+ my (undef,undef,$cdom,$cnum,undef,$action)=split(/\//,$r->uri);
+ my $is_course;
# Is this even a user?
if (&Apache::lonnet::homeserver($cnum,$cdom) eq 'no_host') {
&Apache::loncommon::simple_error_page($r,'No info',
'No user information available');
return OK;
+ } else {
+ $is_course = &Apache::lonnet::is_course($cdom,$cnum);
}
+
# --------------------------------------------------------- The syllabus fields
my %syllabusfields=&Apache::lonlocal::texthash(
'aaa_contactinfo' => 'Contact Information',
@@ -62,18 +67,49 @@ sub handler {
'ccc_webreferences' => 'Web References');
# ------------------------------------------------------------ Get Query String
- &Apache::loncommon::get_unprocessed_cgi
- ($ENV{'QUERY_STRING'},['forcestudent','register']);
-# ----------------------------------------------------- Force menu registration
- my $addentries='';
- if ($env{'form.register'}) {
- $addentries=' onLoad="'.&Apache::lonmenu::loadevents().
- '" onUnload="'.&Apache::lonmenu::unloadevents().'"';
- $r->print(&Apache::lonmenu::registerurl(1));
+ &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
+ ['forceedit','forcestudent',
+ 'register']);
+
+# ----------------------------------------------- Available Portfolio file display
+ if (($target ne 'tex') && ($action eq 'portfolio')) {
+ &display_portfolio_header($r,$is_course);
+ my ($blocked,$blocktext) =
+ &Apache::loncommon::blocking_status('port',$cnum,$cdom);
+ if (!$blocked) {
+ &display_portfolio_files($r,$is_course);
+ } else {
+ $r->print($blocktext);
+ }
+ $r->print(&Apache::loncommon::end_page());
+ return OK;
}
+
+ if ($is_course) {
+ if ($target ne 'tex') {
+ my $start_page =
+ &Apache::loncommon::start_page(
+ "Course Information",
+ undef,
+ {'function' => $env{'forcestudent'},
+ 'domain' => $cdom,
+ 'force_register' => $env{'forceregister'},});
+ $r->print($start_page);
+ $r->print('
'.&mt('Group files').'
');
+ &print_portfiles_link($r,$is_course);
+ $r->print(&Apache::loncommon::end_page());
+ }
+ return OK;
+ }
+
# --------------------------------------------------------------- Force Student
my $forcestudent='';
if ($env{'form.forcestudent'}) { $forcestudent='student'; };
+
+ my $forceregister = '';
+ if ($forcestudent eq '') {
+ $forceregister = $env{'form.register'};
+ }
# --------------------------------------- There is such a user, get environment
my %courseenv=&Apache::lonnet::dump('environment',$cdom,$cnum);
@@ -81,10 +117,9 @@ sub handler {
my $start_page =
&Apache::loncommon::start_page("Personal Information",undef,
{'function' => $forcestudent,
- 'add_entries' => $addentries,
- 'domain' => $cdom,
+ 'domain' => $cdom,
'force_register' =>
- $env{'form.register'},});
+ $forceregister,});
$r->print($start_page);
$r->print('
'.&Apache::loncommon::plainname($cnum,$cdom).'
');
} else {
@@ -111,13 +146,15 @@ sub handler {
if ($forcestudent or $target eq 'tex') { $allowed=0; }
if ($allowed) {
+ my $query_string = &build_query_string({'forcestudent' => '1',});
$r->print('
'.&mt('Privacy Note').': '.
&mt('The information you submit can be viewed by anybody who is logged into LON-CAPA. Do not provide information that you are not ready to share publicly.').
'
'.
- &Apache::loncommon::help_open_topic('Uploaded_Templates_TextBoxes','Help with filling in text boxes').'
Show Public View'.
+ &Apache::loncommon::help_open_topic('Uploaded_Templates_TextBoxes','Help with filling in text boxes').'
Show Public View'.
&Apache::loncommon::help_open_topic('Uploaded_Templates_PublicView').'