Annotation of loncom/interface/lonsyllabus.pm, revision 1.85

1.1       www         1: # The LearningOnline Network
                      2: # Syllabus
                      3: #
1.85    ! bisitz      4: # $Id: lonsyllabus.pm,v 1.84 2009/03/27 15:46:38 bisitz Exp $
1.1       www         5: #
                      6: # Copyright Michigan State University Board of Trustees
                      7: #
                      8: # This file is part of the LearningOnline Network with CAPA (LON-CAPA).
                      9: #
                     10: # LON-CAPA is free software; you can redistribute it and/or modify
                     11: # it under the terms of the GNU General Public License as published by
                     12: # the Free Software Foundation; either version 2 of the License, or
                     13: # (at your option) any later version.
                     14: #
                     15: # LON-CAPA is distributed in the hope that it will be useful,
                     16: # but WITHOUT ANY WARRANTY; without even the implied warranty of
                     17: # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
                     18: # GNU General Public License for more details.
                     19: #
                     20: # You should have received a copy of the GNU General Public License
                     21: # along with LON-CAPA; if not, write to the Free Software
                     22: # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
                     23: #
                     24: # /home/httpd/html/adm/gpl.txt
                     25: #
                     26: # http://www.lon-capa.org/
                     27: #
                     28: 
                     29: package Apache::lonsyllabus;
                     30: 
                     31: use strict;
1.70      amueller   32: use Apache::lontemplate;
1.1       www        33: use Apache::Constants qw(:common);
                     34: use Apache::loncommon;
                     35: use Apache::lonnet;
1.5       www        36: use Apache::lontexconvert;
1.11      www        37: use Apache::lonfeedback;
1.19      www        38: use Apache::lonannounce;
1.23      www        39: use Apache::lonlocal;
1.32      www        40: use Apache::lonhtmlcommon;
1.38      www        41: use Apache::lonspeller();
1.54      albertel   42: use HTML::Entities();
1.1       www        43: 
                     44: sub handler {
                     45:     my $r = shift;
1.46      www        46:     &Apache::loncommon::content_type($r,'text/html');
                     47:     $r->send_http_header;
                     48:     return OK if $r->header_only;
1.45      www        49: 
1.46      www        50:     my $target=$env{'form.grade_target'};
1.45      www        51: # --------------------------------------------------- Get course info from URL
                     52:     my (undef,undef,$cdom,$cnum)=split(/\//,$r->uri);
1.46      www        53: # ------------------------------------------------------------ Get query string
                     54:     &Apache::loncommon::get_unprocessed_cgi
1.47      www        55:                         ($ENV{'QUERY_STRING'},['forcestudent','register','forceedit','wrapperdisplay']);
1.45      www        56: # ----------------------------------------------------- Is this even a course?
                     57:     my $homeserver=&Apache::lonnet::homeserver($cnum,$cdom);
                     58:     if ($homeserver eq 'no_host') {
                     59:         &Apache::loncommon::content_type($r,'text/html');
                     60:         $r->send_http_header;
1.49      albertel   61:       	&Apache::loncommon::simple_error_page($r,'No syllabus available',
                     62: 					      'No syllabus available');
1.45      www        63:         return OK;
                     64:     }
                     65: # ------------------------------------- There is such a course, get environment
                     66:     my %courseenv=&Apache::lonnet::dump('environment',$cdom,$cnum);
1.46      www        67: 
1.1       www        68: # ------------------------------------------------------------ Print the screen
1.49      albertel   69: 
                     70:     if ($target eq 'tex') {
1.40      albertel   71: 	$r->print(&Apache::lonprintout::print_latex_header($env{'form.latex_type'}));
1.28      sakharuk   72:     } 
1.46      www        73: # -------------------------------------------------- Let's see who handles this
1.47      www        74:     my $externalsyllabus=$courseenv{'externalsyllabus'};
1.49      albertel   75: 
1.46      www        76:     if ($externalsyllabus=~/\w/) {
1.50      albertel   77: 	
1.47      www        78:        if ($env{'form.wrapperdisplay'} eq 'menu') {
1.50      albertel   79: 	   $r->print(&Apache::lonwrapper::simple_menu());
                     80:        } else {	    
                     81: 	   $r->print(&Apache::lonwrapper::wrapper("/public/$cdom/$cnum/syllabus?wrapperdisplay=menu",
                     82: 						   $externalsyllabus));
                     83:        }
                     84:        return OK;
1.47      www        85:      } 
1.42      www        86: 
1.46      www        87: # ------------------------------ The buck stops here: internal syllabus display
1.5       www        88: # --------------------------------------------------------- The syllabus fields
1.23      www        89:     my %syllabusfields=&Apache::lonlocal::texthash(
1.5       www        90:        'aaa_instructorinfo' => 'Instructor Information',
                     91:        'bbb_description'    => 'Course Description',
                     92:        'ccc_prereq'         => 'Prerequisites',
1.7       www        93:        'cdc_classhours'     => 'Class Hours',
1.5       www        94:        'ddd_officehours'    => 'Office Hours',
                     95:        'eee_helproom'       => 'Helproom Hours',
1.7       www        96:        'efe_projectinfo'    => 'Project Information',
1.5       www        97:        'fff_examinfo'       => 'Exam Information',
1.7       www        98:        'fgf_deadlines'      => 'Deadlines',
1.5       www        99:        'ggg_grading'        => 'Grading Information',
1.7       www       100:        'hhh_readings'       => 'Readings',
                    101:        'iii_coursepack'     => 'Coursepack',
                    102:        'jjj_weblinks'       => 'Web Links',
1.9       www       103:        'kkk_textbook'       => 'Textbook',
                    104:        'lll_includeurl'     => 'URLs To Include in Syllabus');
1.6       www       105: # --------------------------------------------------------------- Force Student
                    106:     my $forcestudent='';
1.40      albertel  107:     if ($env{'form.forcestudent'}) { $forcestudent='student'; };
1.27      www       108:     my $forceedit='';
1.40      albertel  109:     if ($env{'form.forceedit'}) { $forceedit='edit'; }
1.5       www       110:        
1.45      www       111: # ----------------------------------------------------------------- Make header 
1.28      sakharuk  112:     if ($target ne 'tex') {
1.60      albertel  113: 	my $rss_link = &Apache::lonrss::rss_link($cnum,$cdom);
1.65      raeburn   114:         my $js;
                    115:         if ($env{'form.backto'} eq 'coursecatalog') {
                    116:             $js .= <<"ENDSCRIPT";
                    117: 
                    118: <script type="text/javascript">
                    119: function ToCatalog(caller) {
                    120:     numidx = getIndexByName('coursenum');
                    121:     if (numidx > -1) {
                    122:         if (caller != 'details') {
                    123:             document.backtocat.elements[numidx].value = '';
                    124:         }
                    125:     }
                    126:     document.backtocat.submit();
                    127: }
                    128: 
                    129: function getIndexByName(item) {
                    130:     for (var i=0;i<document.backtocat.elements.length;i++) {
                    131:         if (document.backtocat.elements[i].name == item) {
                    132:             return i;
                    133:         }
                    134:     }
                    135:     return -1;
                    136: }
                    137: 
                    138: </script>
                    139: 
                    140: ENDSCRIPT
                    141:         }
1.49      albertel  142: 	my $start_page = 
1.65      raeburn   143: 	    &Apache::loncommon::start_page("Syllabus", $rss_link.$js,
1.49      albertel  144: 					   {'function'       => $forcestudent,
                    145: 					    'domain'         => $cdom,
                    146: 					    'force_register' =>
                    147: 						$env{'form.register'},});
                    148: 
1.65      raeburn   149: 	$r->print($start_page);
                    150:         if ($env{'form.backto'} eq 'coursecatalog') {
                    151:             &Apache::lonhtmlcommon::clear_breadcrumbs();
                    152:             &Apache::lonhtmlcommon::add_breadcrumb
                    153:              ({href=>"javascript:ToCatalog()",
                    154:                text=>"Course Catalog"});
                    155:             if ($env{'form.coursenum'} ne '') {
                    156:                 &Apache::lonhtmlcommon::add_breadcrumb
                    157:                   ({href=>"javascript:ToCatalog('details')",
                    158:                    text=>"Course details"});
                    159:             }
                    160:             &Apache::lonhtmlcommon::add_breadcrumb
                    161:               ({href=>$r->uri,
                    162:                text=>"Course syllabus"});
                    163:             $r->print(&Apache::lonhtmlcommon::breadcrumbs());
1.80      neumanie  164:         }	
                    165: 	
1.17      www       166:     }
                    167: # ---------------------------------------------------------- Load syllabus info
1.4       www       168:     my %syllabus=&Apache::lonnet::dump('syllabus',$cdom,$cnum);
1.5       www       169:     my $allowed=0;
1.27      www       170:     my $privileged=0;
1.4       www       171: 
1.2       www       172: # This handler might be called anonymously ...
                    173: # ----------------------------------------------------- Only if not public call
1.40      albertel  174:     if ($env{'user.environment'}) {
1.1       www       175: # does this user have privileges to post, etc?
1.53      albertel  176:        if ($env{'request.course.id'}
                    177: 	   && $cdom eq $env{'course.'.$env{'request.course.id'}.'.domain'}
                    178: 	   && $cnum eq $env{'course.'.$env{'request.course.id'}.'.num'}) {
1.40      albertel  179:           $allowed=&Apache::lonnet::allowed('mdc',$env{'request.course.id'});
1.27      www       180: 	  $privileged=$allowed;
                    181: 	  if (($syllabus{'uploaded.lastmodified'}) && (!$forceedit)) {
                    182: 	      $forcestudent='student';
                    183: 	  }
1.30      sakharuk  184:           if ($forcestudent or $target eq 'tex') { $allowed=0; }
1.80      neumanie  185:        }    
1.40      albertel  186:        if (($allowed) && ($env{'form.storesyl'})) {
1.55      albertel  187: 	   foreach my $syl_field (keys(%syllabusfields)) {
                    188:                my $field=$env{'form.'.$syl_field};
1.33      www       189: 	       chomp($field);
1.5       www       190:                $field=~s/\s+$//s;
1.33      www       191: 	       $field=~s/^\s+//s;
                    192: 	       $field=~s/\<br\s*\/*\>$//s;
                    193: 	       $field=&Apache::lonfeedback::clear_out_html($field,1);
1.55      albertel  194: 	       $syllabus{$syl_field}=$field;
                    195:                if ($syl_field eq 'lll_includeurl') { # clean up included URLs
1.9       www       196:                   my $field='';
1.55      albertel  197: 	          foreach my $value (split(/\n/,$syllabus{$syl_field})) {
                    198: 		      my $url=$value;
1.9       www       199: # get rid of leading and trailing spaces
                    200:                       $url=~s/^\s+//;
                    201:                       $url=~s/\s+$//;
1.75      raeburn   202:                       if ($url=~m|^https?\://([^/]+)/(.+)$|) {
1.55      albertel  203: 			  my $host = $1;
1.9       www       204:                           my $remainder=$2;
                    205: # remove the hostname from internal URLs
1.57      albertel  206: 			  my $hostname = &Apache::lonnet::hostname($host);
                    207: 			  my %all_hostnames = &Apache::lonnet::all_hostnames();
                    208: 		          foreach my $possible_host (keys(%all_hostnames)) {
                    209:                               if ($possible_host =~ /\Q$hostname\E/i) {
1.9       www       210: 			         $url=$remainder;
                    211: 			      }
                    212: 		          }
                    213: 		      }
                    214: # norm internal URLs
1.75      raeburn   215:                       unless ($url=~/^https?\:/) {
1.9       www       216: 		          $url=&Apache::lonnet::clutter($url);
                    217:                       }
                    218: # re-assemble field
                    219:                       if ($url) {
                    220: 		          $field.=$url."\n";
                    221:                       }
                    222: 		  }
1.55      albertel  223:                   $syllabus{$syl_field}=$field;
1.9       www       224: 	      }
1.5       www       225:            }
1.40      albertel  226:            $syllabus{'uploaded.domain'}=$env{'user.domain'};
                    227:            $syllabus{'uploaded.name'}=$env{'user.name'};
1.5       www       228:            $syllabus{'uploaded.lastmodified'}=time;
                    229:            &Apache::lonnet::put('syllabus',\%syllabus,$cdom,$cnum);
                    230:        }
1.4       www       231:     }
1.85    ! bisitz    232: 
        !           233: #---------------------Print External URL Syllabus Info
        !           234: if( ($allowed) && ($target ne 'tex') ) {
        !           235: 	my $protocol = $Apache::lonnet::protocol{$homeserver};
        !           236:   	$protocol = 'http' if ($protocol ne 'https');
        !           237:         $r->print('<p class="LC_info">'
        !           238:                  .&mt('This syllabus can be publicly viewed at [_1]'
        !           239:                      ,'<tt>'.$protocol.'://'.&Apache::lonnet::hostname($homeserver).$r->uri.'</tt>')
        !           240:                  .'&nbsp;'.&Apache::loncommon::help_open_topic('Syllabus_ExtLink')
        !           241:                  .'</p>'
        !           242:                  .'<p class="LC_info">'
        !           243:                  .&mt('Instead of using this template you can specify an external URL as Syllabus in the [_1]Course Parameters[_2].'
        !           244:                      ,'<a href="/adm/parmset?action=crsenv">','</a>')
        !           245:                  .'</p>'
        !           246:         );
        !           247: }
        !           248: 
        !           249: #-Print Help Text
1.81      neumanie  250: if ($target ne 'tex') {
                    251: 	if($allowed){ 
                    252: 		$r->print(&Apache::loncommon::help_open_topic('Uploaded_Templates_TextBoxes',&mt('Help with filling in text boxes')));
                    253: 	}
                    254: }
1.80      neumanie  255: #--------Functions
                    256: if ($target ne 'tex') {
                    257: 		if($allowed || $privileged){		
1.84      bisitz    258:                 $r->print(&Apache::lontemplate::start_functionslist());
1.80      neumanie  259: 		if($allowed){ 		
1.84      bisitz    260:                     $r->print(&Apache::lontemplate::item_functionslist(
                    261:                         '<a href="'.$r->uri.'?forcestudent=1">'.&mt('Show Public View').'</a>'
                    262:                        .&Apache::loncommon::help_open_topic('Uploaded_Templates_PublicView')));
1.80      neumanie  263: 		}elsif($privileged){
1.84      bisitz    264:                     $r->print(&Apache::lontemplate::item_functionslist(
                    265:                         '<a href="'.$r->uri.'?forceedit=1">'.&mt('Edit').'</a>'));
1.80      neumanie  266: 		}
1.84      bisitz    267:                 $r->print(&Apache::lontemplate::end_functionslist());
1.80      neumanie  268: 		}
                    269:  }
                    270: #----------------------------Print Headtitle
                    271: if($target ne 'tex'){
                    272: 	$r->print('<h1>'.$courseenv{'description'}.'</h1>'); 	
                    273: 	$r->print('<h3>'.  &Apache::lonnet::domain($cdom,'description').'</h3>');
                    274: }else{
                    275: 	$r->print('\noindent{\large\textbf{'.$courseenv{'description'}.'}}\\\\\\\\\textbf{'.
                    276: 	&Apache::lonnet::domain($cdom,'description').'}\\\\');
                    277: }
                    278: # -------------------------------------------------------- Get course personnel
                    279:     my %coursepersonnel=&Apache::lonnet::get_course_adv_roles($cdom.'/'.$cnum);
                    280:     if ($target ne 'tex') {
                    281: 	$r->print(&Apache::lonhtmlcommon::start_pick_box());
                    282:     } else {
                    283: 	$r->print('\begin{tabular}{|p{0.45\textwidth}|p{0.45\textwidth}|}\hline');
                    284:     }
                    285:     my @personnel=sort(keys(%coursepersonnel));
                    286:     my $lastpers=$personnel[$#personnel];
                    287:     foreach my $element (@personnel) {
                    288: 	if ($target ne 'tex') {
                    289: 	    $r->print(&Apache::lonhtmlcommon::row_title($element));
                    290: 	} else {
                    291: 	    $r->print(' '.&Apache::lonxml::xmlparse($r,'tex',$element).' & '); 
                    292: 	}
                    293:         foreach (split(/\,/,$coursepersonnel{$element})) {
                    294: 	    my ($puname,$pudom)=split(/\:/,$_);
                    295: 	    if ($target ne 'tex') {
                    296:                 my $courseperson = &Apache::loncommon::plainname($puname,$pudom);
                    297:                 if (($env{'user.name'} eq '') || ($env{'user.name'} eq 'public') ||
                    298:                     ($env{'user.domain'} eq '') || ($env{'user.domain'} eq 'public')) {
                    299: 		    $r->print(' '.$courseperson);
                    300:                 } else {
                    301:                     $r->print(' '.&Apache::loncommon::aboutmewrapper($courseperson,
                    302:                               $puname,$pudom));
                    303:                 }
                    304: 	    } else {
                    305: 		$r->print(' '.&Apache::loncommon::plainname($puname,
                    306:                               $pudom).' ');
                    307: 	    }
                    308: 	}
                    309: 	if ($target ne 'tex') {
                    310:             my $lastclose=$element eq $lastpers?1:0;
                    311:             $r->print(&Apache::lonhtmlcommon::row_closure($lastclose));
                    312: 	} else {
                    313: 	    $r->print('\\\\ \hline');
                    314: 	}
                    315:     }
                    316:     if ($target ne 'tex') {
                    317: 	$r->print(&Apache::lonhtmlcommon::end_pick_box());
                    318:     } else {
                    319: 	$r->print('\end{tabular}\\\\');
                    320:     }
1.79      neumanie  321: #----------Print last update
                    322:  my $lastmod=$syllabus{'uploaded.lastmodified'};
1.25      www       323:        $lastmod=($lastmod?&Apache::lonlocal::locallocaltime($lastmod):&mt('never'));
1.26      albertel  324:        my $who = &Apache::loncommon::aboutmewrapper(
                    325:                     &Apache::loncommon::plainname($syllabus{'uploaded.name'},
1.7       www       326:                      $syllabus{'uploaded.domain'}),$syllabus{'uploaded.name'},
1.79      neumanie  327:                      $syllabus{'uploaded.domain'});      
                    328:  if ($target ne 'tex') {
1.28      sakharuk  329: 	   $r->print('<table><tr><td>'.&mt('Last updated').':</td><td>'.
1.61      albertel  330: 		     $lastmod.'</td><td>'.
                    331: 		     ($who ? &mt('by').' '.$who
                    332:                            : '' ).
1.79      neumanie  333: 		     '</td></tr></table>');
1.28      sakharuk  334:        } else {
1.61      albertel  335: 	   $r->print('\\\\ '.&mt('Last updated').': '.$lastmod.' '.
                    336: 		     ($who? &mt('by').'\\\\ '.
                    337: 		            &Apache::loncommon::plainname($syllabus{'uploaded.name'},$syllabus{'uploaded.domain'})
                    338: 		          :'')
                    339: 		     .'\\\\');
1.80      neumanie  340:        }
1.79      neumanie  341: # -------------------------------------------------------------- Announcements?
                    342:     my $day = &Apache::lonannounce::showday(time,2,
                    343: 			 &Apache::lonannounce::readcalendar($cdom.'_'.$cnum));
1.80      neumanie  344:     if ($target ne 'tex') {
1.82      neumanie  345: 	if($allowed){
                    346: 		&Apache::lontemplate::print_start_template($r,'RSS Feeds and Blogs','LC_ContentBoxSpecial');
                    347: 		$r->print(&Apache::lonrss::advertisefeeds($cnum,$cdom,$forceedit));			
                    348: 		&Apache::lontemplate::print_end_template($r);
1.80      neumanie  349: 	}
1.82      neumanie  350: 	elsif(&Apache::lonrss::advertisefeeds($cnum,$cdom) ne ''){		
                    351: 		&Apache::lontemplate::print_start_template($r,'RSS Feeds and Blogs','LC_ContentBoxSpecial');
                    352: 		$r->print(&Apache::lonrss::advertisefeeds($cnum,$cdom,$forceedit));		
                    353: 		&Apache::lontemplate::print_end_template($r);
1.80      neumanie  354: 	}
                    355: 	
1.79      neumanie  356:     } else {
                    357: 	$r->print(&Apache::lonxml::xmlparse($r,'tex',$day));
                    358:     }	
                    359: # ---------------------------------------------------------------- Get syllabus
                    360:     if (($syllabus{'uploaded.lastmodified'}) || ($allowed)) {     
1.5       www       361:        if ($allowed) {
1.27      www       362: 	   $r->print('<form method="post">'.
                    363: 		     '<input type="hidden" name="forceedit" value="edit" />');
1.5       www       364:        }
1.33      www       365:        my @htmlids=();
1.77      neumanie  366: 	
1.73      ehlerst   367: 	foreach my $field (sort(keys(%syllabusfields))) {
1.55      albertel  368: 	   if (($syllabus{$field}=~/\w/) || ($allowed)) {
                    369: 	       my $message=$syllabus{$field};
                    370: 	       if ($field eq 'lll_includeurl') { # this is the "included" field
1.79      neumanie  371: 		   my $urls=$message;		
                    372: 		   $message='';		  
                    373: 		   foreach my $filelink (split(/\n/,$urls)) {			
1.55      albertel  374: 		       my $output='';
1.79      neumanie  375: 			# embed style?
                    376: 		       my ($curfext)=($filelink=~/\.([^\.]+)$/);		
                    377: 		       my $embstyle=&Apache::loncommon::fileembstyle($curfext);			
                    378: 		       if (($embstyle eq 'ssi') || ($curfext=~/\/$/)) {# make ssi call and remove everything but the body contents
1.55      albertel  379: 			   $output=&Apache::lonnet::ssi_body($filelink);
1.79      neumanie  380: 		       } elsif ($embstyle eq 'img') {# embed as an image
1.55      albertel  381: 			   $output='<img src="'.$filelink.'" />';
                    382: 		       }
1.79      neumanie  383: 		       if($output ne ''){
                    384: 		       		if ($target ne 'tex') {				
                    385: 			  	 	$message.='<p>'.$output.'</p>';
                    386: 		       		} else {
                    387: 			   		$message.=' '.&Apache::lonxml::xmlparse($r,'tex','<p>'.$output.'</p>').' ';
                    388: 		       		}
                    389: 			}     
1.55      albertel  390: 		   }
                    391: 		   if ($allowed) {
                    392: 		       $r->print('<h3>'.$syllabusfields{$field}.
1.73      ehlerst   393: 			 &Apache::loncommon::help_open_topic('Syllabus_URLs').'</h3>');
1.55      albertel  394: 		   } else {
                    395: 		       $r->print($message);
                    396: 		   } 
                    397: 	       } else {
                    398: 		   &Apache::lonfeedback::newline_to_br(\$message);
1.75      raeburn   399: 		   $message =~s|(https?\://[^\s]+)|<a href="$1"><tt>$1</tt></a>|g;
1.55      albertel  400: 		   if ($allowed) {
                    401: 		       $message=&Apache::lonspeller::markeduptext($message);
                    402: 		   }
                    403: 		   $message=&Apache::lontexconvert::msgtexconverted($message);
1.73      ehlerst   404: 		   if ($target ne 'tex') {
1.74      ehlerst   405: 			if($allowed){
                    406: 				$r->print('<p>');
1.76      neumanie  407: 			}			
                    408: 			&Apache::lontemplate::print_template($r, $syllabusfields{$field}, $message,$allowed,'LC_ContentBoxSpecial');
1.55      albertel  409: 		   } else {
                    410: 		       $r->print('\\\\\textbf{'.$syllabusfields{$field}.'}\\\\'.
                    411: 				 &Apache::lonxml::xmlparse($r,'tex',$message).'\\\\');
                    412: 		   }
                    413: 		   push(@htmlids,$field);
                    414: 	       }
                    415: 	       if ($allowed) {
1.74      ehlerst   416: 			if($target ne 'tex'){
                    417: 				$r->print('</p>');
1.79      neumanie  418: 				&Apache::lontemplate::print_editbox_template($r, $syllabus{$field}, $field);
1.74      ehlerst   419: 			}
1.79      neumanie  420: 			
1.55      albertel  421: 	       }
                    422: 	   }
1.77      neumanie  423:        }    
                    424: 	
1.5       www       425:        if ($allowed) {
1.32      www       426: 	   $r->print('</form>'.
1.33      www       427: 		     &Apache::lonhtmlcommon::htmlareaselectactive(@htmlids));
1.5       www       428:        }
1.79      neumanie  429:       # if ($target ne 'tex') {$r->print('</p>');} else {$r->print('\\\\');}
1.4       www       430:     } else {
1.36      sakharuk  431: 	if ($target ne 'tex') {$r->print('<p>');} else {$r->print('\par ');} 
1.63      bisitz    432: 	$r->print(&mt('No syllabus information provided.'));
1.36      sakharuk  433: 	if ($target ne 'tex') {$r->print('</p>');}
1.1       www       434:     }
1.79      neumanie  435:     if ($target ne 'tex') {	
1.65      raeburn   436:         if ($env{'form.backto'} eq 'coursecatalog') {
                    437:             $r->print('<form name="backtocat" method="post" action="/adm/coursecatalog">'.
1.66      raeburn   438:                       &Apache::lonhtmlcommon::echo_form_input(['backto','courseid']).
1.65      raeburn   439:                       '</form>');
                    440:         }
1.48      albertel  441: 	$r->print(&Apache::loncommon::end_page());
                    442:     } else {
                    443: 	$r->print('\end{document}');
                    444:     }
1.1       www       445:     return OK;
                    446: } 
                    447: 
                    448: 1;
                    449: __END__

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>