Diff for /loncom/interface/lonsyllabus.pm between versions 1.136 and 1.137

version 1.136, 2014/01/09 15:18:40 version 1.137, 2014/06/17 23:22:14
Line 99  sub handler { Line 99  sub handler {
     my $minimal=$courseenv{'minimalsyllabus'};      my $minimal=$courseenv{'minimalsyllabus'};
   
     if (($minimal =~/\w/) || ($uploaded =~/\w/)) {      if (($minimal =~/\w/) || ($uploaded =~/\w/)) {
         my $item;          my ($item,$is_pdf);
         if ($minimal =~/\w/) {          if ($minimal =~/\w/) {
             if ($external =~ m{\Q$minimal\E$}) {              if ($external =~ m{\Q$minimal\E$}) {
                 undef($external);                  undef($external);
Line 110  sub handler { Line 110  sub handler {
                 undef($external);                  undef($external);
             }              }
             $item = $uploaded;              $item = $uploaded;
               if ($item =~ /\.pdf$/i) {
                   $is_pdf = 1;
               }
         }          }
         unless ($allowed && $forceedit) {          unless ($allowed && $forceedit) {
             my $file=&Apache::lonnet::filelocation("",$item);              my $file=&Apache::lonnet::filelocation("",$item);
Line 129  sub handler { Line 132  sub handler {
                         if ($env{'form.only_body'}) {                          if ($env{'form.only_body'}) {
                             $args{'only_body'} = 1;                              $args{'only_body'} = 1;
                         }                          }
                           if ($env{'request.use_absolute'}) {
                               $args{'use_absolute'} = $env{'request.use_absolute'};
                           }
                         $r->print(&Apache::loncommon::start_page("Syllabus",undef,\%args).                          $r->print(&Apache::loncommon::start_page("Syllabus",undef,\%args).
                                   $result.                                    $result.
                                   &Apache::loncommon::end_page());                                    &Apache::loncommon::end_page());
Line 157  sub handler { Line 163  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));                      $r->print(&Apache::lonwrapper::wrapper($item,undef,$env{'request.use_absolute'},
                                                              undef,$is_pdf,&mt('Syllabus')));
                 }                  }
             }              }
             return OK;              return OK;
Line 170  sub handler { Line 177  sub handler {
                          ' \strut \\\\ '.&mt('Print the syllabus directly from your web browser').                           ' \strut \\\\ '.&mt('Print the syllabus directly from your web browser').
                          '\end{document}');                           '\end{document}');
             } else {              } else {
                 $r->print(&Apache::lonwrapper::wrapper($external));                  my $is_ext = 1;
                   my $is_pdf;
                   if ($external =~ /\.pdf$/i) {
                       $is_pdf = 1;
                   }
                   $r->print(&Apache::lonwrapper::wrapper($external,undef,$env{'request.use_absolute'},
                                                          $is_ext,$is_pdf,&mt('Syllabus')));
             }              }
             return OK;              return OK;
         }          }
Line 695  ENDSCRIPT Line 708  ENDSCRIPT
                          onload => 'setTemplateBoxes();',                           onload => 'setTemplateBoxes();',
                        );                         );
         $args->{'add_entries'} = \%loaditem;          $args->{'add_entries'} = \%loaditem;
       } else {
           if ($env{'request.use_absolute'}) {
               $args->{'use_absolute'} = $env{'request.use_absolute'};
           }
     }      }
     if ($env{'form.only_body'}) {      if ($env{'form.only_body'}) {
         $args->{'only_body'} = 1;          $args->{'only_body'} = 1;

Removed from v.1.136  
changed lines
  Added in v.1.137


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