--- loncom/interface/lonsyllabus.pm 2007/07/27 00:17:17 1.60 +++ loncom/interface/lonsyllabus.pm 2008/08/25 14:50:01 1.67 @@ -1,7 +1,7 @@ # The LearningOnline Network # Syllabus # -# $Id: lonsyllabus.pm,v 1.60 2007/07/27 00:17:17 albertel Exp $ +# $Id: lonsyllabus.pm,v 1.67 2008/08/25 14:50:01 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -110,15 +110,58 @@ sub handler { # ----------------------------------------------------------------- Make header if ($target ne 'tex') { my $rss_link = &Apache::lonrss::rss_link($cnum,$cdom); - + my $js; + if ($env{'form.backto'} eq 'coursecatalog') { + $js .= <<"ENDSCRIPT"; + + + +ENDSCRIPT + } my $start_page = - &Apache::loncommon::start_page("Syllabus", $rss_link, + &Apache::loncommon::start_page("Syllabus", $rss_link.$js, {'function' => $forcestudent, 'domain' => $cdom, 'force_register' => $env{'form.register'},}); - $r->print($start_page.'

'.$courseenv{'description'}.'

'. + $r->print($start_page); + if ($env{'form.backto'} eq 'coursecatalog') { + &Apache::lonhtmlcommon::clear_breadcrumbs(); + &Apache::lonhtmlcommon::add_breadcrumb + ({href=>"javascript:ToCatalog()", + text=>"Course Catalog"}); + if ($env{'form.coursenum'} ne '') { + &Apache::lonhtmlcommon::add_breadcrumb + ({href=>"javascript:ToCatalog('details')", + text=>"Course details"}); + } + &Apache::lonhtmlcommon::add_breadcrumb + ({href=>$r->uri, + text=>"Course syllabus"}); + $r->print(&Apache::lonhtmlcommon::breadcrumbs()); + } + $r->print('

'.$courseenv{'description'}.'

'. &Apache::lonnet::domain($cdom,'description').'

'); } else { $r->print('\noindent{\large\textbf{'.$courseenv{'description'}.'}}\\\\\\\\\textbf{'. @@ -136,35 +179,41 @@ sub handler { # -------------------------------------------------------- Get course personnel my %coursepersonnel=&Apache::lonnet::get_course_adv_roles($cdom.'/'.$cnum); if ($target ne 'tex') { - $r->print(''); + $r->print(&Apache::loncommon::start_data_table()); } else { $r->print('\begin{tabular}{|p{0.45\textwidth}|p{0.45\textwidth}|}\hline'); } foreach my $element (sort keys %coursepersonnel) { if ($target ne 'tex') { - $r->print(''); + $r->print(''.&Apache::loncommon::end_data_table_row()); } else { $r->print('\\\\ \hline'); } } if ($target ne 'tex') { - $r->print('
'.$element.''); + $r->print(&Apache::loncommon::start_data_table_row(). + ''.$element.''); } else { $r->print(' '.&Apache::lonxml::xmlparse($r,'tex',$element).' & '); } foreach (split(/\,/,$coursepersonnel{$element})) { my ($puname,$pudom)=split(/\:/,$_); if ($target ne 'tex') { - $r->print(' '.&Apache::loncommon::aboutmewrapper( - &Apache::loncommon::plainname($puname, - $pudom),$puname,$pudom)); + my $courseperson = &Apache::loncommon::plainname($puname,$pudom); + if (($env{'user.name'} eq '') || ($env{'user.name'} eq 'public') || + ($env{'user.domain'} eq '') || ($env{'user.domain'} eq 'public')) { + $r->print(' '.$courseperson); + } else { + $r->print(' '.&Apache::loncommon::aboutmewrapper($courseperson, + $puname,$pudom)); + } } else { $r->print(' '.&Apache::loncommon::plainname($puname, $pudom).' '); } } if ($target ne 'tex') { - $r->print('
'); + $r->print(&Apache::loncommon::end_data_table()); } else { $r->print('\end{tabular}\\\\'); } @@ -189,7 +238,7 @@ sub handler { } if ($allowed) { $r->print('

'. -&Apache::loncommon::help_open_topic('Uploaded_Templates_TextBoxes','Help with filling in text boxes').'

'.&mt('This syllabus can be publicly viewed at') +&Apache::loncommon::help_open_topic('Uploaded_Templates_TextBoxes',&mt('Help with filling in text boxes')).'

'.&mt('This syllabus can be publicly viewed at') .' http://'. &Apache::lonnet::hostname($homeserver).$r->uri.''. &Apache::loncommon::help_open_topic('Syllabus_ExtLink').'

'. @@ -260,12 +309,16 @@ sub handler { $syllabus{'uploaded.domain'}); if ($target ne 'tex') { $r->print('
'.&mt('Last updated').':'. - $lastmod.''.&mt('by').' '.$who. + $lastmod.''. + ($who ? &mt('by').' '.$who + : '' ). '

'); } else { - $r->print('\\\\ '.&mt('Last updated').': '.$lastmod.' '.&mt('by').'\\\\ '. - &Apache::loncommon::plainname($syllabus{'uploaded.name'}, - $syllabus{'uploaded.domain'}).'\\\\'); + $r->print('\\\\ '.&mt('Last updated').': '.$lastmod.' '. + ($who? &mt('by').'\\\\ '. + &Apache::loncommon::plainname($syllabus{'uploaded.name'},$syllabus{'uploaded.domain'}) + :'') + .'\\\\'); } if ($allowed) { $r->print('

'. @@ -323,7 +376,7 @@ sub handler { if ($allowed) { $r->print('
'); + ' '); } } } @@ -334,10 +387,15 @@ sub handler { if ($target ne 'tex') {$r->print('

');} else {$r->print('\\\\');} } else { if ($target ne 'tex') {$r->print('

');} else {$r->print('\par ');} - $r->print('No syllabus information provided.'); + $r->print(&mt('No syllabus information provided.')); if ($target ne 'tex') {$r->print('

');} } if ($target ne 'tex') { + if ($env{'form.backto'} eq 'coursecatalog') { + $r->print(''. + &Apache::lonhtmlcommon::echo_form_input(['backto','courseid']). + '
'); + } $r->print(&Apache::loncommon::end_page()); } else { $r->print('\end{document}');