--- loncom/interface/lonsyllabus.pm 2003/02/10 20:03:13 1.12 +++ loncom/interface/lonsyllabus.pm 2003/03/10 14:20:07 1.16 @@ -1,7 +1,7 @@ # The LearningOnline Network # Syllabus # -# $Id: lonsyllabus.pm,v 1.12 2003/02/10 20:03:13 www Exp $ +# $Id: lonsyllabus.pm,v 1.16 2003/03/10 14:20:07 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -46,13 +46,12 @@ sub handler { The LearningOnline Network with CAPA - ENDDOCUMENT my (undef,undef,$cdom,$cnum)=split(/\//,$r->uri); # Is this even a course? my $homeserver=&Apache::lonnet::homeserver($cnum,$cdom); if ($homeserver eq 'no_host') { - $r->print('No syllabus available'); + $r->print('No syllabus available'); return OK; } # --------------------------------------------------------- The syllabus fields @@ -73,16 +72,24 @@ ENDDOCUMENT 'kkk_textbook' => 'Textbook', 'lll_includeurl' => 'URLs To Include in Syllabus'); -# --------------------------------------------------------------- Force Student +# ------------------------------------------------------------ Get query string &Apache::loncommon::get_unprocessed_cgi - ($ENV{'QUERY_STRING'},['forcestudent']); + ($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)); + } +# --------------------------------------------------------------- Force Student my $forcestudent=''; if ($ENV{'form.forcestudent'}) { $forcestudent='student'; }; # ------------------------------------- There is such a course, get environment my %courseenv=&Apache::lonnet::dump('environment',$cdom,$cnum); - $r->print(&Apache::loncommon::bodytag - ("Syllabus",$forcestudent,'','',$cdom)); + $r->print(''.&Apache::loncommon::bodytag + ("Syllabus",$forcestudent,$addentries,'',$cdom,$ENV{'form.register'})); $r->print('

'.$courseenv{'description'}.'

'. $Apache::lonnet::domaindescription{$cdom}.'

'); my %syllabus=&Apache::lonnet::dump('syllabus',$cdom,$cnum); @@ -98,7 +105,7 @@ ENDDOCUMENT } if ($allowed) { $r->print('

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

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

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

'. '

Show Student View'. @@ -174,11 +181,7 @@ ENDDOCUMENT my $embstyle=&Apache::loncommon::fileembstyle($curfext); if (($embstyle eq 'ssi') || ($curfext=~/\/$/)) { # make ssi call and remove everything but the body contents - $output= - ($filelink=~/^http\:/?&Apache::lonnet::externalssi($filelink): - &Apache::lonnet::ssi($filelink)); - $output=~s/^.*\]*\>//si; - $output=~s/\<\/body\s*\>.*$//si; + $output=&Apache::lonnet::ssi_body($filelink); } elsif ($embstyle eq 'img') { # embed as an image $output='';