Diff for /loncom/interface/lonsyllabus.pm between versions 1.139 and 1.141

version 1.139, 2016/01/26 14:30:25 version 1.141, 2017/02/18 19:05:51
Line 116  sub handler { Line 116  sub handler {
         }          }
         unless ($allowed && $forceedit) {          unless ($allowed && $forceedit) {
             my $file=&Apache::lonnet::filelocation("",$item);              my $file=&Apache::lonnet::filelocation("",$item);
             if ($file =~ /\.(tex|x?html?)$/) {                if ($file =~ /\.(tex|x?html?)$/) {
                 my $filetype = $1;                  my $filetype = $1;
                 my $filecontents=&Apache::lonnet::getfile($file);                  my $filecontents=&Apache::lonnet::getfile($file);
                 if ($filecontents eq -1) {                  if ($filecontents eq -1) {
Line 125  sub handler { Line 125  sub handler {
                     if ($target eq 'tex') {                      if ($target eq 'tex') {
                         $r->print($filecontents);                          $r->print($filecontents);
                     } else {                      } else {
                         my $result = &Apache::lontexconvert::converted(\$filecontents,                          my $texengine = $env{'form.texengine'};
                                                                        $env{'form.texengine'});                          if ($texengine eq '') {
                               $texengine = 'tth';
                           } elsif (lc($texengine) eq 'jsmath') {
                               $texengine = 'MathJax';
                           }
                           my $result = &Apache::lontexconvert::converted(\$filecontents,$texengine);
                         my %args;                          my %args;
                         &get_breadcrumbs($cdom,$cnum,$crstype,\%args);                          &get_breadcrumbs($cdom,$cnum,$crstype,\%args);
                         if ($env{'form.only_body'}) {                          if ($env{'form.only_body'}) {
Line 163  sub handler { Line 168  sub handler {
                               &mt('Print the syllabus directly from your web browser').                                &mt('Print the syllabus directly from your web browser').
                               '\end{document}');                                '\end{document}');
                 } else {                  } else {
                     $r->print(&Apache::lonwrapper::wrapper($item,undef,$env{'request.use_absolute'},                      my $brcrum;
                       if ($env{'form.folderpath'} =~ /^supplemental/) {
                           my $title = $env{'form.title'};
                           if ($title eq '') {
                               $title = &mt('Syllabus');
                           }
                           $brcrum =
                               &Apache::lonhtmlcommon::docs_breadcrumbs(undef,$crstype,undef,$title,1);
                       }
                       $r->print(&Apache::lonwrapper::wrapper($item,$brcrum,$env{'request.use_absolute'},
                                                            undef,$is_pdf,undef,&mt('Syllabus')));                                                             undef,$is_pdf,undef,&mt('Syllabus')));
                 }                  }
             }              }
Line 178  sub handler { Line 192  sub handler {
                          '\end{document}');                           '\end{document}');
             } else {              } else {
                 my $is_ext = 1;                  my $is_ext = 1;
                 my $is_pdf;                  my ($is_pdf,$brcrum);
                 if ($external =~ /\.pdf$/i) {                  if ($external =~ /\.pdf$/i) {
                     $is_pdf = 1;                      $is_pdf = 1;
                 }                  }
                 $r->print(&Apache::lonwrapper::wrapper($external,undef,$env{'request.use_absolute'},                  if ($env{'form.folderpath'} =~ /^supplemental/) {
                       my $title = $env{'form.title'};
                       if ($title eq '') {
                           $title = &mt('Syllabus');
                       }
                       $brcrum =
                           &Apache::lonhtmlcommon::docs_breadcrumbs(undef,$crstype,undef,$title,1);
                   }
                   $r->print(&Apache::lonwrapper::wrapper($external,$brcrum,$env{'request.use_absolute'},
                                                        $is_ext,$is_pdf,undef,&mt('Syllabus')));                                                         $is_ext,$is_pdf,undef,&mt('Syllabus')));
             }              }
             return OK;              return OK;

Removed from v.1.139  
changed lines
  Added in v.1.141


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