--- loncom/interface/lonaboutme.pm 2006/08/04 19:42:55 1.48 +++ loncom/interface/lonaboutme.pm 2006/09/21 15:50:10 1.56 @@ -1,7 +1,7 @@ # The LearningOnline Network # "About Me" Personal Information # -# $Id: lonaboutme.pm,v 1.48 2006/08/04 19:42:55 albertel Exp $ +# $Id: lonaboutme.pm,v 1.56 2006/09/21 15:50:10 albertel 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; @@ -49,12 +50,16 @@ sub handler { $r->print(&Apache::lonprintout::print_latex_header($env{'form.latex_type'})); } 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 = &check_for_course($cdom,$cnum); } + # --------------------------------------------------------- The syllabus fields my %syllabusfields=&Apache::lonlocal::texthash( 'aaa_contactinfo' => 'Contact Information', @@ -68,12 +73,29 @@ sub handler { # ----------------------------------------------- Available Portfolio file display if (($target ne 'tex') && ($action eq 'portfolio')) { - &display_portfolio_header($r); - &display_portfolio_files($r); + &display_portfolio_header($r,$is_course); + &display_portfolio_files($r,$is_course); $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('
'; @@ -487,27 +585,59 @@ sub parse_directory { my $title=&HTML::Entities::encode($item,'<>&"'); $output .= ' '.$title; $output .= ' | '. + ''. + ' '.$showname.''; + $output.=' | '; + if ($have_meta) { + $output.= ''; - + '" class="LC_icon" />'; + } $output .= ' | '; } } return $output; } +sub check_for_course { + my ($cdom,$cnum) = @_; + my %courses = &Apache::lonnet::courseiddump($cdom,'.',1,'.','.',$cnum,undef, + undef,'.'); + if (exists($courses{$cdom.'_'.$cnum})) { + return 1; + } + return 0; +} + 1; __END__